@infinite-table/infinite-react 11.0.3 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +1 -1
- package/index.d.ts +12 -0
- package/index.dev.js +875 -188
- package/index.dev.mjs +875 -188
- package/index.js +9 -9
- package/index.mjs +9 -9
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var FT=Object.create;var Ci=Object.defineProperty;var NT=Object.getOwnPropertyDescriptor;var LT=Object.getOwnPropertyNames;var kT=Object.getPrototypeOf,zT=Object.prototype.hasOwnProperty;var VT=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),GT=(n,e)=>{for(var t in e)Ci(n,t,{get:e[t],enumerable:!0})},xc=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of LT(e))!zT.call(n,r)&&r!==t&&Ci(n,r,{get:()=>e[r],enumerable:!(o=NT(e,r))||o.enumerable});return n};var H=(n,e,t)=>(t=n!=null?FT(kT(n)):{},xc(e||!n||!n.__esModule?Ci(t,"default",{value:n,enumerable:!0}):t,n)),HT=n=>xc(Ci({},"__esModule",{value:!0}),n);var io=VT((HE,Fp)=>{"use strict";Fp.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});var oP={};GT(oP,{AutoScroller:()=>go,CellSelectionState:()=>Ue,DRAG_ITEM_ATTRIBUTE:()=>bt,DataClient:()=>bc,DataSource:()=>Mw,DataSourceActionType:()=>Nh,DeepMap:()=>U,DragDropProvider:()=>Ji,DragInteractionTarget:()=>ar,DragList:()=>Wn,FixedSizeSet:()=>zl,FlashingColumnCell:()=>gT,GroupRowsState:()=>Dt,INTERNAL_MatrixDebugger:()=>yT,InfiniteTable:()=>cn,InfiniteTableClassName:()=>Jt,InfiniteTableComponent:()=>rT,Menu:()=>sn,RowDetailCache:()=>mr,RowDetailState:()=>At,RowDisabledState:()=>xt,RowSelectionState:()=>Oe,TreeDataSource:()=>Xv,TreeExpandState:()=>ft,TreeGrid:()=>lT,TreeSelectionState:()=>Je,WeakFixedSizeSet:()=>Gl,alignNode:()=>Tl,components:()=>nP,createDefaultProxy:()=>Ra,createFlashingColumnCellComponent:()=>Tc,debounce:()=>Yt,debug:()=>Ye,defaultDragProxyMove:()=>wa,defaultFilterFunction:()=>Cu,defaultFilterTypes:()=>Nn,defaultTreeFilterFunction:()=>Ua,eventMatchesKeyboardShortcut:()=>yl,filterDataArray:()=>Vu,filterTypes:()=>Nn,flatten:()=>mf,getComponentStateRoot:()=>Lt,group:()=>ca,interceptMap:()=>uT,keyboardShortcuts:()=>sT,multisort:()=>jt,multisortNested:()=>Ja,queryKeyToCacheKey:()=>Ao,toTreeDataArray:()=>Ug,useComponentState:()=>kt,useDataSourceApi:()=>Fh,useDataSourceInternal:()=>fr,useDataSourceSelector:()=>Ne,useDataSourceState:()=>el,useDragDropProvider:()=>fn,useDragListContext:()=>ho,useEffectWhen:()=>Kl,useEffectWhenSameDeps:()=>cT,useEffectWithChanges:()=>vo,useEffectWithObject:()=>Cw,useGridScroll:()=>Al,useInfiniteColumnApi:()=>oT,useInfiniteColumnCell:()=>Ur,useInfiniteColumnEditor:()=>ga,useInfiniteColumnFilterEditor:()=>Uo,useInfiniteHeaderCell:()=>Nr,useInfinitePortalContainer:()=>Mb,useInfiniteTableApi:()=>nT,useLayoutEffectWithChanges:()=>Tw,useManagedDataSource:()=>Hu,useMasterRowInfo:()=>En,useOverlay:()=>ln,useOverlayPortal:()=>Jy,usePrevious:()=>On,useRowInfoReducers:()=>Ew,useVisibleColumnSizes:()=>Sb,withSelectedLeafNodesOnly:()=>Sc});module.exports=HT(oP);function Yt(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}var xe=H(require("react"));var $=(...n)=>n.filter(e=>!!`${e}`).join(" ");var to=H(require("react")),es=require("react");var KT=H(require("react")),Dn=require("react");var Fo=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Yt(e,{wait:o}):e,a=new r(l=>{let s=l[0],{width:u,height:c}=s.contentRect;if(s.borderBoxSize?.[0])c=s.borderBoxSize[0].blockSize,u=s.borderBoxSize[0].inlineSize;else{let d=n.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(n),()=>{a.disconnect()}};var Ii=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=(0,Dn.useRef)({width:0,height:0}),r=i=>{let a;return n.current&&(a=Fo(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,Dn.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),(0,Dn.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};function Se(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function ht(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var Mc=(n,e)=>n-e;var Ri=(n,e)=>Mc(n.revision,e.revision),U=class n{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,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),u=!a;if(i!==void 0){if(i<0)return;i--}let c=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!u)return;let h=g?[]:[...e,p],S=m?()=>this.visitWithNext(h,t,o,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,h,l,S,f);if(o&&y===!0)return!0;l++}else S?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(o&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new n;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push(i)},t),o}getEntriesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push([r,i])},t),o}getLeafNodesStartingWith(e,t,o){let{respectOrder:r=!1}=o||{},i=[],a=[];return this.getStartingWith(e,(l,s,u)=>{!u.map&&u.hasOwnProperty("value")&&(r?i.push(u):a.push(t(u)))},o),r?i.sort(Ri).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>o.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>[o.keys,o.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:o,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},u=this.map,c,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(c=u.get(m),!c||!c.map)if(d=!0,p===f-1){d=!0;break}else return[];u=c.map}else if(!o&&u.has(this.emptyKey))return[[]];return c&&c.value!==void 0&&(o||(s({...c,keys:e}),d=!0)),d?i?a.sort(Ri).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,u,r,o),i?a.sort(Ri).map(p=>p.keys):l)}getKeysStartingWith(e,t){let o=[];return this.getStartingWith(e,r=>{o.push(r)},t),o}getStartingWith(e,t,o){let{excludeSelf:r,depthLimit:i}=o||{},a=this.map,l,s=!1;if(e.length)for(let u=0,c=e.length;u<c;u++){let d=e[u];if(l=a.get(d),!l||!l.map)if(s=!0,u===c-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(u,c,d,p,f)=>{t(c,u,{...f,keys:c}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;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=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.map,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],u=e[e.length-1],c=s?.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],u=ht(()=>{if(l)for(let[c]of l){let d=this.visitKey(c,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let c=r(a,s,u);if(i&&c===!0)return!0}u()}getArray(e){let t=[];return this.visit((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Ri);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=U;function Fe(){return globalThis}var vi=["#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"],Ec=Symbol("color"),wi=new WeakMap,$l=Se();function Yl(n=vi){wi.set(n,n.map(e=>0))}Yl();var BT=(n=vi)=>{let e=[];wi.has(n)?e=wi.get(n):(e=n.map(o=>0),wi.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??vi[0]},Dr=":",ql="*",Ac="-",WT=",",jT="debug",UT="diffdebug",Oc=!1,Pr=new U,xr=new Map;function Xl(n,e){let t=n.split(Dr),o=new U;o.set(t,!0);let r=e.split(Dr),i=new Set(r).has(ql),a=r.indexOf(ql),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(Dr)):!0}}function Fc(n,e){let t=`channel=${n}_permissions=${e}`;if(xr.has(t))return xr.get(t);let o=e.split(WT);function r(l){return xr.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(ql)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(Ac);if(u&&(s=s.substring(Ac.length)),Xl(n,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),Xl(n,s))return r(!u)}return r(!1)}var Zl=()=>Ye.enable??(Fe()&&Fe().localStorage?.getItem(jT))??"",$T=()=>Ye.diffenable??(Fe()&&Fe().localStorage?.getItem(UT))??`${Oc}`,Ql="",Nc=Oc;function Jl(n){Nc=`${$T()}`=="true",Ql!==n&&(Ql=n,xr.clear())}function Lc(n){Jl(Zl()),typeof Fe()<"u"&&Fe().addEventListener&&Fe().addEventListener("storage",function(){Jl(Zl())});function e(t,o){let r=o?`${o}${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)??kc,u=s,c,d=0,p=()=>c??Fc(r,Ql),f=BT(Ye.colors),m=Object.defineProperties((...g)=>{let h=$l.getListenersCount(),S;if(h>0&&(S=S??Date.now(),$l({color:f,channel:r,args:g,timestamp:S})),p()){if(S=S??Date.now(),d&&Nc){let T=S-d;u(`%c[${r}]`,`color: ${f}`,`+${T}ms:`)}d=S;let y=[],C;if(g.forEach(T=>{if(T[Ec])C===void 0&&(C=!0),y.push(...T);else{if(typeof T!="string"&&typeof T!="number"){C=!1;return}y.push(`${T}%s`)}}),C){let T=[`%c[${r}]%c %s`,`color: ${f}`,"",...y,""];u(...T)}else u(`%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[Ec]=!0,S}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{c=g}},logFn:{configurable:!1,get:()=>u,set:g=>{u=g??s}},destroy:{value:()=>{Pr.delete(i)}}});return Pr.set(i,m),m}return e(n)}var kc=console.log.bind(console),_c;Object.defineProperty(Lc,"enable",{get:()=>_c,set:n=>{_c=n,Jl(Zl())}});var Ye=Lc;Ye.colors=vi;Ye.logFn=kc;var YT=(n,e)=>$l.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;Xl(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Ye.onLogIntent=YT;Ye.isChannelEnabled=Fc;Ye.destroyAll=()=>{Yl(),Yl(Ye.colors),Pr.clear(),xr.clear()};var Nt=n=>{let e=Ye(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},xn=n=>{let e=Ye(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Mr=()=>Mr;Mr.extend=()=>Mr;var It=class{constructor(e){this.debug=Mr,this.error=Mr}};var zc=xn("CSSVariableWatch"),Vc=Nt("CSSVariableWatch"),Gc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};function Hc(n){return n.startsWith("var(")||n.startsWith("calc(")?n:`var(${n})`}var qT=n=>{let e=(0,es.useRef)(0),t=to.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);Ii(n.ref,t,{earlyAttach:!0}),to.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,Vc(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);zc(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},Er=n=>{let e=(0,es.useRef)(null);qT({...n,ref:e});let t=Hc(n.varName),{allowInts:o=!1}=n;return to.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:Gc},to.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};var ko=require("react");function Mn(){let n=null,e=new Set;return{getSnapshot(){return n},setSnapshot(t){n=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var dn=require("react");function Rt(n,e,t){if(n===e)return!0;if(!n||!e)return!1;let o=typeof n;if(o!==typeof e||o!=="object")return!1;var i=Object.keys(n),a=Object.keys(e);t&&(i=i.filter(c=>!t.has(c)),a=a.filter(c=>!t.has(c)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var u=i[s];if(!(t&&t.has(u))&&(n[u]!==e[u]||!Object.prototype.hasOwnProperty.call(e,u)))return!1}return!0}function Kc(n,e,t){let o=(0,dn.useRef)(e);o.current=e;let r=(0,dn.useRef)(t);r.current=t;let i=(0,dn.useRef)(void 0),a=(0,dn.useRef)(!1),l=(0,dn.useCallback)(()=>{let s=n.getSnapshot(),u=o.current(s);return a.current&&r.current(i.current,u)?i.current:(i.current=u,a.current=!0,u)},[n]);return(0,dn.useSyncExternalStore)(n.subscribe,l,l)}function Pi(n,e){return Kc(n,e,Object.is)}function No(n,e){return Kc(n,e,Rt)}var Bc=H(require("react")),ts;function Lo(){return ts||(ts=Bc.createContext(null))}var Wc=Mn(),jc=()=>{};function Di(){let n=Lo();return(0,ko.useContext)(n)||void 0}function xi(){let n=Di();return(0,ko.useCallback)(()=>n?.getSnapshot(),[n])}function Mi(n){let e=Lo(),t=(0,ko.useContext)(e),o=No(t||Wc,t?n:jc);return t?o??void 0:void 0}function En(){let n=Lo(),e=(0,ko.useContext)(n),o=Pi(e||Wc,e?r=>r.masterRowInfo:jc);return e?o:void 0}var zo=H(require("react")),at=require("react");function An(n){if(n==null)return!1;let e=n;return!0}var _n=require("react");var Ei=require("react"),qt=()=>{let[n,e]=(0,Ei.useState)(0);return[n,(0,Ei.useCallback)(()=>{e(t=>t+1)},[e])]};var Uc=n=>{let e=(0,_n.useCallback)(n,[]),t=(0,_n.useRef)(!1),o=(0,_n.useRef)(!1),r=(0,_n.useRef)(void 0),[i,a]=qt();t.current&&(o.current=!0),(0,_n.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};var Ai=require("react");function Le(n){let e=(0,Ai.useRef)(n);return e.current=n,(0,Ai.useCallback)(()=>e.current,[])}var _i=require("react"),On=(n,e)=>{let t=(0,_i.useRef)(e===void 0?n:e);return(0,_i.useLayoutEffect)(()=>{t.current=n}),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 XT="\u200B",ns=class n{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,o=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",u=e.track||this.markerDetails.track||"Unknown",c=XT+s;return performance.measure(c,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:u,color:r,properties:a.length>0?a.map(d=>[d.name,d.value]):void 0,tooltipText:l}}}),performance.clearMeasures(c),this};this.debugId=e}static create(e){return new n(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(Ar).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:Ar[o].track,label:i.label}),get label(){let i=Ar[o];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:u=>e.end({...u,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,o,{get:()=>{let i=Ar[o];return e.markerDetails.track=i.track,r}}),t},{})}};function st(n){return ns.create(n)}function $c(n,e){let t=new Set;function o(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return n.apply(this,s)}return{fn:o,propertyReads:t}}var os=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function _r(n){return n!==void 0}function Fn(n,e){let t=e[n];return _r(t)}var Yc=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)};function ZT(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=Fn(r,e)?e[r]:e[`default${os(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function qc(n,e,t){let{fn:o,propertyReads:r}=$c(n,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=o(e);return r.forEach(a=>t.add(a)),i}function Xc(n){let{props:e,initialSetupState:t,propsToForward:o,parentState:r,mapPropsToState:i,propsToStateSet:a}=n,l={};o&&(l=ZT(o,e,t));let s={...t,...l};if(i){let u=qc(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...u}}return s}function Zc(n,e,t){let{getProps:o,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,u=e.payload.mappedState,c=e.payload.updatedPropsToState,d={...n};if(u&&Object.assign(d,u),i){let f=qc(i,{props:o(),state:d,oldState:n,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:n,state:d,updatedProps:c,parentState:s}):d}function Qc(n){let{dispatch:e,getState:t,getProps:o,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=Yc}=n,u=t();return Object.keys(u).reduce((c,d)=>{let p=d;return Object.defineProperty(c,d,{set:m=>{let g=o(),h=t(),S=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:c,state:h})===!1&&(S=!1),S){let T=[m],I=`on${os(d)}Change`;if(l&&l[p]){let b=l[p](m,h);I=b.callbackName||I,T=b.callbackParams}s(g,I,T)}let y=r[p];typeof y=="function"&&(m=y(m));let C=!!i?.[p];Fn(d,g)&&!C||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),c},{})}function QT(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}=n,a={},l=0,s={},u=0,c={},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&&(c[m]={newValue:h,oldValue:g},d++,Fn(m,e)||Fn(m,t)))if(r.hasOwnProperty(f)){let S=h,y=r[f];typeof y=="function"&&(S=y(h)),o[m]!==S&&(a[m]=S,l++)}else i.has(f)&&(s[m]=e[m],u++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:u,rawUpdatedProps:c,rawUpdatedPropsCount:d}}function Jc(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i,dispatch:a,actions:l,onPropChange:s,onPropsChange:u,beforeDispatch:c}=n,d=QT({currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}),{newMappedState:p,newMappedStateCount:f,updatedPropsToState:m,updatedPropsToStateCount:g,rawUpdatedProps:h,rawUpdatedPropsCount:S}=d;if(g===0&&f===0)return!1;if(c?.(d),a({payload:{mappedState:f?p:null,updatedPropsToState:g?m:null}}),s){for(let y in h)if(h.hasOwnProperty(y)){let{newValue:C,oldValue:T}=h[y];s({name:y,newValue:C,oldValue:T},e,l,o)}}return u&&S&&u(h,e,l,o),!0}var rs;function ed(){return rs||(rs=(0,at.createContext)(null))}function Lt(n){let e=n.getParentState||(()=>null);function t(r){let[i]=(0,at.useState)(()=>n.initSetupState?n.initSetupState(r):{}),a=(0,at.useRef)(new Set),l=(0,at.useMemo)(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),u=Le(s);function c(){return Xc({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:n.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,at.useState)(c),p=Le(r),f=(w,v)=>Zc(w,v,{getProps:p,getParentState:()=>u?.()??null,mapPropsToState:n.mapPropsToState,concludeReducer:n.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,at.useReducer)(f,d),h=Le(m),{allowedControlledPropOverrides:S}=n,y=(0,at.useMemo)(()=>Qc({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:S,interceptedActions:n.interceptActions,mappedCallbacks:n.mappedCallbacks}),[g,l,S]),C=n.Context??ed(),T=(0,at.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]),I=On(r),b=(0,at.useRef)(!1);b.current=!1;let R=n.layoutEffect?at.useLayoutEffect:at.useEffect;return R(()=>{let w=r;Jc({currentProps:w,prevProps:I,state:m,propsToForward:l,propsToStateSet:a.current,dispatch:g,actions:y,onPropChange:n.onPropChange,onPropsChange:n.onPropsChange,beforeDispatch:({newMappedState:P,newMappedStateCount:x,updatedPropsToState:M,updatedPropsToStateCount:D})=>{let E=m.debugId,z=E?st(E).track.ComponentState.label.PropUpdate.start():void 0,V=n.debugName?typeof n.debugName=="function"?`${n.debugName(w)}:rerender`:`${n.debugName}:rerender`:"rerender";Nt(V)("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(M??{})),z&&z.end({label:V,details:[x>0?{name:"Updated properties",value:Object.keys(P).join(", ")}:void 0,D>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,D>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(An)})}})&&(b.current=!0)}),R(()=>{s!=null&&!b.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Uc(()=>()=>{n.cleanup?.(h())}),{contextValue:T,ContextComponent:C}}return{ManagedComponentContextProvider:zo.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return zo.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function kt(n){return n=n??ed(),zo.useContext(n)}var fd=H(require("react"));var yt="Infinite",ze={rootClassName:yt};var Oi=()=>ze;var td="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",nd={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Gt="_16lm1iw3b _16lm1iw3c _16lm1iw35",od={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Vo={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Fi={1:"_16lm1iw1c",none:"_16lm1iw1d"},Or={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var rd={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},id={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},ad={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var ld={none:"_16lm1iwd"},sd={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Ni={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var ud={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var cd={none:"_16lm1iw1x"};var dd={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var pd={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function md(n){let{rootClassName:e}=Oi();return fd.createElement("div",{...n,className:$(`${e}Footer`,Ni.relative,Vo.flex,Or.row,n.className)})}var Ae=H(require("react")),Sn=require("react"),Sg=require("react-dom");function Li(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function Y(n){return n.slice(4,-1)}var yd=H(require("react"));var Go={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"},gd="_1jm33zvf";var hd={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 ut="InfiniteIcon";var Ve=n=>{let{icon:e,...t}=n,o=n.size??"var(--infinite-icon-size)",r={flex:"none",width:o,height:o,fill:"currentColor",...n.style};return yd.createElement("svg",{viewBox:"0 0 24 24",...t,className:e?$(n.className,Go[e],ut,`${ut}-${hd[e]}`):n.className,style:r},n.children)};var is=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 Sd=n=>is.createElement(Ve,{...n,icon:"filterOperatorContains"},Ge.includesOperator.map(e=>is.createElement("path",{key:e,d:e})));var as=H(require("react"));var bd=n=>as.createElement(Ve,{...n,icon:"filterOperatorEndsWith"},as.createElement("path",{d:Ge.endsWithOperator[0]}));var ls=H(require("react"));var Td=n=>ls.createElement(Ve,{...n,icon:"filterOperatorEq"},ls.createElement("path",{d:Ge.eqOperator[0]}));var ss=H(require("react"));var Cd=n=>ss.createElement(Ve,{...n,icon:"filterOperatorGte"},ss.createElement("path",{d:Ge.gteOperator[0]}));var us=H(require("react"));var Id=n=>us.createElement(Ve,{...n,icon:"filterOperatorGt"},us.createElement("path",{d:Ge.gtOperator[0]}));var cs=H(require("react"));var Rd=n=>cs.createElement(Ve,{...n,icon:"filterOperatorLte"},cs.createElement("path",{d:Ge.lteOperator[0]}));var ds=H(require("react"));var wd=n=>ds.createElement(Ve,{...n,icon:"filterOperatorLt"},ds.createElement("path",{d:Ge.ltOperator[0]}));var ps=H(require("react"));var vd=n=>ps.createElement(Ve,{...n,icon:"filterOperatorNeq"},ps.createElement("path",{d:Ge.neqOperator[0]}));var fs=H(require("react"));var Pd=n=>fs.createElement(Ve,{...n,icon:"filterOperatorStartsWith"},fs.createElement("path",{d:Ge.startsWithOperator[0]}));var Rs=H(require("react"));var dt=H(require("react")),ro=require("react");var Ho=H(require("react")),no=require("react");function JT(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function eC(n){var e=JT(n,"string");return typeof e=="symbol"?e:String(e)}function tC(n,e,t){return e=eC(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dd(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function xd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dd(Object(t),!0).forEach(function(o){tC(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Dd(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Md(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var nC=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},he=n=>{var e=t=>{var o=n.defaultClassName,r=xd(xd({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=n.variantClassNames[i][s];u&&(o+=" "+u)}}for(var[c,d]of n.compoundVariants)nC(c,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return Md(n.variantClassNames,t=>Md(t,o=>o.split(" ")[0]))}},e};var Ed="_1eexc2a6";var Ad=he({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:[]}),_d="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Od=he({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Fd=he({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"]]}),Nd=he({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"]]}),Ld="_12zfob12u _16lm1iw22 _16lm1iw1z";var kd="_12zfob17",zd="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Vd=he({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),ms=he({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Gd="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Hd=he({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Kd="_12zfob1b _16lm1iw2",Bd="_16lm1iw1",Wd="_12zfob16",jd=he({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Ud="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var $d="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j",ki="_1nnkya21";var Yd={transition:"width 0.25s, opacity 0.25s"},Jx=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function Ko(n){let[e,t]=(0,no.useState)(!0),[o,r]=(0,no.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=n,u=s!=null&&s>0,c=n.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...Yd,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if((0,no.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,no.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return Ho.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:$(l,ut,$d,`${ut}-filter`)},u?Ho.createElement("div",{"data-name":"index",style:m,className:kd},s):null,Ho.createElement("div",{className:ki,style:{width:p[0],...f}}),Ho.createElement("div",{className:ki,style:{width:p[1],...f}}),Ho.createElement("div",{className:ki,style:{width:p[2],...f}}))}var zi=Object.freeze({}),oC={string:zi,number:{}};function Bo(n,e){let t=e.default||zi;return n.type===void 0?t:n.type===null?zi:typeof n.type=="string"?e[n.type]||oC[n.type]||zi:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var hs=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((R,w)=>{let v=R.maxSize??r??void 0,P=R.minSize??o??void 0;s.push(P),u.push(v),R.size!=null&&(v!=null&&R.size>v&&(R.size=v),P!=null&&R.size<P&&(R.size=P));let x=R.flex==0?null:R.flex;if(R.size==null&&x==null)throw`Items must specify either a size or a flex property. Item at index ${w} doesn't have either of those.`;x!=null&&(l+=1),a+=x??0,i+=R.size??0});let c=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,w)=>{if(R.flex!=null){let v=d*R.flex,P=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=!1,D=0;P!=null&&v>P&&(p[w]=!0,M=!0,D=P),x!=null&&v<x&&(f[w]=!0,M=!0,D=x),M&&(m+=1,l-=1,a-=R.flex,c-=D)}}),m&&(d=c/a);let g=[],h=0,S=c,y=a,C=0,T=0,I=[];return{items:t.map((R,w)=>{let v={...R},P=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=0,D=p[w],E=f[w],z=D||E,V=R.size??0;if(R.flex!=null){if(z)E&&(M=x),D&&(M=P);else{h+=1;let N=L=>(P!=null&&L>P&&(L=P),x!=null&&L<x&&(L=x),L);h===l?M=N(S):(M=N(Math.round(R.flex*d)),T+=M,S=c-T,y-=R.flex,d=S/y)}V=M,v.flexSize=M}return g.push(M),I.push(V),v.computedSize=V,C+=V,v}),flexSizes:g,minSizes:s,maxSizes:u,computedSizes:I,remainingSize:Math.round(e-C)}};function Vi(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}function Xd(n,e,t){let o=!1,r=0;for(let i of n)i.computedFlex&&(o=!0),r+=i.computedWidth;return o&&Math.round(r)>Math.round(e-t)}function gs(n,e){return n.computedFlex&&!e?"flex":"width"}function Fr(n,e,t){if(e==="width"){let{flex:o,...r}=n??{};return{...r,width:t}}return{...n,flex:t}}var ys=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((x,M)=>(x[M]={...n.columnSizing[M]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],u=l.id,c=s?.id,d=Xd(n.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=gs(l,d),h=s?.computedWidth,S=s?.computedMinWidth,y=s?.computedMaxWidth,C=s?gs(s,d):"width",T=!1,I=!1,b=r>0?1:-1,{value:R,clamped:w,diff:v}=Vi(Math.round(p+r),f,m,b);if(n.shareSpaceOnResize){if(s==null)return o[u]=Fr(o[u],g,R),I=w==="min",T=w==="max",{adjustedDiff:R-p,reservedWidth:t,columnSizing:o,minReached:I,maxReached:T,constrained:I||T};let{value:x,clamped:M,diff:D}=Vi(Math.round(h-r),S,y,b);if(w&&M&&(Math.abs(v)>Math.abs(D)?M=!1:w=!1),!(!w&&!M)){if(w){let E=Vi(Math.round(h-r-v),S,y,b);x=E.value,M=E.clamped,D=E.diff}else if(M){let E=Vi(Math.round(p+r+D),f,m,b);R=E.value,w=E.clamped,v=E.diff}}o[u]=Fr(o[u],g,R),o[c]=Fr(o[c],C,x),I=w==="min"||M==="min",T=w==="max"||M==="max"}else o[u]=Fr(o[u],g,R),I=w==="min",T=w==="max";let P=R-p;return{adjustedDiff:P,reservedWidth:n.shareSpaceOnResize?t:Math.round(t-P),columnSizing:o,minReached:I,maxReached:T,constrained:I||T}};function qd(n,e){return n+e}function rC(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var Zd=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((y,C)=>(y[C]={...n.columnSizing[C]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((y,C)=>n.dragHandlePositionAfter-C).reverse(),a=i.map(y=>n.items[y]),l=a.map(y=>y.computedWidth),s=Xd(n.items,e,t),u=a.map(y=>gs(y,s)),c=0,{computedSizes:d}=hs({items:a.map(y=>(y.resizable===!1&&(c+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(qd,0)+r-c,0)}),p=a.map((y,C)=>d[C]-y.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((y,C)=>{let T=a[C];if(!T.resizable){h.push(0);return}let I=u[C],b=l[C],R=rC(o),{maxReached:w,minReached:v,constrained:P,adjustedDiff:x}=ys({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[C],shareSpaceOnResize:!1,items:n.items,columnSizing:R});o[T.id]=Fr(R[T.id],I,Math.round(b+x)),h.push(x),w||(m=!1),v||(f=!1),P||(g=!1)});let S=h.reduce(qd,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:S,columnSizing:o,reservedWidth:Math.round(t-S)}};var Gi;function Xt(){if(Gi!=null)return Gi;let n=Fe().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),Gi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Gi}var Qd=["start",void 0,"end"],Jd=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Qd.indexOf(r)-Qd.indexOf(i)}),n);function ep(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function Ss(n,...e){return ep(t=>t!=null,n,...e)}function tp(n,e,...t){return ep((o,r)=>!(r in n),e,...t)}var Hi=!0,iC=!0,aC=!0,np="string",pn="unknown";var lC=xn("getComputedVisibleColumns"),sC=(n,e,t)=>n[t]!==!1,bs=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1};function oo(n,e){if(n)return n[e]?n[e]:Object.values(n).find(t=>t.field===e)}function uC(n,e){let t=Bo(n,e);return n.sortType?n.sortType:t.sortType?t.sortType:typeof n.type=="string"?n.type:np}function cC(n,e,t){let r=(Array.isArray(n)?n:n?[n]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[pn];let l=oo(e,a);if(!l)return[pn];let s=uC(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===pn)?pn:r.length===1?r[0]:r}function Ts(n,e){let{colType:t,sortable:o,columnDefaultSortable:r}=e,i=n.defaultSortable??t.defaultSortable,a=!!n.groupByForColumn;if(i==null&&!a){let l=n.field??t.field,s=n.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return o??i??r??Hi}var op=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,pinnedStartMaxWidth:c,pinnedEndMaxWidth:d,filterValue:p,sortable:f,sortInfo:m,multiSort:g,filterTypes:h=Nn,viewportReservedWidth:S,resizableColumns:y,draggableColumns:C,columnDefaultDraggable:T,columnOrder:I,columnPinning:b,editable:R,columnDefaultEditable:w,columnDefaultFilterable:v,columnDefaultGroupable:P,columnDefaultSortable:x,columnSizing:M,columnTypes:D,columnVisibility:E,columnVisibilityAssumeVisible:z,groupBy:V})=>{let N=0,L={};V.forEach((G,ee)=>{G.field&&(L[G.field]=ee)});let F=(p||[]).reduce((G,ee)=>{let{id:ge,field:Te}=ee;return Te&&(G[Te]=ee),ge&&(G[ge]=ee),G},{}),B=Jd(I===!0?Object.keys(n):I,b),X=B.filter(G=>n[G]?sC(E,z,G):(lC(`Column with id "${G}" specified in columnOrder array cannot be found in the columns map.`),!1)),_=new Map,k=X.map((G,ee)=>{let ge=n[G];return _.set(G,ee),ge}),K=(m??[]).reduce((G,ee,ge)=>(ee.id?G[ee.id]={sortInfo:ee,index:ge}:ee.field&&(G[ee.field]={sortInfo:ee,index:ge}),G),{});function Q(G){let ee=n[G],ge=Bo(ee,D),Te={minWidth:ge?.minWidth,maxWidth:ge?.maxWidth,width:ge?.defaultWidth,flex:ge?.defaultFlex},ct={width:ee?.defaultWidth,flex:ee?.defaultFlex,minWidth:ee?.minWidth,maxWidth:ee?.maxWidth},re=M[G];re?.width!=null&&re.flex==null&&delete ct.flex,re?.flex!=null&&re.width==null&&delete ct.width;let j=Ss(ct,re);j.width!=null&&delete Te.flex,j.flex!=null&&delete Te.width,j=Ss(Te,j);let lt=j.flex??void 0,ae=j.minWidth??ee?.minWidth??o,Ee=j.maxWidth??ee?.maxWidth??r,Ze=lt!=null?void 0:j.width??(a?void 0:i);return!Ze&<==null&&(a?lt=a:Ze=ae),{size:Ze,flex:lt,minSize:ae,maxSize:Ee}}let Ie=hs({availableSize:Math.max(t.width-(S??0)-(l??Xt()),0),maxSize:r,minSize:o,items:X.map(Q)}),{computedSizes:se,flexSizes:me,minSizes:ve,maxSizes:Pe}=Ie,ce=[],oe=[],ue=[],pe=[];pe.length=X.length;let Z=new Map,J=new Map,W=0,ie=0,ne=0,le=null,O=[],A=0,de=0,ye=0;k.forEach((G,ee)=>{let ge=X[ee],Te=se[ee],ct=O[ee]=bs(ge,b);ct==="start"?A+=Te:ct==="end"?ye+=Te:de+=Te});let we=t.width-ye,be=[],Me=new Map;X.forEach((G,ee)=>{let ge=k[ee];Me.set(G,ge)});let qe=[];Object.keys(n).forEach(G=>{let ee=n[G];qe.push(G),Me.has(G)||Me.set(G,ee)});let We=new Map;Me.forEach((G,ee)=>{let ge=_.get(ee);ge==null&&(ge=-1);let Te=ge!=-1,ct=X[ge+1],re=Bo(G,D),j=ge,lt=K[ee]?K[ee]:G.field?K[G.field]??null:null,ae=lt?.sortInfo??null,Ee=!!ae,Ze=Ee&&ae.dir===1,Ct=Ee&&!Ze,Cc=lt?.index??-1,Bl=Te?{}:Q(ee),Ic=Te?se[ge]:Bl.size||0,bT=Te&&me[ge]||null,TT=Te?ve[ge]||0:Bl.minSize||0,CT=Te?Pe[ge]||1e4:Bl.maxSize||1e4,Et=Te?bs(ee,b):!1,Rc=Te?ge===X.length-1:!1,bi=j,IT=Te?Et==="start"?ie:Et==="end"?ne:N-ie:0;Et=="start"?bi=Te?j:-1:Et==="end"?bi=Te?j-(ce.length+ue.length):-1:bi=Te?j-ce.length:-1;let RT=Te?Et==="start"||Et===!1?N:we+ne:-1,wT=Te?Et!==le:!1,vT=Te?Rc||Et!==bs(ct,b):!1,wc=G.cssEllipsis??re.cssEllipsis??s,PT=G.headerCssEllipsis??re.cssEllipsis??G.cssEllipsis??re.headerCssEllipsis??u??wc,Ti=Te&&(F[ee]||G.field||G.groupByForColumn)&&(F[ee]||F[G.field||G.groupByForColumn])||null,DT=G.defaultFilterable??re.defaultFilterable??v??!0,xT=R??G.defaultEditable??re.defaultEditable??w??!1,Wl=G.dataType||re.dataType||(Array.isArray(G.type)?G.type[0]:G.type)||np,MT=G.sortType||re.sortType||Wl,vc=G.filterType||re.filterType||Wl,Pc=!1;if(Ti!=null&&!Ti.disabled){let Ul=h[vc];Ul&&(!Ul.emptyValues||!Ul.emptyValues.includes(Ti.filter.value))&&(Pc=!0)}let Oo=G.field??re.field,ET=G.valueGetter??re.valueGetter,jl=G.defaultGroupable??re.defaultGroupable??P??!!Oo;Oo||(jl=!1),G.groupByForColumn&&(jl=!1);let Dc=Oo?L[Oo]!==void 0:!1,AT=Dc?L[Oo]:void 0,_T=Ts(G,{colType:re,sortable:f,columnDefaultSortable:x}),OT=G.resizable??re.resizable??y??iC,Qe={colType:re,align:re.align,headerAlign:re.headerAlign,computedVisible:Te,verticalAlign:re.verticalAlign,defaultHiddenWhenGroupedBy:re.defaultHiddenWhenGroupedBy,valueGetter:ET,valueFormatter:re.valueFormatter,renderValue:re.renderValue,render:re.render,style:re.style,className:re.className,contentFocusable:re.contentFocusable,renderMenuIcon:re.renderMenuIcon,renderSortIcon:re.renderSortIcon,renderRowDetailIcon:re.renderRowDetailIcon,renderSelectionCheckBox:re.renderSelectionCheckBox,renderHeaderSelectionCheckBox:re.renderHeaderSelectionCheckBox,headerStyle:re.headerStyle,headerClassName:re.headerClassName,columnGroup:re.columnGroup,getValueToEdit:re.getValueToEdit,getValueToPersist:re.getValueToPersist,shouldAcceptEdit:re.shouldAcceptEdit,field:Oo,...G,components:{...re.components,...G.components},computedResizable:OT,computedMinWidth:TT,computedMaxWidth:CT,computedFlex:bT,computedDataType:Wl,computedEditable:xT,computedSortType:MT,computedFilterType:vc,cssEllipsis:wc,headerCssEllipsis:PT,computedFilterValue:Ti,computedFiltered:Pc,computedFilterable:DT,computedGroupable:jl,computedGroupedBy:Dc,computedGroupedByIndex:AT,computedWidth:Ic,computedAbsoluteOffset:RT,computedPinningOffset:IT,computedVisibleIndexInCategory:bi,computedOffset:N,computedSortable:_T,computedSortInfo:ae,computedSortIndex:Cc,computedMultiSort:g,computedSorted:Ee,computedSortedAsc:Ze,computedSortedDesc:Ct,computedVisibleIndex:j,computedPinned:Et,computedDraggable:C??G.defaultDraggable??T??aC,computedFirstInCategory:wT,computedLastInCategory:vT,computedFirst:ge===0,computedLast:Rc,id:ee,header:G.header??re.header??G.name??G.field};Te&&(N+=Ic,Z.set(Qe.id,Qe),pe[ge]=Qe,Et==="start"&&(ce.push(Qe),ie+=Qe.computedWidth),Et==="end"&&(oe.push(Qe),ne+=Qe.computedWidth),Et||(ue.push(Qe),W+=Qe.computedWidth),le=Et),Qe.groupByForColumn&&(Qe.computedSortType=G.sortType||re.sortType||cC(Qe.groupByForColumn,e,D),be.push(Qe)),J.set(Qe.id,Qe),Qe.field&&!Qe.groupByForColumn&&!We.has(Qe.field)&&We.set(Qe.field,Qe)}),be.forEach(G=>{G.computedSortable=rp(G,{fieldsToColumn:We,userColumns:e,columnTypes:D,sortable:f,columnDefaultSortable:x})});let rt=new Map;qe.forEach(G=>{let ee=J.get(G);ee&&rt.set(G,ee)}),J.forEach(G=>{rt.has(G.id)||rt.set(G.id,G)});let it=c!=null?Math.min(c,ie):ie,et=d!=null?Math.min(d,ne):ne;return{computedRemainingSpace:t.width-(A+ye+de),computedPinnedStartColumnsWidth:ie,computedPinnedEndColumnsWidth:ne,computedUnpinnedColumnsWidth:W,computedColumnOrder:B,computedPinnedStartColumns:ce,computedPinnedEndColumns:oe,computedUnpinnedOffset:ie,computedPinnedEndOffset:ie+W,computedUnpinnedColumns:ue,computedVisibleColumns:pe,computedColumnsMap:J,computedColumnsMapInInitialOrder:rt,computedVisibleColumnsMap:Z,computedPinnedEndWidth:et,computedPinnedStartWidth:it,renderSelectionCheckBox:pe.reduce((G,ee)=>G||!!ee.renderSelectionCheckBox,!1),fieldsToColumn:We}};function rp(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=n.defaultSortable??n.colType.defaultSortable;if(l!=null)return l;let s=r??Hi,u=n.sortType??n.colType.sortType;return u!=null&&u!==pn&&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 C=o.get(S),T=C?f.getColumnApi(C.id):void 0;if(C&&T)y=T.isSortable();else{let I=oo(i,S);if(I){let b=Ts(I,{colType:Bo(I,a??{}),sortable:t,columnDefaultSortable:r});y=typeof b=="boolean"?b:void 0}else y=!1}}return y===void 0&&h.valueGetter&&(y=!0),y??r??Hi},!0)}}function St(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},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 ip(n,e,t){let{api:o,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,u=i(),{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=u,f=r(),m=St(n.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});return{horizontalLayoutPageIndex:null,column:n,columnApi:m,dataSourceApi:s,renderLocation:t,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:o,renderBag:{header:n.name||n.id||""}}}function Wo(n,e,t,o){let r=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,i=r.header;if(typeof i=="function"){let a=ip(r,e,t),l=i(a)??null;return o?o(l,a):l}return i?o?o(i,ip(r,e,t)):i:r.name||r.id||""}var ap=H(require("react"));var jo=`${yt}HeaderCell__filter`,Ki=`${yt}HeaderCell__filterOperator`,xM=`${jo}__input`;var Cs=ap.createContext(null);var sp=require("react");var lp=require("react"),Is;function Bi(){return Is||(Is=(0,lp.createContext)(null))}function te(n){let e=Bi(),t=(0,sp.useContext)(e);return No(t,n)}function Ke(){return te(n=>({getState:n.getState,actions:n.actions,getComputed:n.getComputed,getDataSourceState:n.getDataSourceState,dataSourceApi:n.dataSourceApi,dataSourceActions:n.dataSourceActions,api:n.api,getDataSourceMasterContext:n.getDataSourceMasterContext}))}var dC=`${jo}__input`,Wi=n=>n.stopPropagation();function up(n){let{filterOperatorMenuVisibleForColumnId:e}=te(c=>({filterOperatorMenuVisibleForColumnId:c.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Nr(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=(0,ro.useState)(!1),l=dt.useCallback(()=>{a(!0)},[]),s=dt.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return dt.createElement("div",{onPointerUp:Wi,onPointerDown:Wi,onFocus:l,onBlur:s,className:`${jo} ${ms({active:u})}`,style:{height:n.columnHeaderHeight}},dt.createElement(Cs.Provider,{value:n},dt.createElement(r,null),dt.createElement(o,null)))}function cp(){let{columnApi:n,disabled:e,operator:t}=Uo(),o=t?.components?.Icon??Ko;return dt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:$(Ki,zd,e?`${Ki}--disabled`:"")},dt.createElement(o,{size:20,className:`${Vd({disabled:e})}`}))}function dp(){return dt.createElement("div",{onPointerUp:Wi,onPointerDown:Wi,className:`${jo} ${ms({active:!1})} ${rd["50%"]}`})}function Uo(){let n=Ke(),{column:e,columnApi:t}=Nr(),o=Wo(e,n,"column-filter"),r=dt.useContext(Cs),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=(0,ro.useState)(l?.filter.value??""),[d,p]=(0,ro.useState)(0);(0,ro.useEffect)(()=>n.getState().pendingColumnFilters.onCancel(e.id,()=>p(y=>y+1)),[e.id]);let f=dt.useCallback(y=>{c(y),r.onChange(y)},[r.onChange]),m=dt.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),g=dt.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);(0,ro.useEffect)(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let y=[...s.emptyValues][0];y!==u&&c(y)}},[l?.filter.value,d]);let h=r.operator,S=h?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:S,operator:h,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:f,clearValue:m,removeColumnFilter:g,ariaLabel:`Filter for ${o}`,className:`${Ld} ${dC}`}}function $o(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Uo();return Rs.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function ji(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Uo();return Rs.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}var Zt=(n,e)=>{let t=n?.[e];return t?{components:{Icon:t}}:{}};function pp(n={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:o}=n;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Zt(o,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Zt(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Zt(o,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Zt(o,"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(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Zt(o,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Zt(o,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Zt(o,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Zt(o,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Zt(o,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var Nn=pp({StringFilterEditor:$o,NumberFilterEditor:ji,icons:{includes:Sd,eq:Td,neq:vd,startsWith:Pd,endsWith:bd,gt:Id,gte:Cd,lt:wd,lte:Rd}});function Ui(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected===null?r.push(...e.map(l=>`${l}--row-partially-selected`)):o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Qo=require("react"),Jp=require("react-dom");function Ln(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function fp(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}var q={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 $i="true",fe={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)"}}},mp="column-header-height";var gp=`.${ze.rootClassName}`;function ws(n){return Ln(n,gp)}var hp=Y(q.scrollLeft),pC=Y(q.scrollTop),fC=Y(q.columnWidthAtIndex),vs=Y(q.columnOffsetAtIndex),yp=Y(q.columnReorderEffectDurationAtIndex),mC=Y(q.columnOffsetAtIndexWhileReordering),gC=Y(q.columnVisibilityAtIndex),hC=Y(q.columnZIndexAtIndex);function Qt(n,e,t){let o=t?ws(t):document.querySelector(gp);yC(n,e,o)}function yC(n,e,t){if(t){let o=n,r=q[o]?Y(q[o]):n;t.style.setProperty(r,`${e}`)}}function Yo(n,e){if(e)for(var t in n){let o=q[t]?Y(q[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function Ps(n,e,t){Qt(`${vs}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${hp}))`:`${n.computedAbsoluteOffset+e}px`,t)}function Ds(n,e,t){Qt(`${hC}-${n}`,`${e}`,t)}function Lr(n,e,t){Qt(`${mC}-${n}`,typeof e=="number"?`calc( var(${vs}-${n}) + ${e}px )`:e,t)}function kr(n,e,t){Qt(`${gC}-${n}`,e,t)}function Yi(n,e,t){Qt(`${yp}-${n}`,t??"",e)}function xs(n,e){let t=`${yp}-${n}`;Qt(t,fe.components.Cell.reorderEffectDuration,e)}var Re={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${fC}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Qt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${vs}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Qt(this.varName.get(n),e,t)}}};function Sp(n,e){Yo({[hp]:`${n.scrollLeft}px`,[pC]:`${n.scrollTop}px`},e)}var bp="_16lm1iw1",Tp="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Cp="_1yeub2vs",Ip="_1yeub2vr",Rp=he({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 RE=he({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var _p=require("react");var zr={bodyWidth:{name:Y(fe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Y(fe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Y(fe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Y(fe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Y(fe.runtime.browserScrollbarWidth),value:""}},SC=Y(q.scrollbarWidthHorizontal),wp=Y(q.scrollbarWidthVertical),bC=Y(q.columnWidthAtIndex),TC=Y(q.columnZIndexAtIndex),vp=Y(q.scrollLeft),CC=Y(q.activeCellColWidth),Pp=Y(q.activeCellColOffset),Ep=Y(q.baseZIndexForCells),IC=Y(q.pinnedStartWidth),Dp=Y(q.bodyWidth),RC=Y(q.bodyHeight),xp=Y(q.pinnedEndOffset),Mp=Y(q.pinnedEndWidth),wC=Y(q.computedVisibleColumnsCount);function qi(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${Ep}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Ap(n){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:o,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:u,scrollbars:c}=n,d=Xt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[Re.columnWidths.varName.get(h)]=g.computedWidth+"px",m[Re.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${vp}) )`:g.computedPinned==="end"?`calc( var(${xp}) ${p.length?"+":""} ${p.map(y=>Re.columnWidths.get(y.computedVisibleIndex)).join(" + ")} + var(${vp}) )`:`${g.computedOffset}px`;let S=qi(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${TC}-${h}`]=`${S}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[zr.browserScrollbarWidth.name]=`${Xt()}px`),f[zr.bodyWidth.name]=`calc(${q.bodyWidth} - ${q.scrollbarWidthVertical})`,f[zr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[zr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${bC}-${g})`).join(" + ")})`,f[zr.visibleColumnsCount.name]=e.length,s!=null){f[CC]=Re.columnWidths.get(s[1]);let m=Re.columnOffsets.get(s[1]);if(u.isHorizontalLayoutBrain){let g=u.getPageIndexForRow(s[0]);f[Pp]=g?`calc( ${fe.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[Pp]=m}return f[wC]=e.length,f[SC]=c.horizontal?`${d}px`:"0px",f[wp]=c.vertical?`${d}px`:"0px",f[IC]="calc( "+t.map(m=>Re.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Mp]="calc( "+o.map(m=>Re.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Ep]=e.length*10,f[xp]=`calc( var(${Dp}) - var(${Mp}) - var(${wp}) )`,f[Dp]=`${l.width}px`,f[RC]=`${l.height}px`,f}var Es=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};function Op(n){let{actions:e,getState:t,focused:o,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:u,onSelfBlur:c,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedVisibleColumns:y,computedUnpinnedColumnsWidth:C,scrollbars:T,focusedClassName:I,focusedWithinClassName:b,computedPinnedStartOverflow:R,computedPinnedEndOverflow:w,focusedStyle:v,focusedWithinStyle:P,brain:x}=te(F=>{let{state:B,computed:X}=F;return{brain:B.brain,actions:F.actions,getState:F.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:X.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:X.computedPinnedEndColumnsWidth,computedPinnedStartColumns:X.computedPinnedStartColumns,computedPinnedEndColumns:X.computedPinnedEndColumns,computedVisibleColumns:X.computedVisibleColumns,computedUnpinnedColumnsWidth:X.computedUnpinnedColumnsWidth,scrollbars:X.scrollbars,focusedClassName:F.state.focusedClassName,focusedWithinClassName:F.state.focusedWithinClassName,computedPinnedStartOverflow:X.computedPinnedStartOverflow,computedPinnedEndOverflow:X.computedPinnedEndOverflow,focusedStyle:F.state.focusedStyle,focusedWithinStyle:F.state.focusedWithinStyle}}),M=(0,_p.useMemo)(()=>Ap({computedVisibleColumns:y,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:C,bodySize:d,activeCellIndex:p,brain:x,scrollbars:T}),[y,h,S,m,g,C,d,p,x,T]),D=Es(F=>{e.focused=F}),E=Es(F=>{e.focusedWithin=F}),N={...n,onFocus:F=>{if(n?.onFocus?.(F),F.target===i.current||F.target===a.current){if(t().focused)return;D(!0),u?.(F),r&&(E(!1),l?.(F));return}r||(E(!0),s?.(F))},onBlur:F=>{if(n?.onBlur?.(F),F.target===i.current||F.target===a.current){if(!t().focused)return;D(!1),c?.(F),r&&(E(!1),l?.(F));return}i.current?.contains(F.relatedTarget)||(E(!1),l?.(F))}},L=$(Jt,Tp,f?`${Jt}--horizontal-layout`:null,N?.className,m?`${Jt}--has-pinned-start ${Ip}`:null,g?`${Jt}--has-pinned-end ${Cp}`:null,o?`${Jt}--focused`:null,r?`${Jt}--focused-within`:null,o&&I?I:null,r&&b?b:null,R?`${Jt}--has-pinned-start-overflow`:null,w?`${Jt}--has-pinned-end-overflow`:null,Rp({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:o,focusedWithin:r}));return N.className=L,N.style={...n?.style,...M},o&&v&&Object.assign(N.style,v),r&&P&&Object.assign(N.style,P),N}var Bp=H(io());function Xi(n){return n.map(e=>e instanceof kn?e:new kn(null,[e]))}var kn=class n{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new n("+",[this,...e])}subtract(...e){return new n("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new n("*",[this,...e])}divide(...e){return new n("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>vC(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function vC(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var PC=(...n)=>new kn("+",Xi(n)),Np=(...n)=>new kn("-",Xi(n)),DC=(...n)=>new kn("*",Xi(n)),xC=(...n)=>new kn("/",Xi(n)),Vr={add:PC,subtract:Np,minus:Np,multiply:DC,divide:xC};var ao=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var He=Fe().requestAnimationFrame||(n=>setTimeout(n,16)),Ht=Fe().cancelAnimationFrame||(n=>clearTimeout(n));var Lp=n=>{let e=null,t=null;return{stop(){e!==null&&Ht(e),t!=null&&Ht(t)},scroll(o){e!==null&&Ht(e),t!=null&&Ht(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft-p,e=He(()=>{i.scroll(o)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft+p,t=He(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var je=class n{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new n(e)}static from(e){return new n(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function kp(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function zp(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function MC(n,e,t){let o=kp(n,t),r=kp(e,t);return o===r?zp(t,e)-zp(t,n):o-r}function Vp(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>MC(o,r,t)),e}function EC(n){if(n.length<2)return!1;let e=n[0].left,t=n[0].top,o={left:!1,top:!1};for(let r=1,i=n.length;r<i;r++){if(o.left&&o.top)return!1;n[r].left!==e&&(o.left=!0),n[r].top!==t&&(o.top=!0)}return!(o.left&&o.top)}function AC(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=Vp(n);let t=n[0],o=n[n.length-1];return t.left===o.left?e.left===t.left&&e.top>=Math.min(t.top,o.top)&&e.top<=Math.max(t.top,o.top):e.top===t.top&&e.left>=Math.min(t.left,o.left)&&e.left<=Math.max(t.left,o.left)}function Gp(n,e){if(EC(n))return AC(n,e);n=Vp(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(_C([t,i,a],e))return!0}return!1}function _C(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var qo=class{containsPoint(e){return Gp(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Xo=class n extends qo{static clone(e){return new n(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 OC(n,e){let t=Math.min(n.left,e.left),o=Math.min(n.top,e.top),r=n.left+n.width,i=e.left+e.width,a=Math.max(r,i),l=n.top+n.height,s=e.top+e.height,u=Math.max(l,s);return new _e({top:o,left:t,width:a-t,height:u-o})}var _e=class n extends qo{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 n(t)}static clone(t){return new n(t)}static from(t){return n.clone(t)}static fromPoint(t){return n.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let o=this;for(let r of t)o=OC(o,r);return o}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 Xo(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 As;function FC(){if(typeof document>"u"||!document.body)return 1/0;let n=document.createElement("div");n.style.cssText="position:absolute;top:0;left:0;width:1px;visibility:hidden;pointer-events:none",document.body.appendChild(n);let e=o=>(n.style.height=`${o}px`,Math.abs(n.getBoundingClientRect().height-o)<1),t=1e6;if(!e(t))return n.remove(),1/0;for(;t<64e6&&e(t*2);)t*=2;return n.remove(),t}function Zi(){return As===void 0&&(As=FC()),As}function Qi(n){return n<=4e6?!1:n>Zi()}function _s(n,e){if(!Qi(n))return 1;let t=Zi()-e,o=n-e;return t>0&&o>0?o/t:1}function Hp(n){let e=null;return{get value(){let t=n.getScrollPosition(),o=n.getScrollRatio();return o>1&&e!==null&&Math.abs(e-t)<=o?e:(e=null,t)},set value(t){e=t,n.setScrollPosition(t)}}}function Os(n,e,t=Math.floor){return Math.abs(n-e)<=1e6?e:t(n)}var Kp=10,NC=Y(q.pinnedStartWidth);function Wp(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,groupingToolbarDragListId:h,api:S,horizontalLayoutPageIndex:y,pageWidth:C}=n;function T(Z){let J=Z==="start"?F:B;return V===L?J:L===Z?J+E.computedWidth:V===Z?J-E.computedWidth:J}function I(Z){if(Z.columnIndex===z||y!=null)return!0;let J=e[Z.columnIndex];if(J.computedPinned)return!0;let W=l.getScrollPosition().scrollLeft,ie=J.computedOffset+(y!=null&&C!=null?C*y:0);return ie>=W+T("start")&&ie+J.computedWidth<=W+c.width-T("end")}let b=(Z,J)=>{let{restrictToParentGroup:W,dragColumn:ie}=J,ne=[];if(Z.forEach(O=>{if(O.computedVisibleIndex===z)return;let A={columnId:O.id,columnIndex:O.computedVisibleIndex,offsetX:O.computedOffset+Math.round(O.computedWidth/2)};I(A)&&ne.push(A)}),W){let A=function(ye,we,be){let Me=Z[ye];Me&&(Me.columnGroup!==ie.columnGroup&&be.add(Me.id),A(ye+we,we,be))};var le=A;let O=ie.computedVisibleIndex,de=new Set;A(O-1,-1,de),A(O+1,1,de),ne=ne.filter(ye=>!de.has(ye.columnId))}return ne},w=r.length,v={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},P={left:v.clientX-c.left-(v.clientX-s.left)+Kp,top:v.clientY-c.top-(v.clientY-s.top)+Kp},x=l.getScrollPosition(),M=e.map(Z=>Z.computedVisibleIndex),D=M,E=t.get(i),z=E.computedVisibleIndex,V=E?.computedPinned,N=z,L=V,F=l.getFixedStartColsWidth(),B=l.getFixedEndColsWidth(),X=v,_={x:0,y:0},k=1,K=0;function Q(Z){let J=Math.round(Z.clientX),W=Math.round(Z.clientY);if(J===X.clientX&&W===X.clientY)return _e.from(s).shift({left:_.x,top:_.y});X={clientX:J,clientY:W};let ne=l.getScrollPosition().scrollLeft-x.scrollLeft;return _.x=X.clientX-v.clientX,_.y=X.clientY-v.clientY,K=_.x+ne,k=K<0?-1:1,f({left:P.left+_.x,top:P.top+_.y}),_e.from(s).shift({left:_.x,top:_.y})}function Ie(Z){let J=0;V?V==="start"&&Z.forEach((W,ie)=>{J||e[W]?.computedPinned!=="start"&&(J=ie)}):Z.forEach((W,ie)=>{e[W]?.computedPinned==="start"&&(J=ie+1)}),w=J,se("start",Z,J)}function se(Z,J,W){if(Z==="start"){let ie=0;for(let ne=0;ne<W;ne++){let le=J[ne],O=e[le];ie+=O.computedWidth}Qt(NC,`${ie}px`,a)}}function me(Z){if(Z==null||Z===N)return;if(N===-1&&Z!==-1&&(kr(z,"",a),m(!1)),N=Z,Z===-1){ve(z);return}let J=ao(M,z,N>z?N-1:N);w=0;let ie=new Set;return J.forEach((ne,le)=>{let O=D[le];ne!==O&&ie.add(ne),Ie(J)}),D=J,Pe(ie),{newColumnIndexes:J,indexesWithTransition:ie,pinnedStartCount:w}}function ve(Z){D=D.filter(W=>W!==Z),e.forEach(W=>{let ie=W.computedVisibleIndex,ne=ie>Z;xs(ie,a);let le="";ne&&(le=Vr.minus(Re.columnOffsets.get(ie),Re.columnWidths.get(Z)).done()),Lr(ie,le,a)}),kr(Z,"hidden",a),m(!0)}function Pe(Z){e.forEach(J=>{let W=J.computedVisibleIndex;Z.has(W)?xs(W,a):Yi(W,a);let ie=W===z,ne=k===-1?W<N||W>z:W<z||W>=N,le="";k===-1?le=ie?Re.columnOffsets.get(N):ne?Re.columnOffsets.get(W):Vr.add(Re.columnOffsets.get(W),Re.columnWidths.get(z)).done():le=ne?Re.columnOffsets.get(W):ie?Vr.add(Re.columnOffsets.get(N-1),Re.columnWidths.get(N-1)).minus(Re.columnWidths.get(z)).done():Vr.minus(Re.columnOffsets.get(W),Re.columnWidths.get(z)).done(),Lr(W,le,a)})}let ce=c.left+T("start"),oe=c.right-T("end"),ue=Lp({scrollOffsetStart:ce,scrollOffsetEnd:oe}),pe=Hp({getScrollPosition:()=>l.getScrollPosition().scrollLeft,setScrollPosition:Z=>{S.scrollLeft=Z},getScrollRatio:()=>l.getScrollRatio("horizontal")});return Q(v),{speedScroller:ue,stop(){ue.stop()},onMove(Z){let J=Q(Z);if(g().dropTargetListId===h||p&&!d.containsPoint(J.getCenter()))return p&&me(-1),null;ue.scroll({mousePosition:X,get scrollLeft(){return pe.value},set scrollLeft(A){pe.value=A}});let W=b(e,{dragColumn:E,restrictToParentGroup:u==="group"}),ie=k===-1?E.computedOffset+K:E.computedOffset+E.computedWidth+K,ne=(0,Bp.default)(W,ie,({offsetX:A},de)=>A<de?-1:A>de?1:0);ne<0&&(ne=~ne),W.length?ne=W[ne]?W[ne].columnIndex:W[W.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ne=0),ne===z+1&&(ne=z),me(ne);let le={};o.forEach(A=>{le[A.id]="end"});for(let A=0;A<w;A++){let de=D[A],ye=e[de];le[ye.id]="start"}let O=D.map(A=>e[A].id);return{columnPinning:le,columnOrder:O}}}}function Fs(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],u=o.indexOf(s),c=o.indexOf(r);return ao(o,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=o.indexOf(s),c=o.indexOf(r);return ao(o,c,u)}return e}var tt=H(require("react"));var lo=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 o=((...r)=>{this.off(e,o),t(...r)});return this.on(e,o)}off(e,t){let o=this.listeners[e];if(!o)return;let r=o.indexOf(t);r!==-1&&o.splice(r,1)}emit(e,...t){let o=this.listeners[e];o&&o.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 jp=H(io());var Up=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:u,dragIndex:c,dragRectangle:d}=o,p=u===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,jp.default)(h,S,(R,w)=>R-w);y<0&&(y=~y),m===1&&y===c+1&&p&&y--;let C=Math.min(c,y),T=Math.max(c,y),I=p?i.map((R,w)=>{if(w===c&&p)return t;if(w<C||w>=T)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((R,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)}}),b={offset:t,dropIndex:y,dragSourceListId:u,dropTargetListId:a,dragIndex:c,outside:!1,items:i,dragItem:s,offsetsForItems:I,dragRect:g,status:"accepted"};return e.acceptsDrop(b)?{event:b,error:null,success:!0}:(b.status="rejected",{event:b,error:"rejected by interaction target",success:!1})},$p=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:u,listId:c}=o,d=je.from(s.getCenter()),p=c===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?o.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:u,outside:!f,items:l,dragSourceListId:c,dropTargetListId:i,offsetsForItems:p?l.map((S,y)=>S.id===u.id?t:f?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-u.rect.width,top:0}:{left:0,top:-u.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 De=class De{static startDrag(e,t){let o=e instanceof Zo?e:new Zo(e),r=new Ns({activeDragSource:o,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){let{listId:t}=e,o=De.dragInteractionTargetsMap.get(t);if(o&&o!==e){console.warn(`DragInteractionTarget with listId ${t} already registered`);return}return o||(De.dragInteractionTargetsMap.set(t,e),De.emit("register",e)),()=>{De.unregisterDragInteractionTarget(e)}}static unregisterAll(){De.dragInteractionTargetsMap.forEach(e=>{De.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(!e)return;let{listId:t}=e;De.dragInteractionTargetsMap.get(t)===e&&(De.dragInteractionTargetsMap.delete(t),e.unregister(),De.emit("unregister",e))}static onDragStart(e){let{dragItem:t,dragIndex:o}=e.activeDragSource,r=e.activeDragSource.listId,a=De.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;De.dragInteractionTargetsMap.forEach(u=>{let c=u.getData();u.start({dragIndex:c.listId===r?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),De.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:o})}static withDragMove(e,t){let{activeDragSource:o}=e,{listId:r}=o,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 u=Up(e,s);if(u){t(s,u),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let u=$p(e,s);u&&t(s,u)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];De.withDragMove(e,(u,{event:c})=>{u.move(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null,s=l?.dropTargetListId??null;De.emit("drag-move",{dragSourceListId:o,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:o,dragItem:r}=t,i=null,a=[];De.withDragMove(e,(s,{event:u})=>{e.cancelled&&(u={...u,dropTargetListId:null,dropIndex:-1,outside:!1}),s.drop(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null;De.emit("drag-drop",{dragSourceListId:o,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 lo;var pt=De,Zo=class n{static clone(e){let t=e.getData();return new n(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){Rt(this.data,e)||(this.data=e,this.dragRectangle=new _e(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=_e.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},Ns=class extends lo{constructor(t){super(t.listeners);this.phase="start";this.cancelled=!1;this.currentOffset={top:0,left:0};this.initialDragSource=Zo.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:o}=this.activeDragSource,r={dragSourceListId:t,dragItemId:o.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 o={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=Zo.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=pt;var Yp=require("react"),qp=tt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),fn=()=>tt.useContext(qp),Xp=tt.createContext(""),so=n=>{let e=tt.useContext(Xp);return e?`${n}-${e}`:n},Ji=n=>{let[e,t]=tt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=tt.useId(),r=tt.useRef(e);r.current=e;let i=tt.useCallback(()=>{let l=r.current;return{dragSourceListId:l.dragSourceListId,dropTargetListId:l.dropTargetListId,dragItemId:l.dragItemId,status:l.status}},[]),a=tt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:i}),[e,t]);return(0,Yp.useEffect)(()=>{let l=pt.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),s=pt.on("drag-move",c=>{let d=r.current,p={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(d)!==JSON.stringify(p)&&t(p)}),u=pt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{l(),s(),u()}},[pt,t]),tt.createElement(Xp.Provider,{value:o},tt.createElement(qp.Provider,{value:a},typeof n.children=="function"?n.children(a):n.children))};var ea="header",ta="grouping-toolbar";var Ls=`${yt}Body`,Zp=n=>n.querySelector(`.${Ls}`);var uo=`${yt}HeaderCell`,ks=`${yt}HeaderWrapper`,Qp=n=>Array.from(n.querySelectorAll(`.${ks}`));function Gr(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var LC=Y(q.baseZIndexForCells),kC=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:Rt(n,e)},ef=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=(0,Qo.useState)(null),[a,l]=(0,Qo.useState)(!1),{getCurrentDragSourceAndTarget:s}=fn(),u=so(ta),{getComputed:c,getState:d,api:p,computedDraggable:f,rootRef:m,actions:g}=te(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:y.state.domRef})),h=(0,Qo.useCallback)(y=>{let C=c().computedVisibleColumnsMap.get(n);if(!C||!C.computedSortable)return;let{multiSortBehavior:T}=d();p.toggleSortingForColumn(n,{multiSortBehavior:T==="replace"&&(y.ctrlKey||y.metaKey)?"append":T})},[]),S=(0,Qo.useCallback)(y=>{if(Gr(y.target))return;let{brain:C,draggableColumnsRestrictTo:T}=d(),{computedVisibleColumns:I,computedVisibleColumnsMap:b,computedPinnedStartColumns:R,computedUnpinnedColumns:w,computedPinnedEndColumns:v}=c(),P=b.get(n);if(!P.computedDraggable){h(y);return}let x=e.current,M=x.getBoundingClientRect(),D=m.current.getBoundingClientRect(),E=C.getAvailableSize(),z=P.computedVisibleIndex,V=C.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),N=C.isHorizontalLayoutBrain?C.getPageWidth():null,L=x.style.cursor??"auto",F=!1,B=m.current,X=_e.from(Zp(B).getBoundingClientRect()),_=Qp(B).map(ce=>_e.from(ce.getBoundingClientRect())),k=X.getMinimumBoundingRectangle(..._),K=Wp({brain:C,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:N,draggableColumnsRestrictTo:T,computedPinnedEndColumns:v,computedPinnedStartColumns:R,computedUnpinnedColumns:w,computedVisibleColumns:I,computedVisibleColumnsMap:b,dragColumnHeaderTargetRect:M,dragColumnId:n,getCurrentDragSourceAndTarget:s,groupingToolbarDragListId:u,api:p,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:D,acceptDropToReorderRect:k,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),Q=null,Ie,se;function me(ce){let{columnPinning:oe,columnOrder:ue}=ce;kC(d().columnPinning,oe)||(g.columnPinning=oe);let pe=c().computedColumnOrder;JSON.stringify(ue,pe)&&(g.columnOrder=Fs({newColumnOrder:ue,visibleColumnOrder:c().computedVisibleColumns.map(Z=>Z.id),existingColumnOrder:pe,dragColumnId:n}))}let ve=ce=>{let{headerBrain:oe,brain:ue}=d();if(!F){F=!0;let pe=ue.keepColumnRendered(V),Z=oe.keepColumnRendered(V);if(ue.isHorizontalLayoutBrain){let W=ue.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ie=oe.extendRenderRange({start:!0,end:!0,direction:"horizontal"});se=()=>{W(),ie()}}Ie=()=>{pe(),Z()},g.columnReorderDragColumnId=P.id,t!=null&&(g.columnReorderInPageIndex=t),Ds(z,`calc( var(${LC}) + 10000 )`,m.current),m.current?.classList.add(Ms),x.style.cursor="grabbing"}Q=K.onMove(ce)},Pe=ce=>{let oe=ce.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:ue}=d(),pe=m.current;pe?.classList.remove(Ms),K.stop(),C.update({...E}),Ie?.(),se?.(),x.style.cursor=L,x.hasPointerCapture?.(oe)&&x.releasePointerCapture(oe),x.removeEventListener("pointermove",ve),x.removeEventListener("pointerup",Pe),i(null);let Z=p.getColumnApi(P.id)?.isSortable()??!1;!F&&Z&&p.toggleSortingForColumn(P.id,{multiSortBehavior:ue==="replace"&&(ce.ctrlKey||ce.metaKey)?"append":ue}),(0,Jp.flushSync)(()=>{Q?me(Q):F&&o&&p.setVisibilityForColumn(P.id,!1),g.columnReorderDragColumnId=!1,t!=null&&(g.columnReorderInPageIndex=null)}),I.forEach(J=>{Yi(J.computedVisibleIndex,pe),kr(J.computedVisibleIndex,"",pe),Lr(J.computedVisibleIndex,"",pe)}),Ds(z,qi(P,{pinnedStartColsCount:R.length,visibleColsCount:I.length}),pe)})};x.addEventListener("pointermove",ve),x.addEventListener("pointerup",Pe),x.setPointerCapture(y.pointerId)},[n,t,u]);return{onPointerDown:f?S:h,dragColumnOutside:a,proxyPosition:r}};var rr=H(require("react"));var Ce=H(require("react")),ke=require("react");var nf=Symbol("REPAINT_CELLS_KEY_NO_ROW");function of(n){return typeof n=="function"}function tf(n,e){let{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(o);if(!a)return nf;let l=r.getDataSourceStates();return n({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function rf(n,e,t){let o=tf(n,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=tf(n,e);r!==nf&&(Object.is(r,o)||(o=r,t()))})}var af="_1eexc2a7 _1eexc2a6",lf=he({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"]]}),sf=he({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 uf="_1eexc2a5",na=he({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Jo="_1eexc2a8";var oa=H(require("react")),ra=require("react");var cf="qz8ht90 _16lm1iwk";function zC(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:VC}=Lt({forwardProps:zC,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function GC(){let{componentState:n,componentActions:e}=kt(),{checked:t,domProps:o,disabled:r}=n,i=(0,ra.useRef)(null);return(0,ra.useEffect)(()=>{i.current.indeterminate=t==null},[t]),oa.createElement("input",{...o,className:$("InfiniteCheckBox",cf,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function zn(n){return oa.createElement(VC,{...n},oa.createElement(GC,null))}var HC="*",Ue=class{constructor(e){this.wildcard=HC;this.cache=new U;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(u=>{this.cache.delete(u)}),this.cache.delete(s),o)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){xn(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),u=this.deselectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||u?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function Vn(n,e){return e().dataArray[n]}function ia(n){return n().dataArray}var ft=class{constructor(e){this.collapsedPathsMap=new U;this.expandedPathsMap=new U;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var zs=n=>Array.isArray(n)?new U(n.map(e=>[e,!0])):n,KC=(n,e)=>n.length-e.length,Je=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new U;this.cache=new U;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new U})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?zs(e):this.config.treePaths}withTreePaths(e,t){let o=this.config.treePaths;t=this.getTreePaths(t);let r=t!==o;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=o,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(o=>o.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],o){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},o)}getSelectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&o.push(i.keys)})},t),o}getDeselectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||o.push(i.keys)})},t),o}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 n(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:zs(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?zs(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:o,treePaths:r}=this.config;return t!=="visible"||!o||o===r?!1:o.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:o,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{o.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:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){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 o=this.cache.get(e);if(o)return o;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(KC);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,u=0,c=this.getNodeBooleanSelectionStateFromParent(e);c?s+=r:u+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(c?(s-=g,u+=g):(u-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:u})}if(!s&&!u)return this.cacheIt(e,{selected:c,selectedCount:c?r:0,deselectedCount:c?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:u,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.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:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function tr(n,e){return new Je(n,er(e))}function er(n){return()=>{let e=typeof n=="function"?n():n,{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}:{treePaths:o??t,multiRowSelectionTarget:r}}}var aa=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof 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(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!o)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(o.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),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new 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 o=this.getState(),r=new ft(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new ft(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new ft(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?Vn(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,er(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,er(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof 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 Vs(n){return n.map(en)}function en(n){if(Fe().structuredClone)return Fe().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return Vs(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(Vs(Array.from(n)));if(n instanceof Map)return new Map(Vs(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=en(n[t]));return e}function Hr(n){return n}var la="____not_loaded_yet____";function Gs(n){return typeof n=="string"&&n.startsWith(la)}var co=Object.seal({data:null,field:null});var wt="____root____";function Gn(){return!1}function Hs(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function sa(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function pf(n,e){let{marker:t,reducers:o={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:u}=n;t&&t.start();let c=new U;function d(S,y,C,T=0,I=[]){let b=!C.length||T===C.length-1,R=y[u?.values||"values"]||{};for(let w in R)if(R.hasOwnProperty(w)){let v=w;I.push(v),p.set(I,!0),S.set(I,{reducerResults:R[w][u?.totals||"totals"]||{},items:[]}),b||d(S,R[w],C,T+1,I),I.pop()}}let p=r?new U:void 0,f=[],m=Hs(o),g=en(m);e.visitDepthFirst((S,y,C,T)=>{let[I,...b]=y,R=S.children,w=c.get(b);if(w&&(w.cache=S.cache,w.childrenLoading=S.childrenLoading,w.childrenAvailable=S.childrenAvailable,w.error=S.error),b.length==i.length&&i.length){if(w){w.items=R;for(let P=0,x=b.length;P<x;P++){let M=b.slice(0,P),D=c.get(M);D&&(D.items=D.items||[],D.items=D.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let v=0,P=R.length;v<P;v++){if(!R[v]){let E={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...b,`${la}${v}`],E);continue}let x=R[v].data,M=R[v].keys||[];if(M.length){let E=M[M.length-1];b.push(E)}let D={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:R[v].totalChildrenCount,totalChildrenCountUnfiltered:R[v].totalChildrenCountUnfiltered,reducerResults:R[v].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(b,D),r){let E=D.pivotDeepMap=new U,z=R[v].pivot;d(E,z,r,0,f)}M.length&&b.pop()}T?.()});let h={deepMap:c,groupParams:n,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 df(n,e,t,o,r,i,a,l,s,u=Hr){let{items:c,reducerResults:d,pivotDeepMap:p}=n.get(e);if(c.push(o),a&&sa(o,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?o[g]:null;h&&(co.data=o,co.field=g,y=h(co));let C=(S||u)(y,o);t.push(C),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:en(s),items:[]}));let{reducerResults:T,items:I}=p.get(t);I.push(o),a&&sa(o,r,a,T,e)}t.length=0}}function ff(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=n,d=c(r),p=[...o,d],f=s(r);if(t.set(p,!0),f){for(let S=0,y=o.length;S<=y;S++){let C=o.slice(0,S),T=e.get(C),{reducerResults:I,items:b}=T;b.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&sa(r,i,a,I,C)}return}let m=en(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:o.length});let h=u(r);if(!(!h||!Array.isArray(h))){for(let S=0,y=h.length;S<y;S++){let C=h[S];ff(n,e,t,p,C,S,a,l)}a&&Kr(a,m,g)}}function Ks(n,e){let{reducers:t,marker:o}=n;if(o){let u=Object.keys(t??{});o.start({details:u.length>0?[{name:"Reducers",value:u.join(", ")}]:void 0})}let r=Hs(t),i=en(r),a=new U,l=new U;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 u=0,c=e.length;u<c;u++)ff(n,a,l,[],e[u],u,t,r);t&&Kr(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function ca(n,e){let{marker:t,groupBy:o,defaultToKey:r=Hr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new U:void 0,u=new U,c=[],d=[],p=Hs(a),f=en(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:en(p)};i&&(g.pivotDeepMap=new U),u.set(c,g)}for(let g=0,h=e.length;g<h;g++){let S=e[g],y={};for(let C=0;C<l;C++){let{field:T,groupField:I,valueGetter:b,toKey:R}=o[C],w=T?S[T]:null;b&&(co.data=S,co.field=T,w=b(co));let v=(R||r)(w,S);if(y[T||I]=v,c.push(v),!u.has(c)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:en(p)};i&&(P.pivotDeepMap=new U),u.set(c,P)}df(u,c,d,S,g,i,a,s,p,r)}l||df(u,c,d,S,g,i,a,s,p,r),a&&sa(S,g,a,f,c),c.length=0}a&&(u.visitDepthFirst((g,h,S,y)=>{Kr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:C,reducerResults:T},I,b,R)=>{Kr(a,T,C),R?.()}),y?.()}),Kr(a,f,e));let m={deepMap:u,groupParams:n,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:o.map(g=>g.field).join(", ")}]}),m}function mf(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function BC(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d??null,f;if(Object.keys(u).length>0){p={...d},f={};for(let y in i)if(i.hasOwnProperty(y)){let T=i[y].field;T&&(f[T]=u[y]),T&&p[T]==null&&(p[T]=u[y])}}let m=!0,g=o[o.length-1],h=g;if(p!=null){let y=t[o.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(la)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Gn,hasSelectedCells:Gn,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function ua(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function Kr(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function gf(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:u,treeResult:c,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:S}=r,{deepMap:y}=c,C=n.length,T=t[t.length-1],I=T?T.nodeExpanded:!0;for(let b=0;b<C;b++){let R=n[b],w=u(R,b),v=[...e,w];if(l(R)){let V={id:w,nodePath:v,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Gn,hasSelectedCells:Gn,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,b],indexInParent:b,indexInAll:I?i.length:-1};p&&(V.rowSelected=p(V)),d&&(V.rowDisabled=d(V)),f&&f(V);let N=h&&S!=null&&S>0&&V.indexInAll%S===0?V.indexInAll/S:null;for(let L=0,F=t.length;L<F;L++){let B=t[L];if(I||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(V),N!=null&&I){if(typeof h=="function"&&h(B)!==!0)continue;let X=ua(B,V.indexInAll,N);i[X.indexInAll]=X,V.indexInAll++}}I&&(i[V.indexInAll]=V);continue}let M=y.get(v)?.totalLeafNodesCount??0,D={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:v,id:w,data:R,indexInAll:i.length,indexInParent:b,indexInParentNodes:[...o,b],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Gn,hasSelectedCells:Gn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(D.rowSelected=p(D),g)){let V=g.getSelectionCountFor(D.nodePath);D.selectedLeafNodesCount=V.selectedCount,D.deselectedLeafNodesCount=V.deselectedCount}d&&(D.rowDisabled=d(D)),f&&f(D);let E=!0;if(m&&(D.selfExpanded=E=m(D)),I||(E=!1),D.nodeExpanded=E,I&&h&&S!=null&&S>0){let V=D.indexInAll,N=D.parentNodes;if(N.length>0&&V%S===0){let L=V/S,F=0;N.forEach(B=>{typeof h=="function"&&h(B)!==!0||(i.push(ua(B,V+F,L)),F++,D.indexInAll++)})}}I&&(i[D.indexInAll]=D);let z=s(R);Array.isArray(z)&&gf(z,v,[...t,D],D.indexInParentNodes,r,i)}return i}function hf(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return gf(e,[],[],[],n,o),t&&t.end(),{data:o}}function yf(n){let{marker:e,lazyLoad:t,groupResult:o,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:u,isRowSelected:c,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=n,{groupParams:m,deepMap:g,pivot:h}=o,{groupBy:S}=m;e&&e.start({details:[{name:"Group by fields",value:S.map(b=>b.field).join(", ")}]});let y=[],C=[],T=[],I=[];return g.visitDepthFirst((b,R,w,v)=>{let P=b.items,x=R.length,M=s?.isGroupRowCollapsed(R)??!1;I.push(w);let D=BC({lazyLoad:t,groupBy:S,parents:Array.from(T),reducers:f,indexInGroup:w,indexInParentGroups:Array.from(I),indexInAll:y.length,groupKeys:R,error:b.error,totalChildrenCount:b.totalChildrenCount,childrenLoading:(b.childrenLoading||!M&&!b.childrenAvailable)&&t,childrenAvailable:b.childrenAvailable,directChildrenCount:R.length===S.length?b.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},b);if(c&&(D.rowSelected=c(D),d)){let L=d.getSelectionCountFor(D.groupKeys);D.selectedChildredCount=L.selectedCount,D.deselectedChildredCount=L.deselectedCount}u&&(D.rowDisabled=u(D));let E=T[T.length-1],z=E?.collapsed??!1;z&&(M=!0),D.collapsed=M;let V=p||M;if(z&&(V=!1),V){if(i&&r!=null&&r>0){let L=D.indexInAll,F=D.parents;if(F.length>0&&L%r===0){let B=L/r,X=0;F.forEach(_=>{typeof i=="function"&&i(_)!==!0||(y.push(ua(_,L+X,B)),X++,D.indexInAll++)})}}y.push(D),C.push(y.length-1)}D.collapsedChildrenCount=0,T.forEach(L=>{L.deepRowInfoArray.push(D),L.collapsedGroupsCount+=M?1:0}),E&&D.selfLoaded&&t&&(E.directChildrenLoadedCount+=1),a&&a(D),T.push(D);let N=!0;if(N){if(v)v();else if(!h){let L=y.length;M||(y.length+=P.length);let F=0;for(let B=0,X=P.length;B<X;B++){let _=P[B];if(!M&&i&&r!=null&&r>0){let Ie=L+B+F;if(Ie%r===0){let se=Ie/r;T.forEach(me=>{if(typeof i=="function"&&i(me)!==!0)return;let ve=L+B+F;y[ve]=ua(me,ve,se),F++,y.length++})}}let k=L+B+F,Q={id:_?l(_,k):`${R}-${B}`,data:_,isCellSelected:Gn,hasSelectedCells:Gn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!_,rowSelected:!1,rowDisabled:!1,rootGroupBy:S,collapsed:M,groupKeys:R,parents:Array.from(T),indexInParentGroups:[...I,B],indexInGroup:B,indexInAll:k,groupBy:S,groupNesting:x+1,groupCount:D.groupCount};c&&(Q.rowSelected=c(Q)),u&&(Q.rowDisabled=u(Q)),a&&a(Q),T.forEach((Ie,se)=>{se===T.length-1&&_&&(Ie.directChildrenLoadedCount+=1),M&&(Ie.collapsedChildrenCount+=1),Ie.deepRowInfoArray.push(Q)}),M||(y[L+B+F]=Q)}}}T.pop(),I.pop()}),e&&e.end(),{data:y,groupRowsIndexes:C}}function Hn(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||Hr)(l,n);return t.push(s),t},[])}var WC=new U,Sf=new WeakMap;function da(n){let{originalDataArray:e,groupBy:t,toPrimaryKey:o}=n;if(!e||!t.length)return WC;let r=Sf.get(e);if(r&&r.groupBy===t)return r.groups;let i=new U,a=t.length,l=[];return e.forEach(s=>{let u=Hn(s,t);l.length=0;for(let c=0;c<u.length;c++){l.push(u[c]);let d=i.get(l);d||(d={count:0},l.length===a&&(d.primaryKeys=[]),i.set(l,d)),d.count++,d.primaryKeys?.push(o(s))}}),Sf.set(e,{groupBy:t,groups:i}),i}function jC(n,e){let t=[];return n.getLeafNodesStartingWith(e,o=>{let r=o.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var Oe=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new U;this.deselectedMap=new U;this.onlyUsePrimaryKeys=!1;this.selectionCache=new U;this.selectionCountCache=new U;this.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,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Hn(r,o):[]}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:o}=this.getConfig();return e.length?o?.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:o,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=Hn(l,o),u=r(l),c=[...s,u];a.delete(c),this.isRowSelected(u,s)!==t&&i.set(c,!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:o}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(o?.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 U;this.selectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new U;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let o=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,o??null),o}computeLazyRowCount(e){let t=this.getConfig(),o=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!o)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===o)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,u)=>s+(Gs(u[u.length-1])?1:this.getLazyRowCount(u)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new U;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let o=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,o),o}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),o=e.length?t?.get(e):void 0;return e.length&&!o?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!Gs(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new U;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:o,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?o?.get(e):void 0,s=l?l.items:r??[],u=l?l.totalChildrenCount:a,c=new Set,d=u==null||s.length>=u;for(let p=0;p<s.length;p++){let f=s[p];f==null?d=!1:c.add(i(f))}t={primaryKeys:c,complete:d},this.lazyLoadedRows.set(e,t)}return t}isLazyEntryFilteredOut(e){let{groupDeepMap:t}=this.getConfig(),o=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>o?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let o=this.selectionCountCache.get(e);if(o!=null)return o;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 u=this.getLazyRowCount(e),c=u===void 0?1:Math.max(u-l-s,0);t?l+=c:s+=c;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 o=this.getGroupDeepMap()?.get(e);return o?this.getLazyUnfilteredCount(e)??o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),o={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?da(t).getKeysStartingWith(e,o):t.groupDeepMap?.getKeysStartingWith(e,o)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:o,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?jC(da(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(o?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=o?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new n(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear(),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()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}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 o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}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 o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!r))return this.getLazySelectionCountFor(e,t??this.getGroupRowBooleanSelectionStateFromParent(e));if(this.onlyUsePrimaryKeys&&(r||this.targetsVisibleRowsOnly())){let u=this.getAllPrimaryKeysInsideGroup(e),c=0,d=0;u.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}c++}else{if(this.selectedMap.has([f])){c++;return}d++}});let p={selectedCount:c,deselectedCount:d};return this.selectionCountCache.set(e,p),p}if(e.length===r&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:u}=this.getConfig(),c=0,d=0;this.getVisibleDataInsideGroup(e).forEach(f=>{this.isRowSelected(u(f),e)?c++:d++});let p={selectedCount:c,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let u=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,c=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=c-(d+p),m={selectedCount:d+(u?f:0),deselectedCount:p+(u?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;i.forEach(u=>{let c=this.selectedMap.get(u),d=this.deselectedMap.get(u),p=c?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(u,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function nr(n,e){return new Oe(n,mt(e))}function mt(n){return()=>{let e=typeof n=="function"?n():n,{originalDataArray:t,postFilterDataArray:o}=e,r=!!e.lazyLoad,i=r?e.originalLazyGroupData.get([wt]):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&&!!o&&o.length<t.length,originalDataArray:t,postFilterDataArray:o}}}function bf(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof 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:u}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?Hn(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Hn(d,u):[]}let c=new Oe(a,mt(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Oe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Hn(d,u):[]}let c=new Oe(l,mt(e));c.deselectRow(r,i),t.rowSelection=c}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof 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,u=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(!(u instanceof Oe))throw"Invalid row selection";return u.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 u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}function Tf(n,e){pa(n,e),$C(n,e),e.detail===2&&UC(n,e),n.getState().onCellClick?.(n,e)}function UC(n,e){if(Gr(e.target))return;let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function $C(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=o(),{rowsPerPage:g}=f,h=p.length,S=new Ue(c);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 C=!!o().wrapRowsHorizontally;d.multiSelectClick(y,C?{horizontalLayout:C,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:C})}else d.resetClick(y);l.cellSelection=S}function YC(n){return n.getState().multiRowSelectionWith!=="click"&&n.getComputed().renderSelectionCheckBox?"checkbox":"click"}function qC(n){return n?Gr(n)?!0:typeof n.closest!="function"?!1:!!n.closest(`.${Jo}, [data-name="expand-collapse-icon"]`):!1}function pa(n,e,t=e.key?"keyboard":"click"){let{rowIndex:o,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:u,cloneTreeSelection:c}=n,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&qC(e.target))return!1;let h=m[o];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=YC(n);if(t==="click"&&S==="checkbox")return!1;let y=t==="checkbox"||t==="keyboard"&&S==="checkbox",C=()=>{e.shiftKey?d.multiSelectClick(o):y||e.metaKey||e.ctrlKey?d.singleAddClick(o):d.resetClick(o)};if(g){let{treeSelectionState:I}=p;if(!(I instanceof Je))return!1;let b=c(I);d.treeSelectionState=b,C(),d.treeSelectionState=void 0;let R=!e.shiftKey&&(y||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=R?{nodePath:h.nodePath,selected:!!b.isNodeSelected(h.nodePath)}:null),a.treeSelection=b,!0}let{rowSelection:T}=p;return!T||typeof T!="object"?!1:(T=u(T),d.rowSelectionState=T,C(),a.rowSelection=T,!0)}else if(f==="single-row"){if(h.isGroupRow)return!1;let S=e.metaKey||e.ctrlKey||t!=="click";if(g){let{treeApi:C}=l;return S?C.toggleNodeSelection(h.nodePath):C.selectNode(h.nodePath),!0}let y=h.id;return S?s.rowSelectionApi.toggleRowSelection(y):s.rowSelectionApi.selectRow(y),!0}return!1}function Cf(n,e){let{getComputed:t,dataSourceActions:o,dataSourceApi:r}=n,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=n.getDataSourceState;return pa({rowIndex:e,api:n,getComputed:t,getState:n.getState,getDataSourceState:l,dataSourceActions:o,dataSourceApi:r,cloneRowSelection:s=>nr(s,l),cloneTreeSelection:s=>tr(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}var Br=H(require("react")),vf=require("react");var If="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Rf=he({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 wf="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",f1=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var fa=`${ut}-expand-collapse`;function po(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=(0,vf.useState)(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),Fn("expanded",n)||i(!r)};Br.useEffect(()=>{Fn("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return Br.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:$(n.className,If,Go.expandCollapse,Rf({direction:t||"start",expanded:r,disabled:o}),`${ut}`,`${fa}`,`${fa}--${l}`,`${fa}--${t==="end"?"end":"start"}`,o?`${fa}--disabled`:"")},Br.createElement("path",{d:wf}))}function Pf(n){return typeof n.field=="string"}function Df(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?o.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=o.get(e.field))}return r}function tn(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=o(),h=r===f&&m==="row",S=!g||typeof g=="function"&&!g(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:C}}=or({column:p,rowInfo:u,rowDetailState:S,columnsMap:e().computedColumnsMap,context:n}),T=St(p.id,n);return c?{api:a,dataSourceApi:l,column:p,columnApi:T,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:T,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:T,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:T,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}}function xf(n){return Ef(n.column,n.rowInfo)}function Mf(n){let{column:e,context:t,rowInfo:o,visibleColumnIds:r}=n,i=Df({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=or(n),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:c,stylingParam:d,formattedValueContext:u,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:XC({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnIds:n.visibleColumnIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function XC(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=n,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=o,S=p(),{selectionMode:y,cellSelection:C}=S,T=Df({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),I=d.toggleGroupRow,b=C?.isCellSelected(o.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:b,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...u,editError:g&&g.primaryKey===o.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:T,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:h,toggleGroupRow:I,toggleCurrentGroupRow:()=>{o.isGroupRow&&I(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:S.groupBy,pivotBy:S.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),R}function ZC(n,e){if(!n.isGroupRow)return;let t=n.groupData;if(!t.length)return;let o=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==o)return;return o}function Ef(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:Pf(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),a===void 0&&e.isGroupRow&&n.groupByForColumn&&Pf(n)&&(a=ZC(e,n.field)),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function QC(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}}function or(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=Ef(e,t),a=QC(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Af=he({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),_f="_7pupv00",Of=he({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Ff}=ze,mn=`${Ff}Cell`,Wr=`${Ff}Cell_content`;var{rootClassName:JC}=ze,nn=`${JC}ColumnCell`;var eI=Y(q.columnZIndexAtIndex),tI=Y(q.columnVisibilityAtIndex);function Nf({rowInfo:n,column:e}){let t=0;if(n.dataSourceHasGrouping)if(n.isGroupRow){let o=e?.groupByForColumn,r=n.groupBy[n.groupBy.length-1],i=!!n.pivotValuesMap,a=i&&!!e?.field&&!!o&&!Array.isArray(o)&&(o.field??o.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(o)&&n.groupNesting===n.rootGroupBy.length;t=a||l?n.groupNesting:n.groupNesting-1}else t=n.groupNesting;return{[Y(fe.components.Row.groupNesting)]:t}}function Lf({rowInfo:n}){return{[Y(fe.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}function Bs(n,e){return n?typeof n=="function"?n(e):n:void 0}function Ws(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function kf(n){let{column:e,rowInfo:t,rowIndex:o,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:u,formattedValueContext:c,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:h,rowActive:S,rowDisabled:y,rowSelected:C,cellSelected:T,cellSelection:I,getData:b,computedVisibleColumns:R,visibleColumnIds:w,computedColumnOrder:v,columnReorderInPageIndex:P}=n,x=w??R.map(me=>me.id),M=v,D,E={...c,visibleColumnIds:x,allColumnIds:M,rowIndex:o,get rowHasSelectedCells(){return D===void 0&&(D=t.hasSelectedCells(x)),D}},z=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),V=typeof f=="function"?f(E):f,N;d?.className&&(N=Bs(d.className,u)),g&&(N=$(N,Bs(g,u))),e.className&&(N=$(N,Bs(e.className,u))),z&&(N=$(N,Of({align:l})));let L;t.dataSourceHasGrouping&&e.groupByForColumn&&(L=Nf({rowInfo:t,column:e})),z&&(L=Lf({rowInfo:t})),p&&(L=typeof p=="function"?{...L,...p(E)}:{...L,...p}),m&&(L=Ws(L,m,u)),d?.style&&(L=Ws(L,d.style,u)),e.style&&(L=Ws(L,e.style,u)),L=L||{},L.height=r,L.zIndex=`var(${eI}-${e.computedVisibleIndex})`,L.visibility=`var(${tI}-${e.computedVisibleIndex}, visible)`;let F=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:o)%2===1,B=h?F?"odd":"even":!1,X=!1,_=!1,k=!1,K=!1;if(I&&T){let me=b(),ve=me[t.indexInAll-1],Pe=me[t.indexInAll+1],ce=R[e.computedVisibleIndex+1],oe=R[e.computedVisibleIndex-1];X=ve?!I.isCellSelected(ve.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?_=!0:_=oe?!I.isCellSelected(t.id,oe.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?k=!0:k=ce?!I.isCellSelected(t.id,ce.id):!0,K=Pe?!I.isCellSelected(Pe.id,e.id):!0}let Q=I&&T?{top:X,left:_,right:k,bottom:K}:null,Ie=P!=null?a!==P:!1,se=$(Q?sf(Q):"",Ui(e,[nn,mn],lf,{dragging:!1,insideDisabledDraggingPage:Ie,zebra:B,align:l,verticalAlign:s,rowDisabled:y,rowActive:S,cellSelected:T,rowSelected:C,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}),N,V);return{style:L,className:se,cellSelectionBorders:Q,zebra:B,columnIsTree:z}}var gn=H(require("react"));var nI=Y(q.columnWidthAtIndex),oI=Y(q.columnReorderEffectDurationAtIndex);function rI(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=n,S=typeof m=="function"?m():m,y={width:`var(${nI}-${i.computedVisibleIndex})`,transition:`transform var(${oI}-${i.computedVisibleIndex}, 0s)`,...h.style},C={...h,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:$(h.className,mn,af),children:gn.createElement(gn.Fragment,null,d,gn.createElement("div",{className:$(Wr,e?Gt:sd.hidden,s),style:r},S),c)};u!=null&&(C["data-row-id"]=`${u}`);let T=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?gn.createElement(T,{...C,ref:a}):gn.createElement("div",{...C,ref:a})}var ma=gn.memo(rI);var mo=H(require("react")),fo=require("react");function zf(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=ga(),i=(0,fo.useRef)(null),a=(0,fo.useRef)(!1),l=mo.useCallback(c=>{i.current=c,c&&c.focus()},[]),s=(0,fo.useCallback)(c=>{let{key:d}=c;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):c.stopPropagation()},[]),u=(0,fo.useCallback)(()=>{a.current||t()},[]);return mo.createElement(mo.Fragment,null,mo.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:u,className:$(td,ld.none),type:"text",defaultValue:n,onChange:(0,fo.useCallback)(c=>{e(c.target.value)},[])}))}function Vf(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var jr=Ce.createContext(null),iI=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Ce.createElement(po,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},aI={display:"inline-block",visibility:"visible"},js=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Ce.createElement(po,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:aI,expanded:o,onChange:t})},lI=n=>{let{rowInfo:e,rowIndex:t,column:o,api:r}=n;e.isGroupRow&&o.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||zn;return Ce.createElement(l,{domProps:{className:Jo},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{Cf(r,t)},checked:e.rowSelected})};function sI(n){let{repaintCellsKey:e,column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=n,[,a]=(0,ke.useReducer)(s=>s+1,0),l=of(e)?e:void 0;(0,ke.useEffect)(()=>{if(l)return rf(l,{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i},a)},[l,t,o,r,i])}function uI(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:u,cellStyle:c,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:h,onMouseEnter:S,onRowMouseEnter:y,onRowMouseLeave:C,rowIndex:T,rowHeight:I,columnsMap:b,fieldsToColumn:R,domRef:w,hidden:v,showZebraRows:P,getDataSourceState:x,dataSourceApi:M,dataSourceActions:D,getState:E,imperativeApi:z,componentActions:V,getComputed:N,getDataSourceMasterContext:L}=n,F=(0,ke.useSyncExternalStore)((0,ke.useCallback)(ae=>t.subscribeToRowIndex(T,ae),[t,T]),(0,ke.useCallback)(()=>t.getRowInfoAtIndex(T),[t,T]));sI({repaintCellsKey:p,column:g,rowIndex:T,rowInfoStore:t,getDataSourceState:x});let B=!F,X=!g,_=Ce.useRef(null),k=(0,ke.useCallback)(ae=>{_.current=ae,w&&w(ae)},[w]),K=F??{id:"",indexInAll:T,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:Q}=K,Ie=N(),{activeRowIndex:se,keyboardNavigation:me,columnReorderInPageIndex:ve}=E(),Pe=T===se&&me==="row",ce={getState:E,getDataSourceState:x,getDataSourceMasterContext:L,actions:V,dataSourceActions:D,api:z,dataSourceApi:M},oe=K.rowDisabled,ue=Mf({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:K,rowDetailState:f,columnsMap:b,visibleColumnIds:s,fieldsToColumn:R,context:ce}),{stylingParam:pe,renderParams:Z,formattedValueContext:J,renderFunctions:W,groupByColumnReference:ie,inEdit:ne}=ue,{align:le,verticalAlign:O}=Z,A=Z,de=Ce.useRef(A),ye=y&&S?ae=>{let Ze={...J,rowIndex:T};y(Ze,ae),S(ae)}:S,we=C&&h?ae=>{let Ee={...J,rowIndex:T,rowInfo:K};C(Ee,ae),h(ae)}:h,be=(0,ke.useCallback)(ae=>{let Ee=g.computedVisibleIndex;E().cellClick({rowIndex:T,colIndex:Ee,event:ae})},[T,g.computedVisibleIndex,me]),Me=(0,ke.useCallback)(ae=>{let Ee=g.computedVisibleIndex;if(E().cellMouseDown({rowIndex:T,colIndex:Ee,event:ae}),me==="row"){oe||(V.activeRowIndex=T);return}me==="cell"&&(V.activeCellIndex=[T,Ee])},[T,oe,g.computedVisibleIndex,me]),{selectionMode:qe,cellSelection:We,isNodeReadOnly:rt}=e,it=A.cellSelected;A.domRef=k,A.htmlElementRef=_,A.toggleCurrentTreeNode=(0,ke.useCallback)(A.toggleCurrentTreeNode,[K]),A.selectCell=(0,ke.useCallback)(A.selectCell,[K]),A.deselectCell=(0,ke.useCallback)(A.deselectCell,[K]),A.selectCurrentRow=(0,ke.useCallback)(A.selectCurrentRow,[K]),A.deselectCurrentRow=(0,ke.useCallback)(A.deselectCurrentRow,[K]),A.toggleCurrentGroupRow=(0,ke.useCallback)(A.toggleCurrentGroupRow,[K]),A.toggleCurrentRowSelection=(0,ke.useCallback)(A.toggleCurrentRowSelection,[K]),A.toggleCurrentGroupRowSelection=(0,ke.useCallback)(A.toggleCurrentGroupRowSelection,[K]),A.toggleCurrentTreeNodeSelection=(0,ke.useCallback)(A.toggleCurrentTreeNodeSelection,[K]);let et=g.components?.Editor??zf,Xe=ne?Ce.createElement(Hf,{contextValue:A},Ce.createElement(et,null)):null,G=(0,ke.useCallback)(ht(()=>{if(v||ne)return null;if(de.current=A,W.renderGroupIcon&&(A.renderBag.groupIcon=Ce.createElement(vt,{render:W.renderGroupIcon,renderParam:{...A,renderBag:{...A.renderBag}}})),W.renderSelectionCheckBox&&qe=="multi-row"&&(A.renderBag.selectionCheckBox=Ce.createElement(vt,{render:lI,renderParam:A}),W.renderSelectionCheckBox!==!0&&(A.renderBag.selectionCheckBox=Ce.createElement(vt,{render:W.renderSelectionCheckBox,renderParam:{...A,renderBag:{...A.renderBag}}}))),K.isTreeNode){let{isParentNode:Ze}=K,Ct;Ct=(Ze?W.renderTreeIconForParentNode:W.renderTreeIconForLeafNode)||typeof W.renderTreeIcon=="function"?W.renderTreeIcon:Ze&&W.renderTreeIcon===!0?js:void 0,Ct===!0?Ct=js:Ct&&(A.renderBag.treeIcon=Ce.createElement(vt,{render:js,renderParam:A})),Ct&&(A.renderBag.treeIcon=Ce.createElement(vt,{render:Ct,renderParam:{...A,renderBag:{...A.renderBag}}}))}W.renderRowDetailIcon&&(A.renderBag.rowDetailsIcon=Ce.createElement(vt,{render:iI,renderParam:{...A,renderBag:{...A.renderBag}}}),typeof W.renderRowDetailIcon=="function"&&(A.renderBag.rowDetailsIcon=Ce.createElement(vt,{render:W.renderRowDetailIcon,renderParam:{...A,renderBag:{...A.renderBag}}}))),W.renderValue&&(A.renderBag.value=Ce.createElement(vt,{render:W.renderValue,renderParam:{...A,renderBag:{...A.renderBag}}})),K.isGroupRow&&W.renderGroupValue&&(A.renderBag.value=Ce.createElement(vt,{render:W.renderGroupValue,renderParam:{...A,renderBag:{...A.renderBag}}})),!K.isGroupRow&&W.renderLeafValue&&(A.renderBag.value=Ce.createElement(vt,{render:W.renderLeafValue,renderParam:{...A,renderBag:{...A.renderBag}}})),de.current=A;let ae=A.renderBag.value;ae instanceof Date&&(ae=ae.toLocaleDateString());let Ee=Ce.createElement(Ce.Fragment,null,le!=="end"?A.renderBag.treeIcon:null,le!=="end"?A.renderBag.groupIcon:null,le!=="end"?A.renderBag.rowDetailsIcon:null,le!=="end"?A.renderBag.selectionCheckBox:null,ae,le==="end"?A.renderBag.selectionCheckBox:null,le==="end"?A.renderBag.rowDetailsIcon:null,le==="end"?A.renderBag.groupIcon:null,le==="end"?A.renderBag.treeIcon:null);return g.render?Ce.createElement(vt,{render:g.render,renderParam:{...A,renderBag:{...A.renderBag,all:Ee}}}):Ee}),[g,v,ne,f,g.renderTreeIcon||g.renderTreeIconForParentNode?rt:!1,...Vf(A,{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:ee,className:ge}=kf({column:g,rowInfo:K,rowIndex:T,rowHeight:I,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:le,verticalAlign:O,stylingParam:pe,formattedValueContext:J,groupByColumnReference:ie,rowStyle:o,rowClassName:r,cellStyle:c,cellClassName:d,showZebraRows:P,rowActive:Pe,rowDisabled:oe,rowSelected:Q,cellSelected:it,cellSelection:We,getData:l,visibleColumnIds:s,computedVisibleColumns:Ie.computedVisibleColumns,computedColumnOrder:u,columnReorderInPageIndex:ve}),Te=(0,ke.useMemo)(()=>ee,[ee?JSON.stringify(ee):null]),ct=Xe,re=G(),j={domRef:k,cellType:"body",column:g,width:m,rowId:K.id,horizontalLayoutPageIndex:a,style:Te,onMouseLeave:we,onMouseEnter:ye,onClick:be,afterChildren:ct,onMouseDown:Me,cssEllipsis:g.cssEllipsis??!0,className:ge,renderChildren:(0,ke.useCallback)(()=>re,[G])},lt=jr.Provider;return X||B?Ce.createElement("div",{ref:k,style:{display:"none"}}):Ce.createElement(lt,{value:de.current},Ce.createElement(ma,{...j}))}var Gf=Ce.memo(uI);function Ur(){return(0,ke.useContext)(jr)}function ga(){let{api:n,editingValueRef:e,editingCell:t}=te(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:o,rowInfo:r}=Ur(),[i]=Ce.useState(()=>t?.value),[a,l]=Ce.useState(i),s=t?!t.active&&!!t.waiting:!1,u=Ce.useCallback(f=>{e.current=f,l(f)},[]);Ce.useLayoutEffect(()=>{e.current=i},[]);let c=n.confirmEdit,d=n.cancelEdit,p=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function $r(n){return n.render(n.renderParam)??null}function vt(n){let e=jr.Provider;return rr.createElement(e,{value:n.renderParam},rr.createElement($r,{render:n.render,renderParam:n.renderParam}))}function Hf(n){let e=jr.Provider;return rr.createElement(e,{value:n.contextValue},n.children)}function Kn(n){let e=ha.Provider;return rr.createElement(e,{value:n.renderParam},rr.createElement($r,{render:n.render,renderParam:n.renderParam}))}var Bn=H(require("react"));var Kf="yhvuzb1",Bf="yhvuzb0";var Us=Li({"data-name":""}),$s={[Us["data-name"]]:"menu-icon"},Wf=`[${Us["data-name"]}="${$s["data-name"]}"]`;var cI={width:"100%",pointerEvents:"none"},Ys=$(`${ut}-menu`,Kf);function Yr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...cI,borderTop:`${fe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return Bn.createElement("div",{...o,style:e,...$s,onPointerDown:s=>s.stopPropagation(),className:$(t,Hd({menuVisible:i,reserveSpaceWhenHidden:r}),ut,`${ut}-menu`,a==null?Bf:"")},a??Bn.createElement(Bn.Fragment,null,Bn.createElement("div",{className:Ys,style:l}),Bn.createElement("div",{className:Ys,style:l}),Bn.createElement("div",{className:Ys,style:l})))}var ir=H(require("react")),qr=require("react");var jf="_1b8djff1 _16lm1iw1",Uf={asc:"_1b8djff2",desc:"_1b8djff3",none:"_1b8djff4"},ya="_1b8djff5",$f="--_1b8djff0";var Yf={transition:"width 0.25s, opacity 0.25s"},GO=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Sa(n){let[e,t]=(0,qr.useState)(!0),[o,r]=(0,qr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=n,c=u!=null&&u>0,d=n.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Yf,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};(0,qr.useEffect)(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==o){let C=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(C)}}return()=>{}},[i,e]);let g=()=>{let C=!(o===0&&i===0);C!==e&&t(C)};if(!e&&!n.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,[$f]:`${a}px`},className:$(s,ut,jf,Uf[h],`${ut}-sort`,`${ut}-sort--${h}`)},c?ir.createElement("div",{"data-name":"index",style:S,className:Wd},u):null,ir.createElement("div",{className:ya,style:{width:f[0],...m},onTransitionEnd:g}),ir.createElement("div",{className:ya,style:{width:f[1],...m}}),ir.createElement("div",{className:ya,style:{width:f[2],...m}}))}var Jf=H(require("react")),Xs=require("react");function qs(n){return Math.max(n.width-Xt(),0)}function qf(n){let{context:e,column:t,diff:o,shareSpaceOnResize:r}=n,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,u=e.getComputed().computedVisibleColumns,c=!1,d=u.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},c=!0),f),{}),p=c?{...a,...d}:a;return ys({shareSpaceOnResize:r,availableSize:qs(s),reservedWidth:l||0,dragHandleOffset:o,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:u.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var Xr=require("react"),Zr=H(require("react"));function Xf(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){Re.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;Re.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?Ps(l,i,o.current):Re.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){Ps(u,i,o.current);continue}u.computedPinned!=="end"&&Re.columnOffsets.set(l,u.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Re.columnOffsets.set(l,u.computedOffset+i,o.current)}}}}}function Zf(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,u=i.current;if(o.forEach((c,d)=>{s+=c;let p=n[d],f=r[p],m=f.computedWidth+c;Re.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Re.columnOffsets.set(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&Re.columnOffsets.set(c,d.computedOffset+s,u)}}}}var ba="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Ta=he({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=he({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:dI}=ze,pI=`${dI}HeaderCell_ResizeHandle`;function fI(n){let{brain:e,headerBrain:t}=te(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=(0,Xr.useRef)(null),[r,i]=(0,Xr.useState)(!1),a=(0,Xr.useRef)(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,S=g.pointerId,y=g.clientX,C=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()}}C.setPointerCapture(S);let T=Xf(n.columnIndex,{columns:n.columns,shareSpaceOnResize:h,domRef:o}),I=(w,{done:v}={})=>{s&&(w=w/(s+1),v&&(w=Math.round(w))),u==="end"&&(w*=-1);let{adjustedDiff:P,constrained:x}=n.computeResize({diff:w,shareSpaceOnResize:h});return a.current!==x&&i(x),T.resize(P),P},b=w=>{I(Math.round(w.clientX-y))},R=w=>{C.releasePointerCapture(S),C.removeEventListener("pointermove",b),C.removeEventListener("pointerup",R);let v=Math.round(w.clientX-y),P=I(v,{done:!0});p(),T.resize(0),n.onResize({diff:P,shareSpaceOnResize:h})};C.addEventListener("pointermove",b),C.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return Zr.createElement("div",{ref:o,className:`${pI} ${ba} ${Ca({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},Zr.createElement("div",{style:m,className:Ta({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var Qf=Zr.memo(fI);function em(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=te(u=>({computedVisibleColumns:u.computed.computedVisibleColumns,getState:u.getState,getComputed:u.getComputed,actions:u.actions})),a=(0,Xs.useCallback)(({diff:u,shareSpaceOnResize:c})=>qf({context:{getState:o,getComputed:r},column:n,diff:u,shareSpaceOnResize:c}),[n,o,r]),l=(0,Xs.useCallback)(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return n.computedResizable?Jf.createElement(Qf,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}function mI(n,e){if(!n||!e)return null;let t=e.field||e.groupByForColumn,o=null,r=null;for(let i of n)(i.id===e.id||i.field===e.id)&&(o=i),t&&(i.id===t||i.field===t)&&(r=i);return o||r}function gI(n,e){return!n||!e?n===e:n.filter.type===e.filter.type&&n.filter.operator===e.filter.operator&&n.filter.value===e.filter.value&&!!n.disabled==!!e.disabled}var Ia=class{constructor(){this.pending=new Map;this.applied=new Map;this.cancelListeners=new Map}schedule(e,t,o){let r=o.getFilterValueItem();this.isLastApplied(e,r)&&this.applied.delete(e);let i=this.pending.get(e);i&&clearTimeout(i.timeout);let a=setTimeout(()=>{this.pending.delete(e);let l=o.getFilterValueItem();if(!gI(l,r)&&!this.isLastApplied(e,l)){this.applied.delete(e),this.notifyCancel(e);return}o.apply(t);let s=o.getFilterValueItem();s&&s.filter.value===t?this.applied.delete(e):this.applied.set(e,t)},o.delay);this.pending.set(e,{timeout:a,typedOver:r})}cancel(e){let t=this.pending.get(e);t&&(clearTimeout(t.timeout),this.pending.delete(e),this.notifyCancel(e))}onCancel(e,t){let o=this.cancelListeners.get(e);return o||(o=new Set,this.cancelListeners.set(e,o)),o.add(t),()=>{o.delete(t),!o.size&&this.cancelListeners.get(e)===o&&this.cancelListeners.delete(e)}}isLastApplied(e,t){return!!t&&this.applied.has(e)&&t.filter.value===this.applied.get(e)}notifyCancel(e){this.cancelListeners.get(e)?.forEach(t=>t())}};function tm(n){let{columnId:e,filterDelay:t,api:o}=n,r=a=>{o.setColumnFilter(e,a)};if(!(t>0))return r;let i=()=>mI(n.getDataSourceState().filterValue,n.getComputed().computedColumnsMap.get(e));return a=>{n.getState().pendingColumnFilters.schedule(e,a,{delay:t,getFilterValueItem:i,apply:r})}}var $e=H(require("react")),Kt=require("react");var nm=he({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),om=he({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function rm(n,e){return Rt(n,e)}var ar=class extends lo{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 rm(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return rm(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let o=!0;return typeof this.data.shouldAcceptDrop=="function"&&(o=this.data.shouldAcceptDrop(t)),o=!!o,o!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=o,o?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),o}adjustForScroll(t){this.breakpoints=this.breakpoints.map(o=>o-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 o=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>o||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=o?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:o,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:u}=t,c=Array.from({length:i.length},(f,m)=>m),d=[];o===-1?d=c.filter(f=>f!==r):d=ao(c,r,o>r?o-1:o);let p={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:u,status:t.status};this.emit("drop",p)}};var hI={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function yI(n,e){let t=getComputedStyle(n),o=e==="vertical"?t.overflowY:t.overflowX;return o!=="auto"&&o!=="scroll"?!1:e==="vertical"?n.scrollHeight>n.clientHeight:n.scrollWidth>n.clientWidth}function SI(n,e){let t=n;for(;t&&!(t===document.documentElement||t===document.body);){if(yI(t,e))return t;t=t.parentElement}return null}function bI(n,e){return{startScrollingFrom:n*e.startFromPercentage,maxScrollValueAt:n*e.maxScrollAtPercentage}}var Zs=1;function im(n,e,t){if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return t.maxPixelScroll;if(n===e.startScrollingFrom)return Zs;let r=1-(n-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function TI(n,e,t){let{accelerateAt:o,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return n;if(i<o)return Zs;let a=(i-o)/(r-o);return Math.max(Zs,Math.ceil(n*t.ease(a)))}function am(n,e,t,o,r,i,a){if(n<e||n>t)return 0;let l=bI(o,r),s=n-e,u=t-n,c=u<s,d;return c?d=im(u,l,r):d=-im(s,l,r),d===0?0:a?(d>0?1:-1)*TI(Math.abs(d),i,r):d}var go=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={...hI,...e.config}}start(e){this.scrollContainer=SI(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},o=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=o,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,o=0;return this.orientation==="vertical"?t=am(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):o=am(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:o}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var Qs="data-drag-list-id",bt="data-drag-item-id",lr="data-drag-item-list-id",lm=`[${bt}]`,sm=()=>null,um=n=>{let{node:e,offset:t}=n;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},CI=n=>`${n.getAttribute(bt)}`;function Js(n,e){let t=n.current?.querySelectorAll(lm)??[];return Array.from(t).filter(r=>r.getAttribute(lr)===`${e}`)}function II(n,e){let t=Js(n,e);return Array.from(t).map(r=>{let i=CI(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function RI(n){let{domRef:e,orientation:t,dragListId:o}=n,r=II(e,o),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,u=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>u&&(u=f.right)}let c=_e.from({top:a,left:l,width:u-l,height:s-a});return{draggableItems:r,orientation:t,listId:o,listRectangle:c,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial,preserveDragSpace:n.preserveDragSpace}}function cm(n){return new ar(RI(n))}function dm(n,e){let t=document.querySelector(`[${Qs}="${e}"]`);t?n.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 pm(n,e){let t=n.current;t&&t!==e&&pt.unregisterDragInteractionTarget(t),n.current=e,e&&pt.registerDragInteractionTarget(e)}function fm(n){let{getProps:e,domRef:t,setInteractionTarget:o}=n;return pt.on("register",r=>{let{dragListId:i,acceptDropsFrom:a,orientation:l,shouldAcceptDrop:s}=e(),u=r.getData();if(u.initial&&u.listId!==i&&a?.includes(u.listId)){let c=cm({domRef:t,orientation:l,dragListId:i,initial:!1,acceptDropsFrom:a,shouldAcceptDrop:s});r.once("unregister",()=>{o(null)}),o(c)}})}function Ra(n,e){let t=n.cloneNode(!0);return t.removeAttribute(bt),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 wa({proxyElement:n,dx:e,dy:t}){n.style.transform=`translate3d(${e}px, ${t}px, 0)`}function mm(n){let e=n.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",n.current=null)}function gm(n,e,t){let o=n.current;return(!o||o.length===0)&&(o=Js(e,t),n.current=o),o}function hm(n,e){let{dragListId:t,orientation:o,domRef:r,proxyStateRef:i,sourceScrollOffsetRef:a,dragItemsRef:l,getDragItems:s,getOnDrop:u,getOnAcceptDrop:c,getOnRemove:d,getUpdatePosition:p,updateDragOperationSourceAndTarget:f,updateDragProxyRenderState:m}=e,g=n.on("start",({dragItem:b,dragSourceListId:R,dropTargetListId:w})=>{f({dragSourceListId:R,dropTargetListId:w,dragItemId:b.id,status:"accepted"})}),h=n.on("move",({offsetsForItems:b,items:R,status:w,dragItem:v})=>{if(w==="rejected")return;let P=s(),x=p(),M=i.current;R.forEach((D,E)=>{let z=b[E],V=P[E];if(V&&!(M&&D.id===M.dragItemId)){if(!M&&D.id===v.id){let N=a.current;z={left:z.left+N.left,top:z.top+N.top}}x({id:D.id,node:V,offset:z})}})}),S=n.on("drop",b=>{let{sortedIndexes:R,dragIndex:w,dropIndex:v,dragItem:P,items:x,dragSourceListId:M,dropTargetListId:D,outside:E,status:z}=b,V=s();l.current=[];let N=c(),L=d(),F=u(),B=p();x.forEach((k,K)=>{let Q=V[K];Q&&B({id:k.id,node:Q,offset:null})}),mm(i),m(k=>k&&(requestAnimationFrame(()=>m(sm)),{...k,dragItemId:null})),t===D&&M!==t&&N&&z==="accepted"&&N({dragItemId:P.id,dragSourceListId:M,dropTargetListId:D,dragIndex:w,dropIndex:v,dropItemId:x[v]?.id});let _=null;v===-1&&M===t&&D===t&&E&&(_=L),v!==-1&&D===t&&M===t&&(_=F),_&&_?.(R,{dragIndex:w,dropIndex:v,dragItemId:x[w].id,dropItemId:x[v]?.id})}),y=null,C=null,T=null,I=null;if(!n.getData().initial&&r.current){if(y=new go({orientation:o,onScroll:()=>{}}),y.start(r.current),C=y.getScrollContainer(),C){let b=o==="vertical"?C.scrollTop:C.scrollLeft;T=()=>{let R=o==="vertical"?C.scrollTop:C.scrollLeft,w=R-b;b=R,w!==0&&(n.adjustForScroll(w),pt.retriggerMove())},C.addEventListener("scroll",T)}I=b=>{y.updatePointer({left:b.clientX,top:b.clientY})},Fe().addEventListener("pointermove",I)}return()=>{g(),h(),S(),y&&y.stop(),C&&T&&C.removeEventListener("scroll",T),I&&Fe().removeEventListener("pointermove",I)}}function ym(n,e,t){let{dragListId:o,orientation:r,acceptDropsFrom:i,preserveDragSpace:a,onDragProxySetup:l}=e,{domRef:s,proxyStateRef:u,sourceScrollOffsetRef:c,dragItemsRef:d,setInteractionTarget:p,updateDragProxyRenderState:f}=t,m=e.dragStrategy??"proxy",g=m==="proxy"&&!e.renderDragProxy,h=m==="proxy"&&!!e.renderDragProxy,S=e.onDragProxyMove??wa,y=n.currentTarget,C=y.getAttribute(bt);if(C==null){let K=Ln(y,lm);K&&(C=K.getAttribute(bt))}if(C==null){console.warn("Could not find drag item id for element",y,`Make sure you have a parent element with a ${bt} attribute`);return}C=`${C}`;let T=null,I=Js(s,o);d.current=I;let b=cm({domRef:s,orientation:r,dragListId:o,acceptDropsFrom:i,initial:!0,preserveDragSpace:a}),R=b.getData().draggableItems,w=R.findIndex(K=>K.id===C);if(w===-1)return;let v=R[w],P=I[w]?.getAttribute(bt)===`${C}`?I[w]:I.find(K=>K.getAttribute(bt)===`${C}`);p(b);let x={left:n.clientX,top:n.clientY},M={left:n.clientX,top:n.clientY};c.current={top:0,left:0};let D=new go({orientation:r,onScroll:()=>{}});s.current&&D.start(s.current);let E=D.getScrollContainer(),z=E?r==="vertical"?E.scrollTop:E.scrollLeft:0;function V(){T&&T.move({left:M.left,top:M.top})}let N=()=>{if(!E)return;let K=r==="vertical"?E.scrollTop:E.scrollLeft,Q=K-z;z=K,Q!==0&&(b.adjustForScroll(Q),r==="vertical"?c.current.top+=Q:c.current.left+=Q),V()};E?.addEventListener("scroll",N);let L=K=>{if(M={left:K.clientX,top:K.clientY},!T){if(T=pt.startDrag({listId:o,dragItem:v,dragIndex:w},x),P&&g){let se=P.getBoundingClientRect(),me=null,ve={dragItemNode:P,dragItemId:`${C}`,initialRect:se,initialCoords:x,get proxyElement(){return me||(me=Ra(P,se)),me}},Pe=l?.(ve),ce=Pe?.proxyElement??ve.proxyElement;P.style.visibility="hidden",u.current={proxyElement:ce,originalNode:P,dragItemId:`${C}`,initialRect:se,cleanup:Pe?.cleanup}}if(P&&h){let se=P.getBoundingClientRect();P.style.visibility="hidden",u.current={proxyElement:P,originalNode:P,dragItemId:`${C}`,initialRect:se,cleanup:()=>{}};let me={dragItemId:`${C}`,initialRect:se,dx:0,dy:0};f(()=>me)}}let Q=K.clientX-x.left,Ie=K.clientY-x.top;if(h)f(se=>se&&{...se,dx:Q,dy:Ie});else{let se=u.current;se&&S({proxyElement:se.proxyElement,dx:Q,dy:Ie})}D.updatePointer({left:K.clientX,top:K.clientY}),V()},F=K=>{K.preventDefault()},B=K=>{if(D.stop(),E?.removeEventListener("scroll",N),k.removeEventListener("pointermove",L),k.removeEventListener("pointerup",X),k.removeEventListener("pointercancel",_),k.removeEventListener("dragstart",F,!0),h&&(f(Q=>Q&&{...Q,dragItemId:null}),requestAnimationFrame(()=>{f(sm)})),!T){mm(u),p(null);return}K?T.cancel():T.drop(),T=null},X=()=>B(!1),_=()=>B(!0),k=Fe();k.addEventListener("pointermove",L),k.addEventListener("pointerup",X),k.addEventListener("pointercancel",_),k.addEventListener("dragstart",F,!0)}var Sm=$e.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),ho=()=>$e.useContext(Sm);function wI(n,e){let t=Le(e),[o,r]=$e.useState(null),i=$e.useRef(null),a=(0,Kt.useCallback)(s=>{pm(i,s),r(s)},[]),l=Le(o);return(0,Kt.useEffect)(()=>()=>{pt.unregisterDragInteractionTarget(i.current),i.current=null},[]),(0,Kt.useEffect)(()=>fm({getProps:t,domRef:n,setInteractionTarget:a}),[t]),{interactionTarget:o,setInteractionTarget:a,getInteractionTarget:l}}var Wn=n=>{let e=$e.useRef(null),t=$e.useRef(null),[o,r]=(0,Kt.useState)(null),i=$e.useRef({top:0,left:0}),a=$e.useRef(null),l=$e.useCallback(P=>{a.current=P},[]),{dropTargetListId:s,dragSourceListId:u}=fn(),{updateDragOperationSourceAndTarget:c,dragItemId:d,status:p}=fn(),f=Le(n.onDrop),m=Le(n.onAcceptDrop),g=Le(n.onRemove),h=Le(n.updatePosition??um),{interactionTarget:S,setInteractionTarget:y}=wI(e,n);(0,Kt.useEffect)(()=>{dm(e,n.dragListId)},[n.dragListId]),(0,Kt.useEffect)(()=>{if(S)return hm(S,{dragListId:n.dragListId,orientation:n.orientation,domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,getDragItems:T,getOnDrop:f,getOnAcceptDrop:m,getOnRemove:g,getUpdatePosition:h,updateDragOperationSourceAndTarget:c,updateDragProxyRenderState:r})},[S,n.dragListId]);let C=$e.useRef([]),T=(0,Kt.useCallback)(()=>gm(C,e,n.dragListId),[n.dragListId]),I=(0,Kt.useCallback)(P=>{ym(P,n,{domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,setInteractionTarget:y,updateDragProxyRenderState:r})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside,n.dragStrategy,n.renderDragProxy,n.onDragProxySetup,n.onDragProxyMove]),b=!!d,R=$e.useMemo(()=>({dragItemId:d,onDragItemPointerDown:I,dragSourceListId:u,dropTargetListId:s,status:p,dragListId:n.dragListId,draggingInProgress:b}),[d,I,b,u,s,n.dragListId]),w={className:$("DragList",b?"DragList--dragging":"",nm({dragging:b})),[Qs]:n.dragListId},v=typeof n.children=="function"?n.children(w,R):n.children;return $e.createElement(Sm.Provider,{value:R},v,o&&n.renderDragProxy?n.renderDragProxy({...o,ref:l}):null)},vI=$e.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),PI=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=ho(),l=n.dragListId??o,s=i===l&&r===`${n.id}`,u=$e.useMemo(()=>({dragItemId:n.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,s,l,t,i,a]),c={[bt]:`${n.id}`,[lr]:l,onPointerDown:e,className:$("DraggableItem",s?"DraggableItem--active":"",om({active:s,draggingInProgress:t}))},d=typeof n.children=="function"?n.children(c,u):n.children;return $e.createElement(vI.Provider,{value:u},d)};Wn.DraggableItem=PI;var eu=H(require("react"));var bm=n=>eu.createElement(Ve,{...n,icon:"hidden",viewBox:"0 -960 960 960"},eu.createElement("path",{d:Ge.hidden[0]}));var ii=H(require("react"));function Tm(){return{}}var Cm=n=>({allowColumnHideWhileDragging:e=>e??!0});var Im=require("react"),DI=(0,Im.createContext)(null);function tu(){return DI}var Bt=H(require("react"));var Io=H(require("react")),Pt=require("react");var va=H(require("react"));function xI(n){let{height:e,width:t,count:o}=n;return va.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var Rm=va.memo(xI);var wm="mlx2t3";var Pa=H(require("react")),_m=require("react");var vm=require("react"),Pm=(n,e)=>{(0,vm.useEffect)(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var Dm={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},xm={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Mm={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},nu="_1ueijco1",Em="_1ueijco0 _16lm1iw0";var Am=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=Dm[`${n}`]:e=$(xm[`${n.horizontal}`],Mm[`${n.vertical}`]),e};var MI="InfiniteVirtualScrollContainer";var Om=Pa.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??(0,_m.useRef)(null);return Pm(c,i),Pa.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:$(a,MI,Em,Am(r))},o)});var ka=H(require("react")),bo=require("react");var Fm=H(require("react")),sr=require("react");function EI(n){let[e,t]=(0,sr.useState)(n.updater.get),o=(0,sr.useRef)(null);return(0,sr.useLayoutEffect)(()=>{function r(a){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=n.updater.onChange(r);return()=>{o.current!=null&&cancelAnimationFrame(o.current),i()}},[n.updater,n.useraf]),e??null}var jn=Fm.memo(EI);var Nm=H(io());var ou=(n,e)=>n-e,hn={horizontal:!0,vertical:!0};function Da(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var ru="DebugID=";function Un(n,e){return e&&e.startsWith(ru)?e:e?`${ru}${n}:${e}`:`${ru}${n}`}var xa={start:0,end:0},iu=n=>{n()},au=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},Lm=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},Qr=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function AI(n){return n.horizontalChange||n.verticalChange}var yo=class extends It{constructor(t){let o=Un(t,`${t}:MatrixBrain`);super(o);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=xa;this.verticalExtendRangeBy=xa;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 o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{Qr(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?iu:Qr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?iu:Qr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:o}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=hn)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=hn)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=o.startIndex,u=o.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=hn)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",u=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,c=this.getItemAt(l,t),d=u.start||0,p=u.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(c=Math.max(0,c-d),r+=d),p&&(r+=p);let f=c+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,c=Math.max(a,f-r)),{startIndex:c,endIndex:f}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,o),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,Nm.default)(a,t,ou);return p>=0?p:~p-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:o};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,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=au;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=hn){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,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:u}=t,c=typeof s=="number",d=typeof u=="number",p=c&&s!==this.availableWidth,f=d&&u!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=u,this.availableRenderHeight=u),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",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,C=l!=null,T=y&&a!==this.rowHeight,I=C&&l!==this.colWidth;y&&(this.rowHeight=a),C&&(this.colWidth=l);let b=t.rowspan!=null,R=t.colspan!=null,w=b&&t.rowspan!=this.rowspan,v=R&&t.colspan!=this.colspan;w&&(this.rowspan=t.rowspan),v&&(this.colspan=t.colspan);let P=S||I||p||v,x=h||T||f||w;(o||AI)({horizontalChange:P,verticalChange:x,colsChanged:S,colWidthChanged:I,widthChanged:p,colspanChanged:v,rowsChanged:h,rowHeightChanged:T,heightChanged:f,rowspanChanged:w})&&this.updateRenderCount({horizontal:P,vertical:x})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=hn){this.reset(t),this.doUpdateRenderCount(t),this.updateLargeContent()}supportsLargeContent(t){return t==="vertical"}alignScrollOrigin(t,o){return Math.floor(o)}updateLargeContent(){let t=this.getVirtualizedContentSize(),o=this.supportsLargeContent("vertical")&&Qi(t.height),r=this.supportsLargeContent("horizontal")&&Qi(t.width);this.largeContent={vertical:o,horizontal:r},this.scrollRatio={vertical:o?_s(t.height,this.availableHeight):1,horizontal:r?_s(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:o}=this;if(!o.vertical&&!o.horizontal)return t;let r=Zi();return{width:o.horizontal?r:t.width,height:o.vertical?r:t.height}}toContentScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop*o,scrollLeft:t.scrollLeft*r}}toNativeScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop/o,scrollLeft:t.scrollLeft/r}}getScrollOrigin(){return this.scrollOrigin}getDOMScrollPosition(t=this.getScrollPosition()){let o=this.getScrollOrigin();return!o.scrollTop&&!o.scrollLeft?t:{scrollTop:t.scrollTop-o.scrollTop,scrollLeft:t.scrollLeft-o.scrollLeft}}onScrollOriginChangeForBrain(t){return this.onScrollOriginChangeFns.add(t),()=>{this.onScrollOriginChangeFns.delete(t)}}updateScrollOrigin(){let{scrollPosition:t,largeContent:o,scrollOrigin:r}=this,i=u=>this.alignScrollOrigin("vertical",u),a=u=>this.alignScrollOrigin("horizontal",u),l=o.vertical?Os(t.scrollTop,i(r.scrollTop),i):0,s=o.horizontal?Os(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(o=>o(t))}doUpdateRenderCount(t=hn){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(this.updateScrollOrigin(),o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?iu:Qr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="function"){let c=[],d=0,p=r;d+=s,p-=u;for(let f=d;f<p;f++)c.push(this.getItemSize(f,t));a=Da(l,c)}else a=(o?Math.ceil(l/o):0)+1;return a+=s+u,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{Qr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=xa,this.verticalExtendRangeBy=xa,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 lu=H(io());function km(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function zm(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function Jr(n,e){for(let t of n)if(e(t))return t}var Ma=(n,e)=>n-e,Ea=class extends It{constructor(t,o){super(`${t}:GridCellManager`);this.matrix=new U;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,S=f>=s;(m||g||h||S)&&u.add(c)}),u};this.debugId=t,this.pool=o,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=Jr(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=Jr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,u)=>{let c=[a,u],d=this.getCellAt(c);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(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((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,lu.default)(o,t,Ma);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,lu.default)(o,t,Ma);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>o&&this.detachCellAt(a),l===o&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return Jr(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return Jr(t,r=>this.getCellPosition(r)?.[1]===o)}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 Vm=H(io());var Aa=class extends It{constructor(t,o){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=o,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,Vm.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Gm=!0,So=Y(q.y),Hm=Y(q.scrollTop),_I=Y(q.scrollLeft),JN=Y(q.columnOffsetAtIndex),su=Y(q.columnOffsetAtIndexWhileReordering),ur=class extends It{constructor(t,o,r){o=o||"ReactHeadlessTableRenderer";super(o);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.ownsPositionVars=!1;this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{i||(r-=this.brain.getScrollOrigin().scrollTop),t.style.setProperty(So,i?`calc( ${r}px + var(${Hm}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${So}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Re.columnOffsets.get(r),d=`${su}-${r}`,p=s?`calc( ${a}px + var(${Hm}, 0px) )`:`${a-this.brain.getScrollOrigin().scrollTop}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(So,p));let m=`translate3d(${this.ownsPositionVars?l?`calc( ${i}px + var(${_I}, 0px) )`:`${i-this.brain.getScrollOrigin().scrollLeft}px`:`var(${d}, ${c})`}, var(${So}), 0)`;if(t.__transformValue!==m&&(t.__transformValue=m,t.style.transform=m),u!=null&&this.ownsPositionVars){let g=`${u}`;t.__zIndex!==g&&(t.__zIndex=g,t.style.zIndex=g)}};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.cellsDetachedInRenderPass=null;this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let u=r.getItemOffsetFor(t,"vertical"),c=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=u>g-p?"end":u<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-g+s+p),this.brain.isHorizontalLayoutBrain){let S=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(S,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let u=r.getItemOffsetFor(t,"horizontal"),c=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=u>g-p?"end":u<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,u]}=i.getRenderRange();if(t<l||t>=u)return!1;let c=Math.floor((l+u)/2);if(t>=c){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,g=[];if(i&&(o&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,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&&(o&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,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]})),o){let h={start:[0,p],end:[o,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,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(o<a&&(d=!0,p="start"),l&&!d){let f=s-l;o>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(o)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};He(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o,r)=>{if(this.destroyed)return;let i=t.getElement(),a=this.cellManager.getCellPosition(t);if(!a)return;let[l,s]=a,u=this.brain.getCellOffset(l,s);if(u==null)return;let{x:c,y:d}=u;if(i){let p=()=>{this.updateHoverClassNamesForRow(l);let f=this.getCellRealCoordinates(l,s);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,Gm){let m=this.ownsPositionVars?this.getFixedCellPlacement(l,s,{x:c,y:d}):null;this.setTransform(i,l,s,m??{x:c,y:d},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let h=(o?o.hidden:!!this.isCellCovered(l,s))?"-1":m?`${m.zIndex}`:i.dataset.zIndex||"auto";i.__zIndex!==h&&(i.__zIndex=h,i.style.zIndex=h)}else i.style.display="",i.style.left=`${c}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 o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,Gm&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getDOMScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.flushPendingAfterCommitWork(),this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(I=>{let b=i.getRowIndex(I);if(b!=null){let R=this.brain.getItemOffsetFor(b,"vertical");if(R==null)return;let w=I.getElement();if(!w)return;this.setDetailTransform(w,b,{y:R,scrollLeft:o.getDOMScrollPosition(t).scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&Sp(o.getDOMScrollPosition(t),this.ownsPositionVars?p.getElement()?.parentElement??null:this.getInfiniteNode(p.getElement()));let f={cols:this.brain.getFixedEndColsOffsets({skipScroll:!0}),rows:this.brain.getFixedEndRowsOffsets({skipScroll:!0})},{start:m,end:g}=this.brain.getRenderRange(),[h,S]=m,[y,C]=g,T=(I,b)=>{let R=r.getCellAt([I,b])?.getElement(),w=R?o.getCellOffset(I,b):null;if(!R||!w)return;let v=this.getFixedCellPlacement(I,b,w,f);v&&this.setTransform(R,I,b,v,v.zIndex)};if(s||u)for(let I=h;I<y;I++){for(let b=0;b<s;b++)T(I,b);if(u){let b=a-u;for(let R=b;R<a;R++)T(I,R)}}if(c||d)for(let I=S;I<C;I++){for(let b=0;b<c;b++)T(b,I);if(d){let b=l-d;for(let R=b;R<l;R++)T(R,I)}}if(s&&c)for(let I=0;I<c;I++)for(let b=0;b<s;b++)T(I,b);if(s&&d){let I=l-d;for(let b=I;b<l;b++)for(let R=0;R<s;R++)T(b,R)}if(u&&c){let I=a-u;for(let b=0;b<c;b++)for(let R=I;R<a;R++)T(b,R)}if(u&&d){let I=l-d,b=a-u;for(let R=I;R<l;R++)for(let w=b;w<a;w++)T(R,w)}};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=o,this.cellManager=new Ea(o,r.cellPool),this.cellManager.onCellAttachmentChange((c,d)=>{d?this.onCellAttached(c):this.onCellDetached(c)}),this.rowManager=new Aa(o,r.rowPool),this.rowManager.onRowAttachmentChange((c,d)=>{d?this.onRowAttached(c):this.onRowDetached(c)}),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),u=t.onScrollOriginChange(this.onScrollOriginChange);this.onDestroy=()=>{u(),i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=ws(t)),this.infiniteNode}onCellAttached(t){if(!this.cellsDetachedInRenderPass?.delete(t)&&this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellsDetachedInRenderPass){this.cellsDetachedInRenderPass.add(t);return}this.addDetachedClassNames(t)}addDetachedClassNames(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,o){if(this.destroyed)return[];if(this.cellsDetachedInRenderPass)return this.renderRangeInternal(t,o);let r=this.cellsDetachedInRenderPass=new Set;try{return this.renderRangeInternal(t,o)}finally{this.cellsDetachedInRenderPass=null,r.forEach(i=>this.addDetachedClassNames(i))}}renderRangeInternal(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){let{start:l,end:s}=t,u=this.brain.isHorizontalLayoutBrain,{rowManager:c,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let P=t.start[1],x=t.end[1];m.forEach(M=>{P<=M&&M<x||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,x])=>{g.set(`${P}:${x}`,!0)});let S=f.reduce((P,x)=>P+au(x),0),y=r?f.reduce((P,x)=>P+Lm(x),0):0,C=this.brain.getRowCount(),T=this.brain.getColCount();d.detachCellsStartingAt([C,T]);let I=Math.min(C*T,S);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>y&&(c.poolSize=y));let b=km(...f.map(P=>d.getCellsOutsideRenderRange(P)));b=zm(b,P=>{let x=d.getCellPosition(P);return!(x&&g.has(`${x[0]}:${x[1]}`))}),d.detachCells(b),d.poolSize=I;let R=new Map,w=new Map;f.forEach(P=>{let{start:x,end:M}=P,[D,E]=x,[z,V]=M;for(let N=D;N<z;N++){for(let F=E;F<V;F++){let B=`${N}:${F}`;if(R.has(B))continue;R.set(B,!0);let{rendered:X,mapped:_}=this.isCellRenderedAndMappedCorrectly(N,F);if(N===D||F===E){let K=this.isCellCovered(N,F);if(K&&g.has(`${K[0]}:${K[1]}`)){let Q=d.getCellAt([N,F]);Q!=null&&d.detachCell(Q);continue}}if(X&&!i&&_)continue;let k;X?k=d.getCellAt([N,F]):k=d.getCellFor([N,F],u?"row":"column"),k==null&&(k=d.getDetachedCell()),this.renderCellAt(N,F,k,o)}!r||w.has(N)||(w.set(N,!0),c.isRowAttachedAt(N)&&!i)||this.renderDetailRowAtElement(N,this.rowManager.getRowFor(N),r)}}),h.forEach(([P,x])=>{let{rendered:M,mapped:D}=this.isCellRenderedAndMappedCorrectly(P,x);if(M){if(i||!D){let z=[P,x],V=d.getCellAt(z);this.renderCellAt(P,x,V,o)}return}let E=d.getCellFor([P,x],u?"row":"column");E!=null&&this.renderCellAt(P,x,E,o)});let v=d.getAllCells().map(P=>P.getNode());return r&&c.getAllRows().forEach(P=>{v.push(P.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(v),v}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(u,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}getMatrixRowIndexFromElement(t){let o=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(o):o}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),u=this.brain.getRowspan(t,o),c=this.brain.getColspan(t,o),d=u===1?l:this.brain.getRowHeightWithSpan(t,o,u),p=c===1?s:this.brain.getColWidthWithSpan(t,o,c),{row:f,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:h,colIndex:S}=this.getCellRealCoordinates(t,o),y=i({rowIndex:h,colIndex:S,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(I=>{let b=I.getElement();b&&(b.style.position="absolute",b.style.left="0px",b.style.top="0px"),this.updateElementPosition(I)});let C=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:S}:void 0,T=this.brain.isHorizontalLayoutBrain;if(!y){T?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,o],C),this.updateElementPosition(r,{hidden:g,rowspan:u,colspan:c})}getFixedCellPlacement(t,o,{x:r,y:i},a){let{fixedRowsStart:l,fixedRowsEnd:s,fixedColsStart:u,fixedColsEnd:c}=this.brain.getFixedCellInfo(),d=this.brain.getColCount(),p=this.brain.getRowCount(),f=o<u,m=!f&&!!c&&o>=d-c,g=t<l,h=!g&&!!s&&t>=p-s,S=f||m,y=g||h;if(!S&&!y)return null;m&&(r=(a?.cols??this.brain.getFixedEndColsOffsets({skipScroll:!0}))[o]),h&&(i=(a?.rows??this.brain.getFixedEndRowsOffsets({skipScroll:!0}))[t]);let C=S&&y?f?g?1e5:2e5:g?3e5:4e5:f?u-o:m?d-o:g?l-t:p-t;return{x:r,y:i,scrollLeft:S,scrollTop:y,zIndex:C}}reset(){this.cellManager.reset(),this.rowManager.reset()}};var _a=class extends ur{constructor(t,o,r){super(t,o,r);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage)-this.brain.getScrollOriginPageIndex(),c=fe.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Re.columnOffsets.get(l.colIndex),f=`${su}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(So,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${So})`,S=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==S&&(t.__transformValue=S,t.style.transform=S)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};var Bm=H(require("react"));var cr=class cr extends It{constructor(t){super(t);this.cellRemoveSubscription=Se();this.cellAttachmentChangeSubscription=Se();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,o=t.values().next().value;return o||(this.poolSize+=cr.POOL_SIZE_INCREMENT,o=t.values().next().value),o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/cr.POOL_SIZE_INCREMENT)*cr.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};cr.POOL_SIZE_INCREMENT=1;var Oa=cr;var Km=new Map,OI=()=>{},uu=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Se();let o=Km.get(e)??0,r=`${e}:GridCellReact:${o}`;Km.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=Se(),this.node=Bm.createElement(jn,{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(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=OI,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}},Fa=class extends Oa{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new uu(this.cellDebugId)}};var jm=H(require("react"));var dr=class dr extends It{constructor(t){super(t);this.rowRemoveSubscription=Se();this.rowAttachmentChangeSubscription=Se();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,o=t.values().next().value;return o||(this.poolSize+=dr.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/dr.POOL_SIZE_INCREMENT)*dr.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};dr.POOL_SIZE_INCREMENT=1;var Na=dr;var Wm=new Map,FI=()=>{},cu=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Se();let t=Wm.get(e)??0,o=`${e}:ListRowReact:${t}`;Wm.set(e,t+1),this.debugId=o,this.updater=Se(),this.node=jm.createElement(jn,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=FI,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},La=class extends Na{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new cu(this.rowDebugId)}};function Um(n){return{cellPool:new Fa(n),rowPool:new La(n)}}function ei(n){let e=n.isHorizontalLayoutBrain?new _a(n,`${n.name}:HorizontalLayoutTableRenderer`,Um(`${n.name}:HorizontalLayoutTableRenderer`)):new ur(n,`${n.name}:ReactHeadlessTableRenderer`,Um(`${n.name}:ReactHeadlessTableRenderer`)),t=Se();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function NI(n){let e=ei(n);return e.renderer.ownsPositionVars=!0,e}function LI(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=(0,bo.useMemo)(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:NI(e),[e,n.onRenderUpdater,n.renderer]);return(0,bo.useLayoutEffect)(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),(0,bo.useLayoutEffect)(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),(0,bo.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o}),e.onRenderRangeChange(u=>{i.renderRange(u,{force:!1,onRender:c=>{let d=a.get();d&&c&&d.length===c.length||a(c)},renderCell:t,renderDetailRow:o})})},[i,e,t,o,a,r]),(0,bo.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),ka.createElement(jn,{updater:a})}var za=ka.memo(LI);var ti=H(require("react")),To=require("react");var $m=he({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Va="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Ym=he({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});function qm(n,e){let t=e-n.getScrollOriginPageIndex();return t?`calc(${fe.runtime.totalVisibleColumnsWidthVar} * ${t})`:null}function Xm(n,e){let t="0px",o=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(t=qm(n,n.getPageIndexForRow(o))??"0px",o=o%n.rowsPerPage);let r=n.getRowHeight(o),i=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop;return{activeCellRowHeight:`${r}px`,activeCellRowOffset:`${i}px`,activeCellRowOffsetX:t}}function Zm(n,e){let{scrollTop:t,scrollLeft:o}=n.getDOMScrollPosition(e);return{scrollTopForActiveRow:`${-t}px`,scrollLeftForActiveRowWhenHorizontalLayout:n.isHorizontalLayoutBrain?`${-o}px`:"0px"}}function Qm(n,e,t){let[o]=e,r=e[1],i;if(n.isHorizontalLayoutBrain&&n.rowsPerPage){let u=Re.columnOffsets.get(r),c=qm(n,n.getPageIndexForRow(o));i=c?`calc( ${c} + ${u})`:u,o=o%n.rowsPerPage}let a=typeof t=="function"?t(o):t??n.getRowHeight(o),l=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop,s={activeCellRowHeight:`${a}px`,activeCellRowOffset:`${l}px`};return i!==void 0&&(s.activeCellColOffset=i),s}var{rootClassName:kI}=ze,zI=`${kI}-ActiveRowIndicator`,VI=`calc(${q.activeCellRowOffsetX} + var(${Y(q.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,GI={[Y(q.activeCellOffsetY)]:q.activeCellRowOffset,transform:`translate3d(${VI}, calc( ${q.activeCellOffsetY} + var(${Y(q.scrollTopForActiveRow)}, 0px)), 0px)`,height:q.activeCellRowHeight,maxWidth:fe.runtime.totalVisibleColumnsWidthVar},HI=n=>{let{brain:e}=n,t=(0,To.useRef)(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=qt(),a=(0,To.useRef)(n.activeRowIndex);a.current=n.activeRowIndex;let l=()=>{let s=a.current;s==null||!t.current||Yo(Xm(e,s),t.current)};return(0,To.useLayoutEffect)(l,[n.activeRowIndex,e]),(0,To.useEffect)(()=>{let s=p=>{Yo(Zm(e,p),t.current)};s(e.getScrollPosition());let u=e.onScroll(s),c=e.onRenderCountChange(i),d=e.onScrollOriginChange(l);return()=>{d(),c(),u()}},[e]),ti.createElement("div",{className:Va,"data-name":"active-row"},ti.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${zI} ${Ym({active:o})}`,style:o?GI:void 0}))},Jm=ti.memo(HI);var ni=H(require("react")),Co=require("react");var{rootClassName:KI}=ze,BI=`${KI}-ActiveCellIndicator`,WI=Y(q.columnZIndexAtIndex),eg=(n,e,t,o)=>{e!=null&&Yo(Qm(n,e,t),o.current)},jI=n=>{let{brain:e}=n,[t,o]=qt(),r=(0,Co.useRef)(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];(0,Co.useLayoutEffect)(()=>{eg(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]);let a=(0,Co.useRef)(n);return a.current=n,(0,Co.useEffect)(()=>{let l=e.onRenderCountChange(()=>{o()}),s=e.onScrollOriginChange(()=>{let{activeCellIndex:u,rowHeight:c}=a.current;eg(e,u,c,r)});return()=>{l(),s()}},[e]),ni.createElement("div",{className:Va,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${WI}-${n.activeCellIndex[1]})`}:void 0},ni.createElement("div",{"data-name":"active-cell-indicator",className:`${BI} ${$m({visible:i})}`}))},tg=ni.memo(jI);var Ga=[uf,`${yt}DetachedCell`];function Ha(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var UI=$(wm,nu);function ng(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=n,{autoFocus:h}=g,S=(0,Pt.useRef)(null),[y,C]=(0,Pt.useState)({width:0,height:0});(0,Pt.useEffect)(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),(0,Pt.useEffect)(()=>{let R=S.current?.parentNode;return R?(h&&document.activeElement!==R&&R.focus(),Fo(R,()=>{let P={height:R.clientHeight,width:R.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let T=(0,Pt.useCallback)(R=>{let w=e.getDOMScrollPosition(R);requestAnimationFrame(()=>{S.current&&S.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`)})},[e]),I=(0,Pt.useCallback)(R=>{e.setScrollPosition(e.toContentScrollPosition(R),T)},[e,T]);(0,Pt.useEffect)(()=>{let R=e.onRenderCountChange(()=>{C(e.getNativeScrollSize())});return C(e.getNativeScrollSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),R},[e]);let b=(0,Pt.useRef)({brain:e,vertical:1,horizontal:1});return(0,Pt.useLayoutEffect)(()=>{let R=b.current,w=e.getScrollRatio("vertical"),v=e.getScrollRatio("horizontal");b.current={brain:e,vertical:w,horizontal:v};let P=S.current?.parentElement;if(!P||R.brain!==e||R.vertical===w&&R.horizontal===v)return;let x=e.toNativeScrollPosition(e.getScrollPosition());R.vertical!==w&&(P.scrollTop=x.scrollTop),R.horizontal!==v&&(P.scrollLeft=x.scrollLeft)},[y,e]),Io.createElement(Om,{onContainerScroll:I,...g,ref:t},Io.createElement("div",{ref:S,className:UI,"data-name":"scroll-transform-target"},Io.createElement(za,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Ga}),c!=null?Io.createElement(tg,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?Io.createElement(Jm,{brain:e,activeRowIndex:u}):null,Io.createElement(Rm,{width:y.width,height:y.height}))}function og(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((c,d)=>{let p=c.id,f=n[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let S={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],S);let y=c.columnGroup,C,T=S;for(;y;){let I=e[y];if(I){g.add(y);let b=[p,...g];C=h.has(y)?i.get(y):void 0,C||(C={id:y,type:"group",ref:I,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:S.computedPinned,depth:t.get(y)??0},r.set(b,C),i.set(y,C)),C.columnItems.push(S),C.uniqueGroupId.push(S.id),T&&!h.has(T.id)&&C.children.push(T),T=C,y=I.columnGroup}else break}});let l=[],s=new U,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&rg(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=o+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function rg(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&rg(t.children),e+=o})}var $n=H(require("react")),yn=require("react");var pu=H(require("react"));var ag=H(require("react")),du=require("react");var oi=require("react"),ri=H(require("react"));var{rootClassName:$I}=ze,YI=`${$I}HeaderCell_ResizeHandle`;function qI(n){let e=(0,oi.useRef)(null),[t,o]=(0,oi.useState)(!1),r=(0,oi.useRef)(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=Zf(n.groupColumns.map(T=>T.computedVisibleIndex),{columns:n.columns,domRef:e}),S=T=>{a==="end"&&(T*=-1);let{constrained:I,adjustedDiffs:b,adjustedDiff:R}=n.computeResize(T);return r.current!==I&&o(I),h.resize(b),R},y=T=>{if(g){let I=n.groupColumns.reduce((w,v)=>w+v.computedWidth-v.computedMinWidth,0),b=n.brain.getAvailableSize(),R={width:b.width+I,height:b.height};n.brain.update(R),g=!1}S(Math.round(T.clientX-f))},C=T=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",C);let I=Math.round(T.clientX-f),b=S(I);h.resize(n.groupColumns.map(()=>0)),n.onResize(b)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",C)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:fe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return ri.createElement("div",{ref:e,className:`${YI} ${ba} ${Ca({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},ri.createElement("div",{style:{...c,...n.style},className:Ta({constrained:t})}))}var ig=ri.memo(qI);function lg(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:u}=te(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),c=n[n.length-1],d=(0,du.useCallback)(g=>{let h=l(),{columnSizing:S,viewportReservedWidth:y,bodySize:C}=h,T=s().computedVisibleColumns,I=!1,b=T.reduce((v,P)=>(P.computedFlex&&(v[P.id]={...S[P.id],flex:P.computedWidth},I=!0),v),{}),R=I?{...S,...b}:S;return Zd({availableSize:qs(C),reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:n.length,items:T.map(v=>({id:v.id,resizable:v.computedResizable,computedFlex:v.computedFlex,computedWidth:v.computedWidth,computedMinWidth:v.computedMinWidth,computedMaxWidth:v.computedMaxWidth}))})},[c]),p=(0,du.useCallback)(g=>{let{columnSizing:h,reservedWidth:S}=d(g);u.viewportReservedWidth=S,u.columnSizing=h},[d]);return n.some(g=>g.computedResizable)?ag.createElement(ig,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:p}):null}var sg=`${yt}HeaderGroup`,ug=Y(q.columnWidthAtIndex),XI=Y(q.columnZIndexAtIndex);function cg(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=lg(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=o[0],c=o.length>1?"calc( "+o.map(f=>`var(${ug}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${ug}-${u.computedVisibleIndex})`,d=`calc(var(${XI}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,pu.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:$(Gd,sg),style:p,"data-z-index":d},pu.createElement("div",{className:$(`${sg}__header-content`,Gt)},a),s)}var dg=require("react");var gu=H(require("react")),fu;function hu(){return fu||(fu=gu.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var mu;function Ka(){return mu||(mu=gu.createContext(null))}function Ne(n){let e=Ka(),t=(0,dg.useContext)(e);return No(t,n)}function on(){return Ne(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:ZI}=ze,QI=[],pg=`${ZI}Header`,JI=Nd({overflow:!1}),fg=()=>{};function eR(n){let{bodyBrain:e,headerBrain:t,columns:o,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=n,{getState:u,headerOptions:c,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=te(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,yn.useRef)(null),h=(0,yn.useCallback)(D=>{if(g.current){let{scrollLeft:E}=t.getDOMScrollPosition(D);g.current.style.transform=`translate3d(${-E}px, 0px, 0px)`}},[t]);(0,yn.useEffect)(()=>{let D=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),D},[t]);let S={ref:g,className:$(pg,`${pg}--virtualized`,i,JI),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:C,dataSourceActions:T}=on(),{allRowsSelected:I,someRowsSelected:b,selectionMode:R,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,yn.useMemo)(()=>({allRowsSelected:I,someRowsSelected:b,selectionMode:R}),[I,b,R]),x=(0,yn.useCallback)(D=>{let{rowIndex:E,colIndex:z,domRef:V,height:N,widthWithColspan:L,heightWithRowspan:F,hidden:B}=D,X=o[z];if(!X||B)return null;let _=t.isHorizontalLayoutBrain?t.getPageIndexForRow(E):null,k=l?l.pathsToCells.get([E,z]):null;if(k&&k.type==="group"){let K=k.columnItems.map(se=>se.ref),Q={...k.ref,id:k.id,uniqueGroupId:k.uniqueGroupId,depth:k.depth,columns:K.map(se=>se.id),computedWidth:k.computedWidth,groupOffset:k.groupOffset};return u().columnGroupVisibility[k.id]!==!1?$n.createElement(cg,{horizontalLayoutPageIndex:_,bodyBrain:e,columnGroupsMaxDepth:s,domRef:V,columns:K,width:L,height:N,columnGroup:Q}):null}return $n.createElement(gg,{domRef:V,column:X,horizontalLayoutPageIndex:_,headerOptions:c,dataSourceStatePartialForHeaderCell:P,filterTypes:w,filterDelay:v,getDataSourceState:y,dataSourceApi:C,dataSourceActions:T,width:L,height:F,columnsMap:m})},[c,o,a,l,s,f,t,y,C,T,w,v,P]),M=so(ea);return $n.createElement(Wn,{orientation:"horizontal",dragListId:M,dragStrategy:"inline",onDrop:fg,updatePosition:fg},D=>$n.createElement("div",{...D,...S,className:$(D.className,S.className)},$n.createElement(za,{name:"header",renderCell:x,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:QI,cellDetachedClassNames:Ga})))}var mg=$n.memo(eR);function hg(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=te(b=>({computedPinnedStartColumns:b.computed.computedPinnedStartColumns,computedPinnedEndColumns:b.computed.computedPinnedEndColumns,computedVisibleColumns:b.computed.computedVisibleColumns,columnSize:b.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:u,columnGroupsMaxDepth:c,computedColumnGroups:d,showColumnFilters:p}=te(b=>({columnHeaderHeight:b.state.columnHeaderHeight,columnGroupsDepthsMap:b.state.columnGroupsDepthsMap,columnGroupsMaxDepth:b.state.columnGroupsMaxDepth,computedColumnGroups:b.state.computedColumnGroups,showColumnFilters:b.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:c+2,m=f*s+(p?s:0),g=Bt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return og(a,d,u,c)},[a,d,u]),h=Bt.useCallback(({rowIndex:b,colIndex:R})=>{let w=a[R],v=1,P=1;if(!w||!g)return{rowspan:v,colspan:P};let x=g.pathsToCells.get([b,R]);if(!x)return{rowspan:v,colspan:P};if(x.type==="column")return{colspan:P,rowspan:f-x.depth};let M=x.columnItems.findIndex(D=>D.id===w.id);return{rowspan:v,colspan:M===0?x.columnItems.length:1}},[d,c,a,g,f,u]),S=Bt.useCallback(({rowIndex:b,colIndex:R})=>h({rowIndex:b,colIndex:R}).rowspan,[h]),y=Bt.useCallback(({rowIndex:b,colIndex:R})=>h({rowIndex:b,colIndex:R}).colspan,[h]),C=Bt.useCallback(b=>p?b<f-1?s:2*s:s,[f,p,s]);Ha(e,{colWidth:l,rowHeight:C,rows:f,cols:a.length,height:m,rowspan:S,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Bt.createElement(mg,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:c,columnAndGroupTreeInfo:g}),I=o.vertical&&Xt()?Bt.createElement("div",{className:Kd,style:{zIndex:1e3,width:Xt()}}):null;return Bt.createElement("div",{className:`${ks} ${Ud}`,style:{height:m}},T,I)}var{ManagedComponentContextProvider:tR}=Lt({initSetupState:Tm,forwardProps:Cm,Context:tu()});function yu(n){let{getComputed:e,header:t,brain:o,headerBrain:r,wrapRowsHorizontally:i}=te(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?ii.createElement(tR,{...n},ii.createElement(hg,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function yg(){return ii.useContext(tu()).componentState}var nR=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||zn;return Ae.createElement(s,{domProps:{className:Jo},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},ha=Ae.createContext(null);var oR=Y(q.columnZIndexAtIndex),rR=Y(q.columnVisibilityAtIndex),Su=Ae.createElement("div",{className:Fi[1]}),iz=Li({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[bt]:"",[lr]:""});function iR(n){let e=n.column,{allowColumnHideWhileDragging:t}=yg(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:u}=n,{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=o,{onDragItemPointerDown:f,dragListId:m}=ho(),{api:g,getComputed:h,getState:S,actions:y,getDataSourceMasterContext:C,showColumnFilters:T,components:I,portalDOMRef:b,columnHeaderHeight:R,columnReorderDragColumnId:w,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:P}=te(j=>({api:j.api,getComputed:j.getComputed,getState:j.getState,actions:j.actions,getDataSourceMasterContext:j.getDataSourceMasterContext,showColumnFilters:j.state.showColumnFilters,components:j.state.components,portalDOMRef:j.state.portalDOMRef,columnHeaderHeight:j.state.columnHeaderHeight,columnReorderDragColumnId:j.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:j.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:j.state.columnReorderInPageIndex})),x=w===e.id,M=P!=null?r!==P:!1,{onResize:D,height:E,width:z,headerOptions:V,columnsMap:N}=n,L=e.computedSortInfo,F=e.header,B=(0,Sn.useCallback)(j=>{pe.current=j,n.domRef?.(j)},[n.domRef]),X=V.alwaysReserveSpaceForSortIcon,_=e.headerAlign??e.align,k=(typeof _=="function"?_({isHeader:!0,column:e}):_)??"start",K=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",Q=St(e,{actions:y,api:g,dataSourceActions:l,dataSourceApi:a,getComputed:h,getDataSourceState:i,getDataSourceMasterContext:C,getState:S}),Ie=Q.isSortable(),se=Ie&&(e.computedSorted||X)?Ae.createElement(Sa,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:fe.spacing[2],marginInlineEnd:fe.spacing[2]},className:`${uo}__sort-icon ${Bd} ${jd({align:k})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,ve=e.computedFilterable&&e.computedFiltered?Ae.createElement(Ko,null):null,Pe=e.headerCssEllipsis??e.cssEllipsis??!0,ce={reserveSpaceWhenHidden:k==="center",menuVisible:v===e.id,style:k==="end"?{marginInlineStart:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:fe.spacing[2]}:{marginInlineEnd:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:fe.spacing[2]},domProps:{onMouseDown:j=>{j.stopPropagation(),Q.toggleContextMenu(j.target)}}},oe=e.components?.MenuIcon||I?.MenuIcon||Yr,ue=Ae.createElement(oe,{...ce}),pe=(0,Sn.useRef)(null),Z={horizontalLayoutPageIndex:r,dragging:x,domRef:B,htmlElementRef:pe,renderLocation:"column-header",column:e,columnsMap:N,columnSortInfo:L,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:c,selectionMode:p,api:g,dataSourceApi:a,columnApi:Q,renderBag:{sortIcon:se,filterIcon:ve,menuIcon:ue,menuIconProps:ce,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},J=Z,W=J.renderBag.header,ie=()=>{let j={...Z,renderBag:{...Z.renderBag}};if(e.renderSortIcon&&(j.renderBag.sortIcon=Ae.createElement(Kn,{render:e.renderSortIcon,renderParam:{...j,renderBag:{...j.renderBag}}})),e.renderFilterIcon&&(j.renderBag.filterIcon=Ae.createElement(Kn,{render:e.renderFilterIcon,renderParam:{...j,renderBag:{...j.renderBag}}})),typeof e.renderMenuIcon=="function"&&(j.renderBag.menuIcon=Ae.createElement(Kn,{render:Ze=>{if(typeof e.renderMenuIcon!="function")return null;let Ct=e.renderMenuIcon(Ze);return Ct?Ct.type===oe||Ct.type===Yr?Ct:Ae.createElement(oe,{...ce},Ct):null},renderParam:{...j,renderBag:{...j.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){j.renderBag.selectionCheckBox=Ae.createElement(Kn,{render:nR,renderParam:{...j,renderBag:{...j.renderBag}}});let Ze=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Ze&&Ze!==!0&&(j.renderBag.selectionCheckBox=Ae.createElement(Kn,{render:Ze,renderParam:{...j,renderBag:{...j.renderBag}}}))}F instanceof Function&&(j.renderBag.header=W=Ae.createElement(Kn,{render:F,renderParam:{...j,renderBag:{...j.renderBag}}}));let lt=e.renderMenuIcon===!1?null:j.renderBag.menuIcon,ae=Pe?Ae.createElement("div",{className:Gt},j.renderBag.header):j.renderBag.header,Ee=Ae.createElement(Ae.Fragment,null,k==="center"?Su:null,j.renderBag.selectionCheckBox,ae,j.renderBag.sortIcon,j.renderBag.filterIcon,k==="center"?Su:null,k!=="center"?Su:null,lt);return e.renderHeader?Ae.createElement(Kn,{render:e.renderHeader,renderParam:{...j,renderBag:{...j.renderBag,all:Ee}}}):Ee};(0,Sn.useEffect)(()=>{let j=null,lt=pe.current;return D&<&&(j=Fo(lt,D)),()=>{j?.()}},[pe.current,n.onResize]);let ne={height:E};e.headerStyle&&(ne=typeof e.headerStyle=="function"?{...ne,...e.headerStyle(J)||{}}:{...ne,...e.headerStyle});let le=typeof e.headerClassName=="function"?e.headerClassName(J):e.headerClassName,{onPointerDown:O,proxyPosition:A,dragColumnOutside:de}=ef({columnId:e.id,domRef:pe,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),ye=null,we=ha.Provider,be={filtered:e.computedFiltered,verticalAlign:K,align:k},Me=Ae.useMemo(()=>tm({columnId:e.id,filterDelay:u,api:g,getState:S,getComputed:h,getDataSourceState:i}),[u,e.id]),qe=e.computedFilterType,We=s[qe],rt=e.computedFilterable?e.computedFilterValue?.filter.operator??We?.defaultOperator:void 0,it=e.computedFilterable&&We?We.operators.find(j=>j.name===rt):void 0,et=it?.components?.FilterEditor||We?.components?.FilterEditor||e.components?.FilterEditor||$o,Xe=We?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,G=em(e,{horizontalLayoutPageIndex:r}),ee=`var(${oR}-${e.computedVisibleIndex})`;ne.zIndex=ee,ne.visibility=`var(${rR}-${e.computedVisibleIndex}, visible)`;let ge={"data-field":`${e.field||""}`,"data-column-id":e.id,[bt]:e.id,[lr]:m,"data-header-align":k,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},Te=e.computedFilterable?Ae.createElement(up,{horizontalLayoutPageIndex:r,filterEditor:et,filterOperatorSwitch:Xe??cp,operator:it,filterTypes:s,onChange:Me,columnFilterType:qe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:R}):Ae.createElement(dp,null);J.renderBag.filterEditor=Te;let ct=(0,Sn.useCallback)(j=>{O(j),f(j)},[O,f]),re=ie();return x&&A&&(ye=Ae.createElement("div",{key:e.id,className:`${uo}Proxy ${_d}`,style:{height:E,width:z,left:A.left??0,top:A.top??0}},Ae.createElement("div",{className:Od({visible:de})},Ae.createElement(bm,{size:16})),W),ye=(0,Sg.createPortal)(ye,b.current)),Ae.createElement(we,{value:J},Ae.createElement(ma,{domRef:B,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...ge,"data-z-index":ee,style:ne,width:z,onPointerDown:ct,contentClassName:$(Ad(be),id[k]),contentStyle:T?{height:E/2}:void 0,className:$(uo,cd.none,Ie?od.pointer:"",le,Ui(e,[uo,mn],Fd,{dragging:x,insideDisabledDraggingPage:M,align:k,verticalAlign:K,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Ed),cssEllipsis:Pe,afterChildren:Ae.createElement(Ae.Fragment,null,T?Te:null,G),renderChildren:re}),ye)}var gg=Ae.memo(iR);function Nr(){return(0,Sn.useContext)(ha)}var bn=H(require("react")),Pg=require("react");function bg(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Cg="https://infinite-table.com",Ig="Invalid Infinite Table license. See console for details.",Rg={padding:fe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem"},aR={...Rg,background:"white",color:"black"},lR={...Rg,background:"#fee2e2",color:"#991b1b"},wg={opacity:"1",visibility:"visible",display:"inline-block",pointerEvents:"all",textDecoration:"underline"},sR={...wg,color:"black"},uR={...wg,color:"#991b1b"};function bu(n){return n?{footer:lR,anchor:uR}:{footer:aR,anchor:sR}}var Tg=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(bg(t),o,"important")};function vg(n,e){let t=bu(e),o=()=>{setTimeout(()=>{let i=n();Tg(i,t.footer),Tg(i?.querySelector("a")??null,t.anchor)})};o();let r=setInterval(o,1e3);return()=>{clearInterval(r)}}var Dg=bn.forwardRef(function(e,t){let{invalid:o=!1,...r}=e,{rootClassName:i}=Oi(),a=bn.useRef(null),l=bn.useCallback(u=>{a.current=u,t&&(typeof t=="function"?t(u):t.current=u)},[]);(0,Pg.useEffect)(()=>vg(()=>a.current,o),[o]);let s=bu(o);return bn.createElement("div",{ref:l,...r,className:$(`${i}-Footer`,o?`${i}-Footer--invalid`:null,bp,r.className),style:s.footer},o?`${Ig} `:null,"Powered by"," ",bn.createElement("a",{href:Cg,rel:"noopener noreferrer",role:"link",target:"_blank",style:s.anchor},"Infinite Table"))});var Ba=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new U(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new U(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 Ba{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 n=Fe().performance?.now();return`${Date.now()}:${n}`}function Wa(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var xg=new WeakMap;function ja(n,e){if(!n||!n.length)return[];let t=xg.get(n);t||(t=new WeakMap,xg.set(n,t));let o=t.get(e);if(o)return o;let r=[],i=Wa(n,e)||[];for(let a=0,l=i.length;a<l;a++){let s=i[a],u=e[s.filter.type];if(s.disabled||!u)continue;let c;for(let d=0;d<u.operators.length;d++){let p=u.operators[d];p.name===s.filter.operator&&(c=p.fn)}c&&r.push({field:s.field,valueGetter:s.valueGetter||u.valueGetter,fn:c,value:s.filter.value,emptyValues:u.emptyValues})}return t.set(e,r),r}function Tu(n,e){if(!n.length)return!0;let{data:t}=e,o={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=n.length;r<i;r++){let a=n[r];if(o.field=a.field,o.filterValue=a.value,o.currentValue=a.valueGetter?a.valueGetter(o):a.field?t[a.field]:t,o.emptyValues=a.emptyValues,!a.fn(o))return!1}return!0}var cR=0;function Cu(n){return cR++,Tu(ja(n.filterValue,n.filterTypes),n)}function Ua(n){return ja(n.filterValue,n.filterTypes).length?n.isLeafNode?Cu(n):n.filterTreeNode(n.data):!0}var dR="group-by",Mg="group-by-";function Eg(n){let e=n.map(t=>t.valueGetter?o=>t.valueGetter({data:o,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function $a(n,e){if(!n?.length||!e?.length)return n;let t=!1,o=n.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===dR){let i=Eg(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(Mg)){let i=r.id.slice(Mg.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=Eg([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?o:n}var Ag=!0,pR={originalDataArray:!0,changes:!0},fR={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function Wt(n,e,t){let o=$a(n.sortInfo,n.groupBy),r=n.multiSort?o:o?.[0]??null,i={append:!1,originalDataArray:n.originalDataArray,sortInfo:r,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(i.livePaginationCursor=n.livePaginationCursor,i.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=n.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],n.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=n.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=Iu(i.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=n.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!pR[s]){let u=s,c=fR[u],d=i[u],p=l[u];(c?c(d,p):d===p)||(a[u]=!0)}return i.changes=a,i}function Tn(n,e,t,o,r){let i=Wt(e,o,r),a=i.append;if(e.lazyLoad){let c=e.originalLazyGroupData,d=[wt,...i.groupKeys||[]],p=c.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):c.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Ag,totalCount:0}),t.originalLazyGroupDataChangeDetect=zt()}if(typeof n=="function")try{n=n(i)}catch(c){n=Promise.reject(c)}let s=typeof n=="object"&&typeof n.then=="function"&&(!e.lazyLoad||!a&&!i.groupKeys?.length);s&&(t.loading=!0);let u=c=>{if(console.error('The DataSource "data" function failed:',c),e.lazyLoad){let d=i.groupKeys||[],p=e.originalLazyGroupData.get([wt,...d]),f=c instanceof Error?c.message:String(c);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(n).then(c=>{let d=[],p=!1;if(Array.isArray(c.data)){let m=c;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,C){let T=[wt,...S],I=y.data,b={cache:y.cache??Ag,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??I.length,totalCountUnfiltered:y.totalCountUnfiltered,totalChildrenCount:y.totalChildrenCount,totalChildrenCountUnfiltered:y.totalChildrenCountUnfiltered,children:I,error:y.error},R=[];if(i.lazyLoadBatchSize&&!C){let v=g.get(T),P=!v,x=tp({children:!0},v||{},b);P&&(x.chidren=[]),x.children.length=x.totalCount;let M=i.lazyLoadStartIndex??0,D=Math.min(y.totalCount??I.length,M+i.lazyLoadBatchSize);for(let E=M;E<D;E++){let z=b.children[E-M];if(!z)throw`lazily loaded item not found at index ${E-M}`;x.children[E]=z,z.dataset&&R.push({keys:z.keys,dataset:z.dataset})}P&&g.set(T,x)}else b.children.forEach(v=>{v&&v.dataset&&R.push({keys:v.keys,dataset:v.dataset})}),b.children.length=b.totalCount,g.set(T,b);let w=!1;if(!S||!S.length){let v=g.get([wt]);t.originalDataArray=[...v.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=zt()),R.length){let v=S;R.forEach(({keys:P,dataset:x})=>{h(P,x,v)})}};var f=h;let g=e.originalLazyGroupData;p=!0,h(i.groupKeys||[],m)}}else d=c;p||(t.originalDataArray=a?e.originalDataArray.concat(d):d),s&&(t.loading=!1)}).catch(u)}function Iu(n,{filterTypes:e,filterMode:t}){return t==="local"?!n||!n.some(o=>o.valueGetter)?n:n.map(_g):(Wa(n,e)||[]).map(_g)}function _g(n){if(!n.valueGetter)return n;let e={...n};return delete e.valueGetter,e}function Og(){let n;return(e,t,o)=>{if(n&&n.filterValue===e&&n.filterTypes===t&&n.filterMode===o)return n.result;let r=Iu(e,{filterTypes:t,filterMode:o});return n&&n.filterValue===e&&JSON.stringify(n.result)===JSON.stringify(r)&&(r=n.result),n={filterValue:e,filterTypes:t,filterMode:o,result:r},r}}var mR=()=>new Promise(n=>{He(n)});function Ru(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function Fg(n){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:o}=n;if(!e||!t||t<=0)return!1;for(let r of o.keys())if(r.length===1)return!0;return!1}function Ng(n){for(let[e,t]of n.entries())t==="failed"&&n.delete(e)}function Lg(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,u=l?()=>!1:g=>s[g].data!=null,c=!l,d=new U,p=["_______xxx______"];for(let g=t;g<=o;g++){let h=s[g];if(!h)continue;let S=u(g),y=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&y.pop();let C=y.length?y:p,T=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let I={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:c},b=h.groupKeys,R=d.get(b);if(!R?.[h.id]){let w=!R;R=R||{},R[h.id]||(R[h.id]=I),w&&d.set(b,R)}}if(!S&&r!=null){let I=d.get(C),b=Math.floor(T/r)*r,R=T-b,w=s[h.indexInAll-R].indexInAll,v=u(w),P=s[w].id;if(v||I?.[P])continue;let x=!I;I=I||{};let M={lazyLoadStartIndex:b,lazyLoadBatchSize:r,groupKeys:y,append:c};I[P]||(I[P]=M),x&&d.set(C,I)}}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(()=>mR()).then(()=>Tn(...y))},f)}function wu(n,e){let{rowIndex:t,primaryKey:o}=e,{dataArray:r}=n.getDataSourceState();if(o!==void 0){let i=n.dataSourceApi.getIndexByPrimaryKey(o);if(i!==-1)return i;if(r[t]?.id!==o)return-1}return r[t]?t:-1}function ai(n,e){let t=wu(n,e);return t===-1?null:tn({...n,rowIndex:t,columnId:e.columnId})}function li(n,e){console.warn(`Skipping "${n}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function vu(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[u+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(o.columnMenuVisibleForColumnId=p),p}function Ya(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function Pu(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function kg(n,e,t){if(Pu(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/o),p=Math.floor(u/o),f=l%o,m=u%o,g=Math.min(f,m),h=Math.max(f,m),S=[];for(let y=d;y<=p;y++)for(let C=g;C<=h;C++){let T=y*o+C;if(y===d)for(let I=s;I<r;I++)S.push({rowIndex:T,colIndex:I});else if(y===p)for(let I=0;I<=c;I++)S.push({rowIndex:T,colIndex:I});else for(let I=0;I<r;I++)S.push({rowIndex:T,colIndex:I})}return S}function gR(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var Du=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Vn(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ue(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=Vn(l,this.getDataSourceState),h=Vn(u,this.getDataSourceState);if(!g||!h)return;let S=g.indexInAll,y=h.indexInAll,[C,T]=Ya({rowIndex:S,colIndex:f},{rowIndex:y,colIndex:m});for(let I=C.rowIndex;I<=T.rowIndex;I++)for(let b=C.colIndex;b<=T.colIndex;b++){let R={rowIndex:I,colIndex:b},[w,v]=this.getCellSelectionPosition(R);o?a.selectCell(w,v):a.deselectCell(w,v)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=ia(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=gR(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ue(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ue(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ue:new Ue(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ue(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new Ue(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new Ue(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function zg(n){return new Du(n)}var pr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var At=class extends pr{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function Vg(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new At({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.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,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new At(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Yn(n,e,t){return Math.min(Math.max(n,e),t)}function qa(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Yn(a,r,i)}function hR(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,u=s.length,c=t(),{brain:d}=c,{activeRowIndex:p}=c;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,S=0,y=u-1,C={ArrowDown:()=>{p=qa(o,p,1)},ArrowUp:()=>{p=qa(o,p,-1)},ArrowLeft:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let b=d.rowsPerPage;p-b>=S?p=p-b:C.ArrowUp();return}return I&&I.isGroupRow?i.collapseGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.collapseRowDetail(I.id):!1},ArrowRight:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let b=d.rowsPerPage;p+b<=y?p=p+b:C.ArrowDown();return}return I&&I.isGroupRow?i.expandGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.expandRowDetail(I.id):!1},Enter:()=>{let I=s[p];return I&&I.isGroupRow?i.toggleGroupRow(I.groupKeys):I&&I.isTreeNode&&I.isParentNode?a.treeApi.toggleNode(I.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.toggleRowDetail(I.id):!1},PageDown:()=>{p=Math.min(p+h,u-1)},PageUp:()=>{p=Math.max(p-h,S)},End:()=>{p=y},Home:()=>{p=S}},T=C[l];return T?(T(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function xu(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,u=i().dataArray,c=o(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[S,y]}=p.getRenderRange(),C=S-g-1,T=y-h-1,I=i().dataArray.length-1,b=r().computedVisibleColumns.length-1,R=0,w=0;f=Yn(f,0,I),m=Yn(m,0,b);let v={ArrowDown:()=>{f=Yn(f+1,R,I)},ArrowUp:()=>{f=Yn(f-1,R,I)},ArrowLeft:()=>{if(m===w)if(f!==R&&(m=b),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f-x>=R?f=f-x:v.ArrowUp()}else v.ArrowUp();else m=Yn(m-1,w,b)},ArrowRight:()=>{if(m===b)if(f!==I&&(m=w),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f+x<=I?f=f+x:v.ArrowDown()}else v.ArrowDown();else m=Yn(m+1,w,b)},Enter:()=>{let x=u[f];return x&&x.isGroupRow?t.toggleGroupRow(x.groupKeys):x&&x.isTreeNode&&x.isParentNode?a.treeApi.toggleNode(x.nodePath):x&&t.rowDetailApi.isRowDetailEnabledForRow(x.id)?t.rowDetailApi.toggleRowDetail(x.id):!1},PageDown:()=>{s?m=Math.min(m+T,b):f=Math.min(f+C,I)},PageUp:()=>{s?m=Math.max(m-T,w):f=Math.max(f-C,R)},End:()=>{s?m=b:f=I},Home:()=>{s?m=w:f=R}},P=v[l];return P?(P(),[f,m]):!1}function yR(n,e){let t=xu(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var SR={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Gg(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!SR[t]?!1:i!=null&&l==="row"?hR(n,e):a!=null&&l==="cell"?yR(n,e):!1}var Mu=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=qa(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=xu(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Hg(n){return new Mu(n)}function Kg(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var Eu=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(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(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=wu({...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={...tn({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;o.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let u=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)}),c;try{c=await u(l)}catch(p){c=p}let d=c instanceof Error?c:!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:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...tn({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(tn({...this.context,api:this,columnId:r,rowIndex:i}));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,o=this.columnApiById.get(t);if(o)return o;let r=St(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:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),u=l.get(r),c=i.getRowInfoByIndex(s),d=c?.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",g=or({column:u,rowInfo:c,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 o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};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(),o=new Dt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[wt,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||Tn(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=U.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,o={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){o=o||{};let g=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(o.offset||0),m=u.scrollTop>p+(o.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&this.setNativeScroll({scrollLeft:u.scrollLeft}),u.scrollTop!==c.scrollTop&&!m&&this.setNativeScroll({scrollTop:u.scrollTop}),!0)};this.context=e,this.rowSelectionApi=bf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Hg({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Vg({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=zg({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(vu(t),e?.()),setTimeout(()=>{this.isDestroyed()||(vu(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??xf({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(tn({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=!!i.pivotColumn,s=i.groupByForColumn,u=l?void 0:i.field,c=s?Array.isArray(s)?s:[s]:[],d=c.map(m=>m.valueGetter?g=>m.valueGetter({data:g,field:m.field}):m.field?m.field:m.groupField??void 0).filter(An);d.length&&(u=d);let p=i.computedSortType;if(c.length&&p===pn){let m=this.getState().initialColumns;p=c.flatMap(h=>{let S=h.field??h.groupField,y=S?r.get(S):null;if(y)return y.computedSortType;let C=S?oo(m,S):void 0;return C?C.sortType||(typeof C.type=="string"?C.type:"string"):[pn]})}c.length&&!Array.isArray(p)&&(p=[p]);let f={dir:t,id:i.id,field:u,type:p};!l&&i.valueGetter&&(f.valueGetter=m=>i.valueGetter({data:m,field:i.field})),this.setSortInfoForColumn(e,f,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Kg(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:Kg(d,l)?(u=!0,t):d),u||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;o.computedFilterValue?(c={...o.computedFilterValue,filter:{...o.computedFilterValue.filter,operator:u}},s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:o.valueGetter},o.field&&(c.field=o.field)),c.id=o.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){this.getState().pendingColumnFilters.cancel(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){this.getState().pendingColumnFilters.cancel(e);let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],u=o.filterTypes[l];if(i=!0,!u)return null;let c=a.filter.operator??u?.defaultOperator,p=s[c].defaultFilterValue??(u.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:c,value:p}}}return a}).filter(An),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}setNativeScroll(e){let t=this.getState(),o=t.scrollerDOMRef.current;if(!o)return;let r=t.brain.toNativeScrollPosition({scrollTop:e.scrollTop??0,scrollLeft:e.scrollLeft??0});e.scrollTop!==void 0&&(o.scrollTop=r.scrollTop),e.scrollLeft!==void 0&&(o.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 o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=o.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&this.setNativeScroll({scrollTop:s.scrollTop}),c&&this.setNativeScroll({scrollLeft:s.scrollLeft}),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),u=o.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&this.setNativeScroll({scrollLeft:l.scrollLeft}),!0)}};function Bg(n){return new Eu(n)}var Ro=require("react");var bR=10;function Wg(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${mn} > .${Wr}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${uo}`);if(t===!1&&d)return;let p=c.getAttribute("data-column-id"),f=u.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Gt.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let g=Fe().getComputedStyle(c);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+bR}if(m+=s[p],d){let g=0;c.childNodes.forEach(h=>{if(h!==u&&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 C=Fe().getComputedStyle(S);g+=parseInt(C.marginLeft,10)+parseInt(C.marginRight,10)}}}),m+=g}r&&r.has(p)||o&&!o.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function jg(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=kt(),[a,l]=(0,Ro.useState)(0),s=typeof r=="object"?r.key:r,u=Le(s),c=(0,Ro.useRef)(null);(0,Ro.useEffect)(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,Ro.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let g=Wg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let S=n().columnSizing,y={...S},C=!1;h.forEach(T=>{y[T]={width:g[T]},C=C||y[T].width!==S[T]?.width}),C&&(e.columnSizing=y)},[s,o,a])}var Qn=require("react");var Xa=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!Pu(e,t,r)){kg(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Ya(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let u=i.rowIndex;u<=a.rowIndex;u++)for(let c=i.colIndex;c<=a.colIndex;c++){let d=this.getCellSelectionPosition({rowIndex:u,colIndex:c});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function TR(n,e){return n<e?[n,e]:[e,n]}var Za=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 o=this.getRowAt(e);if(!o||o.rowDisabled||o.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){o.nodePath&&this.isNodeSelectable(o)&&r.setNodeSelection(o.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(o);if(o.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(o.id,a):i.deselectRow(o.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 o=this.getGroupKeys(t);return t.isGroupRow?o?this.rowSelectionState.isGroupRowSelected(o):!1:this.rowSelectionState.isRowSelected(t.id,o)}setRangeSelected(e,t,o){let[r,i]=TR(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,o))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let o=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!o||!r||r.length<o.length?!1:o.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 o=e-1;o>=0&&this.isSelectedAt(o);o--)t=o;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 kh=require("react");var Lh=H(require("react"));var CR=()=>{};function Ug(n,e){let t=new U,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let u=0;u<s.length;u++){let c=s.slice(0,u);t.has(c)||t.set(c,void 0)}t.set(s,l)}function a(l,s){let u=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let c of u){let d=[...l,c[c.length-1]],p=t.get(d),f=p?p[o]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[o]=f),s.push(p)}return s}return a([],[])}function $g(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(o),d=[...t,c],p=r(o),f=ht(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let S=m[g];$g(n,e,d,S)}});p?(u?.(o),s?.(o,CR)):(l?.(o,f,i(o)),s?.(o,f))}function Yg(n,e,t){for(let o=0,r=t.length;o<r;o++)$g(n,e,[],t[o])}var qg=new Uint8Array(new Uint32Array([1]).buffer)[0]===1;function Xg(n,e,t){let o=n.length,r=new Float64Array(o);for(let p=0;p<o;p++){let f=e(n[p]);if(typeof f!="number"||f!==f)return!1;r[p]=(t<0?-f:f)+0}if(o<2)return!0;let i=new Uint32Array(r.buffer),a=qg?0:1,l=qg?1:0,s=new Uint32Array(8*256);for(let p=0;p<o;p++){let f=i[2*p+a],m=i[2*p+l];m&2147483648?(m=~m>>>0,f=~f>>>0,i[2*p+a]=f):m=(m|2147483648)>>>0,i[2*p+l]=m,s[f&255]++,s[256+(f>>>8&255)]++,s[512+(f>>>16&255)]++,s[768+(f>>>24)]++,s[1024+(m&255)]++,s[1280+(m>>>8&255)]++,s[1536+(m>>>16&255)]++,s[1792+(m>>>24)]++}let u=new Uint32Array(o),c=new Uint32Array(o);for(let p=0;p<o;p++)u[p]=p;for(let p=0;p<8;p++){let f=p<4?a:l,m=p%4*8,g=p*256;if(s[g+(i[f]>>>m&255)]===o)continue;let h=0;for(let y=0;y<256;y++){let C=s[g+y];s[g+y]=h,h+=C}for(let y=0;y<o;y++){let C=u[y],T=i[2*C+f]>>>m&255;c[s[g+T]++]=C}let S=u;u=c,c=S}let d=n.slice();for(let p=0;p<o;p++)n[p]=d[u[p]];return!0}var Au=function(n,e){return n-e},IR=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 RR(){try{let n=new Intl.Collator;return IR.has(n.resolvedOptions().locale)?null:n}catch{return null}}var wR=function(n,e){return n=`${n}`,e=`${e}`,Qa===void 0&&(Qa=RR()),Qa?Qa.compare(n,e):n.localeCompare(e)},vR=function(n,e){return n-e},PR={number:Au,string:wR,date:vR},qn=PR;function Zg(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var jt=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;r&&r.start();let i=Zg(n);return xR(i,e,o)||e.sort(Qg(i,o)),r&&r.end(),e},Ja=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=Qg(Zg(n),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,u=d=>d[l],c=d=>d[l]===void 0;return Yg({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??u,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)),o&&o.end(),e};jt.knownTypes=qn;function xR(n,e,t){if(n.length!==1||e.length<1e3)return!1;let o=n[0];if(!o||o.fn||!o.type||o.dir!==1&&o.dir!==-1)return!1;let r=Array.isArray(o.type)?o.type[0]:o.type;if(jt.knownTypes[r]!==Au)return!1;let{field:i,valueGetter:a}=o;return Xg(e,l=>(t&&(l=t(l)),a?a(l):i?l[i]:l),o.dir)}var MR=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=jt.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(jt.knownTypes).join(", ")}`)}return r||(r=qn.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:o*u}},ER=n=>n.map(MR).filter(e=>e instanceof Function),Qg=(n,e)=>{let t=ER(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var AR=H(require("react"));function el(n){return Ne(e=>n(e.dataSourceState))}var _R=Ye("IT:InfiniteTable"),OR="#dc3545",FR="#eb9316";var eh="Warn",th="Error",NR="Info",LR="Success",kR="Logs",tl=_R.extend(kR),YV=tl.extend(NR),zR=tl.extend(eh),VR=tl.extend(th),qV=tl.extend(LR);var GR=FR,HR=OR;var KR=(n,e)=>{e=e?e.extend?e.extend(eh):e:zR,e(typeof e.color=="function"?e.color(GR,n):n)},BR=(n,e)=>{e=e?e.extend?e.extend(th):e:VR,e(typeof e.color=="function"?e.color(HR,n):n)};var Jg=new U,nh=(n,...e)=>{Jg.has(e)||(Jg.set(e,!0),n())};var oh=(n,e=n,t)=>{nh(()=>KR(n,t),e,"warn")},rh=(n,e=n,t)=>{nh(()=>BR(n,t),e,"error")};var _u=new WeakMap,WR=n=>n;function ih(n,e=50,t){_u.set(n,{lastCallTime:0,lastCallArg:null});let o=t??WR;return r=>{let{lastCallTime:i,lastCallArg:a}=_u.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=Rt(o(a),o(r));s<e&&u||(_u.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var nl=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new U;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let u=o&&!o.isEmpty();if(u&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let c=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,p=c.length;d<p;d++){let f=c[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}o?.removeInfo(void 0)}}else{let c=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];u&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),S=s?[...p,h]:void 0,y=s&&!!S,C=y?o?.getMutationsForNodePath(S):o?.getMutationsForPrimaryKey(h);if(C&&C.length){for(let T=0,I=C.length;T<I;T++){let b=C[T];if(b.type==="delete"&&!g&&(y?this.removeNodePath(S,t):this.remove(h),g=!0,d.splice(f,1),f--),b.type==="update"&&!g&&(m={...m,...b.data},d[f]=m),b.type==="update-children"&&!g){let R=b.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}b.type==="insert"&&(b.position==="before"?(d.splice(f,0,b.data),f--):d.splice(f+1,0,b.data))}y?o?.removeNodePathInfo(S):o?.removeInfo(h)}if(!g)if(y){this.addNodePath(S,m);let T=a(m),I=T?null:i(m);!T&&Array.isArray(I)&&(p.push(h),u&&(m[l]=I=I.concat()),c(I,p),p.pop())}else this.add(h,m)}}};c(e,[])}return e}}};var jR=Object.freeze([]),ah=(n,e)=>{let t=n??jR,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};var xt=class extends pr{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function ol(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(n instanceof Date||e instanceof Date)return n instanceof Date&&e instanceof Date&&n.getTime()===e.getTime();if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0,o=n.length;t<o;t++)if(!ol(n[t],e[t]))return!1;return!0}if(typeof n=="object"){let t=Object.keys(n),o=Object.keys(e);if(t.length!==o.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!ol(n[r],e[r]))return!1;return!0}return!1}function UR(n,e){return!(n===void 0||e===void 0||n.isGroupRow!==e.isGroupRow||n.dataSourceHasGrouping!==e.dataSourceHasGrouping||n.isTreeNode!==e.isTreeNode||n.isTreeNode&&n.isParentNode!==e.isParentNode)}var rl={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},lh={...rl,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},$R={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},YR={...rl,...$R,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},sh={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},qR={...rl,...sh,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},XR={...rl,...sh,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},ZR=Object.entries(lh).map(([n,e])=>e?n:void 0).filter(Boolean),QR=Object.entries(lh).map(([n,e])=>e?n:void 0),JR=Object.entries(YR).map(([n,e])=>e?n:void 0),ew=Object.entries(qR).map(([n,e])=>e?n:void 0),tw=Object.entries(XR).map(([n,e])=>e?n:void 0);function nw(n,e){if(n===e)return!0;if(!n||!e||!UR(n,e)||n.id!==e.id||n.data!==e.data&&!ol(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?JR:QR:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?tw:ew:t=ZR;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!ol(r,i))return!1}return!0}function uh(){let n=[],e=new Map,t=new Set,o={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=n,g=f?.marker,S=p!==m&&t.size>0;S&&(o={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=[],C=l();for(let T of C){let I=m[T],b=p[T];if(b===void 0){y.push(T);continue}nw(I,b)||y.push(T)}n=p,(y.length>0||S)&&queueMicrotask(()=>{for(let T=0,I=y.length;T<I;T++){let b=y[T],R=e.get(b);if(R)for(let w of R)w()}if(S)for(let T of Array.from(t))T()}),g&&g.end({details:[{name:"updated row infos",value:y.length}]})},i=p=>n[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&&(o={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>o,getDataArray:()=>n,clear:()=>{n=[],e.clear(),t.clear(),o={dataSourceState:void 0,previousDataSourceState:void 0}}}}var Cn=new Map,In=new Map,Xn=new Map,Rn=new Map,rn=new Map;var ow=Symbol("cursorId"),ch=n=>n.totalLeafNodesCount===0,rw=n=>n.isParentNode?!ch(n):!0;function dh(n){let e=Date.now(),t=[],o=[],r=new U;return{logger:Nt(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:uh(),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 U,waitForNodePathPromises:new U,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new U,dataParams:void 0,onCleanup:Se(),notifyScrollbarsChange:Se(),notifyScrollStop:Se(),notifyRenderRangeChange:Se(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:ow,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:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function iw(n){let e={...n};return delete e.originalDataArray,e}var aw=[],ph=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.unfilteredTreePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear(),n.rowInfoStore.clear()},fh=(n,e)=>({onDataParamsChange:t=>t?ih(t,100,iw):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??ch,isNodeSelectable:t=>t??rw,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=>({...Nn,...t}),sortTypes:t=>({...qn,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof xt)return t;let o=n.propsCache.get("rowDisabledState"),r=o.get(t);return r||(r=new xt(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>ah(t,n.propsCache.get("sortInfo")),groupBy:t=>t??aw});function lw(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}function sw(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var uw={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function mh(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
1
|
+
"use strict";var sC=Object.create;var Ai=Object.defineProperty;var uC=Object.getOwnPropertyDescriptor;var cC=Object.getOwnPropertyNames;var dC=Object.getPrototypeOf,pC=Object.prototype.hasOwnProperty;var fC=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),mC=(n,e)=>{for(var t in e)Ai(n,t,{get:e[t],enumerable:!0})},Wc=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of cC(e))!pC.call(n,r)&&r!==t&&Ai(n,r,{get:()=>e[r],enumerable:!(o=uC(e,r))||o.enumerable});return n};var H=(n,e,t)=>(t=n!=null?sC(dC(n)):{},Wc(e||!n||!n.__esModule?Ai(t,"default",{value:n,enumerable:!0}):t,n)),gC=n=>Wc(Ai({},"__esModule",{value:!0}),n);var co=fC((DA,Xp)=>{"use strict";Xp.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});var BP={};mC(BP,{AutoScroller:()=>To,CellSelectionState:()=>Ue,DRAG_ITEM_ATTRIBUTE:()=>bt,DataClient:()=>Lc,DataSource:()=>gv,DataSourceActionType:()=>dy,DeepMap:()=>j,DragDropProvider:()=>fa,DragInteractionTarget:()=>dr,DragList:()=>qn,FixedSizeSet:()=>Zl,FlashingColumnCell:()=>BT,GroupRowsState:()=>xt,INTERNAL_MatrixDebugger:()=>jT,InfiniteTable:()=>pn,InfiniteTableClassName:()=>tn,InfiniteTableComponent:()=>_T,Menu:()=>cn,RowDetailCache:()=>br,RowDetailState:()=>Ft,RowDisabledState:()=>Mt,RowSelectionState:()=>Oe,TreeDataSource:()=>LP,TreeExpandState:()=>mt,TreeGrid:()=>NT,TreeSelectionState:()=>Je,WeakFixedSizeSet:()=>Jl,alignNode:()=>Ol,components:()=>KP,createDefaultProxy:()=>ka,createFlashingColumnCellComponent:()=>kc,debounce:()=>Xt,debug:()=>qe,defaultDragProxyMove:()=>za,defaultFilterFunction:()=>zu,defaultFilterTypes:()=>zn,defaultTreeFilterFunction:()=>al,eventMatchesKeyboardShortcut:()=>El,filterDataArray:()=>nc,filterTypes:()=>zn,flatten:()=>$f,getComponentStateRoot:()=>Vt,group:()=>wa,interceptMap:()=>kT,keyboardShortcuts:()=>LT,multisort:()=>$t,multisortNested:()=>fl,queryKeyToCacheKey:()=>Lo,toTreeDataArray:()=>Ih,useComponentState:()=>Gt,useDataSourceApi:()=>cy,useDataSourceInternal:()=>Sr,useDataSourceSelector:()=>Ne,useDataSourceState:()=>ml,useDragDropProvider:()=>gn,useDragListContext:()=>Co,useEffectWhen:()=>ts,useEffectWhenSameDeps:()=>zT,useEffectWithChanges:()=>Eo,useEffectWithObject:()=>lv,useGridScroll:()=>Wl,useInfiniteColumnApi:()=>AT,useInfiniteColumnCell:()=>ni,useInfiniteColumnEditor:()=>Ma,useInfiniteColumnFilterEditor:()=>Xo,useInfiniteHeaderCell:()=>Kr,useInfinitePortalContainer:()=>oT,useInfiniteTableApi:()=>ET,useLayoutEffectWithChanges:()=>av,useManagedDataSource:()=>rc,useMasterRowInfo:()=>On,useOverlay:()=>un,useOverlayPortal:()=>DS,usePrevious:()=>Ln,useRowInfoReducers:()=>hv,useVisibleColumnSizes:()=>Ub,withSelectedLeafNodesOnly:()=>Nc});module.exports=gC(BP);function Xt(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}var Pe=H(require("react"));var $=(...n)=>n.filter(e=>!!`${e}`).join(" ");var ao=H(require("react")),fs=require("react");var hC=H(require("react")),En=require("react");var Vo=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Xt(e,{wait:o}):e,a=new r(l=>{let s=l[0],{width:u,height:c}=s.contentRect;if(s.borderBoxSize?.[0])c=s.borderBoxSize[0].blockSize,u=s.borderBoxSize[0].inlineSize;else{let d=n.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(n),()=>{a.disconnect()}};var _i=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=(0,En.useRef)({width:0,height:0}),r=i=>{let a;return n.current&&(a=Vo(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,En.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),(0,En.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};function ye(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function yt(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var jc=(n,e)=>n-e;var Oi=(n,e)=>jc(n.revision,e.revision),j=class n{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,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),u=!a;if(i!==void 0){if(i<0)return;i--}let c=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!u)return;let h=g?[]:[...e,p],S=m?()=>this.visitWithNext(h,t,o,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,h,l,S,f);if(o&&y===!0)return!0;l++}else S?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(o&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new n;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push(i)},t),o}getEntriesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push([r,i])},t),o}getLeafNodesStartingWith(e,t,o){let{respectOrder:r=!1}=o||{},i=[],a=[];return this.getStartingWith(e,(l,s,u)=>{!u.map&&u.hasOwnProperty("value")&&(r?i.push(u):a.push(t(u)))},o),r?i.sort(Oi).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>o.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>[o.keys,o.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:o,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},u=this.map,c,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(c=u.get(m),!c||!c.map)if(d=!0,p===f-1){d=!0;break}else return[];u=c.map}else if(!o&&u.has(this.emptyKey))return[[]];return c&&c.value!==void 0&&(o||(s({...c,keys:e}),d=!0)),d?i?a.sort(Oi).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,u,r,o),i?a.sort(Oi).map(p=>p.keys):l)}getKeysStartingWith(e,t){let o=[];return this.getStartingWith(e,r=>{o.push(r)},t),o}getStartingWith(e,t,o){let{excludeSelf:r,depthLimit:i}=o||{},a=this.map,l,s=!1;if(e.length)for(let u=0,c=e.length;u<c;u++){let d=e[u];if(l=a.get(d),!l||!l.map)if(s=!0,u===c-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(u,c,d,p,f)=>{t(c,u,{...f,keys:c}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;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=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.map,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],u=e[e.length-1],c=s?.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],u=yt(()=>{if(l)for(let[c]of l){let d=this.visitKey(c,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let c=r(a,s,u);if(i&&c===!0)return!0}u()}getArray(e){let t=[];return this.visit((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Oi);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=j;function Fe(){return globalThis}var Ni=["#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"],Uc=Symbol("color"),Fi=new WeakMap,as=ye();function ls(n=Ni){Fi.set(n,n.map(e=>0))}ls();var yC=(n=Ni)=>{let e=[];Fi.has(n)?e=Fi.get(n):(e=n.map(o=>0),Fi.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??Ni[0]},_r=":",ss="*",$c="-",SC=",",bC="debug",TC="diffdebug",qc=!1,Ar=new j,Or=new Map;function us(n,e){let t=n.split(_r),o=new j;o.set(t,!0);let r=e.split(_r),i=new Set(r).has(ss),a=r.indexOf(ss),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(_r)):!0}}function Xc(n,e){let t=`channel=${n}_permissions=${e}`;if(Or.has(t))return Or.get(t);let o=e.split(SC);function r(l){return Or.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(ss)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith($c);if(u&&(s=s.substring($c.length)),us(n,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),us(n,s))return r(!u)}return r(!1)}var cs=()=>qe.enable??(Fe()&&Fe().localStorage?.getItem(bC))??"",CC=()=>qe.diffenable??(Fe()&&Fe().localStorage?.getItem(TC))??`${qc}`,ds="",Zc=qc;function ps(n){Zc=`${CC()}`=="true",ds!==n&&(ds=n,Or.clear())}function Qc(n){ps(cs()),typeof Fe()<"u"&&Fe().addEventListener&&Fe().addEventListener("storage",function(){ps(cs())});function e(t,o){let r=o?`${o}${_r}${t}`:t,i=r.split(_r),a=Ar.get(i);if(a)return a;let l=Ar.get(i.slice(0,-1)),s=(l?l.logFn:qe.logFn)??Jc,u=s,c,d=0,p=()=>c??Xc(r,ds),f=yC(qe.colors),m=Object.defineProperties((...g)=>{let h=as.getListenersCount(),S;if(h>0&&(S=S??Date.now(),as({color:f,channel:r,args:g,timestamp:S})),p()){if(S=S??Date.now(),d&&Zc){let b=S-d;u(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=S;let y=[],C;if(g.forEach(b=>{if(b[Uc])C===void 0&&(C=!0),y.push(...b);else{if(typeof b!="string"&&typeof b!="number"){C=!1;return}y.push(`${b}%s`)}}),C){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...y,""];u(...b)}else u(`%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[Uc]=!0,S}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{c=g}},logFn:{configurable:!1,get:()=>u,set:g=>{u=g??s}},destroy:{value:()=>{Ar.delete(i)}}});return Ar.set(i,m),m}return e(n)}var Jc=console.log.bind(console),Yc;Object.defineProperty(Qc,"enable",{get:()=>Yc,set:n=>{Yc=n,ps(cs())}});var qe=Qc;qe.colors=Ni;qe.logFn=Jc;var IC=(n,e)=>as.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;us(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});qe.onLogIntent=IC;qe.isChannelEnabled=Xc;qe.destroyAll=()=>{ls(),ls(qe.colors),Ar.clear(),Or.clear()};var zt=n=>{let e=qe(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},An=n=>{let e=qe(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Fr=()=>Fr;Fr.extend=()=>Fr;var It=class{constructor(e){this.debug=Fr,this.error=Fr}};var ed=An("CSSVariableWatch"),td=zt("CSSVariableWatch"),nd={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};function od(n){return n.startsWith("var(")||n.startsWith("calc(")?n:`var(${n})`}var RC=n=>{let e=(0,fs.useRef)(0),t=ao.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);_i(n.ref,t,{earlyAttach:!0}),ao.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,td(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);ed(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},Nr=n=>{let e=(0,fs.useRef)(null);RC({...n,ref:e});let t=od(n.varName),{allowInts:o=!1}=n;return ao.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:nd},ao.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};var Ko=require("react");function _n(){let n=null,e=new Set;return{getSnapshot(){return n},setSnapshot(t){n=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var fn=require("react");function Rt(n,e,t){if(n===e)return!0;if(!n||!e)return!1;let o=typeof n;if(o!==typeof e||o!=="object")return!1;var i=Object.keys(n),a=Object.keys(e);t&&(i=i.filter(c=>!t.has(c)),a=a.filter(c=>!t.has(c)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var u=i[s];if(!(t&&t.has(u))&&(n[u]!==e[u]||!Object.prototype.hasOwnProperty.call(e,u)))return!1}return!0}function rd(n,e,t){let o=(0,fn.useRef)(e);o.current=e;let r=(0,fn.useRef)(t);r.current=t;let i=(0,fn.useRef)(void 0),a=(0,fn.useRef)(!1),l=(0,fn.useCallback)(()=>{let s=n.getSnapshot(),u=o.current(s);return a.current&&r.current(i.current,u)?i.current:(i.current=u,a.current=!0,u)},[n]);return(0,fn.useSyncExternalStore)(n.subscribe,l,l)}function Lr(n,e){return rd(n,e,Object.is)}function Go(n,e){return rd(n,e,Rt)}var id=H(require("react")),ms;function Ho(){return ms||(ms=id.createContext(null))}var ad=_n(),ld=()=>{};function Li(){let n=Ho();return(0,Ko.useContext)(n)||void 0}function ki(){let n=Li();return(0,Ko.useCallback)(()=>n?.getSnapshot(),[n])}function zi(n){let e=Ho(),t=(0,Ko.useContext)(e),o=Go(t||ad,t?n:ld);return t?o??void 0:void 0}function On(){let n=Ho(),e=(0,Ko.useContext)(n),o=Lr(e||ad,e?r=>r.masterRowInfo:ld);return e?o:void 0}var Bo=H(require("react")),it=require("react");function Fn(n){if(n==null)return!1;let e=n;return!0}var Nn=require("react");var Vi=require("react"),Zt=()=>{let[n,e]=(0,Vi.useState)(0);return[n,(0,Vi.useCallback)(()=>{e(t=>t+1)},[e])]};var sd=n=>{let e=(0,Nn.useCallback)(n,[]),t=(0,Nn.useRef)(!1),o=(0,Nn.useRef)(!1),r=(0,Nn.useRef)(void 0),[i,a]=Zt();t.current&&(o.current=!0),(0,Nn.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};var Gi=require("react");function Le(n){let e=(0,Gi.useRef)(n);return e.current=n,(0,Gi.useCallback)(()=>e.current,[])}var Hi=require("react"),Ln=(n,e)=>{let t=(0,Hi.useRef)(e===void 0?n:e);return(0,Hi.useLayoutEffect)(()=>{t.current=n}),t.current};var kr={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 wC="\u200B",gs=class n{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,o=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",u=e.track||this.markerDetails.track||"Unknown",c=wC+s;return performance.measure(c,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:u,color:r,properties:a.length>0?a.map(d=>[d.name,d.value]):void 0,tooltipText:l}}}),performance.clearMeasures(c),this};this.debugId=e}static create(e){return new n(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(kr).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:kr[o].track,label:i.label}),get label(){let i=kr[o];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:u=>e.end({...u,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,o,{get:()=>{let i=kr[o];return e.markerDetails.track=i.track,r}}),t},{})}};function ct(n){return gs.create(n)}function ud(n,e){let t=new Set;function o(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return n.apply(this,s)}return{fn:o,propertyReads:t}}var hs=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function zr(n){return n!==void 0}function kn(n,e){let t=e[n];return zr(t)}var cd=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)};function vC(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=kn(r,e)?e[r]:e[`default${hs(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function dd(n,e,t){let{fn:o,propertyReads:r}=ud(n,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=o(e);return r.forEach(a=>t.add(a)),i}function pd(n){let{props:e,initialSetupState:t,propsToForward:o,parentState:r,mapPropsToState:i,propsToStateSet:a}=n,l={};o&&(l=vC(o,e,t));let s={...t,...l};if(i){let u=dd(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...u}}return s}function fd(n,e,t){let{getProps:o,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,u=e.payload.mappedState,c=e.payload.updatedPropsToState,d={...n};if(u&&Object.assign(d,u),i){let f=dd(i,{props:o(),state:d,oldState:n,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:n,state:d,updatedProps:c,parentState:s}):d}function md(n){let{dispatch:e,getState:t,getProps:o,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=cd}=n,u=t();return Object.keys(u).reduce((c,d)=>{let p=d;return Object.defineProperty(c,d,{set:m=>{let g=o(),h=t(),S=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:c,state:h})===!1&&(S=!1),S){let b=[m],I=`on${hs(d)}Change`;if(l&&l[p]){let T=l[p](m,h);I=T.callbackName||I,b=T.callbackParams}s(g,I,b)}let y=r[p];typeof y=="function"&&(m=y(m));let C=!!i?.[p];kn(d,g)&&!C||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),c},{})}function PC(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}=n,a={},l=0,s={},u=0,c={},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&&(c[m]={newValue:h,oldValue:g},d++,kn(m,e)||kn(m,t)))if(r.hasOwnProperty(f)){let S=h,y=r[f];typeof y=="function"&&(S=y(h)),o[m]!==S&&(a[m]=S,l++)}else i.has(f)&&(s[m]=e[m],u++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:u,rawUpdatedProps:c,rawUpdatedPropsCount:d}}function gd(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i,dispatch:a,actions:l,onPropChange:s,onPropsChange:u,beforeDispatch:c}=n,d=PC({currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}),{newMappedState:p,newMappedStateCount:f,updatedPropsToState:m,updatedPropsToStateCount:g,rawUpdatedProps:h,rawUpdatedPropsCount:S}=d;if(g===0&&f===0)return!1;if(c?.(d),a({payload:{mappedState:f?p:null,updatedPropsToState:g?m:null}}),s){for(let y in h)if(h.hasOwnProperty(y)){let{newValue:C,oldValue:b}=h[y];s({name:y,newValue:C,oldValue:b},e,l,o)}}return u&&S&&u(h,e,l,o),!0}var ys;function hd(){return ys||(ys=(0,it.createContext)(null))}function Vt(n){let e=n.getParentState||(()=>null);function t(r){let[i]=(0,it.useState)(()=>n.initSetupState?n.initSetupState(r):{}),a=(0,it.useRef)(new Set),l=(0,it.useMemo)(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),u=Le(s);function c(){return pd({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:n.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,it.useState)(c),p=Le(r),f=(v,w)=>fd(v,w,{getProps:p,getParentState:()=>u?.()??null,mapPropsToState:n.mapPropsToState,concludeReducer:n.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,it.useReducer)(f,d),h=Le(m),{allowedControlledPropOverrides:S}=n,y=(0,it.useMemo)(()=>md({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:S,interceptedActions:n.interceptActions,mappedCallbacks:n.mappedCallbacks}),[g,l,S]),C=n.Context??hd(),b=(0,it.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:h,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,y,h]),I=Ln(r),T=(0,it.useRef)(!1);T.current=!1;let R=n.layoutEffect?it.useLayoutEffect:it.useEffect;return R(()=>{let v=r;gd({currentProps:v,prevProps:I,state:m,propsToForward:l,propsToStateSet:a.current,dispatch:g,actions:y,onPropChange:n.onPropChange,onPropsChange:n.onPropsChange,beforeDispatch:({newMappedState:P,newMappedStateCount:x,updatedPropsToState:M,updatedPropsToStateCount:D})=>{let E=m.debugId,L=E?ct(E).track.ComponentState.label.PropUpdate.start():void 0,V=n.debugName?typeof n.debugName=="function"?`${n.debugName(v)}:rerender`:`${n.debugName}:rerender`:"rerender";zt(V)("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(M??{})),L&&L.end({label:V,details:[x>0?{name:"Updated properties",value:Object.keys(P).join(", ")}:void 0,D>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,D>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(Fn)})}})&&(T.current=!0)}),R(()=>{s!=null&&!T.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),sd(()=>()=>{n.cleanup?.(h())}),{contextValue:b,ContextComponent:C}}return{ManagedComponentContextProvider:Bo.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Bo.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Gt(n){return n=n??hd(),Bo.useContext(n)}var Md=H(require("react"));var at="Infinite",Ve={rootClassName:at};var Ki=()=>Ve;var yd="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Sd={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Bt="_16lm1iw3b _16lm1iw3c _16lm1iw35",bd={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Wo={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Bi={1:"_16lm1iw1c",none:"_16lm1iw1d"},Vr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Td={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Cd={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Id={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Rd={none:"_16lm1iwd"},wd={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Wi={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var vd={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Pd={none:"_16lm1iw1x"};var Dd={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var xd={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function Ed(n){let{rootClassName:e}=Ki();return Md.createElement("div",{...n,className:$(`${e}Footer`,Wi.relative,Wo.flex,Vr.row,n.className)})}var Ee=H(require("react")),Tn=require("react"),Yg=require("react-dom");function ji(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function q(n){return n.slice(4,-1)}var Od=H(require("react"));var jo={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"},Ad="_1jm33zvf";var _d={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 dt="InfiniteIcon";var Ge=n=>{let{icon:e,...t}=n,o=n.size??"var(--infinite-icon-size)",r={flex:"none",width:o,height:o,fill:"currentColor",...n.style};return Od.createElement("svg",{viewBox:"0 0 24 24",...t,className:e?$(n.className,jo[e],dt,`${dt}-${_d[e]}`):n.className,style:r},n.children)};var Ss=H(require("react"));var He={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 Fd=n=>Ss.createElement(Ge,{...n,icon:"filterOperatorContains"},He.includesOperator.map(e=>Ss.createElement("path",{key:e,d:e})));var bs=H(require("react"));var Nd=n=>bs.createElement(Ge,{...n,icon:"filterOperatorEndsWith"},bs.createElement("path",{d:He.endsWithOperator[0]}));var Ts=H(require("react"));var Ld=n=>Ts.createElement(Ge,{...n,icon:"filterOperatorEq"},Ts.createElement("path",{d:He.eqOperator[0]}));var Cs=H(require("react"));var kd=n=>Cs.createElement(Ge,{...n,icon:"filterOperatorGte"},Cs.createElement("path",{d:He.gteOperator[0]}));var Is=H(require("react"));var zd=n=>Is.createElement(Ge,{...n,icon:"filterOperatorGt"},Is.createElement("path",{d:He.gtOperator[0]}));var Rs=H(require("react"));var Vd=n=>Rs.createElement(Ge,{...n,icon:"filterOperatorLte"},Rs.createElement("path",{d:He.lteOperator[0]}));var ws=H(require("react"));var Gd=n=>ws.createElement(Ge,{...n,icon:"filterOperatorLt"},ws.createElement("path",{d:He.ltOperator[0]}));var vs=H(require("react"));var Hd=n=>vs.createElement(Ge,{...n,icon:"filterOperatorNeq"},vs.createElement("path",{d:He.neqOperator[0]}));var Ps=H(require("react"));var Kd=n=>Ps.createElement(Ge,{...n,icon:"filterOperatorStartsWith"},Ps.createElement("path",{d:He.startsWithOperator[0]}));var ks=H(require("react"));var pt=H(require("react")),uo=require("react");var Uo=H(require("react")),lo=require("react");function DC(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function xC(n){var e=DC(n,"string");return typeof e=="symbol"?e:String(e)}function MC(n,e,t){return e=xC(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bd(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Wd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bd(Object(t),!0).forEach(function(o){MC(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bd(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function jd(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var EC=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},ge=n=>{var e=t=>{var o=n.defaultClassName,r=Wd(Wd({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=n.variantClassNames[i][s];u&&(o+=" "+u)}}for(var[c,d]of n.compoundVariants)EC(c,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return jd(n.variantClassNames,t=>jd(t,o=>o.split(" ")[0]))}},e};var Ud="_1eexc2a6";var $d=ge({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:[]}),Yd="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",qd=ge({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Xd=ge({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"]]}),Zd=ge({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"]]}),Qd="_12zfob12u _16lm1iw22 _16lm1iw1z";var Jd="_12zfob17",ep="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",tp=ge({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Ds=ge({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),np="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",op=ge({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),rp="_12zfob1b _16lm1iw2",ip="_16lm1iw1",ap="_12zfob16",lp=ge({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),sp="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var up="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j",Ui="_1nnkya21";var cp={transition:"width 0.25s, opacity 0.25s"},VM=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function $o(n){let[e,t]=(0,lo.useState)(!0),[o,r]=(0,lo.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=n,u=s!=null&&s>0,c=n.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...cp,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if((0,lo.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,lo.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return Uo.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:$(l,dt,up,`${dt}-filter`)},u?Uo.createElement("div",{"data-name":"index",style:m,className:Jd},s):null,Uo.createElement("div",{className:Ui,style:{width:p[0],...f}}),Uo.createElement("div",{className:Ui,style:{width:p[1],...f}}),Uo.createElement("div",{className:Ui,style:{width:p[2],...f}}))}var $i=Object.freeze({}),AC={string:$i,number:{}};function Yo(n,e){let t=e.default||$i;return n.type===void 0?t:n.type===null?$i:typeof n.type=="string"?e[n.type]||AC[n.type]||$i:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var Ms=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((R,v)=>{let w=R.maxSize??r??void 0,P=R.minSize??o??void 0;s.push(P),u.push(w),R.size!=null&&(w!=null&&R.size>w&&(R.size=w),P!=null&&R.size<P&&(R.size=P));let x=R.flex==0?null:R.flex;if(R.size==null&&x==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;x!=null&&(l+=1),a+=x??0,i+=R.size??0});let c=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,v)=>{if(R.flex!=null){let w=d*R.flex,P=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=!1,D=0;P!=null&&w>P&&(p[v]=!0,M=!0,D=P),x!=null&&w<x&&(f[v]=!0,M=!0,D=x),M&&(m+=1,l-=1,a-=R.flex,c-=D)}}),m&&(d=c/a);let g=[],h=0,S=c,y=a,C=0,b=0,I=[];return{items:t.map((R,v)=>{let w={...R},P=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=0,D=p[v],E=f[v],L=D||E,V=R.size??0;if(R.flex!=null){if(L)E&&(M=x),D&&(M=P);else{h+=1;let N=k=>(P!=null&&k>P&&(k=P),x!=null&&k<x&&(k=x),k);h===l?M=N(S):(M=N(Math.round(R.flex*d)),b+=M,S=c-b,y-=R.flex,d=S/y)}V=M,w.flexSize=M}return g.push(M),I.push(V),w.computedSize=V,C+=V,w}),flexSizes:g,minSizes:s,maxSizes:u,computedSizes:I,remainingSize:Math.round(e-C)}};function Yi(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}function pp(n,e,t){let o=!1,r=0;for(let i of n)i.computedFlex&&(o=!0),r+=i.computedWidth;return o&&Math.round(r)>Math.round(e-t)}function xs(n,e){return n.computedFlex&&!e?"flex":"width"}function Gr(n,e,t){if(e==="width"){let{flex:o,...r}=n??{};return{...r,width:t}}return{...n,flex:t}}var Es=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((x,M)=>(x[M]={...n.columnSizing[M]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],u=l.id,c=s?.id,d=pp(n.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=xs(l,d),h=s?.computedWidth,S=s?.computedMinWidth,y=s?.computedMaxWidth,C=s?xs(s,d):"width",b=!1,I=!1,T=r>0?1:-1,{value:R,clamped:v,diff:w}=Yi(Math.round(p+r),f,m,T);if(n.shareSpaceOnResize){if(s==null)return o[u]=Gr(o[u],g,R),I=v==="min",b=v==="max",{adjustedDiff:R-p,reservedWidth:t,columnSizing:o,minReached:I,maxReached:b,constrained:I||b};let{value:x,clamped:M,diff:D}=Yi(Math.round(h-r),S,y,T);if(v&&M&&(Math.abs(w)>Math.abs(D)?M=!1:v=!1),!(!v&&!M)){if(v){let E=Yi(Math.round(h-r-w),S,y,T);x=E.value,M=E.clamped,D=E.diff}else if(M){let E=Yi(Math.round(p+r+D),f,m,T);R=E.value,v=E.clamped,w=E.diff}}o[u]=Gr(o[u],g,R),o[c]=Gr(o[c],C,x),I=v==="min"||M==="min",b=v==="max"||M==="max"}else o[u]=Gr(o[u],g,R),I=v==="min",b=v==="max";let P=R-p;return{adjustedDiff:P,reservedWidth:n.shareSpaceOnResize?t:Math.round(t-P),columnSizing:o,minReached:I,maxReached:b,constrained:I||b}};function dp(n,e){return n+e}function _C(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var fp=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((y,C)=>(y[C]={...n.columnSizing[C]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((y,C)=>n.dragHandlePositionAfter-C).reverse(),a=i.map(y=>n.items[y]),l=a.map(y=>y.computedWidth),s=pp(n.items,e,t),u=a.map(y=>xs(y,s)),c=0,{computedSizes:d}=Ms({items:a.map(y=>(y.resizable===!1&&(c+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(dp,0)+r-c,0)}),p=a.map((y,C)=>d[C]-y.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((y,C)=>{let b=a[C];if(!b.resizable){h.push(0);return}let I=u[C],T=l[C],R=_C(o),{maxReached:v,minReached:w,constrained:P,adjustedDiff:x}=Es({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[C],shareSpaceOnResize:!1,items:n.items,columnSizing:R});o[b.id]=Gr(R[b.id],I,Math.round(T+x)),h.push(x),v||(m=!1),w||(f=!1),P||(g=!1)});let S=h.reduce(dp,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:S,columnSizing:o,reservedWidth:Math.round(t-S)}};var qi;function Qt(){if(qi!=null)return qi;let n=Fe().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),qi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),qi}var mp=["start",void 0,"end"],gp=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:mp.indexOf(r)-mp.indexOf(i)}),n);function hp(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function As(n,...e){return hp(t=>t!=null,n,...e)}function yp(n,e,...t){return hp((o,r)=>!(r in n),e,...t)}var Xi=!0,OC=!0,FC=!0,Sp="string",mn="unknown";var NC=An("getComputedVisibleColumns"),LC=(n,e,t)=>n[t]!==!1,_s=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1};function so(n,e){if(n)return n[e]?n[e]:Object.values(n).find(t=>t.field===e)}function kC(n,e){let t=Yo(n,e);return n.sortType?n.sortType:t.sortType?t.sortType:typeof n.type=="string"?n.type:Sp}function zC(n,e,t){let r=(Array.isArray(n)?n:n?[n]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[mn];let l=so(e,a);if(!l)return[mn];let s=kC(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===mn)?mn:r.length===1?r[0]:r}function Os(n,e){let{colType:t,sortable:o,columnDefaultSortable:r}=e,i=n.defaultSortable??t.defaultSortable,a=!!n.groupByForColumn;if(i==null&&!a){let l=n.field??t.field,s=n.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return o??i??r??Xi}var bp=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,pinnedStartMaxWidth:c,pinnedEndMaxWidth:d,filterValue:p,sortable:f,sortInfo:m,multiSort:g,filterTypes:h=zn,viewportReservedWidth:S,resizableColumns:y,draggableColumns:C,columnDefaultDraggable:b,columnOrder:I,columnPinning:T,editable:R,columnDefaultEditable:v,columnDefaultFilterable:w,columnDefaultGroupable:P,columnDefaultSortable:x,columnSizing:M,columnTypes:D,columnVisibility:E,columnVisibilityAssumeVisible:L,groupBy:V})=>{let N=0,k={};V.forEach((G,J)=>{G.field&&(k[G.field]=J)});let F=(p||[]).reduce((G,J)=>{let{id:me,field:Ce}=J;return Ce&&(G[Ce]=J),me&&(G[me]=J),G},{}),W=gp(I===!0?Object.keys(n):I,T),Y=W.filter(G=>n[G]?LC(E,L,G):(NC(`Column with id "${G}" specified in columnOrder array cannot be found in the columns map.`),!1)),_=new Map,K=Y.map((G,J)=>{let me=n[G];return _.set(G,J),me}),z=(m??[]).reduce((G,J,me)=>(J.id?G[J.id]={sortInfo:J,index:me}:J.field&&(G[J.field]={sortInfo:J,index:me}),G),{});function Q(G){let J=n[G],me=Yo(J,D),Ce={minWidth:me?.minWidth,maxWidth:me?.maxWidth,width:me?.defaultWidth,flex:me?.defaultFlex},st={width:J?.defaultWidth,flex:J?.defaultFlex,minWidth:J?.minWidth,maxWidth:J?.maxWidth},le=M[G];le?.width!=null&&le.flex==null&&delete st.flex,le?.flex!=null&&le.width==null&&delete st.width;let Ye=As(st,le);Ye.width!=null&&delete Ce.flex,Ye.flex!=null&&delete Ce.width,Ye=As(Ce,Ye);let Z=Ye.flex??void 0,ie=Ye.minWidth??J?.minWidth??o,Ae=Ye.maxWidth??J?.maxWidth??r,ut=Z!=null?void 0:Ye.width??(a?void 0:i);return!ut&&Z==null&&(a?Z=a:ut=ie),{size:ut,flex:Z,minSize:ie,maxSize:Ae}}let Te=Ms({availableSize:Math.max(t.width-(S??0)-(l??Qt()),0),maxSize:r,minSize:o,items:Y.map(Q)}),{computedSizes:ue,flexSizes:fe,minSizes:De,maxSizes:xe}=Te,de=[],ne=[],se=[],he=[];he.length=Y.length;let U=new Map,te=new Map,B=0,ae=0,oe=0,re=null,O=[],A=0,ce=0,Re=0;K.forEach((G,J)=>{let me=Y[J],Ce=ue[J],st=O[J]=_s(me,T);st==="start"?A+=Ce:st==="end"?Re+=Ce:ce+=Ce});let Se=t.width-Re,be=[],Me=new Map;Y.forEach((G,J)=>{let me=K[J];Me.set(G,me)});let et=[];Object.keys(n).forEach(G=>{let J=n[G];et.push(G),Me.has(G)||Me.set(G,J)});let tt=new Map;Me.forEach((G,J)=>{let me=_.get(J);me==null&&(me=-1);let Ce=me!=-1,st=Y[me+1],le=Yo(G,D),Ye=me,Z=z[J]?z[J]:G.field?z[G.field]??null:null,ie=Z?.sortInfo??null,Ae=!!ie,ut=Ae&&ie.dir===1,Ct=Ae&&!ut,Mn=Z?.index??-1,ns=Ce?{}:Q(J),zc=Ce?ue[me]:ns.size||0,$T=Ce&&fe[me]||null,YT=Ce?De[me]||0:ns.minSize||0,qT=Ce?xe[me]||1e4:ns.maxSize||1e4,At=Ce?_s(J,T):!1,Vc=Ce?me===Y.length-1:!1,Mi=Ye,XT=Ce?At==="start"?ae:At==="end"?oe:N-ae:0;At=="start"?Mi=Ce?Ye:-1:At==="end"?Mi=Ce?Ye-(de.length+se.length):-1:Mi=Ce?Ye-de.length:-1;let ZT=Ce?At==="start"||At===!1?N:Se+oe:-1,QT=Ce?At!==re:!1,JT=Ce?Vc||At!==_s(st,T):!1,Gc=G.cssEllipsis??le.cssEllipsis??s,eC=G.headerCssEllipsis??le.cssEllipsis??G.cssEllipsis??le.headerCssEllipsis??u??Gc,Ei=Ce&&(F[J]||G.field||G.groupByForColumn)&&(F[J]||F[G.field||G.groupByForColumn])||null,tC=G.defaultFilterable??le.defaultFilterable??w??!0,nC=R??G.defaultEditable??le.defaultEditable??v??!1,os=G.dataType||le.dataType||(Array.isArray(G.type)?G.type[0]:G.type)||Sp,oC=G.sortType||le.sortType||os,Hc=G.filterType||le.filterType||os,Kc=!1;if(Ei!=null&&!Ei.disabled){let is=h[Hc];is&&(!is.emptyValues||!is.emptyValues.includes(Ei.filter.value))&&(Kc=!0)}let zo=G.field??le.field,rC=G.valueGetter??le.valueGetter,rs=G.defaultGroupable??le.defaultGroupable??P??!!zo;zo||(rs=!1),G.groupByForColumn&&(rs=!1);let Bc=zo?k[zo]!==void 0:!1,iC=Bc?k[zo]:void 0,aC=Os(G,{colType:le,sortable:f,columnDefaultSortable:x}),lC=G.resizable??le.resizable??y??OC,Qe={colType:le,align:le.align,headerAlign:le.headerAlign,computedVisible:Ce,verticalAlign:le.verticalAlign,defaultHiddenWhenGroupedBy:le.defaultHiddenWhenGroupedBy,valueGetter:rC,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:zo,...G,components:{...le.components,...G.components},computedResizable:lC,computedMinWidth:YT,computedMaxWidth:qT,computedFlex:$T,computedDataType:os,computedEditable:nC,computedSortType:oC,computedFilterType:Hc,cssEllipsis:Gc,headerCssEllipsis:eC,computedFilterValue:Ei,computedFiltered:Kc,computedFilterable:tC,computedGroupable:rs,computedGroupedBy:Bc,computedGroupedByIndex:iC,computedWidth:zc,computedAbsoluteOffset:ZT,computedPinningOffset:XT,computedVisibleIndexInCategory:Mi,computedOffset:N,computedSortable:aC,computedSortInfo:ie,computedSortIndex:Mn,computedMultiSort:g,computedSorted:Ae,computedSortedAsc:ut,computedSortedDesc:Ct,computedVisibleIndex:Ye,computedPinned:At,computedDraggable:C??G.defaultDraggable??b??FC,computedFirstInCategory:QT,computedLastInCategory:JT,computedFirst:me===0,computedLast:Vc,id:J,header:G.header??le.header??G.name??G.field};Ce&&(N+=zc,U.set(Qe.id,Qe),he[me]=Qe,At==="start"&&(de.push(Qe),ae+=Qe.computedWidth),At==="end"&&(ne.push(Qe),oe+=Qe.computedWidth),At||(se.push(Qe),B+=Qe.computedWidth),re=At),Qe.groupByForColumn&&(Qe.computedSortType=G.sortType||le.sortType||zC(Qe.groupByForColumn,e,D),be.push(Qe)),te.set(Qe.id,Qe),Qe.field&&!Qe.groupByForColumn&&!tt.has(Qe.field)&&tt.set(Qe.field,Qe)}),be.forEach(G=>{G.computedSortable=Tp(G,{fieldsToColumn:tt,userColumns:e,columnTypes:D,sortable:f,columnDefaultSortable:x})});let We=new Map;et.forEach(G=>{let J=te.get(G);J&&We.set(G,J)}),te.forEach(G=>{We.has(G.id)||We.set(G.id,G)});let lt=c!=null?Math.min(c,ae):ae,Xe=d!=null?Math.min(d,oe):oe;return{computedRemainingSpace:t.width-(A+Re+ce),computedPinnedStartColumnsWidth:ae,computedPinnedEndColumnsWidth:oe,computedUnpinnedColumnsWidth:B,computedColumnOrder:W,computedPinnedStartColumns:de,computedPinnedEndColumns:ne,computedUnpinnedOffset:ae,computedPinnedEndOffset:ae+B,computedUnpinnedColumns:se,computedVisibleColumns:he,computedColumnsMap:te,computedColumnsMapInInitialOrder:We,computedVisibleColumnsMap:U,computedPinnedEndWidth:Xe,computedPinnedStartWidth:lt,renderSelectionCheckBox:he.reduce((G,J)=>G||!!J.renderSelectionCheckBox,!1),fieldsToColumn:tt}};function Tp(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=n.defaultSortable??n.colType.defaultSortable;if(l!=null)return l;let s=r??Xi,u=n.sortType??n.colType.sortType;return u!=null&&u!==mn&&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 C=o.get(S),b=C?f.getColumnApi(C.id):void 0;if(C&&b)y=b.isSortable();else{let I=so(i,S);if(I){let T=Os(I,{colType:Yo(I,a??{}),sortable:t,columnDefaultSortable:r});y=typeof T=="boolean"?T:void 0}else y=!1}}return y===void 0&&h.valueGetter&&(y=!0),y??r??Xi},!0)}}function St(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},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 Cp(n,e,t){let{api:o,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,u=i(),{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=u,f=r(),m=St(n.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});return{horizontalLayoutPageIndex:null,column:n,columnApi:m,dataSourceApi:s,renderLocation:t,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:o,renderBag:{header:n.name||n.id||""}}}function qo(n,e,t,o){let r=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,i=r.header;if(typeof i=="function"){let a=Cp(r,e,t),l=i(a)??null;return o?o(l,a):l}return i?o?o(i,Cp(r,e,t)):i:r.name||r.id||""}var Ip=H(require("react"));var Vn=`${at}HeaderCell__filter`,Zi=`${at}HeaderCell__filterOperator`,mE=`${Vn}__input`;var Fs=Ip.createContext(null);var Ls=require("react");var Rp=require("react"),Ns;function Hr(){return Ns||(Ns=(0,Rp.createContext)(null))}function wp(n){let e=Hr(),t=(0,Ls.useContext)(e);return Lr(t,n)}function ee(n){let e=Hr(),t=(0,Ls.useContext)(e);return Go(t,n)}function ze(){return ee(n=>({getState:n.getState,actions:n.actions,getComputed:n.getComputed,getDataSourceState:n.getDataSourceState,dataSourceApi:n.dataSourceApi,dataSourceActions:n.dataSourceActions,api:n.api,getDataSourceMasterContext:n.getDataSourceMasterContext}))}var VC=`${Vn}__input`,Qi=n=>n.stopPropagation();function vp(n){let{filterOperatorMenuVisibleForColumnId:e}=ee(c=>({filterOperatorMenuVisibleForColumnId:c.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Kr(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=(0,uo.useState)(!1),l=pt.useCallback(()=>{a(!0)},[]),s=pt.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return pt.createElement("div",{onPointerUp:Qi,onPointerDown:Qi,onFocus:l,onBlur:s,className:`${Vn} ${Ds({active:u})}`,style:{height:n.columnHeaderHeight}},pt.createElement(Fs.Provider,{value:n},pt.createElement(r,null),pt.createElement(o,null)))}function Pp(){let{columnApi:n,disabled:e,operator:t}=Xo(),o=t?.components?.Icon??$o;return pt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:$(Zi,ep,e?`${Zi}--disabled`:"")},pt.createElement(o,{size:20,className:`${tp({disabled:e})}`}))}function Dp(){return pt.createElement("div",{onPointerUp:Qi,onPointerDown:Qi,className:`${Vn} ${Ds({active:!1})} ${Td["50%"]}`})}function Xo(){let n=ze(),{column:e,columnApi:t}=Kr(),o=qo(e,n,"column-filter"),r=pt.useContext(Fs),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=(0,uo.useState)(l?.filter.value??""),[d,p]=(0,uo.useState)(0);(0,uo.useEffect)(()=>n.getState().pendingColumnFilters.onCancel(e.id,()=>p(y=>y+1)),[e.id]);let f=pt.useCallback(y=>{c(y),r.onChange(y)},[r.onChange]),m=pt.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),g=pt.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);(0,uo.useEffect)(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let y=[...s.emptyValues][0];y!==u&&c(y)}},[l?.filter.value,d]);let h=r.operator,S=h?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:S,operator:h,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:f,clearValue:m,removeColumnFilter:g,ariaLabel:`Filter for ${o}`,className:`${Qd} ${VC}`}}function Zo(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Xo();return ks.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function Ji(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Xo();return ks.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}var Jt=(n,e)=>{let t=n?.[e];return t?{components:{Icon:t}}:{}};function xp(n={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:o}=n;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Jt(o,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Jt(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Jt(o,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Jt(o,"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",...Jt(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Jt(o,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Jt(o,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Jt(o,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Jt(o,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Jt(o,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var zn=xp({StringFilterEditor:Zo,NumberFilterEditor:Ji,icons:{includes:Fd,eq:Ld,neq:Hd,startsWith:Kd,endsWith:Nd,gt:zd,gte:kd,lt:Gd,lte:Vd}});function ea(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected===null?r.push(...e.map(l=>`${l}--row-partially-selected`)):o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.focused&&r.push(...e.map(l=>`${l}--focused`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var or=require("react"),Of=require("react-dom");function Gn(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function Mp(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}var X={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 ta="true",pe={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)"}}},Ep="column-header-height";var Ap=`.${Ve.rootClassName}`;function zs(n){return Gn(n,Ap)}var _p=q(X.scrollLeft),GC=q(X.scrollTop),HC=q(X.columnWidthAtIndex),Vs=q(X.columnOffsetAtIndex),Op=q(X.columnReorderEffectDurationAtIndex),KC=q(X.columnOffsetAtIndexWhileReordering),BC=q(X.columnVisibilityAtIndex),WC=q(X.columnZIndexAtIndex);function en(n,e,t){let o=t?zs(t):document.querySelector(Ap);jC(n,e,o)}function jC(n,e,t){if(t){let o=n,r=X[o]?q(X[o]):n;t.style.setProperty(r,`${e}`)}}function Qo(n,e){if(e)for(var t in n){let o=X[t]?q(X[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function Gs(n,e,t){en(`${Vs}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${_p}))`:`${n.computedAbsoluteOffset+e}px`,t)}function Hs(n,e,t){en(`${WC}-${n}`,`${e}`,t)}function Br(n,e,t){en(`${KC}-${n}`,typeof e=="number"?`calc( var(${Vs}-${n}) + ${e}px )`:e,t)}function Wr(n,e,t){en(`${BC}-${n}`,e,t)}function na(n,e,t){en(`${Op}-${n}`,t??"",e)}function Ks(n,e){let t=`${Op}-${n}`;en(t,pe.components.Cell.reorderEffectDuration,e)}var we={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${HC}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,en(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Vs}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,en(this.varName.get(n),e,t)}}};function Fp(n,e){Qo({[_p]:`${n.scrollLeft}px`,[GC]:`${n.scrollTop}px`},e)}var Np="_16lm1iw1",Lp="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",kp="_1yeub2vs",zp="_1yeub2vr",Vp=ge({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 Bs="_1yeub2vp";var uA=ge({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Yp=require("react");var jr={bodyWidth:{name:q(pe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:q(pe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:q(pe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:q(pe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:q(pe.runtime.browserScrollbarWidth),value:""}},UC=q(X.scrollbarWidthHorizontal),Gp=q(X.scrollbarWidthVertical),$C=q(X.columnWidthAtIndex),YC=q(X.columnZIndexAtIndex),Hp=q(X.scrollLeft),qC=q(X.activeCellColWidth),Kp=q(X.activeCellColOffset),Up=q(X.baseZIndexForCells),XC=q(X.pinnedStartWidth),Bp=q(X.bodyWidth),ZC=q(X.bodyHeight),Wp=q(X.pinnedEndOffset),jp=q(X.pinnedEndWidth),QC=q(X.computedVisibleColumnsCount);function oa(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${Up}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function $p(n){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:o,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:u,scrollbars:c}=n,d=Qt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[we.columnWidths.varName.get(h)]=g.computedWidth+"px",m[we.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Hp}) )`:g.computedPinned==="end"?`calc( var(${Wp}) ${p.length?"+":""} ${p.map(y=>we.columnWidths.get(y.computedVisibleIndex)).join(" + ")} + var(${Hp}) )`:`${g.computedOffset}px`;let S=oa(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${YC}-${h}`]=`${S}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[jr.browserScrollbarWidth.name]=`${Qt()}px`),f[jr.bodyWidth.name]=`calc(${X.bodyWidth} - ${X.scrollbarWidthVertical})`,f[jr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[jr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${$C}-${g})`).join(" + ")})`,f[jr.visibleColumnsCount.name]=e.length,s!=null){f[qC]=we.columnWidths.get(s[1]);let m=we.columnOffsets.get(s[1]);if(u.isHorizontalLayoutBrain){let g=u.getPageIndexForRow(s[0]);f[Kp]=g?`calc( ${pe.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[Kp]=m}return f[QC]=e.length,f[UC]=c.horizontal?`${d}px`:"0px",f[Gp]=c.vertical?`${d}px`:"0px",f[XC]="calc( "+t.map(m=>we.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[jp]="calc( "+o.map(m=>we.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Up]=e.length*10,f[Wp]=`calc( var(${Bp}) - var(${jp}) - var(${Gp}) )`,f[Bp]=`${l.width}px`,f[ZC]=`${l.height}px`,f}var Ws=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};function qp(n){let{actions:e,getState:t,focused:o,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:u,onSelfBlur:c,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedVisibleColumns:y,computedUnpinnedColumnsWidth:C,scrollbars:b,focusedClassName:I,focusedWithinClassName:T,computedPinnedStartOverflow:R,computedPinnedEndOverflow:v,focusedStyle:w,focusedWithinStyle:P,brain:x}=ee(F=>{let{state:W,computed:Y}=F;return{brain:W.brain,actions:F.actions,getState:F.getState,focused:W.focused,focusedWithin:W.focusedWithin,domRef:W.domRef,scrollerDOMRef:W.scrollerDOMRef,onBlurWithin:W.onBlurWithin,onFocusWithin:W.onFocusWithin,onSelfFocus:W.onSelfFocus,onSelfBlur:W.onSelfBlur,bodySize:W.bodySize,activeCellIndex:W.activeCellIndex,wrapRowsHorizontally:W.wrapRowsHorizontally,computedPinnedStartColumnsWidth:Y.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:Y.computedPinnedEndColumnsWidth,computedPinnedStartColumns:Y.computedPinnedStartColumns,computedPinnedEndColumns:Y.computedPinnedEndColumns,computedVisibleColumns:Y.computedVisibleColumns,computedUnpinnedColumnsWidth:Y.computedUnpinnedColumnsWidth,scrollbars:Y.scrollbars,focusedClassName:F.state.focusedClassName,focusedWithinClassName:F.state.focusedWithinClassName,computedPinnedStartOverflow:Y.computedPinnedStartOverflow,computedPinnedEndOverflow:Y.computedPinnedEndOverflow,focusedStyle:F.state.focusedStyle,focusedWithinStyle:F.state.focusedWithinStyle}}),M=(0,Yp.useMemo)(()=>$p({computedVisibleColumns:y,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:C,bodySize:d,activeCellIndex:p,brain:x,scrollbars:b}),[y,h,S,m,g,C,d,p,x,b]),D=Ws(F=>{e.focused=F}),E=Ws(F=>{e.focusedWithin=F}),N={...n,onFocus:F=>{if(n?.onFocus?.(F),F.target===i.current||F.target===a.current){if(t().focused)return;D(!0),u?.(F),r&&(E(!1),l?.(F));return}r||(E(!0),s?.(F))},onBlur:F=>{if(n?.onBlur?.(F),F.target===i.current||F.target===a.current){if(!t().focused)return;D(!1),c?.(F),r&&(E(!1),l?.(F));return}i.current?.contains(F.relatedTarget)||(E(!1),l?.(F))}},k=$(tn,Lp,f?`${tn}--horizontal-layout`:null,N?.className,m?`${tn}--has-pinned-start ${zp}`:null,g?`${tn}--has-pinned-end ${kp}`:null,o?`${tn}--focused`:null,r?`${tn}--focused-within`:null,o&&I?I:null,r&&T?T:null,R?`${tn}--has-pinned-start-overflow`:null,v?`${tn}--has-pinned-end-overflow`:null,Vp({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:o,focusedWithin:r}));return N.className=k,N.style={...n?.style,...M},o&&w&&Object.assign(N.style,w),r&&P&&Object.assign(N.style,P),N}var af=H(co());function ra(n){return n.map(e=>e instanceof Hn?e:new Hn(null,[e]))}var Hn=class n{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new n("+",[this,...e])}subtract(...e){return new n("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new n("*",[this,...e])}divide(...e){return new n("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>JC(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function JC(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var eI=(...n)=>new Hn("+",ra(n)),Zp=(...n)=>new Hn("-",ra(n)),tI=(...n)=>new Hn("*",ra(n)),nI=(...n)=>new Hn("/",ra(n)),Ur={add:eI,subtract:Zp,minus:Zp,multiply:tI,divide:nI};var po=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var Ke=Fe().requestAnimationFrame||(n=>setTimeout(n,16)),Wt=Fe().cancelAnimationFrame||(n=>clearTimeout(n));var Qp=n=>{let e=null,t=null;return{stop(){e!==null&&Wt(e),t!=null&&Wt(t)},scroll(o){e!==null&&Wt(e),t!=null&&Wt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft-p,e=Ke(()=>{i.scroll(o)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft+p,t=Ke(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var je=class n{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new n(e)}static from(e){return new n(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function Jp(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function ef(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function oI(n,e,t){let o=Jp(n,t),r=Jp(e,t);return o===r?ef(t,e)-ef(t,n):o-r}function tf(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>oI(o,r,t)),e}function rI(n){if(n.length<2)return!1;let e=n[0].left,t=n[0].top,o={left:!1,top:!1};for(let r=1,i=n.length;r<i;r++){if(o.left&&o.top)return!1;n[r].left!==e&&(o.left=!0),n[r].top!==t&&(o.top=!0)}return!(o.left&&o.top)}function iI(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=tf(n);let t=n[0],o=n[n.length-1];return t.left===o.left?e.left===t.left&&e.top>=Math.min(t.top,o.top)&&e.top<=Math.max(t.top,o.top):e.top===t.top&&e.left>=Math.min(t.left,o.left)&&e.left<=Math.max(t.left,o.left)}function nf(n,e){if(rI(n))return iI(n,e);n=tf(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(aI([t,i,a],e))return!0}return!1}function aI(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var Jo=class{containsPoint(e){return nf(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var er=class n extends Jo{static clone(e){return new n(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 lI(n,e){let t=Math.min(n.left,e.left),o=Math.min(n.top,e.top),r=n.left+n.width,i=e.left+e.width,a=Math.max(r,i),l=n.top+n.height,s=e.top+e.height,u=Math.max(l,s);return new _e({top:o,left:t,width:a-t,height:u-o})}var _e=class n extends Jo{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 n(t)}static clone(t){return new n(t)}static from(t){return n.clone(t)}static fromPoint(t){return n.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let o=this;for(let r of t)o=lI(o,r);return o}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 er(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 js;function sI(){if(typeof document>"u"||!document.body)return 1/0;let n=document.createElement("div");n.style.cssText="position:absolute;top:0;left:0;width:1px;visibility:hidden;pointer-events:none",document.body.appendChild(n);let e=o=>(n.style.height=`${o}px`,Math.abs(n.getBoundingClientRect().height-o)<1),t=1e6;if(!e(t))return n.remove(),1/0;for(;t<64e6&&e(t*2);)t*=2;return n.remove(),t}function ia(){return js===void 0&&(js=sI()),js}function aa(n){return n<=4e6?!1:n>ia()}function Us(n,e){if(!aa(n))return 1;let t=ia()-e,o=n-e;return t>0&&o>0?o/t:1}function of(n){let e=null;return{get value(){let t=n.getScrollPosition(),o=n.getScrollRatio();return o>1&&e!==null&&Math.abs(e-t)<=o?e:(e=null,t)},set value(t){e=t,n.setScrollPosition(t)}}}function $s(n,e,t=Math.floor){return Math.abs(n-e)<=1e6?e:t(n)}var rf=10,uI=q(X.pinnedStartWidth);function lf(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,groupingToolbarDragListId:h,api:S,horizontalLayoutPageIndex:y,pageWidth:C}=n;function b(U){let te=U==="start"?F:W;return V===k?te:k===U?te+E.computedWidth:V===U?te-E.computedWidth:te}function I(U){if(U.columnIndex===L||y!=null)return!0;let te=e[U.columnIndex];if(te.computedPinned)return!0;let B=l.getScrollPosition().scrollLeft,ae=te.computedOffset+(y!=null&&C!=null?C*y:0);return ae>=B+b("start")&&ae+te.computedWidth<=B+c.width-b("end")}let T=(U,te)=>{let{restrictToParentGroup:B,dragColumn:ae}=te,oe=[];if(U.forEach(O=>{if(O.computedVisibleIndex===L)return;let A={columnId:O.id,columnIndex:O.computedVisibleIndex,offsetX:O.computedOffset+Math.round(O.computedWidth/2)};I(A)&&oe.push(A)}),B){let A=function(Re,Se,be){let Me=U[Re];Me&&(Me.columnGroup!==ae.columnGroup&&be.add(Me.id),A(Re+Se,Se,be))};var re=A;let O=ae.computedVisibleIndex,ce=new Set;A(O-1,-1,ce),A(O+1,1,ce),oe=oe.filter(Re=>!ce.has(Re.columnId))}return oe},v=r.length,w={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},P={left:w.clientX-c.left-(w.clientX-s.left)+rf,top:w.clientY-c.top-(w.clientY-s.top)+rf},x=l.getScrollPosition(),M=e.map(U=>U.computedVisibleIndex),D=M,E=t.get(i),L=E.computedVisibleIndex,V=E?.computedPinned,N=L,k=V,F=l.getFixedStartColsWidth(),W=l.getFixedEndColsWidth(),Y=w,_={x:0,y:0},K=1,z=0;function Q(U){let te=Math.round(U.clientX),B=Math.round(U.clientY);if(te===Y.clientX&&B===Y.clientY)return _e.from(s).shift({left:_.x,top:_.y});Y={clientX:te,clientY:B};let oe=l.getScrollPosition().scrollLeft-x.scrollLeft;return _.x=Y.clientX-w.clientX,_.y=Y.clientY-w.clientY,z=_.x+oe,K=z<0?-1:1,f({left:P.left+_.x,top:P.top+_.y}),_e.from(s).shift({left:_.x,top:_.y})}function Te(U){let te=0;V?V==="start"&&U.forEach((B,ae)=>{te||e[B]?.computedPinned!=="start"&&(te=ae)}):U.forEach((B,ae)=>{e[B]?.computedPinned==="start"&&(te=ae+1)}),v=te,ue("start",U,te)}function ue(U,te,B){if(U==="start"){let ae=0;for(let oe=0;oe<B;oe++){let re=te[oe],O=e[re];ae+=O.computedWidth}en(uI,`${ae}px`,a)}}function fe(U){if(U==null||U===N)return;if(N===-1&&U!==-1&&(Wr(L,"",a),m(!1)),N=U,U===-1){De(L);return}let te=po(M,L,N>L?N-1:N);v=0;let ae=new Set;return te.forEach((oe,re)=>{let O=D[re];oe!==O&&ae.add(oe),Te(te)}),D=te,xe(ae),{newColumnIndexes:te,indexesWithTransition:ae,pinnedStartCount:v}}function De(U){D=D.filter(B=>B!==U),e.forEach(B=>{let ae=B.computedVisibleIndex,oe=ae>U;Ks(ae,a);let re="";oe&&(re=Ur.minus(we.columnOffsets.get(ae),we.columnWidths.get(U)).done()),Br(ae,re,a)}),Wr(U,"hidden",a),m(!0)}function xe(U){e.forEach(te=>{let B=te.computedVisibleIndex;U.has(B)?Ks(B,a):na(B,a);let ae=B===L,oe=K===-1?B<N||B>L:B<L||B>=N,re="";K===-1?re=ae?we.columnOffsets.get(N):oe?we.columnOffsets.get(B):Ur.add(we.columnOffsets.get(B),we.columnWidths.get(L)).done():re=oe?we.columnOffsets.get(B):ae?Ur.add(we.columnOffsets.get(N-1),we.columnWidths.get(N-1)).minus(we.columnWidths.get(L)).done():Ur.minus(we.columnOffsets.get(B),we.columnWidths.get(L)).done(),Br(B,re,a)})}let de=c.left+b("start"),ne=c.right-b("end"),se=Qp({scrollOffsetStart:de,scrollOffsetEnd:ne}),he=of({getScrollPosition:()=>l.getScrollPosition().scrollLeft,setScrollPosition:U=>{S.scrollLeft=U},getScrollRatio:()=>l.getScrollRatio("horizontal")});return Q(w),{speedScroller:se,stop(){se.stop()},onMove(U){let te=Q(U);if(g().dropTargetListId===h||p&&!d.containsPoint(te.getCenter()))return p&&fe(-1),null;se.scroll({mousePosition:Y,get scrollLeft(){return he.value},set scrollLeft(A){he.value=A}});let B=T(e,{dragColumn:E,restrictToParentGroup:u==="group"}),ae=K===-1?E.computedOffset+z:E.computedOffset+E.computedWidth+z,oe=(0,af.default)(B,ae,({offsetX:A},ce)=>A<ce?-1:A>ce?1:0);oe<0&&(oe=~oe),B.length?oe=B[oe]?B[oe].columnIndex:B[B.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),oe=0),oe===L+1&&(oe=L),fe(oe);let re={};o.forEach(A=>{re[A.id]="end"});for(let A=0;A<v;A++){let ce=D[A],Re=e[ce];re[Re.id]="start"}let O=D.map(A=>e[A].id);return{columnPinning:re,columnOrder:O}}}}var wt=`${at}HeaderCell`,$r=`${at}HeaderWrapper`,sf=n=>Array.from(n.querySelectorAll(`.${$r}`));function la(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((c,d)=>{let p=c.id,f=n[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let S={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],S);let y=c.columnGroup,C,b=S;for(;y;){let I=e[y];if(I){g.add(y);let T=[p,...g];C=h.has(y)?i.get(y):void 0,C||(C={id:y,type:"group",ref:I,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:S.computedPinned,depth:t.get(y)??0},r.set(T,C),i.set(y,C)),C.columnItems.push(S),C.uniqueGroupId.push(S.id),b&&!h.has(b.id)&&C.children.push(b),b=C,y=I.columnGroup}else break}});let l=[],s=new j,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&uf(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=o+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function uf(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&uf(t.children),e+=o})}var cf=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),sa=n=>Array.from(n.querySelectorAll(cf)).filter(t=>!!t.offsetParent),ua=n=>n.querySelector(cf);var da=`${at}HeaderGroup`,pf=`.${Vn}`,cI=["input","select","textarea","button","a[href]","[tabindex]"].join(", "),ff=`.${$r}`,qs=`.${at}`,pa=new WeakMap;function fo(n){return n.getState().domRef.current}function tr(n){let e=fo(n);return e?Array.from(e.querySelectorAll(ff)).find(o=>o.closest(qs)===e)??null:null}function mf(n,e){if(!(e instanceof Element))return!1;let t=e.closest(ff);return!!t&&t.closest(qs)===fo(n)}function Kn(n){let e=n.getState(),{computedVisibleColumns:t}=n.getComputed(),o=!!e.computedColumnGroups&&Object.keys(e.computedColumnGroups).length>0,r=o?e.columnGroupsMaxDepth+2:1,i=t.length,a=o?la(t,e.computedColumnGroups,e.columnGroupsDepthsMap,e.columnGroupsMaxDepth):null,l=u=>{if(u.type==="column"){let d=u.ref.computedVisibleIndex;return{type:"column",key:u.ref.id,columnId:u.ref.id,firstCol:d,lastCol:d}}let c=u.columnItems.map(d=>d.ref.computedVisibleIndex);return{type:"group",key:u.uniqueGroupId.join(","),firstCol:Math.min(...c),lastCol:Math.max(...c)}};return{rowCount:r,colCount:i,itemAt:({row:u,col:c})=>{if(u<0||u>=r||c<0||c>=i)return null;if(!a){let p=t[c];return p?{type:"column",key:p.id,columnId:p.id,firstCol:c,lastCol:c}:null}let d=a.pathsToCells.get([u,c]);return d?l(d):null}}}function df(n,e){let t=tr(n);if(!t)return null;let o=e.type==="column"?`.${wt}[data-column-id="${CSS.escape(e.columnId)}"]`:`.${da}[data-group-id="${CSS.escape(e.key)}"]`;return Array.from(t.querySelectorAll(o)).find(i=>i.closest(qs)===fo(n)&&i.offsetParent!==null)??null}function dI(n,e,t){let o=fo(n),r=o?pa.get(o):void 0,i=t.getAttribute("data-column-id"),a=t.classList.contains(da)?t.getAttribute("data-group-id"):null,l=a??i;if(l==null)return null;if(r&&e.itemAt(r)?.key===l)return r;if(i!=null&&a==null){let s=n.getComputed().computedVisibleColumnsMap.get(i);return s?{row:e.rowCount-1,col:s.computedVisibleIndex}:null}for(let s=0;s<e.rowCount;s++)for(let u=0;u<e.colCount;u++)if(e.itemAt({row:s,col:u})?.key===l)return{row:s,col:u};return null}function Yr(){return new Promise(n=>requestAnimationFrame(()=>n()))}async function _t(n,e,t=Kn(n)){let o=t.itemAt(e);if(!o)return!1;o.type==="column"&&(e={row:t.rowCount-1,col:o.firstCol});let r=fo(n);r&&pa.set(r,e);let i=await gf(n,o,Math.min(Math.max(e.col,o.firstCol),o.lastCol));return i?(i.focus({preventScroll:!0}),!0):!1}async function gf(n,e,t){let o=n.getComputed().computedVisibleColumns[t];o&&o.computedPinned===!1&&n.api.scrollColumnIntoView(o.id);let r=document.activeElement,i=df(n,e);for(let a=0;a<20&&(!i||!fI(n,i));a++){await Yr();let l=document.activeElement;if(l!==r&&l&&l!==document.body)return null;i=df(n,e)}return i}function pI(n,e){let t=n.getComputed().computedVisibleColumns[e];return t?{type:"column",key:t.id,columnId:t.id,firstCol:e,lastCol:e}:null}function qr(n,e){let t=n.getComputed().computedVisibleColumns[e];return!!n.getState().showColumnFilters&&!!t?.computedFilterable}function hf(n){return n?Array.from(n.querySelectorAll(cI)).filter(e=>e.tabIndex>=0&&!e.disabled&&e.offsetParent!==null):[]}async function Xs(n,e,t=Kn(n)){let o=pI(n,e);if(!o)return!1;let r=fo(n);r&&pa.set(r,{row:t.rowCount-1,col:e});let i=await gf(n,o,e),[a]=hf(i?.querySelector(pf)??null);return a?(a.focus({preventScroll:!0}),!0):!1}function yf(n,e,t){let o=n.getComputed().computedVisibleColumns.length;return t===1?e.part==="header"&&qr(n,e.col)?{col:e.col,part:"filter"}:e.col+1<o?{col:e.col+1,part:"header"}:"after":e.part==="filter"?{col:e.col,part:"header"}:e.col<=0?"before":qr(n,e.col-1)?{col:e.col-1,part:"filter"}:{col:e.col-1,part:"header"}}function ca(n,e){if(e==="before")return hI(n);if(e==="after")return n.getState().scrollerDOMRef.current?.focus({preventScroll:!0}),!0;let t=Kn(n);return e.part==="filter"?Xs(n,e.col,t):_t(n,{row:t.rowCount-1,col:e.col},t),!0}function Sf(n){if(!tr(n))return!1;let e=n.getComputed().computedVisibleColumns.length;if(!e)return!1;let t=e-1;return ca(n,{col:t,part:qr(n,t)?"filter":"header"})}function fI(n,e){let t=tr(n);if(!t)return!0;if(getComputedStyle(e).visibility==="hidden")return!1;let o=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.right>o.left+1&&r.left<o.right-1}function bf(n,e){let t=fo(n),o=t?pa.get(t):void 0;return o&&e.itemAt(o)?o:{row:e.rowCount-1,col:0}}function Tf(n,e){if(e.target!==e.currentTarget){If(n,mI(e.target)),e.currentTarget instanceof HTMLElement&&gI(n,e.currentTarget,e.target);return}let t=Kn(n);t.colCount&&_t(n,bf(n,t),t)}function Cf(n,e){let t=e.currentTarget,o=e.relatedTarget;(!(t instanceof Node)||!(o instanceof Node)||!t.contains(o))&&If(n,null)}function mI(n){if(!(n instanceof HTMLElement))return null;if(n.classList.contains(wt)){let e=n.getAttribute("data-column-id");return e!=null?{type:"column",key:e}:null}if(n.classList.contains(da)){let e=n.getAttribute("data-group-id");return e!=null?{type:"group",key:e}:null}return null}function If(n,e){let t=n.getState().focusedHeaderItem;t?.type===e?.type&&t?.key===e?.key||(n.actions.focusedHeaderItem=e)}function Rf(n){let e=n.getState().focusedHeaderItem;if(e?.type!=="column")return()=>{};let t=e.key;return()=>{(async()=>{await Yr();let o=document.activeElement,r=tr(n);if(o&&o!==document.body&&!(r&&r.contains(o)))return;let i=n.getComputed().computedVisibleColumnsMap.get(t);if(!i)return;let a=Kn(n);await _t(n,{row:a.rowCount-1,col:i.computedVisibleIndex},a)})()}}function gI(n,e,t){let r=(t instanceof Element?t.closest(`.${wt}`):null)?.getAttribute("data-column-id"),i=r?n.getComputed().computedVisibleColumnsMap.get(r):null,a=()=>{(e.scrollLeft||e.scrollTop)&&(e.scrollLeft=0,e.scrollTop=0)};a(),i&&i.computedPinned===!1&&n.api.scrollColumnIntoView(i.id),requestAnimationFrame(a)}function wf(n,e){if(!tr(n))return!1;let t=Kn(n);if(!t.colCount)return!1;let o=e??bf(n,t).col;return qr(n,o)?(Xs(n,o,t).then(r=>{r||_t(n,{row:t.rowCount-1,col:o},t)}),!0):(_t(n,{row:t.rowCount-1,col:o},t),!0)}function Ys(n,e){let t=n.getState(),{brain:o,keyboardNavigation:r}=t;if(o.getRowCount()>0){let i=Math.max(0,o.getItemAt(o.getScrollPosition().scrollTop,"vertical"));r==="cell"?n.actions.activeCellIndex=[i,e]:r==="row"&&(n.actions.activeRowIndex=i)}t.scrollerDOMRef.current?.focus({preventScroll:!0})}function hI(n){let e=tr(n);if(!e)return!1;let t=sa(document.body),o=t.indexOf(e),r=o>0?t[o-1]:null;return r?r.focus():document.activeElement?.blur(),!0}function yI(n){if(!(n instanceof HTMLElement))return!1;let e=n.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||e==="BUTTON"||n.isContentEditable}function vf(n,e){let t=e.target;if(!(t instanceof HTMLElement))return!1;let o=t.closest(pf);if(o)return SI(n,o,t,e);if(yI(t)||!(t.classList.contains(wt)||t.classList.contains(da)))return!1;let i=Kn(n),a=dI(n,i,t);if(!a)return!1;let l=i.itemAt(a);if(!l)return!1;if(e.key==="Tab"){let c=e.shiftKey?-1:1;return l.type==="group"&&c===1?ca(n,{col:l.firstCol,part:"header"}):ca(n,yf(n,{col:l.firstCol,part:"header"},c))}let{computedVisibleColumns:s}=n.getComputed();if(e.key==="Enter")return l.type!=="column"?!1:(CI(n,l.columnId,e),!0);if(e.key==="ArrowDown"&&e.altKey){if(l.type!=="column")return!1;let c=t.querySelector('[data-name="menu-icon"]');return n.api.getColumnApi(l.columnId)?.toggleContextMenu(c??t),TI(n,l.columnId,a),!0}if(e.altKey||e.ctrlKey||e.metaKey)return!1;let u=s.length-1;switch(e.key){case"ArrowRight":return l.lastCol<u&&_t(n,{row:a.row,col:l.lastCol+1},i),!0;case"ArrowLeft":return l.firstCol>0&&_t(n,{row:a.row,col:l.firstCol-1},i),!0;case"Home":return _t(n,{row:a.row,col:0},i),!0;case"End":return _t(n,{row:a.row,col:u},i),!0;case"ArrowUp":{let c=a.row-1;for(;c>=0&&i.itemAt({row:c,col:a.col})?.key===l.key;)c--;return c>=0&&_t(n,{row:c,col:a.col},i),!0}case"ArrowDown":{let c=a.row+1;for(;c<i.rowCount&&i.itemAt({row:c,col:a.col})?.key===l.key;)c++;return c<i.rowCount?_t(n,{row:c,col:a.col},i):qr(n,a.col)?Xs(n,a.col,i).then(d=>{d||Ys(n,a.col)}):Ys(n,a.col),!0}}return!1}function SI(n,e,t,o){if(o.defaultPrevented)return!1;if(o.key==="Tab")return bI(n,e,t,o.shiftKey);if(o.key!=="ArrowUp"&&o.key!=="ArrowDown"||o.shiftKey||o.altKey||o.ctrlKey||o.metaKey)return!1;let r=e.closest(`.${wt}`)?.getAttribute("data-column-id"),i=r?n.getComputed().computedVisibleColumnsMap.get(r):null;if(!i)return!1;let a=i.computedVisibleIndex;if(o.key==="ArrowUp"){let l=Kn(n);_t(n,{row:l.rowCount-1,col:a},l)}else Ys(n,a);return!0}function bI(n,e,t,o){let i=e.closest(`.${wt}`)?.getAttribute("data-column-id"),a=i?n.getComputed().computedVisibleColumnsMap.get(i):null;if(!a)return!1;let l=hf(e),s=l.findIndex(d=>d===t||d.contains(t)),u=s<=0,c=s===-1||s===l.length-1;return(o?!u:!c)?!1:ca(n,yf(n,{col:a.computedVisibleIndex,part:"filter"},o?-1:1))}async function TI(n,e,t){let o=()=>n.getState().columnMenuVisibleForColumnId===e;for(let i=0;i<10&&!o();i++)await Yr();for(;o();)await Yr();await Yr();let r=document.activeElement;(!r||r===document.body)&&_t(n,t)}function CI(n,e,t){let o=n.getComputed().computedVisibleColumnsMap.get(e);if(!o||!o.computedSortable)return;let{multiSortBehavior:r}=n.getState();n.api.toggleSortingForColumn(e,{multiSortBehavior:r==="replace"&&(t.ctrlKey||t.metaKey)?"append":r})}function Zs(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],u=o.indexOf(s),c=o.indexOf(r);return po(o,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=o.indexOf(s),c=o.indexOf(r);return po(o,c,u)}return e}var nt=H(require("react"));var mo=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 o=((...r)=>{this.off(e,o),t(...r)});return this.on(e,o)}off(e,t){let o=this.listeners[e];if(!o)return;let r=o.indexOf(t);r!==-1&&o.splice(r,1)}emit(e,...t){let o=this.listeners[e];o&&o.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 Pf=H(co());var Df=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:u,dragIndex:c,dragRectangle:d}=o,p=u===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,Pf.default)(h,S,(R,v)=>R-v);y<0&&(y=~y),m===1&&y===c+1&&p&&y--;let C=Math.min(c,y),b=Math.max(c,y),I=p?i.map((R,v)=>{if(v===c&&p)return t;if(v<C||v>=b)return{left:0,top:0};let w=y<=v?1:-1;return r==="horizontal"?{left:Math.round(w*g.width),top:0}:{left:0,top:Math.round(w*g.height)}}):i.map((R,v)=>{let w=y<=v?1:0;return r==="horizontal"?{left:Math.round(w*g.width),top:0}:{left:0,top:Math.round(w*g.height)}}),T={offset:t,dropIndex:y,dragSourceListId:u,dropTargetListId:a,dragIndex:c,outside:!1,items:i,dragItem:s,offsetsForItems:I,dragRect:g,status:"accepted"};return e.acceptsDrop(T)?{event:T,error:null,success:!0}:(T.status="rejected",{event:T,error:"rejected by interaction target",success:!1})},xf=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:u,listId:c}=o,d=je.from(s.getCenter()),p=c===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?o.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:u,outside:!f,items:l,dragSourceListId:c,dropTargetListId:i,offsetsForItems:p?l.map((S,y)=>S.id===u.id?t:f?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-u.rect.width,top:0}:{left:0,top:-u.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 ve=class ve{static startDrag(e,t){let o=e instanceof nr?e:new nr(e),r=new Qs({activeDragSource:o,startPoint:t});return ve.currentDragOperation=r,r.on("start",ve.onDragStart),r.on("move",ve.onDragMove),r.on("drop",ve.onDragDrop),r.start(),r}static retriggerMove(){let e=ve.currentDragOperation;e&&e.phase==="move"&&ve.onDragMove(e)}static emit(e,...t){ve.emitter.emit(e,...t)}static on(e,t){return ve.emitter.on(e,t)}static registerDragInteractionTarget(e){let{listId:t}=e,o=ve.dragInteractionTargetsMap.get(t);if(o&&o!==e){console.warn(`DragInteractionTarget with listId ${t} already registered`);return}return o||(ve.dragInteractionTargetsMap.set(t,e),ve.emit("register",e)),()=>{ve.unregisterDragInteractionTarget(e)}}static unregisterAll(){ve.dragInteractionTargetsMap.forEach(e=>{ve.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(!e)return;let{listId:t}=e;ve.dragInteractionTargetsMap.get(t)===e&&(ve.dragInteractionTargetsMap.delete(t),e.unregister(),ve.emit("unregister",e))}static onDragStart(e){let{dragItem:t,dragIndex:o}=e.activeDragSource,r=e.activeDragSource.listId,a=ve.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;ve.dragInteractionTargetsMap.forEach(u=>{let c=u.getData();u.start({dragIndex:c.listId===r?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),ve.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:o})}static withDragMove(e,t){let{activeDragSource:o}=e,{listId:r}=o,i=[],a=!0,l=ve.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(ve.dragInteractionTargetsMap.get(r))),ve.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let u=Df(e,s);if(u){t(s,u),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let u=xf(e,s);u&&t(s,u)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];ve.withDragMove(e,(u,{event:c})=>{u.move(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null,s=l?.dropTargetListId??null;ve.emit("drag-move",{dragSourceListId:o,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:o,dragItem:r}=t,i=null,a=[];ve.withDragMove(e,(s,{event:u})=>{e.cancelled&&(u={...u,dropTargetListId:null,dropIndex:-1,outside:!1}),s.drop(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null;ve.emit("drag-drop",{dragSourceListId:o,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),ve.currentDragOperation=null,ve.unregisterAll()}};ve.dragInteractionTargetsMap=new Map,ve.currentDragOperation=null,ve.emitter=new mo;var ft=ve,nr=class n{static clone(e){let t=e.getData();return new n(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){Rt(this.data,e)||(this.data=e,this.dragRectangle=new _e(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=_e.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},Qs=class extends mo{constructor(t){super(t.listeners);this.phase="start";this.cancelled=!1;this.currentOffset={top:0,left:0};this.initialDragSource=nr.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:o}=this.activeDragSource,r={dragSourceListId:t,dragItemId:o.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 o={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=nr.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=ft;var Mf=require("react"),Ef=nt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),gn=()=>nt.useContext(Ef),Af=nt.createContext(""),go=n=>{let e=nt.useContext(Af);return e?`${n}-${e}`:n},fa=n=>{let[e,t]=nt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=nt.useId(),r=nt.useRef(e);r.current=e;let i=nt.useCallback(()=>{let l=r.current;return{dragSourceListId:l.dragSourceListId,dropTargetListId:l.dropTargetListId,dragItemId:l.dragItemId,status:l.status}},[]),a=nt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:i}),[e,t]);return(0,Mf.useEffect)(()=>{let l=ft.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),s=ft.on("drag-move",c=>{let d=r.current,p={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(d)!==JSON.stringify(p)&&t(p)}),u=ft.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{l(),s(),u()}},[ft,t]),nt.createElement(Af.Provider,{value:o},nt.createElement(Ef.Provider,{value:a},typeof n.children=="function"?n.children(a):n.children))};var ma="header",ga="grouping-toolbar";var Js=`${at}Body`,_f=n=>n.querySelector(`.${Js}`);function Xr(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var II=q(X.baseZIndexForCells),RI=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:Rt(n,e)},Ff=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=(0,or.useState)(null),[a,l]=(0,or.useState)(!1),{getCurrentDragSourceAndTarget:s}=gn(),u=go(ga),{getComputed:c,getState:d,api:p,computedDraggable:f,rootRef:m,actions:g}=ee(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:y.state.domRef})),h=(0,or.useCallback)(y=>{let C=c().computedVisibleColumnsMap.get(n);if(!C||!C.computedSortable)return;let{multiSortBehavior:b}=d();p.toggleSortingForColumn(n,{multiSortBehavior:b==="replace"&&(y.ctrlKey||y.metaKey)?"append":b})},[]),S=(0,or.useCallback)(y=>{if(Xr(y.target))return;let{brain:C,draggableColumnsRestrictTo:b}=d(),{computedVisibleColumns:I,computedVisibleColumnsMap:T,computedPinnedStartColumns:R,computedUnpinnedColumns:v,computedPinnedEndColumns:w}=c(),P=T.get(n);if(!P.computedDraggable){h(y);return}let x=e.current,M=x.getBoundingClientRect(),D=m.current.getBoundingClientRect(),E=C.getAvailableSize(),L=P.computedVisibleIndex,V=C.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),N=C.isHorizontalLayoutBrain?C.getPageWidth():null,k=x.style.cursor??"auto",F=!1,W=m.current,Y=_e.from(_f(W).getBoundingClientRect()),_=sf(W).map(de=>_e.from(de.getBoundingClientRect())),K=Y.getMinimumBoundingRectangle(..._),z=lf({brain:C,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:N,draggableColumnsRestrictTo:b,computedPinnedEndColumns:w,computedPinnedStartColumns:R,computedUnpinnedColumns:v,computedVisibleColumns:I,computedVisibleColumnsMap:T,dragColumnHeaderTargetRect:M,dragColumnId:n,getCurrentDragSourceAndTarget:s,groupingToolbarDragListId:u,api:p,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:D,acceptDropToReorderRect:K,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),Q=null,Te,ue;function fe(de){let{columnPinning:ne,columnOrder:se}=de;RI(d().columnPinning,ne)||(g.columnPinning=ne);let he=c().computedColumnOrder;JSON.stringify(se,he)&&(g.columnOrder=Zs({newColumnOrder:se,visibleColumnOrder:c().computedVisibleColumns.map(U=>U.id),existingColumnOrder:he,dragColumnId:n}))}let De=de=>{let{headerBrain:ne,brain:se}=d();if(!F){F=!0;let he=se.keepColumnRendered(V),U=ne.keepColumnRendered(V);if(se.isHorizontalLayoutBrain){let B=se.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ae=ne.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ue=()=>{B(),ae()}}Te=()=>{he(),U()},g.columnReorderDragColumnId=P.id,t!=null&&(g.columnReorderInPageIndex=t),Hs(L,`calc( var(${II}) + 10000 )`,m.current),m.current?.classList.add(Bs),x.style.cursor="grabbing"}Q=z.onMove(de)},xe=de=>{let ne=de.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:se}=d(),he=m.current;he?.classList.remove(Bs),z.stop(),C.update({...E}),Te?.(),ue?.(),x.style.cursor=k,x.hasPointerCapture?.(ne)&&x.releasePointerCapture(ne),x.removeEventListener("pointermove",De),x.removeEventListener("pointerup",xe),i(null);let U=p.getColumnApi(P.id)?.isSortable()??!1;!F&&U&&p.toggleSortingForColumn(P.id,{multiSortBehavior:se==="replace"&&(de.ctrlKey||de.metaKey)?"append":se});let te=Q?Rf({getState:d,getComputed:c,api:p,actions:g}):null;(0,Of.flushSync)(()=>{Q?fe(Q):F&&o&&p.setVisibilityForColumn(P.id,!1),g.columnReorderDragColumnId=!1,t!=null&&(g.columnReorderInPageIndex=null)}),te?.(),I.forEach(B=>{na(B.computedVisibleIndex,he),Wr(B.computedVisibleIndex,"",he),Br(B.computedVisibleIndex,"",he)}),Hs(L,oa(P,{pinnedStartColsCount:R.length,visibleColsCount:I.length}),he)})};x.addEventListener("pointermove",De),x.addEventListener("pointerup",xe),x.setPointerCapture(y.pointerId)},[n,t,u]);return{onPointerDown:f?S:h,dragColumnOutside:a,proxyPosition:r}};var ur=H(require("react"));var Ie=H(require("react")),ke=require("react");var Lf=Symbol("REPAINT_CELLS_KEY_NO_ROW");function kf(n){return typeof n=="function"}function Nf(n,e){let{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(o);if(!a)return Lf;let l=r.getDataSourceStates();return n({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function zf(n,e,t){let o=Nf(n,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=Nf(n,e);r!==Lf&&(Object.is(r,o)||(o=r,t()))})}var Vf="_1eexc2a7 _1eexc2a6",Gf=ge({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"]]}),Hf=ge({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 Kf="_1eexc2a5",ha=ge({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),rr="_1eexc2a8";var ya=H(require("react")),Sa=require("react");var Bf="qz8ht90 _16lm1iwk";function wI(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:vI}=Vt({forwardProps:wI,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function PI(){let{componentState:n,componentActions:e}=Gt(),{checked:t,domProps:o,disabled:r}=n,i=(0,Sa.useRef)(null);return(0,Sa.useEffect)(()=>{i.current.indeterminate=t==null},[t]),ya.createElement("input",{...o,className:$("InfiniteCheckBox",Bf,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function Bn(n){return ya.createElement(vI,{...n},ya.createElement(PI,null))}var DI="*",Ue=class{constructor(e){this.wildcard=DI;this.cache=new j;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(u=>{this.cache.delete(u)}),this.cache.delete(s),o)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){An(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),u=this.deselectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||u?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function Wn(n,e){return e().dataArray[n]}function ba(n){return n().dataArray}var mt=class{constructor(e){this.collapsedPathsMap=new j;this.expandedPathsMap=new j;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var eu=n=>Array.isArray(n)?new j(n.map(e=>[e,!0])):n,xI=(n,e)=>n.length-e.length,Je=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new j;this.cache=new j;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new j})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?eu(e):this.config.treePaths}withTreePaths(e,t){let o=this.config.treePaths;t=this.getTreePaths(t);let r=t!==o;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=o,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(o=>o.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],o){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},o)}getSelectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&o.push(i.keys)})},t),o}getDeselectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||o.push(i.keys)})},t),o}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 n(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:eu(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?eu(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:o,treePaths:r}=this.config;return t!=="visible"||!o||o===r?!1:o.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:o,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{o.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:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){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 o=this.cache.get(e);if(o)return o;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(xI);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,u=0,c=this.getNodeBooleanSelectionStateFromParent(e);c?s+=r:u+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(c?(s-=g,u+=g):(u-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:u})}if(!s&&!u)return this.cacheIt(e,{selected:c,selectedCount:c?r:0,deselectedCount:c?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:u,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.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:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function ar(n,e){return new Je(n,ir(e))}function ir(n){return()=>{let e=typeof n=="function"?n():n,{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}:{treePaths:o??t,multiRowSelectionTarget:r}}}var Ta=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Je))throw"Invalid tree selection";let a=new Je(r,ir(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(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!o)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(o.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),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new mt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new mt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new mt(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new mt(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new mt(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?Wn(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,ir(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,ir(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof 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 tu(n){return n.map(nn)}function nn(n){if(Fe().structuredClone)return Fe().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return tu(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(tu(Array.from(n)));if(n instanceof Map)return new Map(tu(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=nn(n[t]));return e}function Zr(n){return n}var Ca="____not_loaded_yet____";function nu(n){return typeof n=="string"&&n.startsWith(Ca)}var ho=Object.seal({data:null,field:null});var vt="____root____";function jn(){return!1}function ou(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function Ia(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function jf(n,e){let{marker:t,reducers:o={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:u}=n;t&&t.start();let c=new j;function d(S,y,C,b=0,I=[]){let T=!C.length||b===C.length-1,R=y[u?.values||"values"]||{};for(let v in R)if(R.hasOwnProperty(v)){let w=v;I.push(w),p.set(I,!0),S.set(I,{reducerResults:R[v][u?.totals||"totals"]||{},items:[]}),T||d(S,R[v],C,b+1,I),I.pop()}}let p=r?new j:void 0,f=[],m=ou(o),g=nn(m);e.visitDepthFirst((S,y,C,b)=>{let[I,...T]=y,R=S.children,v=c.get(T);if(v&&(v.cache=S.cache,v.childrenLoading=S.childrenLoading,v.childrenAvailable=S.childrenAvailable,v.error=S.error),T.length==i.length&&i.length){if(v){v.items=R;for(let P=0,x=T.length;P<x;P++){let M=T.slice(0,P),D=c.get(M);D&&(D.items=D.items||[],D.items=D.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return b?.()}for(let w=0,P=R.length;w<P;w++){if(!R[w]){let E={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...T,`${Ca}${w}`],E);continue}let x=R[w].data,M=R[w].keys||[];if(M.length){let E=M[M.length-1];T.push(E)}let D={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:R[w].totalChildrenCount,totalChildrenCountUnfiltered:R[w].totalChildrenCountUnfiltered,reducerResults:R[w].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(T,D),r){let E=D.pivotDeepMap=new j,L=R[w].pivot;d(E,L,r,0,f)}M.length&&T.pop()}b?.()});let h={deepMap:c,groupParams:n,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 Wf(n,e,t,o,r,i,a,l,s,u=Zr){let{items:c,reducerResults:d,pivotDeepMap:p}=n.get(e);if(c.push(o),a&&Ia(o,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?o[g]:null;h&&(ho.data=o,ho.field=g,y=h(ho));let C=(S||u)(y,o);t.push(C),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:nn(s),items:[]}));let{reducerResults:b,items:I}=p.get(t);I.push(o),a&&Ia(o,r,a,b,e)}t.length=0}}function Uf(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=n,d=c(r),p=[...o,d],f=s(r);if(t.set(p,!0),f){for(let S=0,y=o.length;S<=y;S++){let C=o.slice(0,S),b=e.get(C),{reducerResults:I,items:T}=b;T.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&Ia(r,i,a,I,C)}return}let m=nn(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:o.length});let h=u(r);if(!(!h||!Array.isArray(h))){for(let S=0,y=h.length;S<y;S++){let C=h[S];Uf(n,e,t,p,C,S,a,l)}a&&Qr(a,m,g)}}function ru(n,e){let{reducers:t,marker:o}=n;if(o){let u=Object.keys(t??{});o.start({details:u.length>0?[{name:"Reducers",value:u.join(", ")}]:void 0})}let r=ou(t),i=nn(r),a=new j,l=new j;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 u=0,c=e.length;u<c;u++)Uf(n,a,l,[],e[u],u,t,r);t&&Qr(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function wa(n,e){let{marker:t,groupBy:o,defaultToKey:r=Zr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new j:void 0,u=new j,c=[],d=[],p=ou(a),f=nn(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:nn(p)};i&&(g.pivotDeepMap=new j),u.set(c,g)}for(let g=0,h=e.length;g<h;g++){let S=e[g],y={};for(let C=0;C<l;C++){let{field:b,groupField:I,valueGetter:T,toKey:R}=o[C],v=b?S[b]:null;T&&(ho.data=S,ho.field=b,v=T(ho));let w=(R||r)(v,S);if(y[b||I]=w,c.push(w),!u.has(c)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:nn(p)};i&&(P.pivotDeepMap=new j),u.set(c,P)}Wf(u,c,d,S,g,i,a,s,p,r)}l||Wf(u,c,d,S,g,i,a,s,p,r),a&&Ia(S,g,a,f,c),c.length=0}a&&(u.visitDepthFirst((g,h,S,y)=>{Qr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:C,reducerResults:b},I,T,R)=>{Qr(a,b,C),R?.()}),y?.()}),Qr(a,f,e));let m={deepMap:u,groupParams:n,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:o.map(g=>g.field).join(", ")}]}),m}function $f(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function MI(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d??null,f;if(Object.keys(u).length>0){p={...d},f={};for(let y in i)if(i.hasOwnProperty(y)){let b=i[y].field;b&&(f[b]=u[y]),b&&p[b]==null&&(p[b]=u[y])}}let m=!0,g=o[o.length-1],h=g;if(p!=null){let y=t[o.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:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:jn,hasSelectedCells:jn,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function Ra(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function Qr(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function Yf(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:u,treeResult:c,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:S}=r,{deepMap:y}=c,C=n.length,b=t[t.length-1],I=b?b.nodeExpanded:!0;for(let T=0;T<C;T++){let R=n[T],v=u(R,T),w=[...e,v];if(l(R)){let V={id:v,nodePath:w,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:jn,hasSelectedCells:jn,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,T],indexInParent:T,indexInAll:I?i.length:-1};p&&(V.rowSelected=p(V)),d&&(V.rowDisabled=d(V)),f&&f(V);let N=h&&S!=null&&S>0&&V.indexInAll%S===0?V.indexInAll/S:null;for(let k=0,F=t.length;k<F;k++){let W=t[k];if(I||(W.collapsedLeafNodesCount+=1),W.deepRowInfoArray.push(V),N!=null&&I){if(typeof h=="function"&&h(W)!==!0)continue;let Y=Ra(W,V.indexInAll,N);i[Y.indexInAll]=Y,V.indexInAll++}}I&&(i[V.indexInAll]=V);continue}let M=y.get(w)?.totalLeafNodesCount??0,D={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:w,id:v,data:R,indexInAll:i.length,indexInParent:T,indexInParentNodes:[...o,T],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:jn,hasSelectedCells:jn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(D.rowSelected=p(D),g)){let V=g.getSelectionCountFor(D.nodePath);D.selectedLeafNodesCount=V.selectedCount,D.deselectedLeafNodesCount=V.deselectedCount}d&&(D.rowDisabled=d(D)),f&&f(D);let E=!0;if(m&&(D.selfExpanded=E=m(D)),I||(E=!1),D.nodeExpanded=E,I&&h&&S!=null&&S>0){let V=D.indexInAll,N=D.parentNodes;if(N.length>0&&V%S===0){let k=V/S,F=0;N.forEach(W=>{typeof h=="function"&&h(W)!==!0||(i.push(Ra(W,V+F,k)),F++,D.indexInAll++)})}}I&&(i[D.indexInAll]=D);let L=s(R);Array.isArray(L)&&Yf(L,w,[...t,D],D.indexInParentNodes,r,i)}return i}function qf(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return Yf(e,[],[],[],n,o),t&&t.end(),{data:o}}function Xf(n){let{marker:e,lazyLoad:t,groupResult:o,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:u,isRowSelected:c,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=n,{groupParams:m,deepMap:g,pivot:h}=o,{groupBy:S}=m;e&&e.start({details:[{name:"Group by fields",value:S.map(T=>T.field).join(", ")}]});let y=[],C=[],b=[],I=[];return g.visitDepthFirst((T,R,v,w)=>{let P=T.items,x=R.length,M=s?.isGroupRowCollapsed(R)??!1;I.push(v);let D=MI({lazyLoad:t,groupBy:S,parents:Array.from(b),reducers:f,indexInGroup:v,indexInParentGroups:Array.from(I),indexInAll:y.length,groupKeys:R,error:T.error,totalChildrenCount:T.totalChildrenCount,childrenLoading:(T.childrenLoading||!M&&!T.childrenAvailable)&&t,childrenAvailable:T.childrenAvailable,directChildrenCount:R.length===S.length?T.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},T);if(c&&(D.rowSelected=c(D),d)){let k=d.getSelectionCountFor(D.groupKeys);D.selectedChildredCount=k.selectedCount,D.deselectedChildredCount=k.deselectedCount}u&&(D.rowDisabled=u(D));let E=b[b.length-1],L=E?.collapsed??!1;L&&(M=!0),D.collapsed=M;let V=p||M;if(L&&(V=!1),V){if(i&&r!=null&&r>0){let k=D.indexInAll,F=D.parents;if(F.length>0&&k%r===0){let W=k/r,Y=0;F.forEach(_=>{typeof i=="function"&&i(_)!==!0||(y.push(Ra(_,k+Y,W)),Y++,D.indexInAll++)})}}y.push(D),C.push(y.length-1)}D.collapsedChildrenCount=0,b.forEach(k=>{k.deepRowInfoArray.push(D),k.collapsedGroupsCount+=M?1:0}),E&&D.selfLoaded&&t&&(E.directChildrenLoadedCount+=1),a&&a(D),b.push(D);let N=!0;if(N){if(w)w();else if(!h){let k=y.length;M||(y.length+=P.length);let F=0;for(let W=0,Y=P.length;W<Y;W++){let _=P[W];if(!M&&i&&r!=null&&r>0){let Te=k+W+F;if(Te%r===0){let ue=Te/r;b.forEach(fe=>{if(typeof i=="function"&&i(fe)!==!0)return;let De=k+W+F;y[De]=Ra(fe,De,ue),F++,y.length++})}}let K=k+W+F,Q={id:_?l(_,K):`${R}-${W}`,data:_,isCellSelected:jn,hasSelectedCells:jn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!_,rowSelected:!1,rowDisabled:!1,rootGroupBy:S,collapsed:M,groupKeys:R,parents:Array.from(b),indexInParentGroups:[...I,W],indexInGroup:W,indexInAll:K,groupBy:S,groupNesting:x+1,groupCount:D.groupCount};c&&(Q.rowSelected=c(Q)),u&&(Q.rowDisabled=u(Q)),a&&a(Q),b.forEach((Te,ue)=>{ue===b.length-1&&_&&(Te.directChildrenLoadedCount+=1),M&&(Te.collapsedChildrenCount+=1),Te.deepRowInfoArray.push(Q)}),M||(y[k+W+F]=Q)}}}b.pop(),I.pop()}),e&&e.end(),{data:y,groupRowsIndexes:C}}function Un(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||Zr)(l,n);return t.push(s),t},[])}var EI=new j,Zf=new WeakMap;function va(n){let{originalDataArray:e,groupBy:t,toPrimaryKey:o}=n;if(!e||!t.length)return EI;let r=Zf.get(e);if(r&&r.groupBy===t)return r.groups;let i=new j,a=t.length,l=[];return e.forEach(s=>{let u=Un(s,t);l.length=0;for(let c=0;c<u.length;c++){l.push(u[c]);let d=i.get(l);d||(d={count:0},l.length===a&&(d.primaryKeys=[]),i.set(l,d)),d.count++,d.primaryKeys?.push(o(s))}}),Zf.set(e,{groupBy:t,groups:i}),i}function AI(n,e){let t=[];return n.getLeafNodesStartingWith(e,o=>{let r=o.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var Oe=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new j;this.deselectedMap=new j;this.onlyUsePrimaryKeys=!1;this.selectionCache=new j;this.selectionCountCache=new j;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,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Un(r,o):[]}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:o}=this.getConfig();return e.length?o?.get(e)?.items??[]:t??[]}hasFilteredOutRowsInsideGroup(e){let t=this.getConfig();return t.someRowsFilteredOut?(e.length?va(t).get(e)?.count??0:t.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(e).length:!1}setVisibleRowsSelection(e,t){let{groupBy:o,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=Un(l,o),u=r(l),c=[...s,u];a.delete(c),this.isRowSelected(u,s)!==t&&i.set(c,!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:o}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(o?.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 j;this.selectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new j;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let o=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,o??null),o}computeLazyRowCount(e){let t=this.getConfig(),o=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!o)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===o)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,u)=>s+(nu(u[u.length-1])?1:this.getLazyRowCount(u)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new j;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let o=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,o),o}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),o=e.length?t?.get(e):void 0;return e.length&&!o?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!nu(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new j;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:o,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?o?.get(e):void 0,s=l?l.items:r??[],u=l?l.totalChildrenCount:a,c=new Set,d=u==null||s.length>=u;for(let p=0;p<s.length;p++){let f=s[p];f==null?d=!1:c.add(i(f))}t={primaryKeys:c,complete:d},this.lazyLoadedRows.set(e,t)}return t}isLazyEntryFilteredOut(e){let{groupDeepMap:t}=this.getConfig(),o=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>o?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let o=this.selectionCountCache.get(e);if(o!=null)return o;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 u=this.getLazyRowCount(e),c=u===void 0?1:Math.max(u-l-s,0);t?l+=c:s+=c;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 va(this.getConfig()).get(e)?.count??0;let o=this.getGroupDeepMap()?.get(e);return o?this.getLazyUnfilteredCount(e)??o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),o={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?va(t).getKeysStartingWith(e,o):t.groupDeepMap?.getKeysStartingWith(e,o)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:o,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?AI(va(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(o?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=o?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new n(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear(),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()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}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 o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}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 o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!r))return this.getLazySelectionCountFor(e,t??this.getGroupRowBooleanSelectionStateFromParent(e));if(this.onlyUsePrimaryKeys&&(r||this.targetsVisibleRowsOnly())){let u=this.getAllPrimaryKeysInsideGroup(e),c=0,d=0;u.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}c++}else{if(this.selectedMap.has([f])){c++;return}d++}});let p={selectedCount:c,deselectedCount:d};return this.selectionCountCache.set(e,p),p}if(e.length===r&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:u}=this.getConfig(),c=0,d=0;this.getVisibleDataInsideGroup(e).forEach(f=>{this.isRowSelected(u(f),e)?c++:d++});let p={selectedCount:c,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let u=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,c=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=c-(d+p),m={selectedCount:d+(u?f:0),deselectedCount:p+(u?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;i.forEach(u=>{let c=this.selectedMap.get(u),d=this.deselectedMap.get(u),p=c?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(u,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function lr(n,e){return new Oe(n,gt(e))}function gt(n){return()=>{let e=typeof n=="function"?n():n,{originalDataArray:t,postFilterDataArray:o}=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&&!!o&&o.length<t.length,originalDataArray:t,postFilterDataArray:o}}}function Qf(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,gt(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,gt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?Un(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Un(d,u):[]}let c=new Oe(a,gt(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Oe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Un(d,u):[]}let c=new Oe(l,gt(e));c.deselectRow(r,i),t.rowSelection=c}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,gt(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,gt(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,gt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Oe(i,gt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Oe))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Oe(r,gt(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}function Jf(n,e){Pa(n,e),OI(n,e),e.detail===2&&_I(n,e),n.getState().onCellClick?.(n,e)}function _I(n,e){if(Xr(e.target))return;let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function OI(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=o(),{rowsPerPage:g}=f,h=p.length,S=new Ue(c);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 C=!!o().wrapRowsHorizontally;d.multiSelectClick(y,C?{horizontalLayout:C,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:C})}else d.resetClick(y);l.cellSelection=S}function FI(n){return n.getState().multiRowSelectionWith!=="click"&&n.getComputed().renderSelectionCheckBox?"checkbox":"click"}function NI(n){return n?Xr(n)?!0:typeof n.closest!="function"?!1:!!n.closest(`.${rr}, [data-name="expand-collapse-icon"]`):!1}function Pa(n,e,t=e.key?"keyboard":"click"){let{rowIndex:o,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:u,cloneTreeSelection:c}=n,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&NI(e.target))return!1;let h=m[o];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=FI(n);if(t==="click"&&S==="checkbox")return!1;let y=t==="checkbox"||t==="keyboard"&&S==="checkbox",C=()=>{e.shiftKey?d.multiSelectClick(o):y||e.metaKey||e.ctrlKey?d.singleAddClick(o):d.resetClick(o)};if(g){let{treeSelectionState:I}=p;if(!(I instanceof Je))return!1;let T=c(I);d.treeSelectionState=T,C(),d.treeSelectionState=void 0;let R=!e.shiftKey&&(y||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=R?{nodePath:h.nodePath,selected:!!T.isNodeSelected(h.nodePath)}:null),a.treeSelection=T,!0}let{rowSelection:b}=p;return!b||typeof b!="object"?!1:(b=u(b),d.rowSelectionState=b,C(),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:C}=l;return S?C.toggleNodeSelection(h.nodePath):C.selectNode(h.nodePath),!0}let y=h.id;return S?s.rowSelectionApi.toggleRowSelection(y):s.rowSelectionApi.selectRow(y),!0}return!1}function em(n,e){let{getComputed:t,dataSourceActions:o,dataSourceApi:r}=n,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=n.getDataSourceState;return Pa({rowIndex:e,api:n,getComputed:t,getState:n.getState,getDataSourceState:l,dataSourceActions:o,dataSourceApi:r,cloneRowSelection:s=>lr(s,l),cloneTreeSelection:s=>ar(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}var Jr=H(require("react")),rm=require("react");var tm="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",nm=ge({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 om="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",cO=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Da=`${dt}-expand-collapse`;function yo(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=(0,rm.useState)(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),kn("expanded",n)||i(!r)};Jr.useEffect(()=>{kn("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return Jr.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:$(n.className,tm,jo.expandCollapse,nm({direction:t||"start",expanded:r,disabled:o}),`${dt}`,`${Da}`,`${Da}--${l}`,`${Da}--${t==="end"?"end":"start"}`,o?`${Da}--disabled`:"")},Jr.createElement("path",{d:om}))}function im(n){return typeof n.field=="string"}function am(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?o.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=o.get(e.field))}return r}function on(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=o(),h=r===f&&m==="row",S=!g||typeof g=="function"&&!g(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:C}}=sr({column:p,rowInfo:u,rowDetailState:S,columnsMap:e().computedColumnsMap,context:n}),b=St(p.id,n);return c?{api:a,dataSourceApi:l,column:p,columnApi:b,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}}function lm(n){return um(n.column,n.rowInfo)}function sm(n){let{column:e,context:t,rowInfo:o,visibleColumnIds:r}=n,i=am({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=sr(n),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:c,stylingParam:d,formattedValueContext:u,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:LI({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnIds:n.visibleColumnIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function LI(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=n,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=o,S=p(),{selectionMode:y,cellSelection:C}=S,b=am({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),I=d.toggleGroupRow,T=C?.isCellSelected(o.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:T,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...u,editError:g&&g.primaryKey===o.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(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:h,toggleGroupRow:I,toggleCurrentGroupRow:()=>{o.isGroupRow&&I(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:S.groupBy,pivotBy:S.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),R}function kI(n,e){if(!n.isGroupRow)return;let t=n.groupData;if(!t.length)return;let o=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==o)return;return o}function um(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:im(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),a===void 0&&e.isGroupRow&&n.groupByForColumn&&im(n)&&(a=kI(e,n.field)),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function zI(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}}function sr(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=um(e,t),a=zI(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var cm=ge({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),dm="_7pupv00",pm=ge({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:fm}=Ve,hn=`${fm}Cell`,ei=`${fm}Cell_content`;var{rootClassName:VI}=Ve,rn=`${VI}ColumnCell`;var GI=q(X.columnZIndexAtIndex),HI=q(X.columnVisibilityAtIndex);function mm({rowInfo:n,column:e}){let t=0;if(n.dataSourceHasGrouping)if(n.isGroupRow){let o=e?.groupByForColumn,r=n.groupBy[n.groupBy.length-1],i=!!n.pivotValuesMap,a=i&&!!e?.field&&!!o&&!Array.isArray(o)&&(o.field??o.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(o)&&n.groupNesting===n.rootGroupBy.length;t=a||l?n.groupNesting:n.groupNesting-1}else t=n.groupNesting;return{[q(pe.components.Row.groupNesting)]:t}}function gm({rowInfo:n}){return{[q(pe.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}function iu(n,e){return n?typeof n=="function"?n(e):n:void 0}function au(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function hm(n){let{column:e,rowInfo:t,rowIndex:o,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:u,formattedValueContext:c,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:h,rowActive:S,rowDisabled:y,rowSelected:C,cellSelected:b,cellSelection:I,getData:T,computedVisibleColumns:R,visibleColumnIds:v,computedColumnOrder:w,columnReorderInPageIndex:P}=n,x=v??R.map(fe=>fe.id),M=w,D,E={...c,visibleColumnIds:x,allColumnIds:M,rowIndex:o,get rowHasSelectedCells(){return D===void 0&&(D=t.hasSelectedCells(x)),D}},L=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),V=typeof f=="function"?f(E):f,N;d?.className&&(N=iu(d.className,u)),g&&(N=$(N,iu(g,u))),e.className&&(N=$(N,iu(e.className,u))),L&&(N=$(N,pm({align:l})));let k;t.dataSourceHasGrouping&&e.groupByForColumn&&(k=mm({rowInfo:t,column:e})),L&&(k=gm({rowInfo:t})),p&&(k=typeof p=="function"?{...k,...p(E)}:{...k,...p}),m&&(k=au(k,m,u)),d?.style&&(k=au(k,d.style,u)),e.style&&(k=au(k,e.style,u)),k=k||{},k.height=r,k.zIndex=`var(${GI}-${e.computedVisibleIndex})`,k.visibility=`var(${HI}-${e.computedVisibleIndex}, visible)`;let F=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:o)%2===1,W=h?F?"odd":"even":!1,Y=!1,_=!1,K=!1,z=!1;if(I&&b){let fe=T(),De=fe[t.indexInAll-1],xe=fe[t.indexInAll+1],de=R[e.computedVisibleIndex+1],ne=R[e.computedVisibleIndex-1];Y=De?!I.isCellSelected(De.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?_=!0:_=ne?!I.isCellSelected(t.id,ne.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?K=!0:K=de?!I.isCellSelected(t.id,de.id):!0,z=xe?!I.isCellSelected(xe.id,e.id):!0}let Q=I&&b?{top:Y,left:_,right:K,bottom:z}:null,Te=P!=null?a!==P:!1,ue=$(Q?Hf(Q):"",ea(e,[rn,hn],Gf,{dragging:!1,insideDisabledDraggingPage:Te,zebra:W,align:l,verticalAlign:s,rowDisabled:y,rowActive:S,cellSelected:b,rowSelected:C,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}),N,V);return{style:k,className:ue,cellSelectionBorders:Q,zebra:W,columnIsTree:L}}var yn=H(require("react"));var KI=q(X.columnWidthAtIndex),BI=q(X.columnReorderEffectDurationAtIndex);function WI(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=n,S=typeof m=="function"?m():m,y={width:`var(${KI}-${i.computedVisibleIndex})`,transition:`transform var(${BI}-${i.computedVisibleIndex}, 0s)`,...h.style},C={...h,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:$(h.className,hn,Vf),children:yn.createElement(yn.Fragment,null,d,yn.createElement("div",{className:$(ei,e?Bt:wd.hidden,s),style:r},S),c)};u!=null&&(C["data-row-id"]=`${u}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?yn.createElement(b,{...C,ref:a}):yn.createElement("div",{...C,ref:a})}var xa=yn.memo(WI);var bo=H(require("react")),So=require("react");function ym(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=Ma(),i=(0,So.useRef)(null),a=(0,So.useRef)(!1),l=bo.useCallback(c=>{i.current=c,c&&c.focus()},[]),s=(0,So.useCallback)(c=>{let{key:d}=c;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):c.stopPropagation()},[]),u=(0,So.useCallback)(()=>{a.current||t()},[]);return bo.createElement(bo.Fragment,null,bo.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:u,className:$(yd,Rd.none),type:"text",defaultValue:n,onChange:(0,So.useCallback)(c=>{e(c.target.value)},[])}))}function Sm(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var ti=Ie.createContext(null),jI=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Ie.createElement(yo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},UI={display:"inline-block",visibility:"visible"},lu=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Ie.createElement(yo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:UI,expanded:o,onChange:t})},$I=n=>{let{rowInfo:e,rowIndex:t,column:o,api:r}=n;e.isGroupRow&&o.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||Bn;return Ie.createElement(l,{domProps:{className:rr},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{em(r,t)},checked:e.rowSelected})};function YI(n){let{repaintCellsKey:e,column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=n,[,a]=(0,ke.useReducer)(s=>s+1,0),l=kf(e)?e:void 0;(0,ke.useEffect)(()=>{if(l)return zf(l,{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i},a)},[l,t,o,r,i])}function qI(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:u,cellStyle:c,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:h,onMouseEnter:S,onRowMouseEnter:y,onRowMouseLeave:C,rowIndex:b,rowHeight:I,columnsMap:T,fieldsToColumn:R,domRef:v,hidden:w,showZebraRows:P,getDataSourceState:x,dataSourceApi:M,dataSourceActions:D,getState:E,imperativeApi:L,componentActions:V,getComputed:N,getDataSourceMasterContext:k}=n,F=(0,ke.useSyncExternalStore)((0,ke.useCallback)(ie=>t.subscribeToRowIndex(b,ie),[t,b]),(0,ke.useCallback)(()=>t.getRowInfoAtIndex(b),[t,b]));YI({repaintCellsKey:p,column:g,rowIndex:b,rowInfoStore:t,getDataSourceState:x});let W=!F,Y=!g,_=Ie.useRef(null),K=(0,ke.useCallback)(ie=>{_.current=ie,v&&v(ie)},[v]),z=F??{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:Q}=z,Te=N(),{activeRowIndex:ue,keyboardNavigation:fe,columnReorderInPageIndex:De}=E(),xe=b===ue&&fe==="row",de={getState:E,getDataSourceState:x,getDataSourceMasterContext:k,actions:V,dataSourceActions:D,api:L,dataSourceApi:M},ne=z.rowDisabled,se=sm({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:z,rowDetailState:f,columnsMap:T,visibleColumnIds:s,fieldsToColumn:R,context:de}),{stylingParam:he,renderParams:U,formattedValueContext:te,renderFunctions:B,groupByColumnReference:ae,inEdit:oe}=se,{align:re,verticalAlign:O}=U,A=U,ce=Ie.useRef(A),Re=y&&S?ie=>{let ut={...te,rowIndex:b};y(ut,ie),S(ie)}:S,Se=C&&h?ie=>{let Ae={...te,rowIndex:b,rowInfo:z};C(Ae,ie),h(ie)}:h,be=(0,ke.useCallback)(ie=>{let Ae=g.computedVisibleIndex;E().cellClick({rowIndex:b,colIndex:Ae,event:ie})},[b,g.computedVisibleIndex,fe]),Me=(0,ke.useCallback)(ie=>{let Ae=g.computedVisibleIndex;if(E().cellMouseDown({rowIndex:b,colIndex:Ae,event:ie}),fe==="row"){ne||(V.activeRowIndex=b);return}fe==="cell"&&(V.activeCellIndex=[b,Ae])},[b,ne,g.computedVisibleIndex,fe]),{selectionMode:et,cellSelection:tt,isNodeReadOnly:We}=e,lt=A.cellSelected;A.domRef=K,A.htmlElementRef=_,A.toggleCurrentTreeNode=(0,ke.useCallback)(A.toggleCurrentTreeNode,[z]),A.selectCell=(0,ke.useCallback)(A.selectCell,[z]),A.deselectCell=(0,ke.useCallback)(A.deselectCell,[z]),A.selectCurrentRow=(0,ke.useCallback)(A.selectCurrentRow,[z]),A.deselectCurrentRow=(0,ke.useCallback)(A.deselectCurrentRow,[z]),A.toggleCurrentGroupRow=(0,ke.useCallback)(A.toggleCurrentGroupRow,[z]),A.toggleCurrentRowSelection=(0,ke.useCallback)(A.toggleCurrentRowSelection,[z]),A.toggleCurrentGroupRowSelection=(0,ke.useCallback)(A.toggleCurrentGroupRowSelection,[z]),A.toggleCurrentTreeNodeSelection=(0,ke.useCallback)(A.toggleCurrentTreeNodeSelection,[z]);let Xe=g.components?.Editor??ym,Ze=oe?Ie.createElement(Tm,{contextValue:A},Ie.createElement(Xe,null)):null,G=(0,ke.useCallback)(yt(()=>{if(w||oe)return null;if(ce.current=A,B.renderGroupIcon&&(A.renderBag.groupIcon=Ie.createElement(Pt,{render:B.renderGroupIcon,renderParam:{...A,renderBag:{...A.renderBag}}})),B.renderSelectionCheckBox&&et=="multi-row"&&(A.renderBag.selectionCheckBox=Ie.createElement(Pt,{render:$I,renderParam:A}),B.renderSelectionCheckBox!==!0&&(A.renderBag.selectionCheckBox=Ie.createElement(Pt,{render:B.renderSelectionCheckBox,renderParam:{...A,renderBag:{...A.renderBag}}}))),z.isTreeNode){let{isParentNode:ut}=z,Ct;Ct=(ut?B.renderTreeIconForParentNode:B.renderTreeIconForLeafNode)||typeof B.renderTreeIcon=="function"?B.renderTreeIcon:ut&&B.renderTreeIcon===!0?lu:void 0,Ct===!0?Ct=lu:Ct&&(A.renderBag.treeIcon=Ie.createElement(Pt,{render:lu,renderParam:A})),Ct&&(A.renderBag.treeIcon=Ie.createElement(Pt,{render:Ct,renderParam:{...A,renderBag:{...A.renderBag}}}))}B.renderRowDetailIcon&&(A.renderBag.rowDetailsIcon=Ie.createElement(Pt,{render:jI,renderParam:{...A,renderBag:{...A.renderBag}}}),typeof B.renderRowDetailIcon=="function"&&(A.renderBag.rowDetailsIcon=Ie.createElement(Pt,{render:B.renderRowDetailIcon,renderParam:{...A,renderBag:{...A.renderBag}}}))),B.renderValue&&(A.renderBag.value=Ie.createElement(Pt,{render:B.renderValue,renderParam:{...A,renderBag:{...A.renderBag}}})),z.isGroupRow&&B.renderGroupValue&&(A.renderBag.value=Ie.createElement(Pt,{render:B.renderGroupValue,renderParam:{...A,renderBag:{...A.renderBag}}})),!z.isGroupRow&&B.renderLeafValue&&(A.renderBag.value=Ie.createElement(Pt,{render:B.renderLeafValue,renderParam:{...A,renderBag:{...A.renderBag}}})),ce.current=A;let ie=A.renderBag.value;ie instanceof Date&&(ie=ie.toLocaleDateString());let Ae=Ie.createElement(Ie.Fragment,null,re!=="end"?A.renderBag.treeIcon:null,re!=="end"?A.renderBag.groupIcon:null,re!=="end"?A.renderBag.rowDetailsIcon:null,re!=="end"?A.renderBag.selectionCheckBox:null,ie,re==="end"?A.renderBag.selectionCheckBox:null,re==="end"?A.renderBag.rowDetailsIcon:null,re==="end"?A.renderBag.groupIcon:null,re==="end"?A.renderBag.treeIcon:null);return g.render?Ie.createElement(Pt,{render:g.render,renderParam:{...A,renderBag:{...A.renderBag,all:Ae}}}):Ae}),[g,w,oe,f,g.renderTreeIcon||g.renderTreeIconForParentNode?We:!1,...Sm(A,{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:J,className:me}=hm({column:g,rowInfo:z,rowIndex:b,rowHeight:I,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:re,verticalAlign:O,stylingParam:he,formattedValueContext:te,groupByColumnReference:ae,rowStyle:o,rowClassName:r,cellStyle:c,cellClassName:d,showZebraRows:P,rowActive:xe,rowDisabled:ne,rowSelected:Q,cellSelected:lt,cellSelection:tt,getData:l,visibleColumnIds:s,computedVisibleColumns:Te.computedVisibleColumns,computedColumnOrder:u,columnReorderInPageIndex:De}),Ce=(0,ke.useMemo)(()=>J,[J?JSON.stringify(J):null]),st=Ze,le=G(),Ye={domRef:K,cellType:"body",column:g,width:m,rowId:z.id,horizontalLayoutPageIndex:a,style:Ce,onMouseLeave:Se,onMouseEnter:Re,onClick:be,afterChildren:st,onMouseDown:Me,cssEllipsis:g.cssEllipsis??!0,className:me,renderChildren:(0,ke.useCallback)(()=>le,[G])},Z=ti.Provider;return Y||W?Ie.createElement("div",{ref:K,style:{display:"none"}}):Ie.createElement(Z,{value:ce.current},Ie.createElement(xa,{...Ye}))}var bm=Ie.memo(qI);function ni(){return(0,ke.useContext)(ti)}function Ma(){let{api:n,editingValueRef:e,editingCell:t}=ee(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:o,rowInfo:r}=ni(),[i]=Ie.useState(()=>t?.value),[a,l]=Ie.useState(i),s=t?!t.active&&!!t.waiting:!1,u=Ie.useCallback(f=>{e.current=f,l(f)},[]);Ie.useLayoutEffect(()=>{e.current=i},[]);let c=n.confirmEdit,d=n.cancelEdit,p=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function oi(n){return n.render(n.renderParam)??null}function Pt(n){let e=ti.Provider;return ur.createElement(e,{value:n.renderParam},ur.createElement(oi,{render:n.render,renderParam:n.renderParam}))}function Tm(n){let e=ti.Provider;return ur.createElement(e,{value:n.contextValue},n.children)}function $n(n){let e=Ea.Provider;return ur.createElement(e,{value:n.renderParam},ur.createElement(oi,{render:n.render,renderParam:n.renderParam}))}var Yn=H(require("react"));var Cm="yhvuzb1",Im="yhvuzb0";var su=ji({"data-name":""}),uu={[su["data-name"]]:"menu-icon"},Rm=`[${su["data-name"]}="${uu["data-name"]}"]`;var XI={width:"100%",pointerEvents:"none"},cu=$(`${dt}-menu`,Cm);function ri(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...XI,borderTop:`${pe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return Yn.createElement("div",{...o,style:e,...uu,onPointerDown:s=>s.stopPropagation(),className:$(t,op({menuVisible:i,reserveSpaceWhenHidden:r}),dt,`${dt}-menu`,a==null?Im:"")},a??Yn.createElement(Yn.Fragment,null,Yn.createElement("div",{className:cu,style:l}),Yn.createElement("div",{className:cu,style:l}),Yn.createElement("div",{className:cu,style:l})))}var cr=H(require("react")),ii=require("react");var wm="_1b8djff1 _16lm1iw1",vm={asc:"_1b8djff2",desc:"_1b8djff3",none:"_1b8djff4"},Aa="_1b8djff5",Pm="--_1b8djff0";var Dm={transition:"width 0.25s, opacity 0.25s"},kF=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function _a(n){let[e,t]=(0,ii.useState)(!0),[o,r]=(0,ii.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=n,c=u!=null&&u>0,d=n.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Dm,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};(0,ii.useEffect)(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==o){let C=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(C)}}return()=>{}},[i,e]);let g=()=>{let C=!(o===0&&i===0);C!==e&&t(C)};if(!e&&!n.forceSize)return null;let h=i===1?"asc":i===-1?"desc":"none",S={};return i===-1&&(S.top="100%"),cr.createElement("div",{"data-name":"sort-icon",style:{...l,width:d,[Pm]:`${a}px`},className:$(s,dt,wm,vm[h],`${dt}-sort`,`${dt}-sort--${h}`)},c?cr.createElement("div",{"data-name":"index",style:S,className:ap},u):null,cr.createElement("div",{className:Aa,style:{width:f[0],...m},onTransitionEnd:g}),cr.createElement("div",{className:Aa,style:{width:f[1],...m}}),cr.createElement("div",{className:Aa,style:{width:f[2],...m}}))}var _m=H(require("react")),pu=require("react");function du(n){return Math.max(n.width-Qt(),0)}function xm(n){let{context:e,column:t,diff:o,shareSpaceOnResize:r}=n,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,u=e.getComputed().computedVisibleColumns,c=!1,d=u.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},c=!0),f),{}),p=c?{...a,...d}:a;return Es({shareSpaceOnResize:r,availableSize:du(s),reservedWidth:l||0,dragHandleOffset:o,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:u.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var ai=require("react"),li=H(require("react"));function Mm(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){we.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;we.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?Gs(l,i,o.current):we.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){Gs(u,i,o.current);continue}u.computedPinned!=="end"&&we.columnOffsets.set(l,u.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||we.columnOffsets.set(l,u.computedOffset+i,o.current)}}}}}function Em(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,u=i.current;if(o.forEach((c,d)=>{s+=c;let p=n[d],f=r[p],m=f.computedWidth+c;we.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&we.columnOffsets.set(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&we.columnOffsets.set(c,d.computedOffset+s,u)}}}}var Oa="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Fa=ge({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"]]}),Na=ge({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:ZI}=Ve,QI=`${ZI}HeaderCell_ResizeHandle`;function JI(n){let{brain:e,headerBrain:t}=ee(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=(0,ai.useRef)(null),[r,i]=(0,ai.useState)(!1),a=(0,ai.useRef)(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,S=g.pointerId,y=g.clientX,C=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),w=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{v(),w()}}C.setPointerCapture(S);let b=Mm(n.columnIndex,{columns:n.columns,shareSpaceOnResize:h,domRef:o}),I=(v,{done:w}={})=>{s&&(v=v/(s+1),w&&(v=Math.round(v))),u==="end"&&(v*=-1);let{adjustedDiff:P,constrained:x}=n.computeResize({diff:v,shareSpaceOnResize:h});return a.current!==x&&i(x),b.resize(P),P},T=v=>{I(Math.round(v.clientX-y))},R=v=>{C.releasePointerCapture(S),C.removeEventListener("pointermove",T),C.removeEventListener("pointerup",R);let w=Math.round(v.clientX-y),P=I(w,{done:!0});p(),b.resize(0),n.onResize({diff:P,shareSpaceOnResize:h})};C.addEventListener("pointermove",T),C.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return li.createElement("div",{ref:o,className:`${QI} ${Oa} ${Na({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},li.createElement("div",{style:m,className:Fa({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var Am=li.memo(JI);function Om(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=ee(u=>({computedVisibleColumns:u.computed.computedVisibleColumns,getState:u.getState,getComputed:u.getComputed,actions:u.actions})),a=(0,pu.useCallback)(({diff:u,shareSpaceOnResize:c})=>xm({context:{getState:o,getComputed:r},column:n,diff:u,shareSpaceOnResize:c}),[n,o,r]),l=(0,pu.useCallback)(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return n.computedResizable?_m.createElement(Am,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}function eR(n,e){if(!n||!e)return null;let t=e.field||e.groupByForColumn,o=null,r=null;for(let i of n)(i.id===e.id||i.field===e.id)&&(o=i),t&&(i.id===t||i.field===t)&&(r=i);return o||r}function tR(n,e){return!n||!e?n===e:n.filter.type===e.filter.type&&n.filter.operator===e.filter.operator&&n.filter.value===e.filter.value&&!!n.disabled==!!e.disabled}var La=class{constructor(){this.pending=new Map;this.applied=new Map;this.cancelListeners=new Map}schedule(e,t,o){let r=o.getFilterValueItem();this.isLastApplied(e,r)&&this.applied.delete(e);let i=this.pending.get(e);i&&clearTimeout(i.timeout);let a=setTimeout(()=>{this.pending.delete(e);let l=o.getFilterValueItem();if(!tR(l,r)&&!this.isLastApplied(e,l)){this.applied.delete(e),this.notifyCancel(e);return}o.apply(t);let s=o.getFilterValueItem();s&&s.filter.value===t?this.applied.delete(e):this.applied.set(e,t)},o.delay);this.pending.set(e,{timeout:a,typedOver:r})}cancel(e){let t=this.pending.get(e);t&&(clearTimeout(t.timeout),this.pending.delete(e),this.notifyCancel(e))}onCancel(e,t){let o=this.cancelListeners.get(e);return o||(o=new Set,this.cancelListeners.set(e,o)),o.add(t),()=>{o.delete(t),!o.size&&this.cancelListeners.get(e)===o&&this.cancelListeners.delete(e)}}isLastApplied(e,t){return!!t&&this.applied.has(e)&&t.filter.value===this.applied.get(e)}notifyCancel(e){this.cancelListeners.get(e)?.forEach(t=>t())}};function Fm(n){let{columnId:e,filterDelay:t,api:o}=n,r=a=>{o.setColumnFilter(e,a)};if(!(t>0))return r;let i=()=>eR(n.getDataSourceState().filterValue,n.getComputed().computedColumnsMap.get(e));return a=>{n.getState().pendingColumnFilters.schedule(e,a,{delay:t,getFilterValueItem:i,apply:r})}}var $e=H(require("react")),jt=require("react");var Nm=ge({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Lm=ge({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function km(n,e){return Rt(n,e)}var dr=class extends mo{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 km(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return km(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let o=!0;return typeof this.data.shouldAcceptDrop=="function"&&(o=this.data.shouldAcceptDrop(t)),o=!!o,o!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=o,o?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),o}adjustForScroll(t){this.breakpoints=this.breakpoints.map(o=>o-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 o=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>o||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=o?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:o,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:u}=t,c=Array.from({length:i.length},(f,m)=>m),d=[];o===-1?d=c.filter(f=>f!==r):d=po(c,r,o>r?o-1:o);let p={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:u,status:t.status};this.emit("drop",p)}};var nR={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function oR(n,e){let t=getComputedStyle(n),o=e==="vertical"?t.overflowY:t.overflowX;return o!=="auto"&&o!=="scroll"?!1:e==="vertical"?n.scrollHeight>n.clientHeight:n.scrollWidth>n.clientWidth}function rR(n,e){let t=n;for(;t&&!(t===document.documentElement||t===document.body);){if(oR(t,e))return t;t=t.parentElement}return null}function iR(n,e){return{startScrollingFrom:n*e.startFromPercentage,maxScrollValueAt:n*e.maxScrollAtPercentage}}var fu=1;function zm(n,e,t){if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return t.maxPixelScroll;if(n===e.startScrollingFrom)return fu;let r=1-(n-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function aR(n,e,t){let{accelerateAt:o,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return n;if(i<o)return fu;let a=(i-o)/(r-o);return Math.max(fu,Math.ceil(n*t.ease(a)))}function Vm(n,e,t,o,r,i,a){if(n<e||n>t)return 0;let l=iR(o,r),s=n-e,u=t-n,c=u<s,d;return c?d=zm(u,l,r):d=-zm(s,l,r),d===0?0:a?(d>0?1:-1)*aR(Math.abs(d),i,r):d}var To=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={...nR,...e.config}}start(e){this.scrollContainer=rR(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},o=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=o,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,o=0;return this.orientation==="vertical"?t=Vm(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):o=Vm(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:o}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var mu="data-drag-list-id",bt="data-drag-item-id",pr="data-drag-item-list-id",Gm=`[${bt}]`,Hm=()=>null,Km=n=>{let{node:e,offset:t}=n;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},lR=n=>`${n.getAttribute(bt)}`;function gu(n,e){let t=n.current?.querySelectorAll(Gm)??[];return Array.from(t).filter(r=>r.getAttribute(pr)===`${e}`)}function sR(n,e){let t=gu(n,e);return Array.from(t).map(r=>{let i=lR(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function uR(n){let{domRef:e,orientation:t,dragListId:o}=n,r=sR(e,o),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,u=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>u&&(u=f.right)}let c=_e.from({top:a,left:l,width:u-l,height:s-a});return{draggableItems:r,orientation:t,listId:o,listRectangle:c,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial,preserveDragSpace:n.preserveDragSpace}}function Bm(n){return new dr(uR(n))}function Wm(n,e){let t=document.querySelector(`[${mu}="${e}"]`);t?n.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 jm(n,e){let t=n.current;t&&t!==e&&ft.unregisterDragInteractionTarget(t),n.current=e,e&&ft.registerDragInteractionTarget(e)}function Um(n){let{getProps:e,domRef:t,setInteractionTarget:o}=n;return ft.on("register",r=>{let{dragListId:i,acceptDropsFrom:a,orientation:l,shouldAcceptDrop:s}=e(),u=r.getData();if(u.initial&&u.listId!==i&&a?.includes(u.listId)){let c=Bm({domRef:t,orientation:l,dragListId:i,initial:!1,acceptDropsFrom:a,shouldAcceptDrop:s});r.once("unregister",()=>{o(null)}),o(c)}})}function ka(n,e){let t=n.cloneNode(!0);return t.removeAttribute(bt),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 za({proxyElement:n,dx:e,dy:t}){n.style.transform=`translate3d(${e}px, ${t}px, 0)`}function $m(n){let e=n.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",n.current=null)}function Ym(n,e,t){let o=n.current;return(!o||o.length===0)&&(o=gu(e,t),n.current=o),o}function qm(n,e){let{dragListId:t,orientation:o,domRef:r,proxyStateRef:i,sourceScrollOffsetRef:a,dragItemsRef:l,getDragItems:s,getOnDrop:u,getOnAcceptDrop:c,getOnRemove:d,getUpdatePosition:p,updateDragOperationSourceAndTarget:f,updateDragProxyRenderState:m}=e,g=n.on("start",({dragItem:T,dragSourceListId:R,dropTargetListId:v})=>{f({dragSourceListId:R,dropTargetListId:v,dragItemId:T.id,status:"accepted"})}),h=n.on("move",({offsetsForItems:T,items:R,status:v,dragItem:w})=>{if(v==="rejected")return;let P=s(),x=p(),M=i.current;R.forEach((D,E)=>{let L=T[E],V=P[E];if(V&&!(M&&D.id===M.dragItemId)){if(!M&&D.id===w.id){let N=a.current;L={left:L.left+N.left,top:L.top+N.top}}x({id:D.id,node:V,offset:L})}})}),S=n.on("drop",T=>{let{sortedIndexes:R,dragIndex:v,dropIndex:w,dragItem:P,items:x,dragSourceListId:M,dropTargetListId:D,outside:E,status:L}=T,V=s();l.current=[];let N=c(),k=d(),F=u(),W=p();x.forEach((K,z)=>{let Q=V[z];Q&&W({id:K.id,node:Q,offset:null})}),$m(i),m(K=>K&&(requestAnimationFrame(()=>m(Hm)),{...K,dragItemId:null})),t===D&&M!==t&&N&&L==="accepted"&&N({dragItemId:P.id,dragSourceListId:M,dropTargetListId:D,dragIndex:v,dropIndex:w,dropItemId:x[w]?.id});let _=null;w===-1&&M===t&&D===t&&E&&(_=k),w!==-1&&D===t&&M===t&&(_=F),_&&_?.(R,{dragIndex:v,dropIndex:w,dragItemId:x[v].id,dropItemId:x[w]?.id})}),y=null,C=null,b=null,I=null;if(!n.getData().initial&&r.current){if(y=new To({orientation:o,onScroll:()=>{}}),y.start(r.current),C=y.getScrollContainer(),C){let T=o==="vertical"?C.scrollTop:C.scrollLeft;b=()=>{let R=o==="vertical"?C.scrollTop:C.scrollLeft,v=R-T;T=R,v!==0&&(n.adjustForScroll(v),ft.retriggerMove())},C.addEventListener("scroll",b)}I=T=>{y.updatePointer({left:T.clientX,top:T.clientY})},Fe().addEventListener("pointermove",I)}return()=>{g(),h(),S(),y&&y.stop(),C&&b&&C.removeEventListener("scroll",b),I&&Fe().removeEventListener("pointermove",I)}}function Xm(n,e,t){let{dragListId:o,orientation:r,acceptDropsFrom:i,preserveDragSpace:a,onDragProxySetup:l}=e,{domRef:s,proxyStateRef:u,sourceScrollOffsetRef:c,dragItemsRef:d,setInteractionTarget:p,updateDragProxyRenderState:f}=t,m=e.dragStrategy??"proxy",g=m==="proxy"&&!e.renderDragProxy,h=m==="proxy"&&!!e.renderDragProxy,S=e.onDragProxyMove??za,y=n.currentTarget,C=y.getAttribute(bt);if(C==null){let z=Gn(y,Gm);z&&(C=z.getAttribute(bt))}if(C==null){console.warn("Could not find drag item id for element",y,`Make sure you have a parent element with a ${bt} attribute`);return}C=`${C}`;let b=null,I=gu(s,o);d.current=I;let T=Bm({domRef:s,orientation:r,dragListId:o,acceptDropsFrom:i,initial:!0,preserveDragSpace:a}),R=T.getData().draggableItems,v=R.findIndex(z=>z.id===C);if(v===-1)return;let w=R[v],P=I[v]?.getAttribute(bt)===`${C}`?I[v]:I.find(z=>z.getAttribute(bt)===`${C}`);p(T);let x={left:n.clientX,top:n.clientY},M={left:n.clientX,top:n.clientY};c.current={top:0,left:0};let D=new To({orientation:r,onScroll:()=>{}});s.current&&D.start(s.current);let E=D.getScrollContainer(),L=E?r==="vertical"?E.scrollTop:E.scrollLeft:0;function V(){b&&b.move({left:M.left,top:M.top})}let N=()=>{if(!E)return;let z=r==="vertical"?E.scrollTop:E.scrollLeft,Q=z-L;L=z,Q!==0&&(T.adjustForScroll(Q),r==="vertical"?c.current.top+=Q:c.current.left+=Q),V()};E?.addEventListener("scroll",N);let k=z=>{if(M={left:z.clientX,top:z.clientY},!b){if(b=ft.startDrag({listId:o,dragItem:w,dragIndex:v},x),P&&g){let ue=P.getBoundingClientRect(),fe=null,De={dragItemNode:P,dragItemId:`${C}`,initialRect:ue,initialCoords:x,get proxyElement(){return fe||(fe=ka(P,ue)),fe}},xe=l?.(De),de=xe?.proxyElement??De.proxyElement;P.style.visibility="hidden",u.current={proxyElement:de,originalNode:P,dragItemId:`${C}`,initialRect:ue,cleanup:xe?.cleanup}}if(P&&h){let ue=P.getBoundingClientRect();P.style.visibility="hidden",u.current={proxyElement:P,originalNode:P,dragItemId:`${C}`,initialRect:ue,cleanup:()=>{}};let fe={dragItemId:`${C}`,initialRect:ue,dx:0,dy:0};f(()=>fe)}}let Q=z.clientX-x.left,Te=z.clientY-x.top;if(h)f(ue=>ue&&{...ue,dx:Q,dy:Te});else{let ue=u.current;ue&&S({proxyElement:ue.proxyElement,dx:Q,dy:Te})}D.updatePointer({left:z.clientX,top:z.clientY}),V()},F=z=>{z.preventDefault()},W=z=>{if(D.stop(),E?.removeEventListener("scroll",N),K.removeEventListener("pointermove",k),K.removeEventListener("pointerup",Y),K.removeEventListener("pointercancel",_),K.removeEventListener("dragstart",F,!0),h&&(f(Q=>Q&&{...Q,dragItemId:null}),requestAnimationFrame(()=>{f(Hm)})),!b){$m(u),p(null);return}z?b.cancel():b.drop(),b=null},Y=()=>W(!1),_=()=>W(!0),K=Fe();K.addEventListener("pointermove",k),K.addEventListener("pointerup",Y),K.addEventListener("pointercancel",_),K.addEventListener("dragstart",F,!0)}var Zm=$e.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),Co=()=>$e.useContext(Zm);function cR(n,e){let t=Le(e),[o,r]=$e.useState(null),i=$e.useRef(null),a=(0,jt.useCallback)(s=>{jm(i,s),r(s)},[]),l=Le(o);return(0,jt.useEffect)(()=>()=>{ft.unregisterDragInteractionTarget(i.current),i.current=null},[]),(0,jt.useEffect)(()=>Um({getProps:t,domRef:n,setInteractionTarget:a}),[t]),{interactionTarget:o,setInteractionTarget:a,getInteractionTarget:l}}var qn=n=>{let e=$e.useRef(null),t=$e.useRef(null),[o,r]=(0,jt.useState)(null),i=$e.useRef({top:0,left:0}),a=$e.useRef(null),l=$e.useCallback(P=>{a.current=P},[]),{dropTargetListId:s,dragSourceListId:u}=gn(),{updateDragOperationSourceAndTarget:c,dragItemId:d,status:p}=gn(),f=Le(n.onDrop),m=Le(n.onAcceptDrop),g=Le(n.onRemove),h=Le(n.updatePosition??Km),{interactionTarget:S,setInteractionTarget:y}=cR(e,n);(0,jt.useEffect)(()=>{Wm(e,n.dragListId)},[n.dragListId]),(0,jt.useEffect)(()=>{if(S)return qm(S,{dragListId:n.dragListId,orientation:n.orientation,domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,getDragItems:b,getOnDrop:f,getOnAcceptDrop:m,getOnRemove:g,getUpdatePosition:h,updateDragOperationSourceAndTarget:c,updateDragProxyRenderState:r})},[S,n.dragListId]);let C=$e.useRef([]),b=(0,jt.useCallback)(()=>Ym(C,e,n.dragListId),[n.dragListId]),I=(0,jt.useCallback)(P=>{Xm(P,n,{domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,setInteractionTarget:y,updateDragProxyRenderState:r})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside,n.dragStrategy,n.renderDragProxy,n.onDragProxySetup,n.onDragProxyMove]),T=!!d,R=$e.useMemo(()=>({dragItemId:d,onDragItemPointerDown:I,dragSourceListId:u,dropTargetListId:s,status:p,dragListId:n.dragListId,draggingInProgress:T}),[d,I,T,u,s,n.dragListId]),v={className:$("DragList",T?"DragList--dragging":"",Nm({dragging:T})),[mu]:n.dragListId},w=typeof n.children=="function"?n.children(v,R):n.children;return $e.createElement(Zm.Provider,{value:R},w,o&&n.renderDragProxy?n.renderDragProxy({...o,ref:l}):null)},dR=$e.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),pR=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=Co(),l=n.dragListId??o,s=i===l&&r===`${n.id}`,u=$e.useMemo(()=>({dragItemId:n.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,s,l,t,i,a]),c={[bt]:`${n.id}`,[pr]:l,onPointerDown:e,className:$("DraggableItem",s?"DraggableItem--active":"",Lm({active:s,draggingInProgress:t}))},d=typeof n.children=="function"?n.children(c,u):n.children;return $e.createElement(dR.Provider,{value:u},d)};qn.DraggableItem=pR;var hu=H(require("react"));var Qm=n=>hu.createElement(Ge,{...n,icon:"hidden",viewBox:"0 -960 960 960"},hu.createElement("path",{d:He.hidden[0]}));var gi=H(require("react"));function Jm(){return{}}var eg=n=>({allowColumnHideWhileDragging:e=>e??!0});var tg=require("react"),fR=(0,tg.createContext)(null);function yu(){return fR}var Ot=H(require("react"));var Do=H(require("react")),Dt=require("react");var Va=H(require("react"));function mR(n){let{height:e,width:t,count:o}=n;return Va.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var ng=Va.memo(mR);var og="mlx2t3";var Ga=H(require("react")),dg=require("react");var rg=require("react"),ig=(n,e)=>{(0,rg.useEffect)(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var ag={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},lg={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},sg={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Su="_1ueijco1",ug="_1ueijco0 _16lm1iw0";var cg=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=ag[`${n}`]:e=$(lg[`${n.horizontal}`],sg[`${n.vertical}`]),e};var gR="InfiniteVirtualScrollContainer";var pg=Ga.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??(0,dg.useRef)(null);return ig(c,i),Ga.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:$(a,gR,ug,cg(r))},o)});var Za=H(require("react")),wo=require("react");var fg=H(require("react")),fr=require("react");function hR(n){let[e,t]=(0,fr.useState)(n.updater.get),o=(0,fr.useRef)(null);return(0,fr.useLayoutEffect)(()=>{function r(a){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=n.updater.onChange(r);return()=>{o.current!=null&&cancelAnimationFrame(o.current),i()}},[n.updater,n.useraf]),e??null}var Xn=fg.memo(hR);var mg=H(co());var bu=(n,e)=>n-e,Sn={horizontal:!0,vertical:!0};function Ha(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var Tu="DebugID=";function Zn(n,e){return e&&e.startsWith(Tu)?e:e?`${Tu}${n}:${e}`:`${Tu}${n}`}var Ka={start:0,end:0},Cu=n=>{n()},Iu=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},gg=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},si=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function yR(n){return n.horizontalChange||n.verticalChange}var Io=class extends It{constructor(t){let o=Zn(t,`${t}:MatrixBrain`);super(o);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Ka;this.verticalExtendRangeBy=Ka;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 o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{si(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Cu:si;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Cu:si;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:o}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=Sn)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Sn)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=o.startIndex,u=o.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=Sn)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",u=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,c=this.getItemAt(l,t),d=u.start||0,p=u.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(c=Math.max(0,c-d),r+=d),p&&(r+=p);let f=c+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,c=Math.max(a,f-r)),{startIndex:c,endIndex:f}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,o),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,mg.default)(a,t,bu);return p>=0?p:~p-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:o};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,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Iu;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Sn){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,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:u}=t,c=typeof s=="number",d=typeof u=="number",p=c&&s!==this.availableWidth,f=d&&u!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=u,this.availableRenderHeight=u),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",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,C=l!=null,b=y&&a!==this.rowHeight,I=C&&l!==this.colWidth;y&&(this.rowHeight=a),C&&(this.colWidth=l);let T=t.rowspan!=null,R=t.colspan!=null,v=T&&t.rowspan!=this.rowspan,w=R&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),w&&(this.colspan=t.colspan);let P=S||I||p||w,x=h||b||f||v;(o||yR)({horizontalChange:P,verticalChange:x,colsChanged:S,colWidthChanged:I,widthChanged:p,colspanChanged:w,rowsChanged:h,rowHeightChanged:b,heightChanged:f,rowspanChanged:v})&&this.updateRenderCount({horizontal:P,vertical:x})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=Sn){this.reset(t),this.doUpdateRenderCount(t),this.updateLargeContent()}supportsLargeContent(t){return t==="vertical"}alignScrollOrigin(t,o){return Math.floor(o)}updateLargeContent(){let t=this.getVirtualizedContentSize(),o=this.supportsLargeContent("vertical")&&aa(t.height),r=this.supportsLargeContent("horizontal")&&aa(t.width);this.largeContent={vertical:o,horizontal:r},this.scrollRatio={vertical:o?Us(t.height,this.availableHeight):1,horizontal:r?Us(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:o}=this;if(!o.vertical&&!o.horizontal)return t;let r=ia();return{width:o.horizontal?r:t.width,height:o.vertical?r:t.height}}toContentScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop*o,scrollLeft:t.scrollLeft*r}}toNativeScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop/o,scrollLeft:t.scrollLeft/r}}getScrollOrigin(){return this.scrollOrigin}getDOMScrollPosition(t=this.getScrollPosition()){let o=this.getScrollOrigin();return!o.scrollTop&&!o.scrollLeft?t:{scrollTop:t.scrollTop-o.scrollTop,scrollLeft:t.scrollLeft-o.scrollLeft}}onScrollOriginChangeForBrain(t){return this.onScrollOriginChangeFns.add(t),()=>{this.onScrollOriginChangeFns.delete(t)}}updateScrollOrigin(){let{scrollPosition:t,largeContent:o,scrollOrigin:r}=this,i=u=>this.alignScrollOrigin("vertical",u),a=u=>this.alignScrollOrigin("horizontal",u),l=o.vertical?$s(t.scrollTop,i(r.scrollTop),i):0,s=o.horizontal?$s(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(o=>o(t))}doUpdateRenderCount(t=Sn){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(this.updateScrollOrigin(),o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Cu:si;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="function"){let c=[],d=0,p=r;d+=s,p-=u;for(let f=d;f<p;f++)c.push(this.getItemSize(f,t));a=Ha(l,c)}else a=(o?Math.ceil(l/o):0)+1;return a+=s+u,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{si(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Ka,this.verticalExtendRangeBy=Ka,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 Ru=H(co());function hg(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function yg(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function ui(n,e){for(let t of n)if(e(t))return t}var Ba=(n,e)=>n-e,Wa=class extends It{constructor(t,o){super(`${t}:GridCellManager`);this.matrix=new j;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,S=f>=s;(m||g||h||S)&&u.add(c)}),u};this.debugId=t,this.pool=o,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=ui(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=ui(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,u)=>{let c=[a,u],d=this.getCellAt(c);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Ba)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Ba)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,Ru.default)(o,t,Ba);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,Ru.default)(o,t,Ba);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>o&&this.detachCellAt(a),l===o&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return ui(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return ui(t,r=>this.getCellPosition(r)?.[1]===o)}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 Sg=H(co());var ja=class extends It{constructor(t,o){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=o,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,Sg.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var bg=!0,Ro=q(X.y),Tg=q(X.scrollTop),SR=q(X.scrollLeft),XL=q(X.columnOffsetAtIndex),wu=q(X.columnOffsetAtIndexWhileReordering),mr=class extends It{constructor(t,o,r){o=o||"ReactHeadlessTableRenderer";super(o);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.ownsPositionVars=!1;this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{i||(r-=this.brain.getScrollOrigin().scrollTop),t.style.setProperty(Ro,i?`calc( ${r}px + var(${Tg}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Ro}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=we.columnOffsets.get(r),d=`${wu}-${r}`,p=s?`calc( ${a}px + var(${Tg}, 0px) )`:`${a-this.brain.getScrollOrigin().scrollTop}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(Ro,p));let m=`translate3d(${this.ownsPositionVars?l?`calc( ${i}px + var(${SR}, 0px) )`:`${i-this.brain.getScrollOrigin().scrollLeft}px`:`var(${d}, ${c})`}, var(${Ro}), 0)`;if(t.__transformValue!==m&&(t.__transformValue=m,t.style.transform=m),u!=null&&this.ownsPositionVars){let g=`${u}`;t.__zIndex!==g&&(t.__zIndex=g,t.style.zIndex=g)}};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.cellsDetachedInRenderPass=null;this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let u=r.getItemOffsetFor(t,"vertical"),c=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=u>g-p?"end":u<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-g+s+p),this.brain.isHorizontalLayoutBrain){let S=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(S,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let u=r.getItemOffsetFor(t,"horizontal"),c=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=u>g-p?"end":u<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,u]}=i.getRenderRange();if(t<l||t>=u)return!1;let c=Math.floor((l+u)/2);if(t>=c){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,g=[];if(i&&(o&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,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&&(o&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,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]})),o){let h={start:[0,p],end:[o,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,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(o<a&&(d=!0,p="start"),l&&!d){let f=s-l;o>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(o)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ke(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o,r)=>{if(this.destroyed)return;let i=t.getElement(),a=this.cellManager.getCellPosition(t);if(!a)return;let[l,s]=a,u=this.brain.getCellOffset(l,s);if(u==null)return;let{x:c,y:d}=u;if(i){let p=()=>{this.updateHoverClassNamesForRow(l);let f=this.getCellRealCoordinates(l,s);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,bg){let m=this.ownsPositionVars?this.getFixedCellPlacement(l,s,{x:c,y:d}):null;this.setTransform(i,l,s,m??{x:c,y:d},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let h=(o?o.hidden:!!this.isCellCovered(l,s))?"-1":m?`${m.zIndex}`:i.dataset.zIndex||"auto";i.__zIndex!==h&&(i.__zIndex=h,i.style.zIndex=h)}else i.style.display="",i.style.left=`${c}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 o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,bg&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getDOMScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.flushPendingAfterCommitWork(),this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(I=>{let T=i.getRowIndex(I);if(T!=null){let R=this.brain.getItemOffsetFor(T,"vertical");if(R==null)return;let v=I.getElement();if(!v)return;this.setDetailTransform(v,T,{y:R,scrollLeft:o.getDOMScrollPosition(t).scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&Fp(o.getDOMScrollPosition(t),this.ownsPositionVars?p.getElement()?.parentElement??null:this.getInfiniteNode(p.getElement()));let f={cols:this.brain.getFixedEndColsOffsets({skipScroll:!0}),rows:this.brain.getFixedEndRowsOffsets({skipScroll:!0})},{start:m,end:g}=this.brain.getRenderRange(),[h,S]=m,[y,C]=g,b=(I,T)=>{let R=r.getCellAt([I,T])?.getElement(),v=R?o.getCellOffset(I,T):null;if(!R||!v)return;let w=this.getFixedCellPlacement(I,T,v,f);w&&this.setTransform(R,I,T,w,w.zIndex)};if(s||u)for(let I=h;I<y;I++){for(let T=0;T<s;T++)b(I,T);if(u){let T=a-u;for(let R=T;R<a;R++)b(I,R)}}if(c||d)for(let I=S;I<C;I++){for(let T=0;T<c;T++)b(T,I);if(d){let T=l-d;for(let R=T;R<l;R++)b(R,I)}}if(s&&c)for(let I=0;I<c;I++)for(let T=0;T<s;T++)b(I,T);if(s&&d){let I=l-d;for(let T=I;T<l;T++)for(let R=0;R<s;R++)b(T,R)}if(u&&c){let I=a-u;for(let T=0;T<c;T++)for(let R=I;R<a;R++)b(T,R)}if(u&&d){let I=l-d,T=a-u;for(let R=I;R<l;R++)for(let v=T;v<a;v++)b(R,v)}};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=o,this.cellManager=new Wa(o,r.cellPool),this.cellManager.onCellAttachmentChange((c,d)=>{d?this.onCellAttached(c):this.onCellDetached(c)}),this.rowManager=new ja(o,r.rowPool),this.rowManager.onRowAttachmentChange((c,d)=>{d?this.onRowAttached(c):this.onRowDetached(c)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ke(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop),u=t.onScrollOriginChange(this.onScrollOriginChange);this.onDestroy=()=>{u(),i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=zs(t)),this.infiniteNode}onCellAttached(t){if(!this.cellsDetachedInRenderPass?.delete(t)&&this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellsDetachedInRenderPass){this.cellsDetachedInRenderPass.add(t);return}this.addDetachedClassNames(t)}addDetachedClassNames(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,o){if(this.destroyed)return[];if(this.cellsDetachedInRenderPass)return this.renderRangeInternal(t,o);let r=this.cellsDetachedInRenderPass=new Set;try{return this.renderRangeInternal(t,o)}finally{this.cellsDetachedInRenderPass=null,r.forEach(i=>this.addDetachedClassNames(i))}}renderRangeInternal(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){let{start:l,end:s}=t,u=this.brain.isHorizontalLayoutBrain,{rowManager:c,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let P=t.start[1],x=t.end[1];m.forEach(M=>{P<=M&&M<x||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,x])=>{g.set(`${P}:${x}`,!0)});let S=f.reduce((P,x)=>P+Iu(x),0),y=r?f.reduce((P,x)=>P+gg(x),0):0,C=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([C,b]);let I=Math.min(C*b,S);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>y&&(c.poolSize=y));let T=hg(...f.map(P=>d.getCellsOutsideRenderRange(P)));T=yg(T,P=>{let x=d.getCellPosition(P);return!(x&&g.has(`${x[0]}:${x[1]}`))}),d.detachCells(T),d.poolSize=I;let R=new Map,v=new Map;f.forEach(P=>{let{start:x,end:M}=P,[D,E]=x,[L,V]=M;for(let N=D;N<L;N++){for(let F=E;F<V;F++){let W=`${N}:${F}`;if(R.has(W))continue;R.set(W,!0);let{rendered:Y,mapped:_}=this.isCellRenderedAndMappedCorrectly(N,F);if(N===D||F===E){let z=this.isCellCovered(N,F);if(z&&g.has(`${z[0]}:${z[1]}`)){let Q=d.getCellAt([N,F]);Q!=null&&d.detachCell(Q);continue}}if(Y&&!i&&_)continue;let K;Y?K=d.getCellAt([N,F]):K=d.getCellFor([N,F],u?"row":"column"),K==null&&(K=d.getDetachedCell()),this.renderCellAt(N,F,K,o)}!r||v.has(N)||(v.set(N,!0),c.isRowAttachedAt(N)&&!i)||this.renderDetailRowAtElement(N,this.rowManager.getRowFor(N),r)}}),h.forEach(([P,x])=>{let{rendered:M,mapped:D}=this.isCellRenderedAndMappedCorrectly(P,x);if(M){if(i||!D){let L=[P,x],V=d.getCellAt(L);this.renderCellAt(P,x,V,o)}return}let E=d.getCellFor([P,x],u?"row":"column");E!=null&&this.renderCellAt(P,x,E,o)});let w=d.getAllCells().map(P=>P.getNode());return r&&c.getAllRows().forEach(P=>{w.push(P.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(w),w}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(u,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}getMatrixRowIndexFromElement(t){let o=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(o):o}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),u=this.brain.getRowspan(t,o),c=this.brain.getColspan(t,o),d=u===1?l:this.brain.getRowHeightWithSpan(t,o,u),p=c===1?s:this.brain.getColWidthWithSpan(t,o,c),{row:f,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:h,colIndex:S}=this.getCellRealCoordinates(t,o),y=i({rowIndex:h,colIndex:S,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(I=>{let T=I.getElement();T&&(T.style.position="absolute",T.style.left="0px",T.style.top="0px"),this.updateElementPosition(I)});let C=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,o],C),this.updateElementPosition(r,{hidden:g,rowspan:u,colspan:c})}getFixedCellPlacement(t,o,{x:r,y:i},a){let{fixedRowsStart:l,fixedRowsEnd:s,fixedColsStart:u,fixedColsEnd:c}=this.brain.getFixedCellInfo(),d=this.brain.getColCount(),p=this.brain.getRowCount(),f=o<u,m=!f&&!!c&&o>=d-c,g=t<l,h=!g&&!!s&&t>=p-s,S=f||m,y=g||h;if(!S&&!y)return null;m&&(r=(a?.cols??this.brain.getFixedEndColsOffsets({skipScroll:!0}))[o]),h&&(i=(a?.rows??this.brain.getFixedEndRowsOffsets({skipScroll:!0}))[t]);let C=S&&y?f?g?1e5:2e5:g?3e5:4e5:f?u-o:m?d-o:g?l-t:p-t;return{x:r,y:i,scrollLeft:S,scrollTop:y,zIndex:C}}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Ua=class extends mr{constructor(t,o,r){super(t,o,r);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage)-this.brain.getScrollOriginPageIndex(),c=pe.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=we.columnOffsets.get(l.colIndex),f=`${wu}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Ro,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${Ro})`,S=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==S&&(t.__transformValue=S,t.style.transform=S)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};var Ig=H(require("react"));var gr=class gr extends It{constructor(t){super(t);this.cellRemoveSubscription=ye();this.cellAttachmentChangeSubscription=ye();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,o=t.values().next().value;return o||(this.poolSize+=gr.POOL_SIZE_INCREMENT,o=t.values().next().value),o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/gr.POOL_SIZE_INCREMENT)*gr.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};gr.POOL_SIZE_INCREMENT=1;var $a=gr;var Cg=new Map,bR=()=>{},vu=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=ye();let o=Cg.get(e)??0,r=`${e}:GridCellReact:${o}`;Cg.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=ye(),this.node=Ig.createElement(Xn,{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(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=bR,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}},Ya=class extends $a{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new vu(this.cellDebugId)}};var wg=H(require("react"));var hr=class hr extends It{constructor(t){super(t);this.rowRemoveSubscription=ye();this.rowAttachmentChangeSubscription=ye();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,o=t.values().next().value;return o||(this.poolSize+=hr.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/hr.POOL_SIZE_INCREMENT)*hr.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};hr.POOL_SIZE_INCREMENT=1;var qa=hr;var Rg=new Map,TR=()=>{},Pu=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=ye();let t=Rg.get(e)??0,o=`${e}:ListRowReact:${t}`;Rg.set(e,t+1),this.debugId=o,this.updater=ye(),this.node=wg.createElement(Xn,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=TR,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Xa=class extends qa{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new Pu(this.rowDebugId)}};function vg(n){return{cellPool:new Ya(n),rowPool:new Xa(n)}}function ci(n){let e=n.isHorizontalLayoutBrain?new Ua(n,`${n.name}:HorizontalLayoutTableRenderer`,vg(`${n.name}:HorizontalLayoutTableRenderer`)):new mr(n,`${n.name}:ReactHeadlessTableRenderer`,vg(`${n.name}:ReactHeadlessTableRenderer`)),t=ye();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function CR(n){let e=ci(n);return e.renderer.ownsPositionVars=!0,e}function IR(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=(0,wo.useMemo)(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:CR(e),[e,n.onRenderUpdater,n.renderer]);return(0,wo.useLayoutEffect)(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),(0,wo.useLayoutEffect)(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),(0,wo.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o}),e.onRenderRangeChange(u=>{i.renderRange(u,{force:!1,onRender:c=>{let d=a.get();d&&c&&d.length===c.length||a(c)},renderCell:t,renderDetailRow:o})})},[i,e,t,o,a,r]),(0,wo.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),Za.createElement(Xn,{updater:a})}var Qa=Za.memo(IR);var di=H(require("react")),vo=require("react");var Pg=ge({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Ja="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Dg=ge({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});function xg(n,e){let t=e-n.getScrollOriginPageIndex();return t?`calc(${pe.runtime.totalVisibleColumnsWidthVar} * ${t})`:null}function Mg(n,e){let t="0px",o=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(t=xg(n,n.getPageIndexForRow(o))??"0px",o=o%n.rowsPerPage);let r=n.getRowHeight(o),i=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop;return{activeCellRowHeight:`${r}px`,activeCellRowOffset:`${i}px`,activeCellRowOffsetX:t}}function Eg(n,e){let{scrollTop:t,scrollLeft:o}=n.getDOMScrollPosition(e);return{scrollTopForActiveRow:`${-t}px`,scrollLeftForActiveRowWhenHorizontalLayout:n.isHorizontalLayoutBrain?`${-o}px`:"0px"}}function Ag(n,e,t){let[o]=e,r=e[1],i;if(n.isHorizontalLayoutBrain&&n.rowsPerPage){let u=we.columnOffsets.get(r),c=xg(n,n.getPageIndexForRow(o));i=c?`calc( ${c} + ${u})`:u,o=o%n.rowsPerPage}let a=typeof t=="function"?t(o):t??n.getRowHeight(o),l=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop,s={activeCellRowHeight:`${a}px`,activeCellRowOffset:`${l}px`};return i!==void 0&&(s.activeCellColOffset=i),s}var{rootClassName:RR}=Ve,wR=`${RR}-ActiveRowIndicator`,vR=`calc(${X.activeCellRowOffsetX} + var(${q(X.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,PR={[q(X.activeCellOffsetY)]:X.activeCellRowOffset,transform:`translate3d(${vR}, calc( ${X.activeCellOffsetY} + var(${q(X.scrollTopForActiveRow)}, 0px)), 0px)`,height:X.activeCellRowHeight,maxWidth:pe.runtime.totalVisibleColumnsWidthVar},DR=n=>{let{brain:e}=n,t=(0,vo.useRef)(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=Zt(),a=(0,vo.useRef)(n.activeRowIndex);a.current=n.activeRowIndex;let l=()=>{let s=a.current;s==null||!t.current||Qo(Mg(e,s),t.current)};return(0,vo.useLayoutEffect)(l,[n.activeRowIndex,e]),(0,vo.useEffect)(()=>{let s=p=>{Qo(Eg(e,p),t.current)};s(e.getScrollPosition());let u=e.onScroll(s),c=e.onRenderCountChange(i),d=e.onScrollOriginChange(l);return()=>{d(),c(),u()}},[e]),di.createElement("div",{className:Ja,"data-name":"active-row"},di.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${wR} ${Dg({active:o})}`,style:o?PR:void 0}))},_g=di.memo(DR);var pi=H(require("react")),Po=require("react");var{rootClassName:xR}=Ve,MR=`${xR}-ActiveCellIndicator`,ER=q(X.columnZIndexAtIndex),Og=(n,e,t,o)=>{e!=null&&Qo(Ag(n,e,t),o.current)},AR=n=>{let{brain:e}=n,[t,o]=Zt(),r=(0,Po.useRef)(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];(0,Po.useLayoutEffect)(()=>{Og(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]);let a=(0,Po.useRef)(n);return a.current=n,(0,Po.useEffect)(()=>{let l=e.onRenderCountChange(()=>{o()}),s=e.onScrollOriginChange(()=>{let{activeCellIndex:u,rowHeight:c}=a.current;Og(e,u,c,r)});return()=>{l(),s()}},[e]),pi.createElement("div",{className:Ja,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${ER}-${n.activeCellIndex[1]})`}:void 0},pi.createElement("div",{"data-name":"active-cell-indicator",className:`${MR} ${Pg({visible:i})}`}))},Fg=pi.memo(AR);var el=[Kf,`${at}DetachedCell`];function tl(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var _R=$(og,Su);function Ng(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=n,{autoFocus:h}=g,S=(0,Dt.useRef)(null),[y,C]=(0,Dt.useState)({width:0,height:0});(0,Dt.useEffect)(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),(0,Dt.useEffect)(()=>{let R=S.current?.parentNode;return R?(h&&document.activeElement!==R&&R.focus(),Vo(R,()=>{let P={height:R.clientHeight,width:R.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let b=(0,Dt.useCallback)(R=>{let v=e.getDOMScrollPosition(R);requestAnimationFrame(()=>{S.current&&S.current.style.setProperty("transform",`translate3d(${-v.scrollLeft}px, ${-v.scrollTop}px, 0px)`)})},[e]),I=(0,Dt.useCallback)(R=>{e.setScrollPosition(e.toContentScrollPosition(R),b)},[e,b]);(0,Dt.useEffect)(()=>{let R=e.onRenderCountChange(()=>{C(e.getNativeScrollSize())});return C(e.getNativeScrollSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),R},[e]);let T=(0,Dt.useRef)({brain:e,vertical:1,horizontal:1});return(0,Dt.useLayoutEffect)(()=>{let R=T.current,v=e.getScrollRatio("vertical"),w=e.getScrollRatio("horizontal");T.current={brain:e,vertical:v,horizontal:w};let P=S.current?.parentElement;if(!P||R.brain!==e||R.vertical===v&&R.horizontal===w)return;let x=e.toNativeScrollPosition(e.getScrollPosition());R.vertical!==v&&(P.scrollTop=x.scrollTop),R.horizontal!==w&&(P.scrollLeft=x.scrollLeft)},[y,e]),Do.createElement(pg,{onContainerScroll:I,...g,ref:t},Do.createElement("div",{ref:S,className:_R,"data-name":"scroll-transform-target"},Do.createElement(Qa,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:el}),c!=null?Do.createElement(Fg,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?Do.createElement(_g,{brain:e,activeRowIndex:u}):null,Do.createElement(ng,{width:y.width,height:y.height}))}var Qn=H(require("react")),bn=require("react");var Mu=H(require("react"));var kg=H(require("react")),Du=require("react");var fi=require("react"),mi=H(require("react"));var{rootClassName:OR}=Ve,FR=`${OR}HeaderCell_ResizeHandle`;function NR(n){let e=(0,fi.useRef)(null),[t,o]=(0,fi.useState)(!1),r=(0,fi.useRef)(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=Em(n.groupColumns.map(b=>b.computedVisibleIndex),{columns:n.columns,domRef:e}),S=b=>{a==="end"&&(b*=-1);let{constrained:I,adjustedDiffs:T,adjustedDiff:R}=n.computeResize(b);return r.current!==I&&o(I),h.resize(T),R},y=b=>{if(g){let I=n.groupColumns.reduce((v,w)=>v+w.computedWidth-w.computedMinWidth,0),T=n.brain.getAvailableSize(),R={width:T.width+I,height:T.height};n.brain.update(R),g=!1}S(Math.round(b.clientX-f))},C=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",C);let I=Math.round(b.clientX-f),T=S(I);h.resize(n.groupColumns.map(()=>0)),n.onResize(T)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",C)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:pe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return mi.createElement("div",{ref:e,className:`${FR} ${Oa} ${Na({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},mi.createElement("div",{style:{...c,...n.style},className:Fa({constrained:t})}))}var Lg=mi.memo(NR);function zg(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:u}=ee(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),c=n[n.length-1],d=(0,Du.useCallback)(g=>{let h=l(),{columnSizing:S,viewportReservedWidth:y,bodySize:C}=h,b=s().computedVisibleColumns,I=!1,T=b.reduce((w,P)=>(P.computedFlex&&(w[P.id]={...S[P.id],flex:P.computedWidth},I=!0),w),{}),R=I?{...S,...T}:S;return fp({availableSize:du(C),reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:n.length,items:b.map(w=>({id:w.id,resizable:w.computedResizable,computedFlex:w.computedFlex,computedWidth:w.computedWidth,computedMinWidth:w.computedMinWidth,computedMaxWidth:w.computedMaxWidth}))})},[c]),p=(0,Du.useCallback)(g=>{let{columnSizing:h,reservedWidth:S}=d(g);u.viewportReservedWidth=S,u.columnSizing=h},[d]);return n.some(g=>g.computedResizable)?kg.createElement(Lg,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:p}):null}var xu=`${at}HeaderGroup`,Vg=q(X.columnWidthAtIndex),LR=q(X.columnZIndexAtIndex);function Gg(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=e.uniqueGroupId.join(","),u=wp(g=>g.state.focusedHeaderItem?.type==="group"&&g.state.focusedHeaderItem.key===s),c=zg(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),d=o[0],p=o.length>1?"calc( "+o.map(g=>`var(${Vg}-${g.computedVisibleIndex})`).join(" + ")+" )":`var(${Vg}-${d.computedVisibleIndex})`,f=`calc(var(${LR}-${d.computedVisibleIndex}) + ${i-e.depth})`,m=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return m=m&&typeof m=="object"?m:{},m.width=p,m.height=t,Mu.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,tabIndex:-1,className:$(np,xu,u?`${xu}--focused`:""),style:m,"data-z-index":f},Mu.createElement("div",{className:$(`${xu}__header-content`,Bt)},a),c)}var Hg=require("react");var _u=H(require("react")),Eu;function Ou(){return Eu||(Eu=_u.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var Au;function nl(){return Au||(Au=_u.createContext(null))}function Ne(n){let e=nl(),t=(0,Hg.useContext)(e);return Go(t,n)}function an(){return Ne(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:kR}=Ve,zR=[],Kg=`${kR}Header`,VR=Zd({overflow:!1}),Bg=()=>{};function GR(n){let{bodyBrain:e,headerBrain:t,columns:o,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=n,{getState:u,headerOptions:c,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=ee(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,bn.useRef)(null),h=(0,bn.useCallback)(D=>{if(g.current){let{scrollLeft:E}=t.getDOMScrollPosition(D);g.current.style.transform=`translate3d(${-E}px, 0px, 0px)`}},[t]);(0,bn.useEffect)(()=>{let D=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),D},[t]);let S={ref:g,className:$(Kg,`${Kg}--virtualized`,i,VR),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:C,dataSourceActions:b}=an(),{allRowsSelected:I,someRowsSelected:T,selectionMode:R,filterTypes:v,filterDelay:w}=Ne(D=>({allRowsSelected:D.dataSourceState.allRowsSelected,someRowsSelected:D.dataSourceState.someRowsSelected,selectionMode:D.dataSourceState.selectionMode,filterTypes:D.dataSourceState.filterTypes,filterDelay:D.dataSourceState.filterDelay})),P=(0,bn.useMemo)(()=>({allRowsSelected:I,someRowsSelected:T,selectionMode:R}),[I,T,R]),x=(0,bn.useCallback)(D=>{let{rowIndex:E,colIndex:L,domRef:V,height:N,widthWithColspan:k,heightWithRowspan:F,hidden:W}=D,Y=o[L];if(!Y||W)return null;let _=t.isHorizontalLayoutBrain?t.getPageIndexForRow(E):null,K=l?l.pathsToCells.get([E,L]):null;if(K&&K.type==="group"){let z=K.columnItems.map(ue=>ue.ref),Q={...K.ref,id:K.id,uniqueGroupId:K.uniqueGroupId,depth:K.depth,columns:z.map(ue=>ue.id),computedWidth:K.computedWidth,groupOffset:K.groupOffset};return u().columnGroupVisibility[K.id]!==!1?Qn.createElement(Gg,{horizontalLayoutPageIndex:_,bodyBrain:e,columnGroupsMaxDepth:s,domRef:V,columns:z,width:k,height:N,columnGroup:Q}):null}return Qn.createElement(jg,{domRef:V,column:Y,horizontalLayoutPageIndex:_,headerOptions:c,dataSourceStatePartialForHeaderCell:P,filterTypes:v,filterDelay:w,getDataSourceState:y,dataSourceApi:C,dataSourceActions:b,width:k,height:F,columnsMap:m})},[c,o,a,l,s,f,t,y,C,b,v,w,P]),M=go(ma);return Qn.createElement(qn,{orientation:"horizontal",dragListId:M,dragStrategy:"inline",onDrop:Bg,updatePosition:Bg},D=>Qn.createElement("div",{...D,...S,className:$(D.className,S.className)},Qn.createElement(Qa,{name:"header",renderCell:x,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:zR,cellDetachedClassNames:el})))}var Wg=Qn.memo(GR);function Ug(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=ee(w=>({computedPinnedStartColumns:w.computed.computedPinnedStartColumns,computedPinnedEndColumns:w.computed.computedPinnedEndColumns,computedVisibleColumns:w.computed.computedVisibleColumns,columnSize:w.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:u,columnGroupsMaxDepth:c,computedColumnGroups:d,showColumnFilters:p}=ee(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:c+2,m=f*s+(p?s:0),g=Ot.useMemo(()=>{if(!(!d||!Object.keys(d).length))return la(a,d,u,c)},[a,d,u]),h=Ot.useCallback(({rowIndex:w,colIndex:P})=>{let x=a[P],M=1,D=1;if(!x||!g)return{rowspan:M,colspan:D};let E=g.pathsToCells.get([w,P]);if(!E)return{rowspan:M,colspan:D};if(E.type==="column")return{colspan:D,rowspan:f-E.depth};let L=E.columnItems.findIndex(V=>V.id===x.id);return{rowspan:M,colspan:L===0?E.columnItems.length:1}},[d,c,a,g,f,u]),S=Ot.useCallback(({rowIndex:w,colIndex:P})=>h({rowIndex:w,colIndex:P}).rowspan,[h]),y=Ot.useCallback(({rowIndex:w,colIndex:P})=>h({rowIndex:w,colIndex:P}).colspan,[h]),C=Ot.useCallback(w=>p?w<f-1?s:2*s:s,[f,p,s]);tl(e,{colWidth:l,rowHeight:C,rows:f,cols:a.length,height:m,rowspan:S,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let b=Ot.createElement(Wg,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:c,columnAndGroupTreeInfo:g}),I=o.vertical&&Qt()?Ot.createElement("div",{className:rp,style:{zIndex:1e3,width:Qt()}}):null,T=ze(),R=Ot.useCallback(w=>{Tf(T,w)},[]),v=Ot.useCallback(w=>{Cf(T,w)},[]);return Ot.createElement("div",{className:`${$r} ${sp}`,style:{height:m},tabIndex:0,onFocus:R,onBlur:v},b,I)}var{ManagedComponentContextProvider:HR}=Vt({initSetupState:Jm,forwardProps:eg,Context:yu()});function Fu(n){let{getComputed:e,header:t,brain:o,headerBrain:r,wrapRowsHorizontally:i}=ee(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?gi.createElement(HR,{...n},gi.createElement(Ug,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function $g(){return gi.useContext(yu()).componentState}var KR=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||Bn;return Ee.createElement(s,{domProps:{className:rr},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},Ea=Ee.createContext(null);var BR=q(X.columnZIndexAtIndex),WR=q(X.columnVisibilityAtIndex),Nu=Ee.createElement("div",{className:Bi[1]}),nV=ji({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[bt]:"",[pr]:""});function jR(n){let e=n.column,{allowColumnHideWhileDragging:t}=$g(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:u}=n,{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=o,{onDragItemPointerDown:f,dragListId:m}=Co(),{api:g,getComputed:h,getState:S,actions:y,getDataSourceMasterContext:C,showColumnFilters:b,components:I,portalDOMRef:T,columnHeaderHeight:R,columnReorderDragColumnId:v,columnMenuVisibleForColumnId:w,columnReorderInPageIndex:P,headerFocused:x}=ee(Z=>({api:Z.api,getComputed:Z.getComputed,getState:Z.getState,actions:Z.actions,getDataSourceMasterContext:Z.getDataSourceMasterContext,showColumnFilters:Z.state.showColumnFilters,components:Z.state.components,portalDOMRef:Z.state.portalDOMRef,columnHeaderHeight:Z.state.columnHeaderHeight,columnReorderDragColumnId:Z.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:Z.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:Z.state.columnReorderInPageIndex,headerFocused:Z.state.focusedHeaderItem?.type==="column"&&Z.state.focusedHeaderItem.key===n.column.id})),M=v===e.id,D=P!=null?r!==P:!1,{onResize:E,height:L,width:V,headerOptions:N,columnsMap:k}=n,F=e.computedSortInfo,W=e.header,Y=(0,Tn.useCallback)(Z=>{U.current=Z,n.domRef?.(Z)},[n.domRef]),_=N.alwaysReserveSpaceForSortIcon,K=e.headerAlign??e.align,z=(typeof K=="function"?K({isHeader:!0,column:e}):K)??"start",Q=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",Te=St(e,{actions:y,api:g,dataSourceActions:l,dataSourceApi:a,getComputed:h,getDataSourceState:i,getDataSourceMasterContext:C,getState:S}),ue=Te.isSortable(),fe=ue&&(e.computedSorted||_)?Ee.createElement(_a,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:pe.spacing[2],marginInlineEnd:pe.spacing[2]},className:`${wt}__sort-icon ${ip} ${lp({align:z})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,xe=e.computedFilterable&&e.computedFiltered?Ee.createElement($o,null):null,de=e.headerCssEllipsis??e.cssEllipsis??!0,ne={reserveSpaceWhenHidden:z==="center",menuVisible:w===e.id,style:z==="end"?{marginInlineStart:`calc(${pe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:pe.spacing[2]}:{marginInlineEnd:`calc(${pe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:pe.spacing[2]},domProps:{onMouseDown:Z=>{Z.stopPropagation(),Te.toggleContextMenu(Z.target)}}},se=e.components?.MenuIcon||I?.MenuIcon||ri,he=Ee.createElement(se,{...ne}),U=(0,Tn.useRef)(null),te={horizontalLayoutPageIndex:r,dragging:M,domRef:Y,htmlElementRef:U,renderLocation:"column-header",column:e,columnsMap:k,columnSortInfo:F,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:c,selectionMode:p,api:g,dataSourceApi:a,columnApi:Te,renderBag:{sortIcon:fe,filterIcon:xe,menuIcon:he,menuIconProps:ne,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},B=te,ae=B.renderBag.header,oe=()=>{let Z={...te,renderBag:{...te.renderBag}};if(e.renderSortIcon&&(Z.renderBag.sortIcon=Ee.createElement($n,{render:e.renderSortIcon,renderParam:{...Z,renderBag:{...Z.renderBag}}})),e.renderFilterIcon&&(Z.renderBag.filterIcon=Ee.createElement($n,{render:e.renderFilterIcon,renderParam:{...Z,renderBag:{...Z.renderBag}}})),typeof e.renderMenuIcon=="function"&&(Z.renderBag.menuIcon=Ee.createElement($n,{render:Ct=>{if(typeof e.renderMenuIcon!="function")return null;let Mn=e.renderMenuIcon(Ct);return Mn?Mn.type===se||Mn.type===ri?Mn:Ee.createElement(se,{...ne},Mn):null},renderParam:{...Z,renderBag:{...Z.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){Z.renderBag.selectionCheckBox=Ee.createElement($n,{render:KR,renderParam:{...Z,renderBag:{...Z.renderBag}}});let Ct=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Ct&&Ct!==!0&&(Z.renderBag.selectionCheckBox=Ee.createElement($n,{render:Ct,renderParam:{...Z,renderBag:{...Z.renderBag}}}))}W instanceof Function&&(Z.renderBag.header=ae=Ee.createElement($n,{render:W,renderParam:{...Z,renderBag:{...Z.renderBag}}}));let ie=e.renderMenuIcon===!1?null:Z.renderBag.menuIcon,Ae=de?Ee.createElement("div",{className:Bt},Z.renderBag.header):Z.renderBag.header,ut=Ee.createElement(Ee.Fragment,null,z==="center"?Nu:null,Z.renderBag.selectionCheckBox,Ae,Z.renderBag.sortIcon,Z.renderBag.filterIcon,z==="center"?Nu:null,z!=="center"?Nu:null,ie);return e.renderHeader?Ee.createElement($n,{render:e.renderHeader,renderParam:{...Z,renderBag:{...Z.renderBag,all:ut}}}):ut};(0,Tn.useEffect)(()=>{let Z=null,ie=U.current;return E&&ie&&(Z=Vo(ie,E)),()=>{Z?.()}},[U.current,n.onResize]);let re={height:L};e.headerStyle&&(re=typeof e.headerStyle=="function"?{...re,...e.headerStyle(B)||{}}:{...re,...e.headerStyle});let O=typeof e.headerClassName=="function"?e.headerClassName(B):e.headerClassName,{onPointerDown:A,proxyPosition:ce,dragColumnOutside:Re}=Ff({columnId:e.id,domRef:U,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),Se=null,be=Ea.Provider,Me={filtered:e.computedFiltered,verticalAlign:Q,align:z},et=Ee.useMemo(()=>Fm({columnId:e.id,filterDelay:u,api:g,getState:S,getComputed:h,getDataSourceState:i}),[u,e.id]),tt=e.computedFilterType,We=s[tt],lt=e.computedFilterable?e.computedFilterValue?.filter.operator??We?.defaultOperator:void 0,Xe=e.computedFilterable&&We?We.operators.find(Z=>Z.name===lt):void 0,Ze=Xe?.components?.FilterEditor||We?.components?.FilterEditor||e.components?.FilterEditor||Zo,G=We?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,J=Om(e,{horizontalLayoutPageIndex:r}),me=`var(${BR}-${e.computedVisibleIndex})`;re.zIndex=me,re.visibility=`var(${WR}-${e.computedVisibleIndex}, visible)`;let Ce={"data-field":`${e.field||""}`,"data-column-id":e.id,[bt]:e.id,[pr]:m,"data-header-align":z,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},st=e.computedFilterable?Ee.createElement(vp,{horizontalLayoutPageIndex:r,filterEditor:Ze,filterOperatorSwitch:G??Pp,operator:Xe,filterTypes:s,onChange:et,columnFilterType:tt,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:R}):Ee.createElement(Dp,null);B.renderBag.filterEditor=st;let le=(0,Tn.useCallback)(Z=>{A(Z),f(Z)},[A,f]),Ye=oe();return M&&ce&&(Se=Ee.createElement("div",{key:e.id,className:`${wt}Proxy ${Yd}`,style:{height:L,width:V,left:ce.left??0,top:ce.top??0}},Ee.createElement("div",{className:qd({visible:Re})},Ee.createElement(Qm,{size:16})),ae),Se=(0,Yg.createPortal)(Se,T.current)),Ee.createElement(be,{value:B},Ee.createElement(xa,{domRef:Y,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",tabIndex:-1,column:e,...Ce,"data-z-index":me,style:re,width:V,onPointerDown:le,contentClassName:$($d(Me),Cd[z]),contentStyle:b?{height:L/2}:void 0,className:$(wt,Pd.none,ue?bd.pointer:"",O,ea(e,[wt,hn],Xd,{dragging:M,insideDisabledDraggingPage:D,align:z,verticalAlign:Q,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1,focused:x}),Ud),cssEllipsis:de,afterChildren:Ee.createElement(Ee.Fragment,null,b?st:null,J),renderChildren:Ye}),Se)}var jg=Ee.memo(jR);function Kr(){return(0,Tn.useContext)(Ea)}var Cn=H(require("react")),nh=require("react");function qg(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Zg="https://infinite-table.com",Qg="Invalid Infinite Table license. See console for details.",Jg={padding:pe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem"},UR={...Jg,background:"white",color:"black"},$R={...Jg,background:"#fee2e2",color:"#991b1b"},eh={opacity:"1",visibility:"visible",display:"inline-block",pointerEvents:"all",textDecoration:"underline"},YR={...eh,color:"black"},qR={...eh,color:"#991b1b"};function Lu(n){return n?{footer:$R,anchor:qR}:{footer:UR,anchor:YR}}var Xg=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(qg(t),o,"important")};function th(n,e){let t=Lu(e),o=()=>{setTimeout(()=>{let i=n();Xg(i,t.footer),Xg(i?.querySelector("a")??null,t.anchor)})};o();let r=setInterval(o,1e3);return()=>{clearInterval(r)}}var oh=Cn.forwardRef(function(e,t){let{invalid:o=!1,...r}=e,{rootClassName:i}=Ki(),a=Cn.useRef(null),l=Cn.useCallback(u=>{a.current=u,t&&(typeof t=="function"?t(u):t.current=u)},[]);(0,nh.useEffect)(()=>th(()=>a.current,o),[o]);let s=Lu(o);return Cn.createElement("div",{ref:l,...r,className:$(`${i}-Footer`,o?`${i}-Footer--invalid`:null,Np,r.className),style:s.footer},o?`${Qg} `:null,"Powered by"," ",Cn.createElement("a",{href:Zg,rel:"noopener noreferrer",role:"link",target:"_blank",style:s.anchor},"Infinite Table"))});var ol=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new j(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new j(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 ol{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 Ht(){let n=Fe().performance?.now();return`${Date.now()}:${n}`}function rl(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var rh=new WeakMap;function il(n,e){if(!n||!n.length)return[];let t=rh.get(n);t||(t=new WeakMap,rh.set(n,t));let o=t.get(e);if(o)return o;let r=[],i=rl(n,e)||[];for(let a=0,l=i.length;a<l;a++){let s=i[a],u=e[s.filter.type];if(s.disabled||!u)continue;let c;for(let d=0;d<u.operators.length;d++){let p=u.operators[d];p.name===s.filter.operator&&(c=p.fn)}c&&r.push({field:s.field,valueGetter:s.valueGetter||u.valueGetter,fn:c,value:s.filter.value,emptyValues:u.emptyValues})}return t.set(e,r),r}function ku(n,e){if(!n.length)return!0;let{data:t}=e,o={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=n.length;r<i;r++){let a=n[r];if(o.field=a.field,o.filterValue=a.value,o.currentValue=a.valueGetter?a.valueGetter(o):a.field?t[a.field]:t,o.emptyValues=a.emptyValues,!a.fn(o))return!1}return!0}var XR=0;function zu(n){return XR++,ku(il(n.filterValue,n.filterTypes),n)}function al(n){return il(n.filterValue,n.filterTypes).length?n.isLeafNode?zu(n):n.filterTreeNode(n.data):!0}var ZR="group-by",ih="group-by-";function ah(n){let e=n.map(t=>t.valueGetter?o=>t.valueGetter({data:o,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function ll(n,e){if(!n?.length||!e?.length)return n;let t=!1,o=n.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===ZR){let i=ah(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(ih)){let i=r.id.slice(ih.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=ah([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?o:n}var lh=!0,QR={originalDataArray:!0,changes:!0},JR={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function Ut(n,e,t){let o=ll(n.sortInfo,n.groupBy),r=n.multiSort?o:o?.[0]??null,i={append:!1,originalDataArray:n.originalDataArray,sortInfo:r,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(i.livePaginationCursor=n.livePaginationCursor,i.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=n.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],n.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=n.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=Vu(i.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=n.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!QR[s]){let u=s,c=JR[u],d=i[u],p=l[u];(c?c(d,p):d===p)||(a[u]=!0)}return i.changes=a,i}function In(n,e,t,o,r){let i=Ut(e,o,r),a=i.append;if(e.lazyLoad){let c=e.originalLazyGroupData,d=[vt,...i.groupKeys||[]],p=c.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):c.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:lh,totalCount:0}),t.originalLazyGroupDataChangeDetect=Ht()}if(typeof n=="function")try{n=n(i)}catch(c){n=Promise.reject(c)}let s=typeof n=="object"&&typeof n.then=="function"&&(!e.lazyLoad||!a&&!i.groupKeys?.length);s&&(t.loading=!0);let u=c=>{if(console.error('The DataSource "data" function failed:',c),e.lazyLoad){let d=i.groupKeys||[],p=e.originalLazyGroupData.get([vt,...d]),f=c instanceof Error?c.message:String(c);if(d.length&&p&&!p.childrenAvailable)p.childrenLoading=!1,p.cache=!1,p.error=f,t.originalLazyGroupDataChangeDetect=Ht();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(n).then(c=>{let d=[],p=!1;if(Array.isArray(c.data)){let m=c;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,C){let b=[vt,...S],I=y.data,T={cache:y.cache??lh,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??I.length,totalCountUnfiltered:y.totalCountUnfiltered,totalChildrenCount:y.totalChildrenCount,totalChildrenCountUnfiltered:y.totalChildrenCountUnfiltered,children:I,error:y.error},R=[];if(i.lazyLoadBatchSize&&!C){let w=g.get(b),P=!w,x=yp({children:!0},w||{},T);P&&(x.chidren=[]),x.children.length=x.totalCount;let M=i.lazyLoadStartIndex??0,D=Math.min(y.totalCount??I.length,M+i.lazyLoadBatchSize);for(let E=M;E<D;E++){let L=T.children[E-M];if(!L)throw`lazily loaded item not found at index ${E-M}`;x.children[E]=L,L.dataset&&R.push({keys:L.keys,dataset:L.dataset})}P&&g.set(b,x)}else T.children.forEach(w=>{w&&w.dataset&&R.push({keys:w.keys,dataset:w.dataset})}),T.children.length=T.totalCount,g.set(b,T);let v=!1;if(!S||!S.length){let w=g.get([vt]);t.originalDataArray=[...w.children],v=!0}if(v||(t.originalLazyGroupDataChangeDetect=Ht()),R.length){let w=S;R.forEach(({keys:P,dataset:x})=>{h(P,x,w)})}};var f=h;let g=e.originalLazyGroupData;p=!0,h(i.groupKeys||[],m)}}else d=c;p||(t.originalDataArray=a?e.originalDataArray.concat(d):d),s&&(t.loading=!1)}).catch(u)}function Vu(n,{filterTypes:e,filterMode:t}){return t==="local"?!n||!n.some(o=>o.valueGetter)?n:n.map(sh):(rl(n,e)||[]).map(sh)}function sh(n){if(!n.valueGetter)return n;let e={...n};return delete e.valueGetter,e}function uh(){let n;return(e,t,o)=>{if(n&&n.filterValue===e&&n.filterTypes===t&&n.filterMode===o)return n.result;let r=Vu(e,{filterTypes:t,filterMode:o});return n&&n.filterValue===e&&JSON.stringify(n.result)===JSON.stringify(r)&&(r=n.result),n={filterValue:e,filterTypes:t,filterMode:o,result:r},r}}var ew=()=>new Promise(n=>{Ke(n)});function Gu(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function ch(n){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:o}=n;if(!e||!t||t<=0)return!1;for(let r of o.keys())if(r.length===1)return!0;return!1}function dh(n){for(let[e,t]of n.entries())t==="failed"&&n.delete(e)}function ph(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,u=l?()=>!1:g=>s[g].data!=null,c=!l,d=new j,p=["_______xxx______"];for(let g=t;g<=o;g++){let h=s[g];if(!h)continue;let S=u(g),y=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&y.pop();let C=y.length?y:p,b=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let I={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:c},T=h.groupKeys,R=d.get(T);if(!R?.[h.id]){let v=!R;R=R||{},R[h.id]||(R[h.id]=I),v&&d.set(T,R)}}if(!S&&r!=null){let I=d.get(C),T=Math.floor(b/r)*r,R=b-T,v=s[h.indexInAll-R].indexInAll,w=u(v),P=s[v].id;if(w||I?.[P])continue;let x=!I;I=I||{};let M={lazyLoadStartIndex:T,lazyLoadBatchSize:r,groupKeys:y,append:c};I[P]||(I[P]=M),x&&d.set(C,I)}}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(()=>ew()).then(()=>In(...y))},f)}function Hu(n,e){let{rowIndex:t,primaryKey:o}=e,{dataArray:r}=n.getDataSourceState();if(o!==void 0){let i=n.dataSourceApi.getIndexByPrimaryKey(o);if(i!==-1)return i;if(r[t]?.id!==o)return-1}return r[t]?t:-1}function hi(n,e){let t=Hu(n,e);return t===-1?null:on({...n,rowIndex:t,columnId:e.columnId})}function yi(n,e){console.warn(`Skipping "${n}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function Ku(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[u+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(o.columnMenuVisibleForColumnId=p),p}function sl(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function Bu(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function fh(n,e,t){if(Bu(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/o),p=Math.floor(u/o),f=l%o,m=u%o,g=Math.min(f,m),h=Math.max(f,m),S=[];for(let y=d;y<=p;y++)for(let C=g;C<=h;C++){let b=y*o+C;if(y===d)for(let I=s;I<r;I++)S.push({rowIndex:b,colIndex:I});else if(y===p)for(let I=0;I<=c;I++)S.push({rowIndex:b,colIndex:I});else for(let I=0;I<r;I++)S.push({rowIndex:b,colIndex:I})}return S}function tw(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var Wu=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Wn(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ue(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=Wn(l,this.getDataSourceState),h=Wn(u,this.getDataSourceState);if(!g||!h)return;let S=g.indexInAll,y=h.indexInAll,[C,b]=sl({rowIndex:S,colIndex:f},{rowIndex:y,colIndex:m});for(let I=C.rowIndex;I<=b.rowIndex;I++)for(let T=C.colIndex;T<=b.colIndex;T++){let R={rowIndex:I,colIndex:T},[v,w]=this.getCellSelectionPosition(R);o?a.selectCell(v,w):a.deselectCell(v,w)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=ba(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=tw(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ue(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ue(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ue:new Ue(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ue(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new Ue(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new Ue(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function mh(n){return new Wu(n)}var yr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Ft=class extends yr{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function gh(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new Ft({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new Ft({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 Ft(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new Ft(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Jn(n,e,t){return Math.min(Math.max(n,e),t)}function ul(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Jn(a,r,i)}function nw(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,u=s.length,c=t(),{brain:d}=c,{activeRowIndex:p}=c;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,S=0,y=u-1,C={ArrowDown:()=>{p=ul(o,p,1)},ArrowUp:()=>{p=ul(o,p,-1)},ArrowLeft:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let T=d.rowsPerPage;p-T>=S?p=p-T:C.ArrowUp();return}return I&&I.isGroupRow?i.collapseGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.collapseRowDetail(I.id):!1},ArrowRight:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let T=d.rowsPerPage;p+T<=y?p=p+T:C.ArrowDown();return}return I&&I.isGroupRow?i.expandGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.expandRowDetail(I.id):!1},Enter:()=>{let I=s[p];return I&&I.isGroupRow?i.toggleGroupRow(I.groupKeys):I&&I.isTreeNode&&I.isParentNode?a.treeApi.toggleNode(I.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.toggleRowDetail(I.id):!1},PageDown:()=>{p=Math.min(p+h,u-1)},PageUp:()=>{p=Math.max(p-h,S)},End:()=>{p=y},Home:()=>{p=S}},b=C[l];return b?(b(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function ju(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,u=i().dataArray,c=o(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[S,y]}=p.getRenderRange(),C=S-g-1,b=y-h-1,I=i().dataArray.length-1,T=r().computedVisibleColumns.length-1,R=0,v=0;f=Jn(f,0,I),m=Jn(m,0,T);let w={ArrowDown:()=>{f=Jn(f+1,R,I)},ArrowUp:()=>{f=Jn(f-1,R,I)},ArrowLeft:()=>{if(m===v)if(f!==R&&(m=T),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f-x>=R?f=f-x:w.ArrowUp()}else w.ArrowUp();else m=Jn(m-1,v,T)},ArrowRight:()=>{if(m===T)if(f!==I&&(m=v),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f+x<=I?f=f+x:w.ArrowDown()}else w.ArrowDown();else m=Jn(m+1,v,T)},Enter:()=>{let x=u[f];return x&&x.isGroupRow?t.toggleGroupRow(x.groupKeys):x&&x.isTreeNode&&x.isParentNode?a.treeApi.toggleNode(x.nodePath):x&&t.rowDetailApi.isRowDetailEnabledForRow(x.id)?t.rowDetailApi.toggleRowDetail(x.id):!1},PageDown:()=>{s?m=Math.min(m+b,T):f=Math.min(f+C,I)},PageUp:()=>{s?m=Math.max(m-b,v):f=Math.max(f-C,R)},End:()=>{s?m=T:f=I},Home:()=>{s?m=v:f=R}},P=w[l];return P?(P(),[f,m]):!1}function ow(n,e){let t=ju(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var rw={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function hh(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!rw[t]?!1:t==="ArrowUp"&&!e.shiftKey&&(l==="row"?i===0:l==="cell"?a?.[0]===0:!1)&&wf(n,l==="cell"?a[1]:null)?!0:i!=null&&l==="row"?nw(n,e):a!=null&&l==="cell"?ow(n,e):!1}var Uu=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=ul(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=ju(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function yh(n){return new Uu(n)}function Sh(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var $u=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(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(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=Hu({...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={...on({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;o.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let u=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)}),c;try{c=await u(l)}catch(p){c=p}let d=c instanceof Error?c:!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:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...on({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(on({...this.context,api:this,columnId:r,rowIndex:i}));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,o=this.columnApiById.get(t);if(o)return o;let r=St(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:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),u=l.get(r),c=i.getRowInfoByIndex(s),d=c?.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",g=sr({column:u,rowInfo:c,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 o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};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(),o=new xt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[vt,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||In(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=j.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Ht())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let g=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(o.offset||0),m=u.scrollTop>p+(o.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&this.setNativeScroll({scrollLeft:u.scrollLeft}),u.scrollTop!==c.scrollTop&&!m&&this.setNativeScroll({scrollTop:u.scrollTop}),!0)};this.context=e,this.rowSelectionApi=Qf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=yh({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=gh({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=mh({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(Ku(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Ku(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??lm({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(on({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=!!i.pivotColumn,s=i.groupByForColumn,u=l?void 0:i.field,c=s?Array.isArray(s)?s:[s]:[],d=c.map(m=>m.valueGetter?g=>m.valueGetter({data:g,field:m.field}):m.field?m.field:m.groupField??void 0).filter(Fn);d.length&&(u=d);let p=i.computedSortType;if(c.length&&p===mn){let m=this.getState().initialColumns;p=c.flatMap(h=>{let S=h.field??h.groupField,y=S?r.get(S):null;if(y)return y.computedSortType;let C=S?so(m,S):void 0;return C?C.sortType||(typeof C.type=="string"?C.type:"string"):[mn]})}c.length&&!Array.isArray(p)&&(p=[p]);let f={dir:t,id:i.id,field:u,type:p};!l&&i.valueGetter&&(f.valueGetter=m=>i.valueGetter({data:m,field:i.field})),this.setSortInfoForColumn(e,f,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Sh(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:Sh(d,l)?(u=!0,t):d),u||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;o.computedFilterValue?(c={...o.computedFilterValue,filter:{...o.computedFilterValue.filter,operator:u}},s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:o.valueGetter},o.field&&(c.field=o.field)),c.id=o.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){this.getState().pendingColumnFilters.cancel(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){this.getState().pendingColumnFilters.cancel(e);let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],u=o.filterTypes[l];if(i=!0,!u)return null;let c=a.filter.operator??u?.defaultOperator,p=s[c].defaultFilterValue??(u.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:c,value:p}}}return a}).filter(Fn),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}setNativeScroll(e){let t=this.getState(),o=t.scrollerDOMRef.current;if(!o)return;let r=t.brain.toNativeScrollPosition({scrollTop:e.scrollTop??0,scrollLeft:e.scrollLeft??0});e.scrollTop!==void 0&&(o.scrollTop=r.scrollTop),e.scrollLeft!==void 0&&(o.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 o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=o.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&this.setNativeScroll({scrollTop:s.scrollTop}),c&&this.setNativeScroll({scrollLeft:s.scrollLeft}),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),u=o.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&this.setNativeScroll({scrollLeft:l.scrollLeft}),!0)}};function bh(n){return new $u(n)}var xo=require("react");var iw=10;function Th(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${hn} > .${ei}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${wt}`);if(t===!1&&d)return;let p=c.getAttribute("data-column-id"),f=u.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Bt.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let g=Fe().getComputedStyle(c);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+iw}if(m+=s[p],d){let g=0;c.childNodes.forEach(h=>{if(h!==u&&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 C=Fe().getComputedStyle(S);g+=parseInt(C.marginLeft,10)+parseInt(C.marginRight,10)}}}),m+=g}r&&r.has(p)||o&&!o.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Ch(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=Gt(),[a,l]=(0,xo.useState)(0),s=typeof r=="object"?r.key:r,u=Le(s),c=(0,xo.useRef)(null);(0,xo.useEffect)(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,xo.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let g=Th(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let S=n().columnSizing,y={...S},C=!1;h.forEach(b=>{y[b]={width:g[b]},C=C||y[b].width!==S[b]?.width}),C&&(e.columnSizing=y)},[s,o,a])}var oo=require("react");var cl=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!Bu(e,t,r)){fh(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=sl(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let u=i.rowIndex;u<=a.rowIndex;u++)for(let c=i.colIndex;c<=a.colIndex;c++){let d=this.getCellSelectionPosition({rowIndex:u,colIndex:c});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function aw(n,e){return n<e?[n,e]:[e,n]}var dl=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 o=this.getRowAt(e);if(!o||o.rowDisabled||o.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){o.nodePath&&this.isNodeSelectable(o)&&r.setNodeSelection(o.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(o);if(o.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(o.id,a):i.deselectRow(o.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 o=this.getGroupKeys(t);return t.isGroupRow?o?this.rowSelectionState.isGroupRowSelected(o):!1:this.rowSelectionState.isRowSelected(t.id,o)}setRangeSelected(e,t,o){let[r,i]=aw(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,o))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let o=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!o||!r||r.length<o.length?!1:o.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 o=e-1;o>=0&&this.isSelectedAt(o);o--)t=o;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 fy=require("react");var py=H(require("react"));var lw=()=>{};function Ih(n,e){let t=new j,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let u=0;u<s.length;u++){let c=s.slice(0,u);t.has(c)||t.set(c,void 0)}t.set(s,l)}function a(l,s){let u=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let c of u){let d=[...l,c[c.length-1]],p=t.get(d),f=p?p[o]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[o]=f),s.push(p)}return s}return a([],[])}function Rh(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(o),d=[...t,c],p=r(o),f=yt(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let S=m[g];Rh(n,e,d,S)}});p?(u?.(o),s?.(o,lw)):(l?.(o,f,i(o)),s?.(o,f))}function wh(n,e,t){for(let o=0,r=t.length;o<r;o++)Rh(n,e,[],t[o])}var vh=new Uint8Array(new Uint32Array([1]).buffer)[0]===1;function Ph(n,e,t){let o=n.length,r=new Float64Array(o);for(let p=0;p<o;p++){let f=e(n[p]);if(typeof f!="number"||f!==f)return!1;r[p]=(t<0?-f:f)+0}if(o<2)return!0;let i=new Uint32Array(r.buffer),a=vh?0:1,l=vh?1:0,s=new Uint32Array(8*256);for(let p=0;p<o;p++){let f=i[2*p+a],m=i[2*p+l];m&2147483648?(m=~m>>>0,f=~f>>>0,i[2*p+a]=f):m=(m|2147483648)>>>0,i[2*p+l]=m,s[f&255]++,s[256+(f>>>8&255)]++,s[512+(f>>>16&255)]++,s[768+(f>>>24)]++,s[1024+(m&255)]++,s[1280+(m>>>8&255)]++,s[1536+(m>>>16&255)]++,s[1792+(m>>>24)]++}let u=new Uint32Array(o),c=new Uint32Array(o);for(let p=0;p<o;p++)u[p]=p;for(let p=0;p<8;p++){let f=p<4?a:l,m=p%4*8,g=p*256;if(s[g+(i[f]>>>m&255)]===o)continue;let h=0;for(let y=0;y<256;y++){let C=s[g+y];s[g+y]=h,h+=C}for(let y=0;y<o;y++){let C=u[y],b=i[2*C+f]>>>m&255;c[s[g+b]++]=C}let S=u;u=c,c=S}let d=n.slice();for(let p=0;p<o;p++)n[p]=d[u[p]];return!0}var Yu=function(n,e){return n-e},sw=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"]),pl;function uw(){try{let n=new Intl.Collator;return sw.has(n.resolvedOptions().locale)?null:n}catch{return null}}var cw=function(n,e){return n=`${n}`,e=`${e}`,pl===void 0&&(pl=uw()),pl?pl.compare(n,e):n.localeCompare(e)},dw=function(n,e){return n-e},pw={number:Yu,string:cw,date:dw},eo=pw;function Dh(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var $t=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;r&&r.start();let i=Dh(n);return mw(i,e,o)||e.sort(xh(i,o)),r&&r.end(),e},fl=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=xh(Dh(n),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,u=d=>d[l],c=d=>d[l]===void 0;return wh({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??u,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)),o&&o.end(),e};$t.knownTypes=eo;function mw(n,e,t){if(n.length!==1||e.length<1e3)return!1;let o=n[0];if(!o||o.fn||!o.type||o.dir!==1&&o.dir!==-1)return!1;let r=Array.isArray(o.type)?o.type[0]:o.type;if($t.knownTypes[r]!==Yu)return!1;let{field:i,valueGetter:a}=o;return Ph(e,l=>(t&&(l=t(l)),a?a(l):i?l[i]:l),o.dir)}var gw=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=$t.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys($t.knownTypes).join(", ")}`)}return r||(r=eo.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:o*u}},hw=n=>n.map(gw).filter(e=>e instanceof Function),xh=(n,e)=>{let t=hw(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var yw=H(require("react"));function ml(n){return Ne(e=>n(e.dataSourceState))}var Sw=qe("IT:InfiniteTable"),bw="#dc3545",Tw="#eb9316";var Eh="Warn",Ah="Error",Cw="Info",Iw="Success",Rw="Logs",gl=Sw.extend(Rw),UG=gl.extend(Cw),ww=gl.extend(Eh),vw=gl.extend(Ah),$G=gl.extend(Iw);var Pw=Tw,Dw=bw;var xw=(n,e)=>{e=e?e.extend?e.extend(Eh):e:ww,e(typeof e.color=="function"?e.color(Pw,n):n)},Mw=(n,e)=>{e=e?e.extend?e.extend(Ah):e:vw,e(typeof e.color=="function"?e.color(Dw,n):n)};var Mh=new j,_h=(n,...e)=>{Mh.has(e)||(Mh.set(e,!0),n())};var Oh=(n,e=n,t)=>{_h(()=>xw(n,t),e,"warn")},Fh=(n,e=n,t)=>{_h(()=>Mw(n,t),e,"error")};var qu=new WeakMap,Ew=n=>n;function Nh(n,e=50,t){qu.set(n,{lastCallTime:0,lastCallArg:null});let o=t??Ew;return r=>{let{lastCallTime:i,lastCallArg:a}=qu.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=Rt(o(a),o(r));s<e&&u||(qu.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var hl=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new j;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let u=o&&!o.isEmpty();if(u&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let c=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,p=c.length;d<p;d++){let f=c[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}o?.removeInfo(void 0)}}else{let c=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];u&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),S=s?[...p,h]:void 0,y=s&&!!S,C=y?o?.getMutationsForNodePath(S):o?.getMutationsForPrimaryKey(h);if(C&&C.length){for(let b=0,I=C.length;b<I;b++){let T=C[b];if(T.type==="delete"&&!g&&(y?this.removeNodePath(S,t):this.remove(h),g=!0,d.splice(f,1),f--),T.type==="update"&&!g&&(m={...m,...T.data},d[f]=m),T.type==="update-children"&&!g){let R=T.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}T.type==="insert"&&(T.position==="before"?(d.splice(f,0,T.data),f--):d.splice(f+1,0,T.data))}y?o?.removeNodePathInfo(S):o?.removeInfo(h)}if(!g)if(y){this.addNodePath(S,m);let b=a(m),I=b?null:i(m);!b&&Array.isArray(I)&&(p.push(h),u&&(m[l]=I=I.concat()),c(I,p),p.pop())}else this.add(h,m)}}};c(e,[])}return e}}};var Aw=Object.freeze([]),Lh=(n,e)=>{let t=n??Aw,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};var Mt=class extends yr{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function yl(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(n instanceof Date||e instanceof Date)return n instanceof Date&&e instanceof Date&&n.getTime()===e.getTime();if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0,o=n.length;t<o;t++)if(!yl(n[t],e[t]))return!1;return!0}if(typeof n=="object"){let t=Object.keys(n),o=Object.keys(e);if(t.length!==o.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!yl(n[r],e[r]))return!1;return!0}return!1}function _w(n,e){return!(n===void 0||e===void 0||n.isGroupRow!==e.isGroupRow||n.dataSourceHasGrouping!==e.dataSourceHasGrouping||n.isTreeNode!==e.isTreeNode||n.isTreeNode&&n.isParentNode!==e.isParentNode)}var Sl={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},kh={...Sl,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},Ow={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},Fw={...Sl,...Ow,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},zh={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},Nw={...Sl,...zh,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},Lw={...Sl,...zh,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},kw=Object.entries(kh).map(([n,e])=>e?n:void 0).filter(Boolean),zw=Object.entries(kh).map(([n,e])=>e?n:void 0),Vw=Object.entries(Fw).map(([n,e])=>e?n:void 0),Gw=Object.entries(Nw).map(([n,e])=>e?n:void 0),Hw=Object.entries(Lw).map(([n,e])=>e?n:void 0);function Kw(n,e){if(n===e)return!0;if(!n||!e||!_w(n,e)||n.id!==e.id||n.data!==e.data&&!yl(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?Vw:zw:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?Hw:Gw:t=kw;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!yl(r,i))return!1}return!0}function Vh(){let n=[],e=new Map,t=new Set,o={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=n,g=f?.marker,S=p!==m&&t.size>0;S&&(o={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=[],C=l();for(let b of C){let I=m[b],T=p[b];if(T===void 0){y.push(b);continue}Kw(I,T)||y.push(b)}n=p,(y.length>0||S)&&queueMicrotask(()=>{for(let b=0,I=y.length;b<I;b++){let T=y[b],R=e.get(T);if(R)for(let v of R)v()}if(S)for(let b of Array.from(t))b()}),g&&g.end({details:[{name:"updated row infos",value:y.length}]})},i=p=>n[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&&(o={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>o,getDataArray:()=>n,clear:()=>{n=[],e.clear(),t.clear(),o={dataSourceState:void 0,previousDataSourceState:void 0}}}}var Rn=new Map,wn=new Map,to=new Map,vn=new Map,ln=new Map;var Bw=Symbol("cursorId"),Gh=n=>n.totalLeafNodesCount===0,Ww=n=>n.isParentNode?!Gh(n):!0;function Hh(n){let e=Date.now(),t=[],o=[],r=new j;return{logger:zt(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Vh(),indexer:new hl,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 j,waitForNodePathPromises:new j,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new j,dataParams:void 0,onCleanup:ye(),notifyScrollbarsChange:ye(),notifyScrollStop:ye(),notifyRenderRangeChange:ye(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:Bw,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:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function jw(n){let e={...n};return delete e.originalDataArray,e}var Uw=[],Kh=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.unfilteredTreePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear(),n.rowInfoStore.clear()},Bh=(n,e)=>({onDataParamsChange:t=>t?Nh(t,100,jw):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Gh,isNodeSelectable:t=>t??Ww,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=>({...zn,...t}),sortTypes:t=>({...eo,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof Mt)return t;let o=n.propsCache.get("rowDisabledState"),r=o.get(t);return r||(r=new Mt(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>Lh(t,n.propsCache.get("sortInfo")),groupBy:t=>t??Uw});function $w(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}function Yw(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var qw={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Wh(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
`);let o=er(t);if(n instanceof Je)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??uw,i=t.propsCache.get("treeSelection"),a=i.get(r);return a&&a.setConfig(o),a=a??new Je(r,o),i.set(r,a),a}function gh(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=_r(e.sortInfo),a=_r(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,E)=>{let z=l[E].operators;D[E]=D[E]||{};let V=D[E];return z.forEach(N=>{V[N.name]=N}),D},{}),u=e,c=e.selectionMode;if(c===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)c="multi-cell";else{let D=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(D!==void 0&&(D&&typeof D=="object"?c="multi-row":c="single-row"),!c){let E=u.treeSelection??u.defaultTreeSelection;E!==void 0&&(c=typeof E=="object"?"multi-row":"single-row")}c=c??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(c!==!1&&(c==="single-row"||c==="multi-row")&&(f===null?d=c==="single-row"?null:new Oe({selectedRows:[],deselectedRows:[],defaultSelection:!1},mt(t)):c==="single-row"||f instanceof Oe?d=f:d=new Oe(f,mt(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new Ue;else if(m instanceof Ue)p=m;else{let D=t.propsCache.get("cellSelection"),E=D.get(m)??new Ue(m);D.set(m,E),p=E}let g=t.primaryKey,h=typeof g=="function"?D=>g(D):D=>D[g],S=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(S&&!(S instanceof ft)){let D=t.propsCache.get("treeExpandState"),E=D.get(S)??new ft(S);D.set(S,E),S=E}S=S||new ft({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof Dt)){let D=t.propsCache.get("groupRowsState"),E=D.get(y)??new Dt(y);D.set(y,E),y=E}y=y||new Dt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let C=sw(e.shouldReloadData||{}),T=typeof e.data=="function"&&!!e.lazyLoad,I=!!e.livePagination,b={sortInfo:C.sortInfo??(T||I),filterValue:C.filterValue??(T||I),groupBy:C.groupBy??T,pivotBy:C.pivotBy??T},R=e.sortFunction?"local":b.sortInfo?"remote":"local",v=(typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function")&&!e.lazyLoad?"local":b.filterValue||e.lazyLoad?"remote":"local",P=t.rowDisabledState,x=e.isRowDisabled;if(!x&&P){let D=t.propsCache.get("isRowDisabled"),E=D.get(P);E?x=E:(x=z=>P.isRowDisabled(z.id),D.set(P,x))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:y,treeExpandState:S,treeExpandMode:S.mode,shouldReloadData:b,isRowDisabled:x,rowSelection:d,cellSelection:p,sortMode:R,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=!o||o.originalDataArray!==t.originalDataArray,E=typeof e.livePaginationCursor=="function"?D?lw(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=E}if(t.devToolsDetected&&t.debugId){let D=In.get(t.debugId);D&&(M={...M,...D})}return M}var cw=Nt("DataSource:fullLazyLoad");function hh(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&cw('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new Dt({collapsedRows:!0,expandedRows:[]})))}function yh(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[n,{selectionMode:"single-row"}]};let t=e.__apiRef.current,o=t.treeApi;return{callbackParams:[n.getState(),{treeSelectionState:n,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:o}]}},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof Ue?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function Sh(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Wt(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Wt(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Wt(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Wt(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Wt(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Wt(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>Rt(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Nt(Un(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function bh(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}function Ou(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function Fu(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function Nu(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function Th({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=ht(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Fu({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"||o==="start")&&c();let d=!i&&l.length===1;return n.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let S=e[m.length-1],C=m.slice(0,-1).join("/");if(!d){let T=C;C=m.join("/");let I=m[m.length-1];u[C]=Nu({header:`${I}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:S,pivotIndex:m.length-1,pivotGroupKey:I})}l.forEach((T,I)=>{let b=d?`${m[m.length-1]}`:T.name||T.id,R=Fu({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:T,pivotAggregatorIndex:I,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:S,columnGroup:C,header:b,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),w=`${T.id}:${m.join("/")}`;s[w]=R})}else{let S=m.join("/"),y=m.slice(0,-1);if(u[S]=Nu({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 C=e[m.length-1],T=y.length?y.join("/"):void 0;if(!d){let I=T;T=`total:${m.join("/")}`,u[T]=Nu({header:`${m[m.length-1]} total`,columnGroup:I,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:C,pivotGroupKey:m[m.length-1]})}l.forEach((I,b)=>{let R=d?`${m[m.length-1]} total `:`${I.name||I.id} total`,w=Fu({columnGroup:T,header:R,pivotAggregator:I,pivotAggregatorIndex:b,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:C,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[I.id]:null});s[`total:${I.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||o==="end")&&c(),{columns:s,columnGroups:u}}var Ch=Symbol("CLEAR"),wo=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new U;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Ch,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Ch);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=()=>U.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new n({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:U.clone(e.nodePathToData),o}};var Lu=1e3;function Ih(n){return new ku(n)}var ku=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=>Vn(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Lu:r;return isNaN(a)||(a=Lu),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let u=c=>t.position==="start"?[...e,...c||[]]:[...c||[],...e];return this.updateChildrenByNodePath(u,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.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 o=this.getState().rowDisabledState,r=o?new xt(o):new xt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new 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(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?wo.clone(t,{light:!0}):new wo({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((c,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],c,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof c=="function"?i.updateChildren(a.nodePaths[d],c,p,a.metadata):i.updateNodePath(a.nodePaths[d],c,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(c=>{let d=this.getDataByPrimaryKey(c);d&&i.delete(c,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(c=>{let d=this.getDataByNodePath(c);d&&i.deleteNodePath(c,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,u=a.nodePath;u?a.array.forEach(c=>{i.insertNodePath([...u],c,s,a.metadata),l=this.toPrimaryKey(c),u.pop(),u.push(l),s="after"}):a.array.forEach(c=>{i.insert(l,c,s,a.metadata),l=this.toPrimaryKey(c),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Lu,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(u=>{let c,d;l=p=>{clearTimeout(d),c=p,o.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Rh(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let 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(u&&u.length){if(l===!0)o=!0;else for(let m of u)if(m.field&&l.has(m.field)){o=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),c&&c.length)if(l===!0)i=!0;else for(let m of c){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:o,filterValue:i,aggregationReducers:a,tree:r}}function il(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function al(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function ll(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function wh(n){return"groupNesting"in n?n.groupNesting??0:0}function vh(n,e){if(!(!n.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?n.reducerResults?.[e.reducerId]:n.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function dw(n,e,t,o){if(n==null&&e==null)return 0;if(n==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&o[r]||o.string||qn.string)(n,e);return a===0?0:t.dir*a}function pw(n,e){if(!n?.length||!e)return[];let t=[];for(let o of n){let r=o.id?e[o.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:o.dir,type:o.type,fn:o.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function fw(n){let e=[],t=[];for(let o of n){let r={row:o,children:[]},i=wh(o);for(;t.length&&wh(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 mw(n){let e=[],t=(o,r)=>{o.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(n,[]),e}function Ph(n,e,t,o){let r=pw(e,t);if(!r.length||!n.length)return n;let i={...qn,...o},a=fw(n),l=(u,c)=>{for(let d of r){let p=dw(vh(u.row,d),vh(c.row,d),d,i);if(p!==0)return p}return 0},s=u=>{u.sort(l);for(let c of u)s(c.children)};return s(a),mw(a)}var an=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function gw(n){let e=n.get([wt]);if(!e)return;if(e.totalChildrenCount!=null)return e.totalChildrenCount;let t=0;for(let o=0;o<e.children.length;o++){let r=e.children[o]?.totalChildrenCount;if(r==null)return;t+=r}return t}function hw(n,e){let t=n.get([wt]);if(t)return e?t.totalChildrenCountUnfiltered:t.totalCountUnfiltered}function zu(){return!1}function yw(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:zu,hasSelectedCells:zu};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var Sw=ht(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
4
|
+
`);let o=ir(t);if(n instanceof Je)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??qw,i=t.propsCache.get("treeSelection"),a=i.get(r);return a&&a.setConfig(o),a=a??new Je(r,o),i.set(r,a),a}function jh(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=zr(e.sortInfo),a=zr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,E)=>{let L=l[E].operators;D[E]=D[E]||{};let V=D[E];return L.forEach(N=>{V[N.name]=N}),D},{}),u=e,c=e.selectionMode;if(c===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)c="multi-cell";else{let D=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(D!==void 0&&(D&&typeof D=="object"?c="multi-row":c="single-row"),!c){let E=u.treeSelection??u.defaultTreeSelection;E!==void 0&&(c=typeof E=="object"?"multi-row":"single-row")}c=c??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(c!==!1&&(c==="single-row"||c==="multi-row")&&(f===null?d=c==="single-row"?null:new Oe({selectedRows:[],deselectedRows:[],defaultSelection:!1},gt(t)):c==="single-row"||f instanceof Oe?d=f:d=new Oe(f,gt(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new Ue;else if(m instanceof Ue)p=m;else{let D=t.propsCache.get("cellSelection"),E=D.get(m)??new Ue(m);D.set(m,E),p=E}let g=t.primaryKey,h=typeof g=="function"?D=>g(D):D=>D[g],S=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(S&&!(S instanceof mt)){let D=t.propsCache.get("treeExpandState"),E=D.get(S)??new mt(S);D.set(S,E),S=E}S=S||new mt({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof xt)){let D=t.propsCache.get("groupRowsState"),E=D.get(y)??new xt(y);D.set(y,E),y=E}y=y||new xt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let C=Yw(e.shouldReloadData||{}),b=typeof e.data=="function"&&!!e.lazyLoad,I=!!e.livePagination,T={sortInfo:C.sortInfo??(b||I),filterValue:C.filterValue??(b||I),groupBy:C.groupBy??b,pivotBy:C.pivotBy??b},R=e.sortFunction?"local":T.sortInfo?"remote":"local",w=(typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function")&&!e.lazyLoad?"local":T.filterValue||e.lazyLoad?"remote":"local",P=t.rowDisabledState,x=e.isRowDisabled;if(!x&&P){let D=t.propsCache.get("isRowDisabled"),E=D.get(P);E?x=E:(x=L=>P.isRowDisabled(L.id),D.set(P,x))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:y,treeExpandState:S,treeExpandMode:S.mode,shouldReloadData:T,isRowDisabled:x,rowSelection:d,cellSelection:p,sortMode:R,filterMode:w,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=!o||o.originalDataArray!==t.originalDataArray,E=typeof e.livePaginationCursor=="function"?D?$w(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=E}if(t.devToolsDetected&&t.debugId){let D=wn.get(t.debugId);D&&(M={...M,...D})}return M}var Xw=zt("DataSource:fullLazyLoad");function Uh(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&Xw('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new xt({collapsedRows:!0,expandedRows:[]})))}function $h(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[n,{selectionMode:"single-row"}]};let t=e.__apiRef.current,o=t.treeApi;return{callbackParams:[n.getState(),{treeSelectionState:n,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:o}]}},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof Ue?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function Yh(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Ut(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ke(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Ut(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ke(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Ut(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ke(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Ut(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ke(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Ut(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Ut(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>Rt(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(zt(Zn(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function qh(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}function Xu(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function Zu(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function Qu(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function Xh({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=yt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Zu({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"||o==="start")&&c();let d=!i&&l.length===1;return n.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let S=e[m.length-1],C=m.slice(0,-1).join("/");if(!d){let b=C;C=m.join("/");let I=m[m.length-1];u[C]=Qu({header:`${I}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:S,pivotIndex:m.length-1,pivotGroupKey:I})}l.forEach((b,I)=>{let T=d?`${m[m.length-1]}`:b.name||b.id,R=Zu({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:I,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:S,columnGroup:C,header:T,valueFormatter:({rowInfo:w})=>w.isGroupRow?w.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),v=`${b.id}:${m.join("/")}`;s[v]=R})}else{let S=m.join("/"),y=m.slice(0,-1);if(u[S]=Qu({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 C=e[m.length-1],b=y.length?y.join("/"):void 0;if(!d){let I=b;b=`total:${m.join("/")}`,u[b]=Qu({header:`${m[m.length-1]} total`,columnGroup:I,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:C,pivotGroupKey:m[m.length-1]})}l.forEach((I,T)=>{let R=d?`${m[m.length-1]} total `:`${I.name||I.id} total`,v=Zu({columnGroup:b,header:R,pivotAggregator:I,pivotAggregatorIndex:T,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:C,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:w})=>w.isGroupRow?w.pivotValuesMap?.get(m)?.reducerResults[I.id]:null});s[`total:${I.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||o==="end")&&c(),{columns:s,columnGroups:u}}var Zh=Symbol("CLEAR"),Mo=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new j;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Zh,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Zh);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=()=>j.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new n({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:j.clone(e.nodePathToData),o}};var Ju=1e3;function Qh(n){return new ec(n)}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=()=>ba(this.getState);this.getRowInfoByIndex=e=>Wn(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Ju:r;return isNaN(a)||(a=Ju),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let u=c=>t.position==="start"?[...e,...c||[]]:[...c||[],...e];return this.updateChildrenByNodePath(u,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.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 o=this.getState().rowDisabledState,r=o?new Mt(o):new Mt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Mt({enabledRows:!0,disabledRows:[]});return}let t=new Mt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Mt({disabledRows:!0,enabledRows:[]});return}let t=new Mt(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 Ta({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?Mo.clone(t,{light:!0}):new Mo({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((c,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],c,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof c=="function"?i.updateChildren(a.nodePaths[d],c,p,a.metadata):i.updateNodePath(a.nodePaths[d],c,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(c=>{let d=this.getDataByPrimaryKey(c);d&&i.delete(c,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(c=>{let d=this.getDataByNodePath(c);d&&i.deleteNodePath(c,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,u=a.nodePath;u?a.array.forEach(c=>{i.insertNodePath([...u],c,s,a.metadata),l=this.toPrimaryKey(c),u.pop(),u.push(l),s="after"}):a.array.forEach(c=>{i.insert(l,c,s,a.metadata),l=this.toPrimaryKey(c),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Ju,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(u=>{let c,d;l=p=>{clearTimeout(d),c=p,o.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Jh(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let 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(u&&u.length){if(l===!0)o=!0;else for(let m of u)if(m.field&&l.has(m.field)){o=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),c&&c.length)if(l===!0)i=!0;else for(let m of c){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:o,filterValue:i,aggregationReducers:a,tree:r}}function bl(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function Tl(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function Cl(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function ey(n){return"groupNesting"in n?n.groupNesting??0:0}function ty(n,e){if(!(!n.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?n.reducerResults?.[e.reducerId]:n.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function Zw(n,e,t,o){if(n==null&&e==null)return 0;if(n==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&o[r]||o.string||eo.string)(n,e);return a===0?0:t.dir*a}function Qw(n,e){if(!n?.length||!e)return[];let t=[];for(let o of n){let r=o.id?e[o.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:o.dir,type:o.type,fn:o.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function Jw(n){let e=[],t=[];for(let o of n){let r={row:o,children:[]},i=ey(o);for(;t.length&&ey(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 ev(n){let e=[],t=(o,r)=>{o.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(n,[]),e}function ny(n,e,t,o){let r=Qw(e,t);if(!r.length||!n.length)return n;let i={...eo,...o},a=Jw(n),l=(u,c)=>{for(let d of r){let p=Zw(ty(u.row,d),ty(c.row,d),d,i);if(p!==0)return p}return 0},s=u=>{u.sort(l);for(let c of u)s(c.children)};return s(a),ev(a)}var sn=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function tv(n){let e=n.get([vt]);if(!e)return;if(e.totalChildrenCount!=null)return e.totalChildrenCount;let t=0;for(let o=0;o<e.children.length;o++){let r=e.children[o]?.totalChildrenCount;if(r==null)return;t+=r}return t}function nv(n,e){let t=n.get([vt]);if(t)return e?t.totalChildrenCountUnfiltered:t.totalCountUnfiltered}function tc(){return!1}function ov(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:tc,hasSelectedCells:tc};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var rv=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,20 +13,20 @@ function treeFilterFunction({ data }) {
|
|
|
13
13
|
|
|
14
14
|
Make sure you avoid mutations.
|
|
15
15
|
|
|
16
|
-
`)});function Dh(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a,filterValue:l,filterTypes:s}=n,u=[],c=p=>i(p)||!Array.isArray(r(p)),d=p=>{if(c(p))return p;let f=Dh({...n,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:o(m,p),filterValue:l,filterTypes:s,filterTreeNode:d,isLeafNode:c(m)});h&&(h===!0?h=m:typeof h=="object"&&h===m&&g!==r(h)&&Sw(),u.push(h))}return u}var bw=[];function Vu(n){let{filterTypes:e,marker:t,filterFunction:o,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=n,u=n.filterValue||bw,{dataArray:c}=n;t?.start({details:[{name:"Count before",value:c.length}]});let d=!!l&&!!a&&!!s,p=0;if(d){let f=o;c=Dh({dataArray:c,treeFilterFunction:i||(f?g=>g.isLeafNode?f(g):g.filterTreeNode(g.data):Ua),toPrimaryKey:r,getNodeChildren:a,nodesKey:l,isLeafNode:s,filterValue:u,filterTypes:e})}else if(o)c=c.filter((f,m,g)=>o({data:f,index:m,dataArray:g,primaryKey:r(f,m),filterValue:u,filterTypes:e}));else{let f=ja(u,e);f.length&&(c=c.filter((m,g,h)=>Tu(f,{data:m,index:g,dataArray:h,primaryKey:r(m,g)})))}return t?.end({details:[{name:"Count after",value:c.length}]}),c}function xh(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=st(r).track.DataSource.label.PrepareData.start());let a=Rh(t),l=$a(t.sortInfo,t.groupBy),s=t.sortMode,u=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(u=!1);let c=an(o,t,["refetchKey"]),d=an(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&c&&(d=!0),!1&&(t.originalLazyGroupData=new U,d=!0);let f=t.cache?wo.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,h=t.isTree,S=g?O=>O[g]:void 0,y=g?O=>O[g]===void 0:void 0,C,T;d&&(t.indexer.clear(),t.lazyLoad||(C=f?.getMutations(),T=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:S,isLeafNode:y,nodesKey:g}),h&&t.waitForNodePathPromises.visit(({value:O},A)=>{O&&t.indexer.getDataForNodePath(A)!==void 0&&O.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:b,treeFilterFunction:R,filterValue:w,filterTypes:v}=t,P=!!b||!!R||Array.isArray(w)&&w.length,x=t.filterMode==="local"&&!t.lazyLoad,M=P&&x,D=an(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),E=d||D,z=an(o,t,["sortInfo"]),V=d||D||z,N=x&&(E||!t.lastFilterDataArray),L=u&&(V||!t.lastSortDataArray||a.sortInfo),F=t.groupBy,B=t.pivotBy,X=!h&&(F.length>0||!!B),_=h,k=an(o,t,["rowDisabledState","isRowDisabled"]),K=an(o,t,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),Q=an(o,t,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),Ie=d||V||an(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),se=d||V||an(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),me=an(o,t,["rowInfoReducers"]),ve=X&&(Ie||!t.lastGroupDataArray||a.groupBy)||K||k||me,Pe=_&&(se||a.tree||!t.lastTreeDataArray)||Q||k||me,ce=Date.now(),oe=t.originalDataArray;if(_&&Pe){let O={marker:r?st(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m};t.unfilteredTreePaths=Ks(O,oe).treePaths}if(P||(t.unfilteredCount=oe.length),M){t.unfilteredCount=oe.length;let O=ce;N?(t.devToolsDetected&&(O=Date.now()),oe=Vu({marker:r?st(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:S,isLeafNode:y,nodesKey:g,treeFilterFunction:R,dataArray:oe,toPrimaryKey:m,filterTypes:v,filterFunction:b,filterValue:w}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-O)):oe=t.lastFilterDataArray,t.lastFilterDataArray=oe,t.filteredAt=ce}if(t.filteredCount=(t.lazyLoad&&F.length?gw(t.originalLazyGroupData):void 0)??oe.length,t.lazyLoad&&(t.unfilteredCount=hw(t.originalLazyGroupData,F.length>0)??t.filteredCount),t.postFilterDataArray=oe,u){let O=jt.knownTypes;if(jt.knownTypes={...O,...t.sortTypes},L){let A=ce;if(t.devToolsDetected&&(A=Date.now()),r&&(e=st(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:oe.length}]})),t.sortFunction?(oe=t.sortFunction(l,[...oe]),e&&(e.end(),e=void 0)):h?oe=Ja(l,oe,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:S,toKey:m,nodesKey:g}):oe=jt(l,[...oe],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let de=Date.now()-A;t.debugTimings.set("sort",de)}}else oe=t.lastSortDataArray;jt.knownTypes=O,t.lastSortDataArray=oe,t.sortedAt=ce}t.postSortDataArray=oe;let ue=t.dataArray,pe=t.rowSelection instanceof Oe?t.rowSelection:void 0,Z=t.treeExpandState instanceof ft?t.treeExpandState:void 0,J=t.cellSelection instanceof Ue?t.cellSelection:void 0;pe&&(pe.getConfig=mt(t)),pe?.xcache();let W=t.selectionMode==="single-row"?O=>O.id===t.rowSelection:t.selectionMode==="multi-row"?O=>{let A=pe;return O.isGroupRow?A.getGroupRowSelectionState(O.groupKeys):A.isRowSelected(O.id,O.dataSourceHasGrouping?O.groupKeys:void 0)}:void 0,ie=t.isRowDisabled||zu;t.isRowSelected&&t.selectionMode==="multi-row"&&(W=O=>t.isRowSelected(O,pe,t.selectionMode));let ne;t.isNodeExpanded&&(ne=O=>t.isNodeExpanded(O,Z)),t.isNodeCollapsed&&(ne=O=>!t.isNodeExpanded(O,Z)),ne||(ne=A=>Z.isNodeExpanded(A.nodePath));let le=t.rowInfoReducers;if(X){if(ve){let O=ce;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,de=t.lazyLoad?pf({groupBy:F,pivot:B,mappings:t.pivotMappings,reducers:A,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?st(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):ca({groupBy:F,pivot:B,reducers:A,marker:r?st(r).track.DataSource.label.Group.start():void 0},oe);t.groupDeepMap=de.deepMap,pe&&(pe.getConfig=mt(t));let ye=Object.keys(le||{}),we=il(le),be={reducers:le,results:we,reducerKeys:ye,rowInfo:{}},Me=we?Xe=>{be.rowInfo=Xe,al(be)}:void 0,qe=J?Xe=>{Xe.isCellSelected=G=>J.isCellSelected(Xe.id,G)}:void 0,We=Me||qe?Ou(Me,qe):void 0,rt=yf({marker:r?st(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:de,lazyLoad:!!t.lazyLoad,reducers:A,toPrimaryKey:m,isRowSelected:W,rowSelectionState:pe,withRowInfo:We,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});ue=rt.data,t.rowInfoReducerResults=ll({reducers:le,results:we,array:ue}),t.groupRowsIndexesInDataArray=rt.groupRowsIndexes,t.reducerResults=de.reducerResults;let it=B?Th({deepMap:de.topLevelPivotColumns,pivotBy:B,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=Ph(ue,l,t.pivotColumns,t.sortTypes);et!==ue&&(ue=et,t.groupRowsIndexesInDataArray=ue.map((Xe,G)=>Xe.isGroupRow?G:-1).filter(Xe=>Xe>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-O)}else ue=t.lastGroupDataArray;t.lastGroupDataArray=ue,t.groupedAt=ce}else if(_){if(Pe){let O=ce;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,de={marker:r?st(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m,reducers:A},ye=Ks(de,oe);t.treeDeepMap=ye.deepMap,t.treePaths=ye.treePaths;let we=t.selectionMode==="multi-row"?mh(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=we;let be=Object.keys(le||{}),Me=il(le),qe={reducers:le,results:Me,reducerKeys:be,rowInfo:{}},We=Me?ee=>{qe.rowInfo=ee,al(qe)}:void 0,rt=J?ee=>{ee.isCellSelected=ge=>J.isCellSelected(ee.id,ge)}:void 0,it=We||rt?Ou(We,rt):void 0,et=t.selectionMode==="single-row"?ee=>ee.id===t.treeSelection:t.selectionMode==="multi-row"?ee=>we.isNodeSelected(ee.nodePath):void 0,Xe=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;ue=hf({marker:r?st(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:ye,treeParams:de,dataArray:oe,reducers:A,toPrimaryKey:m,isNodeSelected:et,isNodeExpanded:ne,treeSelectionState:we,withRowInfo:it,repeatWrappedGroupRows:Xe,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=ll({reducers:le,results:Me,array:ue}),t.reducerResults=ye.reducerResults,t.totalLeafNodesCount=ye.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ce,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-O)}else ue=t.lastTreeDataArray;t.lastTreeDataArray=ue}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.pivotColumnGroups=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||Ie||K||k||me){let A=Object.keys(le||{}),de=il(le),ye={reducers:le,results:de,reducerKeys:A,rowInfo:{}};ue=oe.map((we,be)=>{let Me=yw(we,we?m(we):be,be,W,ie,J);return de&&(ye.rowInfo=Me,al(ye)),Me}),t.rowInfoReducerResults=ll({reducers:le,results:de,array:ue})}if(t.postGroupDataArray=ue,ue!==t.dataArray&&(t.updatedAt=ce),t.dataArray=ue,t.reducedAt=ce,t.selectionMode==="multi-row"){let O=t.rowSelection instanceof Oe&&!t.rowSelection.onlyUsePrimaryKeys;if(X&&t.lazyLoad&&!O){r&&(e=st(r).track.DataSource.label.ComputeSelectionCountLazy.start());let A=!0,de=!1;t.dataArray.forEach(we=>{if(!we.isTreeNode&&we.isGroupRow&&we.groupKeys.length===1){let{rowSelected:be}=we;be!==!0&&(A=!1),(be===!0||be===null)&&(de=!0)}});let{rowSelection:ye}=t;ye instanceof Oe&&ye.getLazyHiddenRowsCount([])&&(ye.defaultSelection?de=!0:A=!1),t.allRowsSelected=A,t.someRowsSelected=de,r&&(e?.end(),e=void 0)}else{r&&(e=st(r).track.DataSource.label.ComputeSelectionCount.start());let A=t.isTree?t.treeSelectionState?.getSelectionCountFor([]):t.rowSelection.getSelectionCountFor([]);A?(t.allRowsSelected=A.deselectedCount===0,t.someRowsSelected=A.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:C?.size?C:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(ue,{marker:r?st(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:o}),i&&i?.track.DataSource.label.PrepareData.end({details:[N||L||ve||Pe?{name:"Performed operations",value:[N?"filter":null,L?"sort":null,ve?"group":null,Pe?"tree":null].filter(An).join(", ")}:null,c?{name:"Refetch key",value:`Old ${o.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(An)}),t}var gt=H(require("react"));function Mh(){return Mn()}var nt=require("react");var Vt=require("react");function vo(n,e){let t=(0,Vt.useRef)({}),o=(0,Vt.useRef)({}),r=o.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,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function Tw(n,e){let t=(0,Vt.useRef)({}),o=(0,Vt.useRef)({}),r=o.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,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function Cw(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);(0,Vt.useEffect)(n,t)}function Iw(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
|
|
16
|
+
`)});function oy(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a,filterValue:l,filterTypes:s}=n,u=[],c=p=>i(p)||!Array.isArray(r(p)),d=p=>{if(c(p))return p;let f=oy({...n,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:o(m,p),filterValue:l,filterTypes:s,filterTreeNode:d,isLeafNode:c(m)});h&&(h===!0?h=m:typeof h=="object"&&h===m&&g!==r(h)&&rv(),u.push(h))}return u}var iv=[];function nc(n){let{filterTypes:e,marker:t,filterFunction:o,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=n,u=n.filterValue||iv,{dataArray:c}=n;t?.start({details:[{name:"Count before",value:c.length}]});let d=!!l&&!!a&&!!s,p=0;if(d){let f=o;c=oy({dataArray:c,treeFilterFunction:i||(f?g=>g.isLeafNode?f(g):g.filterTreeNode(g.data):al),toPrimaryKey:r,getNodeChildren:a,nodesKey:l,isLeafNode:s,filterValue:u,filterTypes:e})}else if(o)c=c.filter((f,m,g)=>o({data:f,index:m,dataArray:g,primaryKey:r(f,m),filterValue:u,filterTypes:e}));else{let f=il(u,e);f.length&&(c=c.filter((m,g,h)=>ku(f,{data:m,index:g,dataArray:h,primaryKey:r(m,g)})))}return t?.end({details:[{name:"Count after",value:c.length}]}),c}function ry(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=ct(r).track.DataSource.label.PrepareData.start());let a=Jh(t),l=ll(t.sortInfo,t.groupBy),s=t.sortMode,u=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(u=!1);let c=sn(o,t,["refetchKey"]),d=sn(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&c&&(d=!0),!1&&(t.originalLazyGroupData=new j,d=!0);let f=t.cache?Mo.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,h=t.isTree,S=g?O=>O[g]:void 0,y=g?O=>O[g]===void 0:void 0,C,b;d&&(t.indexer.clear(),t.lazyLoad||(C=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:O},A)=>{O&&t.indexer.getDataForNodePath(A)!==void 0&&O.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:T,treeFilterFunction:R,filterValue:v,filterTypes:w}=t,P=!!T||!!R||Array.isArray(v)&&v.length,x=t.filterMode==="local"&&!t.lazyLoad,M=P&&x,D=sn(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),E=d||D,L=sn(o,t,["sortInfo"]),V=d||D||L,N=x&&(E||!t.lastFilterDataArray),k=u&&(V||!t.lastSortDataArray||a.sortInfo),F=t.groupBy,W=t.pivotBy,Y=!h&&(F.length>0||!!W),_=h,K=sn(o,t,["rowDisabledState","isRowDisabled"]),z=sn(o,t,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),Q=sn(o,t,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),Te=d||V||sn(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),ue=d||V||sn(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),fe=sn(o,t,["rowInfoReducers"]),De=Y&&(Te||!t.lastGroupDataArray||a.groupBy)||z||K||fe,xe=_&&(ue||a.tree||!t.lastTreeDataArray)||Q||K||fe,de=Date.now(),ne=t.originalDataArray;if(_&&xe){let O={marker:r?ct(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m};t.unfilteredTreePaths=ru(O,ne).treePaths}if(P||(t.unfilteredCount=ne.length),M){t.unfilteredCount=ne.length;let O=de;N?(t.devToolsDetected&&(O=Date.now()),ne=nc({marker:r?ct(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:S,isLeafNode:y,nodesKey:g,treeFilterFunction:R,dataArray:ne,toPrimaryKey:m,filterTypes:w,filterFunction:T,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-O)):ne=t.lastFilterDataArray,t.lastFilterDataArray=ne,t.filteredAt=de}if(t.filteredCount=(t.lazyLoad&&F.length?tv(t.originalLazyGroupData):void 0)??ne.length,t.lazyLoad&&(t.unfilteredCount=nv(t.originalLazyGroupData,F.length>0)??t.filteredCount),t.postFilterDataArray=ne,u){let O=$t.knownTypes;if($t.knownTypes={...O,...t.sortTypes},k){let A=de;if(t.devToolsDetected&&(A=Date.now()),r&&(e=ct(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:ne.length}]})),t.sortFunction?(ne=t.sortFunction(l,[...ne]),e&&(e.end(),e=void 0)):h?ne=fl(l,ne,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:S,toKey:m,nodesKey:g}):ne=$t(l,[...ne],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let ce=Date.now()-A;t.debugTimings.set("sort",ce)}}else ne=t.lastSortDataArray;$t.knownTypes=O,t.lastSortDataArray=ne,t.sortedAt=de}t.postSortDataArray=ne;let se=t.dataArray,he=t.rowSelection instanceof Oe?t.rowSelection:void 0,U=t.treeExpandState instanceof mt?t.treeExpandState:void 0,te=t.cellSelection instanceof Ue?t.cellSelection:void 0;he&&(he.getConfig=gt(t)),he?.xcache();let B=t.selectionMode==="single-row"?O=>O.id===t.rowSelection:t.selectionMode==="multi-row"?O=>{let A=he;return O.isGroupRow?A.getGroupRowSelectionState(O.groupKeys):A.isRowSelected(O.id,O.dataSourceHasGrouping?O.groupKeys:void 0)}:void 0,ae=t.isRowDisabled||tc;t.isRowSelected&&t.selectionMode==="multi-row"&&(B=O=>t.isRowSelected(O,he,t.selectionMode));let oe;t.isNodeExpanded&&(oe=O=>t.isNodeExpanded(O,U)),t.isNodeCollapsed&&(oe=O=>!t.isNodeExpanded(O,U)),oe||(oe=A=>U.isNodeExpanded(A.nodePath));let re=t.rowInfoReducers;if(Y){if(De){let O=de;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,ce=t.lazyLoad?jf({groupBy:F,pivot:W,mappings:t.pivotMappings,reducers:A,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?ct(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):wa({groupBy:F,pivot:W,reducers:A,marker:r?ct(r).track.DataSource.label.Group.start():void 0},ne);t.groupDeepMap=ce.deepMap,he&&(he.getConfig=gt(t));let Re=Object.keys(re||{}),Se=bl(re),be={reducers:re,results:Se,reducerKeys:Re,rowInfo:{}},Me=Se?Ze=>{be.rowInfo=Ze,Tl(be)}:void 0,et=te?Ze=>{Ze.isCellSelected=G=>te.isCellSelected(Ze.id,G)}:void 0,tt=Me||et?Xu(Me,et):void 0,We=Xf({marker:r?ct(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:ce,lazyLoad:!!t.lazyLoad,reducers:A,toPrimaryKey:m,isRowSelected:B,rowSelectionState:he,withRowInfo:tt,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});se=We.data,t.rowInfoReducerResults=Cl({reducers:re,results:Se,array:se}),t.groupRowsIndexesInDataArray=We.groupRowsIndexes,t.reducerResults=ce.reducerResults;let lt=W?Xh({deepMap:ce.topLevelPivotColumns,pivotBy:W,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=lt?.columns,t.pivotColumnGroups=lt?.columnGroups;let Xe=ny(se,l,t.pivotColumns,t.sortTypes);Xe!==se&&(se=Xe,t.groupRowsIndexesInDataArray=se.map((Ze,G)=>Ze.isGroupRow?G:-1).filter(Ze=>Ze>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-O)}else se=t.lastGroupDataArray;t.lastGroupDataArray=se,t.groupedAt=de}else if(_){if(xe){let O=de;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,ce={marker:r?ct(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m,reducers:A},Re=ru(ce,ne);t.treeDeepMap=Re.deepMap,t.treePaths=Re.treePaths;let Se=t.selectionMode==="multi-row"?Wh(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Se;let be=Object.keys(re||{}),Me=bl(re),et={reducers:re,results:Me,reducerKeys:be,rowInfo:{}},tt=Me?J=>{et.rowInfo=J,Tl(et)}:void 0,We=te?J=>{J.isCellSelected=me=>te.isCellSelected(J.id,me)}:void 0,lt=tt||We?Xu(tt,We):void 0,Xe=t.selectionMode==="single-row"?J=>J.id===t.treeSelection:t.selectionMode==="multi-row"?J=>Se.isNodeSelected(J.nodePath):void 0,Ze=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;se=qf({marker:r?ct(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Re,treeParams:ce,dataArray:ne,reducers:A,toPrimaryKey:m,isNodeSelected:Xe,isNodeExpanded:oe,treeSelectionState:Se,withRowInfo:lt,repeatWrappedGroupRows:Ze,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=Cl({reducers:re,results:Me,array:se}),t.reducerResults=Re.reducerResults,t.totalLeafNodesCount=Re.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=de,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-O)}else se=t.lastTreeDataArray;t.lastTreeDataArray=se}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.pivotColumnGroups=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||Te||z||K||fe){let A=Object.keys(re||{}),ce=bl(re),Re={reducers:re,results:ce,reducerKeys:A,rowInfo:{}};se=ne.map((Se,be)=>{let Me=ov(Se,Se?m(Se):be,be,B,ae,te);return ce&&(Re.rowInfo=Me,Tl(Re)),Me}),t.rowInfoReducerResults=Cl({reducers:re,results:ce,array:se})}if(t.postGroupDataArray=se,se!==t.dataArray&&(t.updatedAt=de),t.dataArray=se,t.reducedAt=de,t.selectionMode==="multi-row"){let O=t.rowSelection instanceof Oe&&!t.rowSelection.onlyUsePrimaryKeys;if(Y&&t.lazyLoad&&!O){r&&(e=ct(r).track.DataSource.label.ComputeSelectionCountLazy.start());let A=!0,ce=!1;t.dataArray.forEach(Se=>{if(!Se.isTreeNode&&Se.isGroupRow&&Se.groupKeys.length===1){let{rowSelected:be}=Se;be!==!0&&(A=!1),(be===!0||be===null)&&(ce=!0)}});let{rowSelection:Re}=t;Re instanceof Oe&&Re.getLazyHiddenRowsCount([])&&(Re.defaultSelection?ce=!0:A=!1),t.allRowsSelected=A,t.someRowsSelected=ce,r&&(e?.end(),e=void 0)}else{r&&(e=ct(r).track.DataSource.label.ComputeSelectionCount.start());let A=t.isTree?t.treeSelectionState?.getSelectionCountFor([]):t.rowSelection.getSelectionCountFor([]);A?(t.allRowsSelected=A.deselectedCount===0,t.someRowsSelected=A.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:C?.size?C:void 0,treeMutations:b?.size?b:void 0}),t.rowInfoStore.notifyDataArray(se,{marker:r?ct(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:o}),i&&i?.track.DataSource.label.PrepareData.end({details:[N||k||De||xe?{name:"Performed operations",value:[N?"filter":null,k?"sort":null,De?"group":null,xe?"tree":null].filter(Fn).join(", ")}:null,c?{name:"Refetch key",value:`Old ${o.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(Fn)}),t}var ht=H(require("react"));function iy(){return _n()}var ot=require("react");var Kt=require("react");function Eo(n,e){let t=(0,Kt.useRef)({}),o=(0,Kt.useRef)({}),r=o.current,i=(0,Kt.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,Kt.useEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function av(n,e){let t=(0,Kt.useRef)({}),o=(0,Kt.useRef)({}),r=o.current,i=(0,Kt.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,Kt.useLayoutEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function lv(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);(0,Kt.useEffect)(n,t)}function sv(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
|
|
17
17
|
|
|
18
18
|
ERROR_CODE = ${n}
|
|
19
19
|
|
|
20
|
-
See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,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#${n} for more info.`,{code:n,message:e,type:t??"error"}}function ay(n){return Object.entries(n).reduce((e,[t,o])=>{let r=t,i=sv(r,typeof o=="string"?o:o.message,typeof o=="string"?void 0:o.type);return e[r]=i,e},{})}function uv(n){return{message:n.join(""),type:"warning"}}function cv(n){return{message:n.join(""),type:"error"}}var dv=ay({DS001:uv`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.`}),pv=ay({CSS001_CSS:cv`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
|
+
`}),ly={...dv,...pv};var Tt=new Map,sy=n=>{Tt.delete(n),to.delete(n),Rn.delete(n),vn.delete(n),wn.delete(n),ln.delete(n)};function oc(n,e,t){let o=Tt.get(n);if(!o)return;let r=to.get(n);(!r||!Object.hasOwn(r,e))&&to.set(n,{...r||{},[e]:o.getState()[e]}),Rn.set(n,{...Rn.get(n)||{},[e]:t}),o.actions[e]=t}function Il(n,e,t){let o=Tt.get(n);if(!o)return;let r=vn.get(n);(!r||!Object.hasOwn(r,e))&&vn.set(n,{...r||{},[e]:o.getDataSourceState()[e]}),wn.set(n,{...wn.get(n)||{},[e]:t}),o.dataSourceActions[e]=t}var fv=n=>{let e=n.type==="error"?An(n.debugId):zt(n.debugId),t=n.type==="error"?Fh:Oh,o=n.debugId?`${n.code}-${n.debugId}`:n.code,r=n.message;n.debugId&&(r=`${r}
|
|
26
26
|
|
|
27
|
-
Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},si=n=>{let{debugId:e,key:t}=n,o=Ah[t];if(o&&(Dw({...o,debugId:e}),e&&t)){let r=Tt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),Zn(e))}};globalThis.logDevToolsWarning=si;var Zn=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Tt.get(n);t&&e(n,t)};function Oh(n){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:h,cursorId:S}=o,[y,C]=(0,nt.useState)({vertical:!1,horizontal:!1}),T=(0,nt.useRef)(y);(0,nt.useEffect)(()=>(a.onChange(M=>{M&&(T.current=M,C(M))}),()=>a.destroy()),[a]),(0,nt.useEffect)(()=>{if(!m)return;let M=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(M)},[g]),(0,nt.useEffect)(()=>{if(!m||g!==void 0)return;let M=requestAnimationFrame(()=>{T.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:E,dataArray:z}=M;!y.vertical&&E&&(D?t.cursorId=D:D===void 0&&z.length&&(t.cursorId=z.length))},[y.vertical]);let b=(0,nt.useMemo)(()=>Og(),[])(p,h,f),R={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?b:null,cursorId:m?S:null},w=(0,nt.useRef)(!0),v=(0,nt.useRef)(!1);xw(n,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?S:null},v);let P=xi(),x=(0,nt.useRef)([]);vo(()=>{let M=e(),D=P(),{isDetail:E,isDetailReady:z}=Ru(D,e);if(E&&!z)return;let V=Date.now(),N=x.current;N.length>=10&&N.splice(0,1),N.push(V),V-N[0]<200&&N.length>=10&&si({debugId:M.debugId,key:"DS001"}),typeof M.data!="function"&&Tn(M.data,M,t,void 0,D)},{data:r}),vo(M=>{let D=Object.keys(M),E=!1;if(D.length===1){E=!!M.cursorId;let F=e().data;if(Array.isArray(F)&&M.refetchKey){t.originalDataArray=F;return}}let z=P(),{isDetail:V,isDetailReady:N}=Ru(z,e);if(V&&!N)return;let L=e();if(typeof L.data=="function"){if(v.current&&!E&&Fg(L))return;let F;L.debugId&&(F=st(L.debugId).track.DataSource.label.RemoteDataLoad.start()),Tn(L.data,L,t,{append:E},z).then(()=>{F?.end()})}},{...R,data:r}),(0,nt.useEffect)(()=>{v.current=!1}),vo(()=>{let M=e();if(w.current){w.current=!1;let D=Wt(M,void 0,P());t.dataParams=D}},R)}function xw(n,e,t){let{getDataSourceState:o,dataSourceActions:r,dataSourceState:i}=n;(0,nt.useEffect)(()=>{r.lazyLoadCacheOfLoadedBatches=new U},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:u,dataArray:c,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=(0,nt.useRef)(null),m=(h,S,y=o().lazyLoadCacheOfLoadedBatches)=>{let C=o();if(h=h||f.current,!h)return;let{renderStartIndex:T,renderEndIndex:I}=h,{lazyLoadBatchSize:b,lazyLoad:R}=C;R&&((!b||b<=0)&&(!C.groupBy||C.groupBy.length===0)||Lg({startIndex:T,endIndex:I,lazyLoadBatchSize:b,componentState:C,componentActions:r,dismissLoadedRows:S?.dismissLoadedRows??!1},y))},g=(0,nt.useMemo)(()=>Yt(m,{wait:p}),[p]);vo(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(o().lazyLoadCacheOfLoadedBatches.clear(),o().originalLazyGroupData.clear(),m(u.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(u.get()),u.onChange(S=>{f.current=S,Ng(o().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()},[c])}function fr(n){let e=En(),t=xi(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=Hu(n),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Le(s),[d]=(0,gt.useState)(()=>Ih({getState:c,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:c,assignState:u,dataSourceApi:d},f=Le(i),m=Le(p),g=hu(),h=(0,gt.useCallback)(({children:S})=>{let y=Ka(),[C]=(0,gt.useState)(()=>Mh());typeof S=="function"&&(S=S(c()));let T=m();return C.setSnapshot(T),(0,gt.useLayoutEffect)(()=>{C.notify()}),gt.default.createElement(a.Provider,{key:r,value:f()},gt.default.createElement(g.Provider,{value:T},gt.default.createElement(y.Provider,{value:C},S)))},[a,o,r]);return(0,gt.useLayoutEffect)(()=>{let S=t();S&&S.registerDetail(p)},[]),(0,gt.useLayoutEffect)(()=>()=>{let S=c();S.onCleanup(S)},[]),Oh({dataSourceState:s,dataSourceActions:l,getDataSourceState:c}),(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 Fh(){return Ne(n=>n.dataSourceApi)}var cl=class cl{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??cl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};cl.DEFAULT_SIZE=10;var ul=cl;var Ku=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},dl=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)}},Bu=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 Ku:e===!0?new Bu:typeof e=="number"?new dl(e):new dl(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 Nh=(e=>(e.INIT="INIT",e))(Nh||{});var{useManagedComponent:Hu}=Lt({debugName:"DataSource",initSetupState:dh,forwardProps:fh,concludeReducer:xh,mapPropsToState:gh,onPropChange:hh,cleanup:ph,interceptActions:Sh(),mappedCallbacks:yh()});function Mw(n){let{DataSource:e}=fr(n);return Lh.createElement(e,null,n.children??null)}function Ew(){let{rowInfoReducerResults:n}=Ne(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function zh(n){let{getDataSourceState:e}=Ne(o=>({getDataSourceState:o.getDataSourceState}));return(0,kh.useMemo)(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=n[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}var Vh=require("react");var zK=Nt("useColumnSizeFn");function Gh(n){return(0,Vh.useCallback)(t=>{let o=n[t];return o?o.computedWidth:0},[n])}var Ut=require("react");var Aw={scrollLeft:0,scrollTop:0},ui=class{constructor(){this.scrollPosition=Aw;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};var ci=n=>`--infinite-${n}`;var Wu=40,di=ci(mp),Hh=`var(${ci("density-scale")}, 1)`,pi=`calc(var(${ci("row-height")}, ${Wu}px) * ${Hh})`,ju=`calc(var(${di}) * ${Hh})`;function Kh(n,e){if(!n)return null;if(e.rowHeightCSSVar!==pi)return n;if(!Ow())return null;let t=Math.round(n);return t===e.rowHeight?null:t}var _w=ci("loaded");function Ow(){return typeof document>"u"||typeof getComputedStyle!="function"?!1:getComputedStyle(document.documentElement).getPropertyValue(_w).trim()===$i}function Bh(n,e){return n?e.columnHeaderHeightCSSVar===ju?Math.round(n):n:null}function Wh(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var jh=H(require("react"));function Uh(n){return(e,t)=>jh.createElement(n,{key:e.id,rowInfo:e,cache:t})}var fi=class extends yo{constructor(t,o){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.onScrollOriginChange=t=>this.options?.masterBrain?this.options.masterBrain.onScrollOriginChange(t):super.onScrollOriginChangeForBrain(t);this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=Da(u,c.concat(c)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.availableWidth,p=c&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof o=="number",m=typeof r=="number",g=f&&o!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=o,this.rows=o),m&&h&&(this.initialCols=r,this.cols=r);let S=i!=null,y=a!=null,C=S&&i!==this.rowHeight,T=y&&a!==this.initialColWidth;S&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let I=g||C||p,b=h||T||d||I;(b||I)&&this.updateRenderCount({horizontal:b,vertical:I})}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=hn){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{He(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}supportsLargeContent(t){return t==="horizontal"}alignScrollOrigin(t,o){return t==="vertical"||!this.pageWidth?Math.floor(o):Math.floor(o/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 Po(){return{current:null}}var Uu={};function $u(n){return`.${nn}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function Yu(n,e){let t=Un(n),o=e?new fi(t,{isHeader:!1}):new yo(t),r=`${t}:header`,i=e?new fi(r,{isHeader:!0,masterBrain:o}):new yo(r);o.onScroll(c=>{i.setScrollPosition({scrollLeft:c.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=ei(o),{renderer:s,onRenderUpdater:u}=ei(i);return o.onAvailableSizeChange(c=>{i.update({width:c.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:u}}function $h({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Yu(n,!!e),u=Po(),c=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:c,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(!u.current)return null;let p=$u(d);return u.current.querySelector(p)||null},brain:o,headerBrain:r,domRef:u,columnMenuTargetRef:Po(),editingValueRef:Po(),scrollerDOMRef:Po(),portalDOMRef:Po(),focusDetectDOMRef:Po(),activeCellIndicatorDOMRef:Po(),onColumnMenuClick:Se(),cellContextMenu:Se(),contextMenu:Se(),onFilterOperatorMenuClick:Se(),pendingColumnFilters:new Ia,flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Se(),onRowHeightCSSVarChange:Se(),onRowDetailHeightCSSVarChange:Se(),onColumnHeaderHeightCSSVarChange:Se(),cellClick:Se(),cellMouseDown:Se(),keyDown:Se(),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 ui,pinnedEndScrollListener:new ui,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Yh=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,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===pi?Wu:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Uu,columnGroupVisibility:e=>e??Uu,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 Fw(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var qh=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.headerRenderer.destroy(),n.onRenderUpdater.destroy(),n.headerOnRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function Xh(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var pl=new WeakMap;function Zh(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Qh=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups!=o?.pivotColumnGroups?Wh(i??Uu,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=Fw({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let h=pl.get(d);h||(h=Uh(d),pl.set(d,h)),c=h}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof At)&&(u=new At(u)),u=u||new At({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=pl.get(u),f||(f=h=>u.isRowDetailsExpanded(h.id),typeof u=="object"&&pl.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:c,rowDetailState:u,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?!e.columnHeaderHeight||e.columnHeaderHeight===di?ju:e.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=Cn.get(t.debugId);h&&(g={...g,...h})}return g};function Jh(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function ey(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===s-1))break}return Object.keys(o).forEach(d=>{let p=o[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var wn=H(require("react"));var ty=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;var fl=H(require("react"));var ny="_16lm1iwb _16lm1iw1d _16lm1iwk";var oy="164.93361431346415 56.97787143782138",ry={margin:"auto",display:"block",shapeRendering:"auto"},CB=Object.keys({size:1,style:1,className:1,viewBox:1});var iy=n=>fl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...ry,...n.style},width:"24px",height:"24px",viewBox:n.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:$(n.className,ny,Go.loading,gd,"InfiniteIcon","InfiniteIcon-loading")},fl.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:oy},fl.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function ay(n,e,t,o){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=n,l=r.column?{...r.column}:{},s=typeof t=="function"?t(n,e):t;return{header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:o.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,...s,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:s?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})}}function ly(n,e,t,o){let r=typeof t=="function"?t(n,e):t,i={};return n.sortable!=null&&(i.sortable=n.sortable),{...i,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:o.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function qu({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=o,d=e==="multi-column"&&c.isGroupRow&&n+1!==c.groupNesting,p=$(Vo.flex,i.align==="end"?Or.rowReverse:Or.row,nd.center,`${nn}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||u||d&&i.field)?Af({align:a}):null);return d?i.field?wn.createElement("div",{className:p},u,wn.createElement("div",{className:Gt},l??null)):u?wn.createElement("div",{className:p},u):null:(e==="single-column"&&c.isGroupRow,wn.createElement("div",{className:p},s,u,wn.createElement("div",{className:Gt},l??null)))}}function Xu({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===n&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&n+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(c.groupKeys?.length||0)<l?.length:(c.groupKeys?.length||0)<=l?.length;return ty(c)?f=wn.createElement(iy,null):m&&(f=wn.createElement(po,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),o&&(r.renderBag.groupIcon=f,f=wn.createElement(vt,{render:o,renderParam:r})),f}}function sy(){return{getGroupColumnRender:qu,getGroupColumnRenderGroupIcon:Xu}}function uy(n,e,t){return ay(n,e,t,sy())}function cy(n,e,t){return ly(n,e,t,sy())}function dy(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=n;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,g,h)=>{let S=uy({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:u,selectionMode:r},c,i),y=S.id||`group-by-${m.field||m.groupField}`;f.push(y),p[y]=S});else if(u==="single-column"&&t.length){let m=cy({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:u,selectionMode:r},c,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:o,groupBy:t})}:y={...y,...s}),y.inheritFromColumn!==!1&&(y={...typeof y.inheritFromColumn=="string"?d[y.inheritFromColumn]:y.pivotAggregator?.field?oo(d,y.pivotAggregator.field):void 0,...y}),!y.render&&y.renderValue&&(y.render=C=>y.renderValue(C)),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 py=require("react");function Zu(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=Ne(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,py.useCallback)(r=>{let i=n(),a=new Dt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[wt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Tn(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=U.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=zt())}},[])}function Nw(n){return(0,Ut.useMemo)(()=>Xh(n),[n])}function fy(n,e){let{groupBy:t,dataSourceActions:o}=Ne(u=>({groupBy:u.dataSourceState.groupBy,dataSourceActions:u.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;(0,Ut.useEffect)(()=>{o.generateGroupRows=r!=="inline"},[r]),(0,Ut.useEffect)(()=>{o.pivotTotalColumnPosition=i},[i]),(0,Ut.useEffect)(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=Nw(t);Lw(l,n,e);let{toggleGroupRow:s}=kw();return zw(l,n,e),{toggleGroupRow:s}}function Lw(n,e,t){let o=Zu(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(u,c,d,p){let f={};if(d==="inline")return Object.keys(u).forEach(m=>{let g=u[m],h={},S=c.get(g.field);if(S&&d==="inline"){let{groupIndex:C}=S;h={groupByForColumn:S.groupBy,field:S.groupBy?.field,valueGetter:S.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[C]:T.value,rowspan:({rowInfo:T,dataArray:I})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let b=I[T.indexInAll-1]||{indexInParentGroups:[]};if(!b||!b.dataSourceHasGrouping)return 1;let R=b.indexInParentGroups||[],w=T.indexInParentGroups||[],v=!1;for(let M=0;M<=C;M++){let D=R[M];if(w[M]!==D){v=!0;break}}if(!v)return 1;let P=T.parents[C];return P?P.groupCount-(P.collapsedChildrenCount||0)+(P.collapsedGroupsCount||0):1},renderGroupIcon:Xu({groupIndexForColumn:C,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:qu({groupIndexForColumn:C,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,n,i,o)})()},[r,n,i,o])}function kw(){let{groupBy:n,pivotBy:e,selectionMode:t}=Ne(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=kt(),f=Zu();return(0,Ut.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:h}=dy({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});o.columnsWhenGrouping=g;let S=p().columnOrder;if(h.length&&Array.isArray(S)){let y=new Set(S),C=!1;h.forEach(T=>{y.has(T)||(C=!0,S=[T,...S])}),C&&(o.columnOrder=S)}})()},[r,n,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function zw(n,e,t){let{dataArray:o,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:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Le(e);(0,Ut.useLayoutEffect)(()=>{if(f!=="multi-column")return;let h=g(),S=Jh(c,n),y=ey({computedGroupColumns:S,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});Rt(h.columnVisibility,y)||(m.columnVisibility=y)},[s,f,l,i,n,c,p?o:null,p?a:null,p?r:null,p]),(0,Ut.useEffect)(()=>{let h=i.length>0,S=g(),{columnVisibility:y,columnVisibilityForGrouping:C,hideColumnWhenGrouped:T}=S,I={...y},b={...C},R=!1,w=new Set,v=new Set;Object.keys(c).forEach(P=>{let x=c[P];if(x.defaultHiddenWhenGroupedBy||T!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&h||(x.defaultHiddenWhenGroupedBy===!0||T)&&x.field&&n.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&n.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((D,E)=>D||n.has(E),!1)){if(b[P]!==!1){if(y[P]===!1)return;b[P]=!1,R=!0,w.add(P)}}else b[P]===!1&&(delete b[P],R=!0,v.add(P))}),R&&(m.columnVisibilityForGrouping=b,v.forEach(P=>{delete I[P]}),w.forEach(P=>{I[P]=!1}),m.columnVisibility=I)},[c,u,i,n,d])}var my=require("react");var gy=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,sortable:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,draggableColumns:c,columnDefaultDraggable:d,sortInfo:p,multiSort:f,filterValue:m,filterTypes:g,columnOrder:h,columnPinning:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,columnDefaultSortable:b,scrollbarWidth:R,columnTypes:w,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,viewportReservedWidth:x,resizableColumns:M,columnVisibility:D,columnVisibilityAssumeVisible:E,columnSizing:z,groupBy:V})=>{let{computedRemainingSpace:L,computedColumnOrder:F,computedVisibleColumns:B,computedVisibleColumnsMap:X,computedPinnedStartColumns:_,computedPinnedEndColumns:k,computedUnpinnedColumns:K,computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:Ie,computedUnpinnedColumnsWidth:se,computedUnpinnedOffset:me,computedPinnedEndOffset:ve,computedPinnedEndWidth:Pe,computedPinnedStartWidth:ce,renderSelectionCheckBox:oe,computedColumnsMap:ue,computedColumnsMapInInitialOrder:pe,fieldsToColumn:Z}=(0,my.useMemo)(()=>op({columns:n,userColumns:e,scrollbarWidth:R,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:u,viewportReservedWidth:x,resizableColumns:M,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,draggableColumns:c,columnDefaultDraggable:d,columnOrder:h,columnPinning:S,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,columnDefaultSortable:b,editable:y,columnSizing:z,columnTypes:w,columnVisibility:D,columnVisibilityAssumeVisible:E??!0,groupBy:V}),[n,e,t.width,o,r,i,x,R,l,p,f,m,g,h,D,E,d,c,M,v,P,z,w,S,C,T,I,y,V,1]);return{renderSelectionCheckBox:oe,columns:n,computedColumnsMap:ue,computedPinnedEndWidth:Pe,computedPinnedStartWidth:ce,computedRemainingSpace:L,computedUnpinnedOffset:me,computedPinnedEndOffset:ve,computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:Ie,computedUnpinnedColumnsWidth:se,computedPinnedStartColumns:_,computedPinnedEndColumns:k,computedUnpinnedColumns:K,computedVisibleColumns:B,computedVisibleColumnsMap:X,computedColumnOrder:F,computedColumnsMapInInitialOrder:pe,fieldsToColumn:Z}};var yy=require("react");var ml=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function Vw(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?o(d):0;return e&&e.rowHeight.set(c,p),p}:o;let l=typeof o=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function hy(n){let e=new ml;return{computedRowHeight:Vw(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}}function Sy(n){return(0,yy.useMemo)(()=>hy(n),[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}var gr=require("react");var Gw={vertical:!1,horizontal:!1};function by(n){let e=n().brain,{getDataSourceState:t}=on(),[o,r]=(0,gr.useState)(Gw);return(0,gr.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(u=>u.vertical===l&&u.horizontal===s?u:{vertical:l,horizontal:s})}),[e]),(0,gr.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function Ty(n){let{state:e,actions:t,getState:o}=n,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:h,columnSizing:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,columnTypes:b,rowHeight:R,rowDetailHeight:w,isRowDetailExpanded:v,isRowDetailEnabled:P,bodySize:x,showSeparatePivotColumnForSingleAggregation:M,onRowHeightCSSVarChange:D,onFlashingDurationCSSVarChange:E,onRowDetailHeightCSSVarChange:z,onColumnHeaderHeightCSSVarChange:V,computedColumns:N,initialColumns:L,viewportReservedWidth:F,resizableColumns:B,sortable:X,draggableColumns:_}=e,k=t,{multiSort:K,filterValue:Q,filterTypes:Ie,groupBy:se,sortInfo:me,dataSourceActions:ve,getDataSourceState:Pe,dataSourceApi:ce}=Ne(ae=>({dataSourceActions:ae.dataSourceActions,getDataSourceState:ae.getDataSourceState,dataSourceApi:ae.dataSourceApi,sortInfo:ae.dataSourceState.sortInfo,multiSort:ae.dataSourceState.multiSort,filterValue:ae.dataSourceState.filterValue,filterTypes:ae.dataSourceState.filterTypes,groupBy:ae.dataSourceState.groupBy}));(0,Qn.useState)(()=>{D.onChange(ae=>{let Ee=Kh(ae,o());Ee!=null&&(k.rowHeight=Ee)}),E.onChange(ae=>{let Ee=ae?ae*1:null;Ee!=null&&!isNaN(Ee)&&(k.flashingDurationCSSVarValue=Ee)}),z.onChange(ae=>{ae&&(k.rowDetailHeight=ae)}),V.onChange(ae=>{let Ee=Bh(ae,o());Ee!=null&&(k.columnHeaderHeight=Ee)})}),(0,Qn.useEffect)(()=>{ve.showSeparatePivotColumnForSingleAggregation=M},[M]);let{toggleGroupRow:oe}=fy(e,t),ue=N,{computedColumnOrder:pe,computedVisibleColumns:Z,computedVisibleColumnsMap:J,computedPinnedStartColumns:W,computedPinnedEndColumns:ie,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:le,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:de,computedPinnedEndOffset:ye,computedRemainingSpace:we,computedPinnedStartWidth:be,computedPinnedEndWidth:Me,renderSelectionCheckBox:qe,computedColumnsMap:We,computedColumnsMapInInitialOrder:rt,fieldsToColumn:it}=gy({columns:ue,userColumns:L,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:x,viewportReservedWidth:F,resizableColumns:B,sortable:X,draggableColumns:_,sortInfo:me??void 0,multiSort:K,groupBy:se,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,filterValue:Q,filterTypes:Ie,columnSizing:S,columnTypes:b}),et=zh(Z),Xe=Gh(Z),G=by(o),ee=be?le>be:!1,ge=Me?O>Me:!1,[Te]=(0,Qn.useState)(()=>new Za({getRowAt:Ee=>Pe().dataArray[Ee],isNodeSelectable:Ee=>{let{isNodeSelectable:Ze}=Pe();return Ze?Ze(Ee):!0}})),ct=Le(Z),[re]=(0,Qn.useState)(()=>new Xa({getPrimaryKeyByIndex:ce.getPrimaryKeyByIndex,getColumnIdByIndex:ae=>ct()[ae]?.id||""})),{computedRowHeight:j,computedRowSizeCacheForDetails:lt}=Sy({rowDetailHeight:w,rowHeight:R,isRowDetailsExpanded:v,isRowDetailsEnabled:P,getDataSourceState:Pe});return(0,Qn.useMemo)(()=>({multiRowSelector:Te,multiCellSelector:re,computedRowSizeCacheForDetails:lt,computedRowHeight:j,scrollbars:G,columnSize:Xe,rowspan:et,toggleGroupRow:oe,computedColumnsMap:We,computedColumnsMapInInitialOrder:rt,renderSelectionCheckBox:qe,computedPinnedStartOverflow:ee,computedPinnedEndOverflow:ge,computedPinnedStartWidth:be,computedPinnedEndWidth:Me,computedVisibleColumns:Z,computedColumnOrder:pe,computedRemainingSpace:we,computedVisibleColumnsMap:J,computedPinnedStartColumns:W,computedPinnedEndColumns:ie,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:le,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:de,computedPinnedEndOffset:ye,fieldsToColumn:it}),[Te,re,lt,j,G,Xe,et,oe,We,rt,qe,ee,ge,be,Me,Z,pe,we,J,W,ie,ne,le,O,A,de,ye,it])}var Py=require("react");function Hw(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function Kw(){return 4294967295}function Bw(n,e,t){return e=e>>>8^n[t^e&255],e}function Ww(n){return n=~n,n=n<0?4294967295+n+1:n,n}function Qu(n,e=3988292384){var t=Hw(e),o=0,r;for(o=Kw(),r=0;r<n.length;r++)o=Bw(t,o,n.charCodeAt(r));return o=Ww(o),`${o}`}var jw=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Cy=`Thank you for using the Infinite Table free version! Make sure the "Powered by Infinite Table" footer link is visible in your app.
|
|
27
|
+
Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},Si=n=>{let{debugId:e,key:t}=n,o=ly[t];if(o&&(fv({...o,debugId:e}),e&&t)){let r=Tt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),no(e))}};globalThis.logDevToolsWarning=Si;var no=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Tt.get(n);t&&e(n,t)};function uy(n){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:h,cursorId:S}=o,[y,C]=(0,ot.useState)({vertical:!1,horizontal:!1}),b=(0,ot.useRef)(y);(0,ot.useEffect)(()=>(a.onChange(M=>{M&&(b.current=M,C(M))}),()=>a.destroy()),[a]),(0,ot.useEffect)(()=>{if(!m)return;let M=requestAnimationFrame(()=>{b.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(M)},[g]),(0,ot.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,ot.useEffect)(()=>{let M=e(),{livePaginationCursor:D,livePagination:E,dataArray:L}=M;!y.vertical&&E&&(D?t.cursorId=D:D===void 0&&L.length&&(t.cursorId=L.length))},[y.vertical]);let T=(0,ot.useMemo)(()=>uh(),[])(p,h,f),R={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?T:null,cursorId:m?S:null},v=(0,ot.useRef)(!0),w=(0,ot.useRef)(!1);mv(n,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?S:null},w);let P=ki(),x=(0,ot.useRef)([]);Eo(()=>{let M=e(),D=P(),{isDetail:E,isDetailReady:L}=Gu(D,e);if(E&&!L)return;let V=Date.now(),N=x.current;N.length>=10&&N.splice(0,1),N.push(V),V-N[0]<200&&N.length>=10&&Si({debugId:M.debugId,key:"DS001"}),typeof M.data!="function"&&In(M.data,M,t,void 0,D)},{data:r}),Eo(M=>{let D=Object.keys(M),E=!1;if(D.length===1){E=!!M.cursorId;let F=e().data;if(Array.isArray(F)&&M.refetchKey){t.originalDataArray=F;return}}let L=P(),{isDetail:V,isDetailReady:N}=Gu(L,e);if(V&&!N)return;let k=e();if(typeof k.data=="function"){if(w.current&&!E&&ch(k))return;let F;k.debugId&&(F=ct(k.debugId).track.DataSource.label.RemoteDataLoad.start()),In(k.data,k,t,{append:E},L).then(()=>{F?.end()})}},{...R,data:r}),(0,ot.useEffect)(()=>{w.current=!1}),Eo(()=>{let M=e();if(v.current){v.current=!1;let D=Ut(M,void 0,P());t.dataParams=D}},R)}function mv(n,e,t){let{getDataSourceState:o,dataSourceActions:r,dataSourceState:i}=n;(0,ot.useEffect)(()=>{r.lazyLoadCacheOfLoadedBatches=new j},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:u,dataArray:c,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=(0,ot.useRef)(null),m=(h,S,y=o().lazyLoadCacheOfLoadedBatches)=>{let C=o();if(h=h||f.current,!h)return;let{renderStartIndex:b,renderEndIndex:I}=h,{lazyLoadBatchSize:T,lazyLoad:R}=C;R&&((!T||T<=0)&&(!C.groupBy||C.groupBy.length===0)||ph({startIndex:b,endIndex:I,lazyLoadBatchSize:T,componentState:C,componentActions:r,dismissLoadedRows:S?.dismissLoadedRows??!1},y))},g=(0,ot.useMemo)(()=>Xt(m,{wait:p}),[p]);Eo(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(o().lazyLoadCacheOfLoadedBatches.clear(),o().originalLazyGroupData.clear(),m(u.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(u.get()),u.onChange(S=>{f.current=S,dh(o().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,ot.useEffect)(()=>{a&&a>0&&g()},[c])}function Sr(n){let e=On(),t=ki(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=rc(n),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Le(s),[d]=(0,ht.useState)(()=>Qh({getState:c,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:c,assignState:u,dataSourceApi:d},f=Le(i),m=Le(p),g=Ou(),h=(0,ht.useCallback)(({children:S})=>{let y=nl(),[C]=(0,ht.useState)(()=>iy());typeof S=="function"&&(S=S(c()));let b=m();return C.setSnapshot(b),(0,ht.useLayoutEffect)(()=>{C.notify()}),ht.default.createElement(a.Provider,{key:r,value:f()},ht.default.createElement(g.Provider,{value:b},ht.default.createElement(y.Provider,{value:C},S)))},[a,o,r]);return(0,ht.useLayoutEffect)(()=>{let S=t();S&&S.registerDetail(p)},[]),(0,ht.useLayoutEffect)(()=>()=>{let S=c();S.onCleanup(S)},[]),uy({dataSourceState:s,dataSourceActions:l,getDataSourceState:c}),(0,ht.useEffect)(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),(0,ht.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.dataSourceState}}function cy(){return Ne(n=>n.dataSourceApi)}var wl=class wl{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??wl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};wl.DEFAULT_SIZE=10;var Rl=wl;var ic=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},vl=class{constructor(e){this.storage=new Rl(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)}},ac=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)}},br=class{constructor(e){this.cacheStorage=e===!1?new ic:e===!0?new ac:typeof e=="number"?new vl(e):new vl(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 dy=(e=>(e.INIT="INIT",e))(dy||{});var{useManagedComponent:rc}=Vt({debugName:"DataSource",initSetupState:Hh,forwardProps:Bh,concludeReducer:ry,mapPropsToState:jh,onPropChange:Uh,cleanup:Kh,interceptActions:Yh(),mappedCallbacks:$h()});function gv(n){let{DataSource:e}=Sr(n);return py.createElement(e,null,n.children??null)}function hv(){let{rowInfoReducerResults:n}=Ne(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function my(n){let{getDataSourceState:e}=Ne(o=>({getDataSourceState:o.getDataSourceState}));return(0,fy.useMemo)(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=n[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}var gy=require("react");var LB=zt("useColumnSizeFn");function hy(n){return(0,gy.useCallback)(t=>{let o=n[t];return o?o.computedWidth:0},[n])}var Yt=require("react");var yv={scrollLeft:0,scrollTop:0},bi=class{constructor(){this.scrollPosition=yv;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};var Ti=n=>`--infinite-${n}`;var lc=40,Ci=Ti(Ep),yy=`var(${Ti("density-scale")}, 1)`,Ii=`calc(var(${Ti("row-height")}, ${lc}px) * ${yy})`,sc=`calc(var(${Ci}) * ${yy})`;function Sy(n,e){if(!n)return null;if(e.rowHeightCSSVar!==Ii)return n;if(!bv())return null;let t=Math.round(n);return t===e.rowHeight?null:t}var Sv=Ti("loaded");function bv(){return typeof document>"u"||typeof getComputedStyle!="function"?!1:getComputedStyle(document.documentElement).getPropertyValue(Sv).trim()===ta}function by(n,e){return n?e.columnHeaderHeightCSSVar===sc?Math.round(n):n:null}function Ty(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var Cy=H(require("react"));function Iy(n){return(e,t)=>Cy.createElement(n,{key:e.id,rowInfo:e,cache:t})}var Ri=class extends Io{constructor(t,o){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.onScrollOriginChange=t=>this.options?.masterBrain?this.options.masterBrain.onScrollOriginChange(t):super.onScrollOriginChangeForBrain(t);this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=Ha(u,c.concat(c)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.availableWidth,p=c&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof o=="number",m=typeof r=="number",g=f&&o!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=o,this.rows=o),m&&h&&(this.initialCols=r,this.cols=r);let S=i!=null,y=a!=null,C=S&&i!==this.rowHeight,b=y&&a!==this.initialColWidth;S&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let I=g||C||p,T=h||b||d||I;(T||I)&&this.updateRenderCount({horizontal:T,vertical:I})}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=Sn){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{Ke(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}supportsLargeContent(t){return t==="horizontal"}alignScrollOrigin(t,o){return t==="vertical"||!this.pageWidth?Math.floor(o):Math.floor(o/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 Ao(){return{current:null}}var uc={};function cc(n){return`.${rn}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function dc(n,e){let t=Zn(n),o=e?new Ri(t,{isHeader:!1}):new Io(t),r=`${t}:header`,i=e?new Ri(r,{isHeader:!0,masterBrain:o}):new Io(r);o.onScroll(c=>{i.setScrollPosition({scrollLeft:c.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=ci(o),{renderer:s,onRenderUpdater:u}=ci(i);return o.onAvailableSizeChange(c=>{i.update({width:c.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:u}}function Ry({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=dc(n,!!e),u=Ao(),c=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:c,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,focusedHeaderItem:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:d=>{if(!u.current)return null;let p=cc(d);return u.current.querySelector(p)||null},brain:o,headerBrain:r,domRef:u,columnMenuTargetRef:Ao(),editingValueRef:Ao(),scrollerDOMRef:Ao(),portalDOMRef:Ao(),focusDetectDOMRef:Ao(),activeCellIndicatorDOMRef:Ao(),onColumnMenuClick:ye(),cellContextMenu:ye(),contextMenu:ye(),onFilterOperatorMenuClick:ye(),pendingColumnFilters:new La,flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:ye(),onRowHeightCSSVarChange:ye(),onRowDetailHeightCSSVarChange:ye(),onColumnHeaderHeightCSSVarChange:ye(),cellClick:ye(),cellMouseDown:ye(),keyDown:ye(),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 bi,pinnedEndScrollListener:new bi,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var wy=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,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 br(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===Ii?lc:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??uc,columnGroupVisibility:e=>e??uc,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 Tv(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var vy=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.headerRenderer.destroy(),n.onRenderUpdater.destroy(),n.headerOnRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function Py(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var Pl=new WeakMap;function Dy(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var xy=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups!=o?.pivotColumnGroups?Ty(i??uc,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=Tv({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let h=Pl.get(d);h||(h=Iy(d),Pl.set(d,h)),c=h}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof Ft)&&(u=new Ft(u)),u=u||new Ft({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=Pl.get(u),f||(f=h=>u.isRowDetailsExpanded(h.id),typeof u=="object"&&Pl.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:c,rowDetailState:u,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?!e.columnHeaderHeight||e.columnHeaderHeight===Ci?sc:e.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=Rn.get(t.debugId);h&&(g={...g,...h})}return g};function My(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function Ey(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===s-1))break}return Object.keys(o).forEach(d=>{let p=o[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var Pn=H(require("react"));var Ay=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;var Dl=H(require("react"));var _y="_16lm1iwb _16lm1iw1d _16lm1iwk";var Oy="164.93361431346415 56.97787143782138",Fy={margin:"auto",display:"block",shapeRendering:"auto"},b2=Object.keys({size:1,style:1,className:1,viewBox:1});var Ny=n=>Dl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...Fy,...n.style},width:"24px",height:"24px",viewBox:n.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:$(n.className,_y,jo.loading,Ad,"InfiniteIcon","InfiniteIcon-loading")},Dl.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Oy},Dl.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function Ly(n,e,t,o){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=n,l=r.column?{...r.column}:{},s=typeof t=="function"?t(n,e):t;return{header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:o.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,...s,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:s?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})}}function ky(n,e,t,o){let r=typeof t=="function"?t(n,e):t,i={};return n.sortable!=null&&(i.sortable=n.sortable),{...i,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:o.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function pc({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=o,d=e==="multi-column"&&c.isGroupRow&&n+1!==c.groupNesting,p=$(Wo.flex,i.align==="end"?Vr.rowReverse:Vr.row,Sd.center,`${rn}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||u||d&&i.field)?cm({align:a}):null);return d?i.field?Pn.createElement("div",{className:p},u,Pn.createElement("div",{className:Bt},l??null)):u?Pn.createElement("div",{className:p},u):null:(e==="single-column"&&c.isGroupRow,Pn.createElement("div",{className:p},s,u,Pn.createElement("div",{className:Bt},l??null)))}}function fc({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===n&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&n+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(c.groupKeys?.length||0)<l?.length:(c.groupKeys?.length||0)<=l?.length;return Ay(c)?f=Pn.createElement(Ny,null):m&&(f=Pn.createElement(yo,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),o&&(r.renderBag.groupIcon=f,f=Pn.createElement(Pt,{render:o,renderParam:r})),f}}function zy(){return{getGroupColumnRender:pc,getGroupColumnRenderGroupIcon:fc}}function Vy(n,e,t){return Ly(n,e,t,zy())}function Gy(n,e,t){return ky(n,e,t,zy())}function Hy(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=n;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,g,h)=>{let S=Vy({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:u,selectionMode:r},c,i),y=S.id||`group-by-${m.field||m.groupField}`;f.push(y),p[y]=S});else if(u==="single-column"&&t.length){let m=Gy({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:u,selectionMode:r},c,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:o,groupBy:t})}:y={...y,...s}),y.inheritFromColumn!==!1&&(y={...typeof y.inheritFromColumn=="string"?d[y.inheritFromColumn]:y.pivotAggregator?.field?so(d,y.pivotAggregator.field):void 0,...y}),!y.render&&y.renderValue&&(y.render=C=>y.renderValue(C)),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 Ky=require("react");function mc(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=Ne(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,Ky.useCallback)(r=>{let i=n(),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||In(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=j.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Ht())}},[])}function Cv(n){return(0,Yt.useMemo)(()=>Py(n),[n])}function By(n,e){let{groupBy:t,dataSourceActions:o}=Ne(u=>({groupBy:u.dataSourceState.groupBy,dataSourceActions:u.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;(0,Yt.useEffect)(()=>{o.generateGroupRows=r!=="inline"},[r]),(0,Yt.useEffect)(()=>{o.pivotTotalColumnPosition=i},[i]),(0,Yt.useEffect)(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=Cv(t);Iv(l,n,e);let{toggleGroupRow:s}=Rv();return wv(l,n,e),{toggleGroupRow:s}}function Iv(n,e,t){let o=mc(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(u,c,d,p){let f={};if(d==="inline")return Object.keys(u).forEach(m=>{let g=u[m],h={},S=c.get(g.field);if(S&&d==="inline"){let{groupIndex:C}=S;h={groupByForColumn:S.groupBy,field:S.groupBy?.field,valueGetter:S.groupBy?.valueGetter,valueFormatter:({rowInfo:b})=>b.isGroupRow?b.groupKeys?.[C]:b.value,rowspan:({rowInfo:b,dataArray:I})=>{if(b.isTreeNode||!b.isGroupRow)return 1;let T=I[b.indexInAll-1]||{indexInParentGroups:[]};if(!T||!T.dataSourceHasGrouping)return 1;let R=T.indexInParentGroups||[],v=b.indexInParentGroups||[],w=!1;for(let M=0;M<=C;M++){let D=R[M];if(v[M]!==D){w=!0;break}}if(!w)return 1;let P=b.parents[C];return P?P.groupCount-(P.collapsedChildrenCount||0)+(P.collapsedGroupsCount||0):1},renderGroupIcon:fc({groupIndexForColumn:C,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:pc({groupIndexForColumn:C,groupRenderStrategy:d})}}let y={...h,...g};f[m]=y}),Object.keys(f).length===0?void 0:f}(0,Yt.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,n,i,o)})()},[r,n,i,o])}function Rv(){let{groupBy:n,pivotBy:e,selectionMode:t}=Ne(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=Gt(),f=mc();return(0,Yt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:h}=Hy({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});o.columnsWhenGrouping=g;let S=p().columnOrder;if(h.length&&Array.isArray(S)){let y=new Set(S),C=!1;h.forEach(b=>{y.has(b)||(C=!0,S=[b,...S])}),C&&(o.columnOrder=S)}})()},[r,n,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function wv(n,e,t){let{dataArray:o,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:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Le(e);(0,Yt.useLayoutEffect)(()=>{if(f!=="multi-column")return;let h=g(),S=My(c,n),y=Ey({computedGroupColumns:S,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});Rt(h.columnVisibility,y)||(m.columnVisibility=y)},[s,f,l,i,n,c,p?o:null,p?a:null,p?r:null,p]),(0,Yt.useEffect)(()=>{let h=i.length>0,S=g(),{columnVisibility:y,columnVisibilityForGrouping:C,hideColumnWhenGrouped:b}=S,I={...y},T={...C},R=!1,v=new Set,w=new Set;Object.keys(c).forEach(P=>{let x=c[P];if(x.defaultHiddenWhenGroupedBy||b!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&h||(x.defaultHiddenWhenGroupedBy===!0||b)&&x.field&&n.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&n.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((D,E)=>D||n.has(E),!1)){if(T[P]!==!1){if(y[P]===!1)return;T[P]=!1,R=!0,v.add(P)}}else T[P]===!1&&(delete T[P],R=!0,w.add(P))}),R&&(m.columnVisibilityForGrouping=T,w.forEach(P=>{delete I[P]}),v.forEach(P=>{I[P]=!1}),m.columnVisibility=I)},[c,u,i,n,d])}var Wy=require("react");var jy=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,sortable:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,draggableColumns:c,columnDefaultDraggable:d,sortInfo:p,multiSort:f,filterValue:m,filterTypes:g,columnOrder:h,columnPinning:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:b,columnDefaultGroupable:I,columnDefaultSortable:T,scrollbarWidth:R,columnTypes:v,pinnedEndMaxWidth:w,pinnedStartMaxWidth:P,viewportReservedWidth:x,resizableColumns:M,columnVisibility:D,columnVisibilityAssumeVisible:E,columnSizing:L,groupBy:V})=>{let{computedRemainingSpace:k,computedColumnOrder:F,computedVisibleColumns:W,computedVisibleColumnsMap:Y,computedPinnedStartColumns:_,computedPinnedEndColumns:K,computedUnpinnedColumns:z,computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:Te,computedUnpinnedColumnsWidth:ue,computedUnpinnedOffset:fe,computedPinnedEndOffset:De,computedPinnedEndWidth:xe,computedPinnedStartWidth:de,renderSelectionCheckBox:ne,computedColumnsMap:se,computedColumnsMapInInitialOrder:he,fieldsToColumn:U}=(0,Wy.useMemo)(()=>bp({columns:n,userColumns:e,scrollbarWidth:R,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:u,viewportReservedWidth:x,resizableColumns:M,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:w,pinnedStartMaxWidth:P,draggableColumns:c,columnDefaultDraggable:d,columnOrder:h,columnPinning:S,columnDefaultEditable:C,columnDefaultFilterable:b,columnDefaultGroupable:I,columnDefaultSortable:T,editable:y,columnSizing:L,columnTypes:v,columnVisibility:D,columnVisibilityAssumeVisible:E??!0,groupBy:V}),[n,e,t.width,o,r,i,x,R,l,p,f,m,g,h,D,E,d,c,M,w,P,L,v,S,C,b,I,y,V,1]);return{renderSelectionCheckBox:ne,columns:n,computedColumnsMap:se,computedPinnedEndWidth:xe,computedPinnedStartWidth:de,computedRemainingSpace:k,computedUnpinnedOffset:fe,computedPinnedEndOffset:De,computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:Te,computedUnpinnedColumnsWidth:ue,computedPinnedStartColumns:_,computedPinnedEndColumns:K,computedUnpinnedColumns:z,computedVisibleColumns:W,computedVisibleColumnsMap:Y,computedColumnOrder:F,computedColumnsMapInInitialOrder:he,fieldsToColumn:U}};var $y=require("react");var xl=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function vv(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?o(d):0;return e&&e.rowHeight.set(c,p),p}:o;let l=typeof o=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function Uy(n){let e=new xl;return{computedRowHeight:vv(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}}function Yy(n){return(0,$y.useMemo)(()=>Uy(n),[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}var Tr=require("react");var Pv={vertical:!1,horizontal:!1};function qy(n){let e=n().brain,{getDataSourceState:t}=an(),[o,r]=(0,Tr.useState)(Pv);return(0,Tr.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(u=>u.vertical===l&&u.horizontal===s?u:{vertical:l,horizontal:s})}),[e]),(0,Tr.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function Xy(n){let{state:e,actions:t,getState:o}=n,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:h,columnSizing:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:b,columnDefaultGroupable:I,columnTypes:T,rowHeight:R,rowDetailHeight:v,isRowDetailExpanded:w,isRowDetailEnabled:P,bodySize:x,showSeparatePivotColumnForSingleAggregation:M,onRowHeightCSSVarChange:D,onFlashingDurationCSSVarChange:E,onRowDetailHeightCSSVarChange:L,onColumnHeaderHeightCSSVarChange:V,computedColumns:N,initialColumns:k,viewportReservedWidth:F,resizableColumns:W,sortable:Y,draggableColumns:_}=e,K=t,{multiSort:z,filterValue:Q,filterTypes:Te,groupBy:ue,sortInfo:fe,dataSourceActions:De,getDataSourceState:xe,dataSourceApi:de}=Ne(ie=>({dataSourceActions:ie.dataSourceActions,getDataSourceState:ie.getDataSourceState,dataSourceApi:ie.dataSourceApi,sortInfo:ie.dataSourceState.sortInfo,multiSort:ie.dataSourceState.multiSort,filterValue:ie.dataSourceState.filterValue,filterTypes:ie.dataSourceState.filterTypes,groupBy:ie.dataSourceState.groupBy}));(0,oo.useState)(()=>{D.onChange(ie=>{let Ae=Sy(ie,o());Ae!=null&&(K.rowHeight=Ae)}),E.onChange(ie=>{let Ae=ie?ie*1:null;Ae!=null&&!isNaN(Ae)&&(K.flashingDurationCSSVarValue=Ae)}),L.onChange(ie=>{ie&&(K.rowDetailHeight=ie)}),V.onChange(ie=>{let Ae=by(ie,o());Ae!=null&&(K.columnHeaderHeight=Ae)})}),(0,oo.useEffect)(()=>{De.showSeparatePivotColumnForSingleAggregation=M},[M]);let{toggleGroupRow:ne}=By(e,t),se=N,{computedColumnOrder:he,computedVisibleColumns:U,computedVisibleColumnsMap:te,computedPinnedStartColumns:B,computedPinnedEndColumns:ae,computedUnpinnedColumns:oe,computedPinnedStartColumnsWidth:re,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:ce,computedPinnedEndOffset:Re,computedRemainingSpace:Se,computedPinnedStartWidth:be,computedPinnedEndWidth:Me,renderSelectionCheckBox:et,computedColumnsMap:tt,computedColumnsMapInInitialOrder:We,fieldsToColumn:lt}=jy({columns:se,userColumns:k,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:x,viewportReservedWidth:F,resizableColumns:W,sortable:Y,draggableColumns:_,sortInfo:fe??void 0,multiSort:z,groupBy:ue,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:y,columnDefaultEditable:C,columnDefaultFilterable:b,columnDefaultGroupable:I,filterValue:Q,filterTypes:Te,columnSizing:S,columnTypes:T}),Xe=my(U),Ze=hy(U),G=qy(o),J=be?re>be:!1,me=Me?O>Me:!1,[Ce]=(0,oo.useState)(()=>new dl({getRowAt:Ae=>xe().dataArray[Ae],isNodeSelectable:Ae=>{let{isNodeSelectable:ut}=xe();return ut?ut(Ae):!0}})),st=Le(U),[le]=(0,oo.useState)(()=>new cl({getPrimaryKeyByIndex:de.getPrimaryKeyByIndex,getColumnIdByIndex:ie=>st()[ie]?.id||""})),{computedRowHeight:Ye,computedRowSizeCacheForDetails:Z}=Yy({rowDetailHeight:v,rowHeight:R,isRowDetailsExpanded:w,isRowDetailsEnabled:P,getDataSourceState:xe});return(0,oo.useMemo)(()=>({multiRowSelector:Ce,multiCellSelector:le,computedRowSizeCacheForDetails:Z,computedRowHeight:Ye,scrollbars:G,columnSize:Ze,rowspan:Xe,toggleGroupRow:ne,computedColumnsMap:tt,computedColumnsMapInInitialOrder:We,renderSelectionCheckBox:et,computedPinnedStartOverflow:J,computedPinnedEndOverflow:me,computedPinnedStartWidth:be,computedPinnedEndWidth:Me,computedVisibleColumns:U,computedColumnOrder:he,computedRemainingSpace:Se,computedVisibleColumnsMap:te,computedPinnedStartColumns:B,computedPinnedEndColumns:ae,computedUnpinnedColumns:oe,computedPinnedStartColumnsWidth:re,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:ce,computedPinnedEndOffset:Re,fieldsToColumn:lt}),[Ce,le,Z,Ye,G,Ze,Xe,ne,tt,We,et,J,me,be,Me,U,he,Se,te,B,ae,oe,re,O,A,ce,Re,lt])}var nS=require("react");function Dv(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function xv(){return 4294967295}function Mv(n,e,t){return e=e>>>8^n[t^e&255],e}function Ev(n){return n=~n,n=n<0?4294967295+n+1:n,n}function gc(n,e=3988292384){var t=Dv(e),o=0,r;for(o=xv(),r=0;r<n.length;r++)o=Mv(t,o,n.charCodeAt(r));return o=Ev(o),`${o}`}var Av=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Zy=`Thank you for using the Infinite Table free version! Make sure the "Powered by Infinite Table" footer link is visible in your app.
|
|
28
28
|
|
|
29
|
-
If you want to remove the footer link, please visit infinite-table.com to purchase a license.`,
|
|
29
|
+
If you want to remove the footer link, please visit infinite-table.com to purchase a license.`,Qy=!1,Jy=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+8,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},eS=(n="",e,t)=>{let o;try{o=_v(n)}catch{return n?(Jy(["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"):(t?t(Zy):Qy||(Qy=!0,console.info(Zy)),"invalid")}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(Jy([`
|
|
30
30
|
Your Infinite Table license has expired on ${i.toDateString()}.
|
|
31
|
-
`,`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 Uw=n=>{let e="",t=n.split("|").map(l=>{let s=l.indexOf("="),u=s===-1?l:l.slice(0,s),c=s===-1?"":l.slice(s+1);return u==="C"&&(e=c),{name:u,value:c}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let u=t[s];if(Qu(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Qu(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),jw(t)};function vy(n="",e){if(e.isDetail)return"valid";let t=wy(n,{publishedAt:1796157963892,version:"11.0.3"});return t==="invalid"&&!n?"missing":t}var Dy=(n="")=>{let t=!!En();return(0,Py.useMemo)(()=>vy(n,{isDetail:t}),[n,t])};var hr=require("react");var $w=10;function xy(n,e,t){let o=(0,hr.useRef)(!1),r=(0,hr.useRef)(null);(0,hr.useEffect)(()=>{n!=null&&(o.current=!1,Ht(r.current))},[n]),(0,hr.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Ht(r.current),r.current=He(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<$w&&a(l)})};var i=a;a()}return()=>{Ht(r.current)}},[n,e])}var yr=require("react"),Yw=10;function My(n,e,t){let o=(0,yr.useRef)(!1),r=(0,yr.useRef)(null);(0,yr.useEffect)(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),(0,yr.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<Yw&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function Ey(){return Mn()}var Sr=require("react");function Ay(n,e){n.getComputed().multiRowSelector.lastPointerDown={rowIndex:n.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var qw={Enter:!0," ":!0,a:!0};function _y(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=n,{key:l,ctrlKey:s,metaKey:u}=e;if(!qw[l])return!1;let c=t(),d=o(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=c,{selectionMode:h,rowSelection:S,treeSelectionState:y,isTree:C}=d;if(g===!1)return!1;let T=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null;if(!(T!=null?d.dataArray[T]:null)||T==null)return!1;if(l===" "&&(h==="single-row"||h==="multi-row")){let b={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return pa({...n,rowIndex:T},b,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||u)){if(C&&y){let R=a(y);return R.selectAll(),r.treeSelection=R,!0}let b=i(S);return b.selectAll(),r.rowSelection=b,!0}return!1}var Oy=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Fy=n=>Array.from(n.querySelectorAll(Oy)).filter(t=>!!t.offsetParent),gl=n=>n.querySelector(Oy);var Ly=H(io());async function Ny(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var Xw=10,Zw=(n,e)=>n-e;function hl(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=o(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[n.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===n.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[n.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=St(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 Ju(n,e,t){let o=t.getState().editingCell;return Qw(n,e,t,{isCellFocusable:hl,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function ky(n,e,t){let o=(0,Ly.default)(t,n+e,Zw);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=ky;function Qw(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=n.rowIndex,c=n.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:ky(c,e,a),c===null){if(u+=e,u<0||u>=s.length)return null;continue}if(i({colIndex:c,rowIndex:u},t))return{colIndex:c,rowIndex:u}}return null}async function zy(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=hl(e,n)?e:Ju(e,-1,n);if(t){await ec([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;gl(o)?.focus()}}async function ec([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=Xw,l=null,s=!1;function u(c=0){c++,Ht(l),l=He(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&c<a&&u(c),s){try{await Ny(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var Jw=`.${nn}`;function Vy(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:Ln(o,Jw),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:c}=n.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&hl({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:Ju({rowIndex:l,colIndex:s},t,n);if(!u){if(t===-1)r.focus();else{let c=Fy(document.body),d=n.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return ec([u.rowIndex,u.colIndex],n).then(()=>{let c=n.getState().getDOMNodeForCell(u);if(!c)return;gl(c)?.focus()}),!0}var Gy={control:"ctrl"},Hy={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},ev={esc:"escape"},By={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},Wy=Object.keys(By),tc=new Set(Wy),tv=new Set(["shift","alt"]);function yl(n,e){return Array.isArray(e)?e.some(t=>Ky(n,t)):Ky(n,e)}function Ky(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(p=>p.toLowerCase().trim()),r=o.find(p=>Hy[p]),i=o.map(p=>Gy[p]||Hy[p]||ev[p]||p),a=i.filter(p=>tc.has(p)),l=i.filter(p=>!tc.has(p)),s=Wy.reduce((p,f)=>(p[f]=By[f](n),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!tv.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||tc.has(t)||t==="meta"||Gy[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function jy(n,e){let t={...n,cloneRowSelection:a=>nr(a,n.getDataSourceState),cloneTreeSelection:a=>tr(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&_y(t,e)&&e.preventDefault(),(Vy(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&Gg(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,u=n.getComputed().computedVisibleColumns[s];u.computedEditable&&n.api.startEdit({rowIndex:l,columnId:u.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!yl(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function nv(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=Ke(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=on();return(0,Sr.useMemo)(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>tr(c,i),cloneRowSelection:c=>nr(c,i)}),[n,e,i,a,t,l,o])}function ov(){let n=nv();(0,Sr.useEffect)(()=>{let e=n.getState().keyDown.onChange(a=>{jy(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],u=St(s.id,n);Tf({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=n.getComputed().computedVisibleColumns[u],d=St(c.id,n);Ay({...n,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function rv(){let{getState:n}=te(t=>({getState:t.getState}));return{onKeyDown:(0,Sr.useCallback)(t=>{n().keyDown(t)},[])}}function Uy(){return ov(),rv()}var ac=require("react");var Be=H(require("react")),_t=require("react"),Qy=require("react-dom");var Sl="__is_infinite_menu_component";function nc(n){return!!n.tagName}function qy(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=_e.from(nc(e)?e.getBoundingClientRect():e),a=_e.from(nc(t)?t.getBoundingClientRect():t),l=o?_e.from(nc(o)?o.getBoundingClientRect():o):null;if(!l)return{...$y({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=$y({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s={...d,index:0}),d.valid)return{...d,index:u}}return s}function $y(n){let e=_e.from(n.targetRect),t=_e.from(n.anchorRect),o=n.constrainRect?_e.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=Yy(e,i),s=Yy(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function Yy(n,e){return e==="TopLeft"?je.from({top:n.top,left:n.left}):e==="TopCenter"?je.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?je.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?je.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?je.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?je.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?je.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}function iv(n){return n&&typeof n.then=="function"||n instanceof Promise}function bl(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function Xy(n){return typeof n=="function"&&(n=n()),iv(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&bl(n)&&(n=n.getBoundingClientRect()),n?_e.from(n):null}async function Zy(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),bl(o)&&(r=o),r||null}return t(await e)}async function Tl(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Xy(t)||void 0,a=o?await Xy(o):void 0,l=_e.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=qy({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=n.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=n.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function av(n){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function lv(n){let e=Be.useRef(null);return(0,_t.useEffect)(()=>n.realign.onChange(t=>{e.current&&t&&Tl(e.current,t)}),[n.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,_t.useCallback)(t=>{t&&Tl(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}function Jy(n,e){let[t,o]=(0,_t.useState)(null);(0,_t.useLayoutEffect)(()=>{async function a(){let l=e?await Zy(e):null;l!=null&&o(l)}e&&a()},[e]);let r=typeof e=="function"?e():null,i=bl(r)?r:t;return e?i?(0,Qy.createPortal)(n,i):Be.createElement(Be.Fragment,null):e===null||e===!1?n:Be.createElement(av,null,n)}function sv(n){if(Be.Children.count(n)===1){let e=Be.Children.only(n);if(Be.isValidElement(e))return e.props.id||e.key}return null}function uv(n,e,t){if(Be.Children.count(n)===1){let o=Be.Children.only(n);if(Be.isValidElement(o)&&o.type[Sl]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),Be.cloneElement(o,r)}}return n}function ln(n){let e=n,[t]=(0,_t.useState)(()=>new Map),[o,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(lv,{...h,key:h.key}));return m},[]),[s,u]=qt(),c=Jy(l(),n.portalContainer),d=(0,_t.useCallback)((m,g)=>{let S=`${g.id||sv(m)||zt()}`,y=t.get(S),C=b=>()=>{let R=typeof b=="function"?b():b;return uv(R,e.portalContainer,g.constrainTo??e.constrainTo)},T=C(m),I=(b,R)=>{if(!y)return;let w=C(b);Object.assign(y,{children:w}),u(),!!!R?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),I(m),I):(y={key:S,children:T,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Se()},t.set(y.key,y),u(),I)},[t,e.portalContainer,u]);Be.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return Be.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}var GS=H(require("react"));var Cr=H(require("react"));var pS=H(require("react"));var cS=H(require("react"));function Cl(n){return null}Cl.defaultProps={__is_menu_item:!0};var eS="submenu",cv="-";function tS(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:zt(),focused:!1,destroyed:!1,domRef:{current:null}}}function nS(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var oc=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===cv?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:o,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:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}},dv=[{name:"label"}],oS=(n,e)=>{let{props:t,state:o}=n,{activeItemKey:r,keyboardActiveItemKey:i}=o,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:u}=t,c=t.id||o.generatedId;u&&(c=`${u}-${c}`);let d=[...t.columns||dv],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:c},f=[];a?f=a.map(g=>oc(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==eS)&&d.push({name:eS,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:c}};var br=H(require("react"));var rS="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",iS=he({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"]]}),aS="db3arf1",lS="db3arfd";function sS(){return br.createElement("hr",{className:lS})}var Il={renderSeparator:()=>br.createElement(sS,null),renderSubmenuColumn:({domProps:n,item:e})=>e.menu?br.createElement("div",{...n},br.createElement(po,{expanded:!1})):br.createElement("div",{...n})};var uS=(n,e)=>oc(n,e,Il);function dS(n,e){return cS.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Cl)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),uS(n,o)}return uS(n,t)})||[]}function fS(){return{...tS(),domRef:pS.createRef()}}var mS=()=>nS(),gS=n=>oS(n,{...Il,childrenToRuntimeItems:dS});var $t=H(require("react")),Mt=require("react");var Rl=require("react"),rc=(0,Rl.createContext)(null);function ic(){return(0,Rl.useContext)(rc)}function hS(n,e){let t=yS(n,e);if(!t.length)return null;let o=_e.from(t[0]?.getBoundingClientRect()),r=_e.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function yS(n,e){let t=Ln(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function SS(n,e){let t=yS(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function bS(n){let e=n();e.onHideIntent?.(e)}function TS(n,e,t){let{getState:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,hideAll:a}=t;i(e.key),r(e.key),e.originalMenuItem.onClick&&e.originalMenuItem.onClick(n);let l={key:e.key,item:e.originalMenuItem,hideMenu:a};e.originalMenuItem.onAction&&e.originalMenuItem.onAction(l);let{onAction:s}=o();s&&s(l),e.originalMenuItem.hideMenuOnAction&&a()}function CS(n,e){let{getState:t,setActiveItemKey:o,setKeyboardActiveItemKey:r,destroy:i,getSubmenuApi:a,isMounted:l,onItemClick:s}=e,{runtimeItems:u,runtimeSelectableItems:c,keyboardActiveItemKey:d}=t(),p=u.findIndex(S=>S.type==="item"&&S.key===d),f=d,m=u[p],g={ArrowUp:()=>{let S=u.slice(0,p).filter(y=>y.type==="item"&&!y.disabled).pop();S&&S.type==="item"&&S.key&&(f=S.key)},ArrowDown:()=>{let S=u.slice(p+1).filter(y=>y.type==="item"&&!y.disabled)[0];S&&S.type==="item"&&S.key&&(f=S.key)},Home:()=>{g.PageUp()},End:()=>{g.PageDown()},PageUp:()=>{f=c[0].key},PageDown:()=>{f=c[c.length-1].key},ArrowLeft:()=>{o(null),t().parentMenuId&&i()},ArrowRight:()=>{m&&(o(m.key),He(()=>{let S=a();l()&&S&&S.getParentMenuId()===t().menuId&&S.focus()}))},Enter:()=>{if(m)if(m.originalMenuItem?.menu){if(a()){g.ArrowLeft();return}o(m.key)}else s(n,m)}," ":()=>{if(!m)return;m.originalMenuItem.menu||s(n,m);let S=SS(t().menuId,m.key);S&&S.click()},Escape:()=>{g.ArrowLeft();let S=t();S.parentMenuId||S.onHideIntent?.(S)}},h=g[n.key];h&&(h(),n.preventDefault()),f!=d&&r(f)}function IS(n){let{getState:e,setFocused:t,setKeyboardActiveItemKey:o,shouldSelectFirstItemOnFocus:r,hideAll:i}=n,a=()=>{t(!0),setTimeout(()=>{let s=e().domRef.current;r()&&s&&s===document.activeElement&&e().keyboardActiveItemKey==null&&o(e().runtimeSelectableItems[0]?.key??null)})};return{api:{hideMenu:i,focus:()=>{let s=e().domRef.current;s&&(s.focus(),setTimeout(()=>{let u=e().domRef.current;u&&u!==document.activeElement&&u.focus()},10),a())},getMenuId:()=>e().menuId,getParentMenuId:()=>e().parentMenuId},onMenuFocus:a}}var mi=class extends Xo{constructor(e){super(e.slice(0,3))}};var pv=250;function fv(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}He(i)};He(()=>{i()})})}var mv=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||pv;this.getPointerMoveTarget=()=>document.documentElement||mv;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,c=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(c-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=c,(s?new mi([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new mi([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,fv(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new je({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};function RS(n,e){let t=n.filter(o=>o.type==="item"&&e===o.key)[0];return t&&t.menu?t:null}function wS(n,e,t){let o=hS(n,e.key);return o?{id:`${n}-submenu`,alignTo:o,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:t}:null}function vS(n,e){let{parentMenuId:t,constrainTo:o,api:r,hideAll:i,setSubmenuApi:a,setActiveItemKey:l,setKeyboardActiveItemKey:s}=e,u=n.menu;if(!u)return null;typeof u=="function"&&(u=u());let c=u;return{parentMenuItemKey:n.key,parentMenuId:t,constrainTo:o,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),a(p)},onHideIntent:d=>{c?.onHideIntent?.(d),i()},onHide:d=>{d.focused&&(l(null),s(n.key),r.focus())}}}function PS(n,e){return new wl({parentMenuId:n().parentMenuId,onItemActivate:e,itemHasSubMenu:t=>!!n().runtimeItems.filter(r=>r.type==="item"&&r.key===t&&r.menu)[0],getMenuRectFor:t=>{let o=`[data-submenu-for="${t}"]`,r=document.querySelector(o);if(r)return _e.from(r.getBoundingClientRect())}}).getHandlers()}function DS(n,e,t=o=>o){let{columns:o,runtimeItems:r,wrapLabels:i}=n,a=o.map(s=>t(s.width||(typeof s.flex=="number"?`${s.flex}fr`:s.flex)||"auto")).join(" "),l={...e,gridTemplateColumns:a,gridTemplateRows:r.map(()=>"auto").join(" ")};return i||(l.whiteSpace="nowrap"),l}function xS(n,e,t,o){let{active:r,keyboardActive:i,pressed:a}=o,l=n.value.key,s=$(iS({active:r,disabled:!!n.disabled,keyboardActive:i,pressed:a||r}),n.className),u=[],c=0;return e.forEach((d,p)=>{let f=n.value,m=d.field||d.name,g=p+1,h=g+n.span;g<c||(c=h,u.push({key:`${l}-${m}`,column:d,value:f[m],style:{...d.style,...n.style,gridColumnStart:g,gridColumnEnd:h},className:s,dataAttributes:{"data-menu-column-id":`${n.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${t}`,"data-menu-row-index":`${t}`,"data-menu-item-key":`${n.key}`}}))}),u}var Tr=require("react");function MS(){let n=(0,Tr.useRef)(!0);return(0,Tr.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,Tr.useCallback)(()=>n.current,[])}function gv(n,e){let t=`${e.parentMenuId}-submenu`,o=vS(n,e);return o?$t.createElement(sn,{key:t,...o}):null}function hv({onItemActivate:n}){let{getState:e}=ic(),[{onItemEnter:t,onItemLeave:o}]=(0,Mt.useState)(()=>PS(e,r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)}));return{onItemEnter:(0,Mt.useCallback)(t,[]),onItemLeave:(0,Mt.useCallback)(o,[])}}function ES(n){let{domProps:e}=n,{componentState:t,componentState:{columns:o,runtimeItems:r,menuId:i,activeItemKey:a,keyboardActiveItemKey:l,constrainTo:s,destroyed:u,onShow:c,onHide:d,autoFocus:p,parentMenuItemKey:f,domRef:m},componentActions:g,getState:h}=ic(),S=(0,Mt.useCallback)(_=>{g.keyboardActiveItemKey=_},[]),y=(0,Mt.useCallback)(_=>{g.activeItemKey=_},[]),C=MS(),[T,I]=(0,Mt.useState)(null),b=(0,Mt.useRef)(!0),[{api:R,onMenuFocus:w,hideAll:v}]=(0,Mt.useState)(()=>{let _=()=>bS(h);return{hideAll:_,...IS({getState:h,setFocused:k=>{g.focused=k},setKeyboardActiveItemKey:S,shouldSelectFirstItemOnFocus:()=>b.current,hideAll:_})}}),P=null;(0,Mt.useLayoutEffect)(()=>{let{runtimeItems:_}=h(),k=RS(_,a);if(!k){I(null),E();return}let K=wS(i,k,s);K&&M(()=>gv(k,{constrainTo:s,setSubmenuApi:I,setActiveItemKey:y,setKeyboardActiveItemKey:S,parentMenuId:i,hideAll:v,api:R}),K)},[a]);let x=(_,k)=>{TS(_,k,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,hideAll:v})},{showOverlay:M,portal:D,clearAll:E}=ln({portalContainer:!1}),{onItemEnter:z,onItemLeave:V}=hv({onItemActivate:_=>{if(!C())return;let k=_?_.key:null;y(k)}});P=r.map((_,k)=>$t.createElement(yv,{key:_.type==="item"?_.key:k,onItemEnter:(K,Q)=>{z(K.key,Q)},onItemLeave:(K,Q)=>{V(K.key,Q)},columns:o,active:_.type==="item"&&_.key===a,keyboardActive:_.type==="item"&&_.key===l,item:_,index:k,onClick:x}));let N=DS(t,e.style);function L(_){CS(_,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,destroy:()=>{g.destroyed=!0},getSubmenuApi:()=>T,isMounted:C,onItemClick:x})}function F(){g.focused=!1}let B=(0,Mt.useCallback)(_=>{_?(m.current=_,c?.(h(),R),p&&R.focus()):(d?.(h()),m.current=_)},[]),X=$t.createElement("div",{className:Vo.contents},$t.createElement("div",{...e,"data-menu-id":i,"data-submenu-for":f,tabIndex:0,ref:B,onKeyDown:_=>{e.onKeyDown?.(_),L(_)},onMouseDown:_=>{b.current=!1,e.onMouseDown?.(_)},onMouseUp:_=>{b.current=!0,e.onMouseUp?.(_)},onFocus:w,onBlur:F,className:$(rS,e.className,"InfiniteMenu"),style:N},P),D);return u?null:X}function yv(n){let[e,t]=$t.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=null;return r.type==="decoration"?s=$t.createElement("div",{style:r.style},r.value):s=xS(r,o,i,{active:a,keyboardActive:l,pressed:e}).map(u=>{let c=u.column,d={style:u.style,...u.dataAttributes,className:u.className,onPointerEnter:p=>{r.disabled||n.onItemEnter?.(r,p)},onPointerLeave:p=>{r.disabled||n.onItemLeave?.(r,p)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:p=>{r.disabled||n.onClick(p,r)}};return c.render?$t.createElement($r,{key:u.key,render:c.render,renderParam:{item:r.value,column:c,value:u.value,domProps:d}}):$t.createElement("div",{key:u.key,...d},u.value)}),$t.createElement("div",{className:aS},s)}var{ManagedComponentContextProvider:Sv}=Lt({initSetupState:fS,forwardProps:mS,mapPropsToState:gS,layoutEffect:!0});function bv(n){let{componentActions:e,componentState:t}=kt(),o=Le(t);return Cr.createElement(rc.Provider,{value:{componentActions:e,componentState:t,getState:o}},Cr.createElement(ES,{domProps:n.domProps}))}function sn(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:S,...y}=n;return Cr.createElement(Sv,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...n},Cr.createElement(bv,{domProps:y}))}sn[Sl]=!0;var zS=H(require("react"));function vl(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function Pl(n){let e=o=>{o.__insideMenu=!0},t=o=>{o.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{onShow:o=>{o.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:o=>{t(o),n?.()}}}function Dl(n){return{columns:[],items:[],autoFocus:!0,...Pl(n.onHideIntent)}}function AS(n,e){let{items:t,columns:o}=vl(n);return t&&t.length?{...e,items:t||[],columns:o}:null}function _S(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=n,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=e.getColumnLabel(p);c.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let h=!!g;i.setVisibilityForColumn(p.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}},"-",{key:"group-by",label:"Group by",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=e.getColumnLabel(p);c.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}}].filter(c=>!!c)}function OS(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i}=e,{getColumnMenuItems:a}=i(),l=r().computedColumnsMap.get(n);if(!l)return null;let s={column:l,columnApi:St(l.id,e),...e},u=o(s),c=a?a(u,s):u;return!c||!c.length?null:{autoFocus:!0,items:c,...Pl(t)}}function FS(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i,getDataSourceState:a,actions:l,dataSourceApi:s,dataSourceActions:u,api:c}=e,{getFilterOperatorMenuItems:d}=i(),p=r().computedColumnsMap.get(n);if(!p)return null;let{filterTypes:f}=a(),m=f[p.computedFilterType];if(!m)return null;let g=m.operators.map(T=>{let I=T.name,b=p.computedFilterValue?p.computedFilterValue.filter.operator===I:I===m.defaultOperator;return{key:I,icon:o.renderOperatorIcon(T),label:o.renderOperatorLabel(T.label??T.name),onAction:()=>{c.setColumnFilterOperator(n,I)},checked:b?o.renderDoneIcon():null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:o.renderClearIcon(),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(n)}},"-"],...g],y={column:p,api:c,getState:i,getDataSourceState:a,getComputed:r,actions:l,dataSourceApi:s,dataSourceActions:u,columnFilterValue:p.computedFilterValue,filterTypes:f},C=d?d(S,y):S;return{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,...Pl(t)}}function NS(n,e,t){let o=n instanceof Promise||Array.isArray(n)?!0:!!(n&&Array.isArray(n.items));if(n instanceof Promise)return{menu:t.renderLazyMenu(n,e),preventDefault:o};let{items:r,columns:i}=vl(n);return!r||!r.length?{menu:null,preventDefault:Array.isArray(r)}:{preventDefault:o,menu:t.renderMenu({...e,columns:i,items:r})}}function LS(n,e,t,o){let{columnId:r,rowIndex:i,event:a}=n,{getComputed:l,getState:s}=e,{getCellContextMenuItems:u}=s(),{computedColumnsMap:c}=l(),d=c.get(r),p={...tn({...e,rowIndex:i,columnId:d.id}),event:a};if(!d||!u)return{cellContext:p,menu:null,preventDefault:!1};let f=Dl({onHideIntent:t}),m=u(p,e);return{cellContext:p,...NS(m,f,o)}}function kS(n,e,t,o){let{getState:r,getComputed:i}=e,{getContextMenuItems:a}=r(),{computedColumnsMap:l}=i(),s=n.columnId?l.get(n.columnId):void 0,u=s?{...n,...tn({...e,rowIndex:n.rowIndex,columnId:s.id})}:n;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let c=Dl({onHideIntent:t}),d=a(u,e);return{cellContext:u,...NS(d,c,o)}}function VS(n,e){let t=e.getState().components?.CheckBox||zn;return _S(e,{renderCheckBox:({key:o,...r})=>zS.createElement(t,{key:o,...r}),getColumnLabel:o=>Wo(o,e,"column-menu")})}function HS(n,e,t){let o=e.getState().components?.Menu??sn,r=OS(n,e,t,i=>VS([],i));return r?GS.createElement(o,{...r}):null}function KS(n){return typeof n=="function"?n():n}function gi(n){return KS(n.menuConstrainTo)??n.domRef.current}function BS(n,e,t){return e?()=>KS(e)??(t||n().portalDOMRef.current):t||!1}var WS=5,jS=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]],xl=10;function US(n){function e(t){t.__insideMenu!==!0&&n()}return document.documentElement.addEventListener("mousedown",e),()=>{document.documentElement.removeEventListener("mousedown",e)}}function hi(n,e,t){if(n)return US(()=>{e(),t()});e()}function $S(n){let{getState:e,actions:t}=n;return o=>{o&&(e().columnMenuTargetRef.current=o.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=o.column.id)}}function Tv(n){let{columnId:e,context:t,clearAll:o,show:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){o(),a.columnMenuVisibleForColumnId=null}let c=n.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[data-column-id="${e}"] ${Wf}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(u,{constrainTo:gi(i()),id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function YS(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e,{columnMenuVisibleForColumnId:i,columnMenuTargetRef:a}=t();if(i){let l=US(()=>{r(),o.columnMenuVisibleForColumnId=null});return Tv({columnId:i,context:n,clearAll:r,show:(s,u)=>e.show(i,s,u)}),l}a.current=null,r()}function qS(n){let e={top:n.clientY,left:n.clientX},t=_e.fromPoint(e);return t.width+=WS,t.height+=WS,{point:e,rect:t}}function XS(n,e){let{actions:t,getState:o,getDataSourceState:r}=n,{clearAll:i}=e;return a=>{if(!a)return;let{event:l}=a;function s(){i(),t.cellContextMenuVisibleFor=null}let u=e.getContent(a,s),{cellContext:c,preventDefault:d}=u,{rect:p}=qS(l);e.show(u,{constrainTo:gi(o()),id:"cell-context-menu",alignTo:p,alignPosition:jS}),d&&l.preventDefault(),t.cellContextMenuVisibleFor={columnId:a.columnId,rowId:a.rowId,rowIndex:a.rowIndex,colIndex:a.colIndex};let{onCellContextMenu:f}=o();f&&f({...c,getState:o,getDataSourceState:r},l)}}function ZS(n,e){let{actions:t,getState:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{event:a}=i;function l(){r(),t.contextMenuVisibleFor=null}let s=e.getContent(i,l),{cellContext:u,preventDefault:c}=s,{point:d,rect:p}=qS(a);e.show(s,{constrainTo:gi(o()),id:"table-context-menu",alignTo:p,alignPosition:jS}),c&&a.preventDefault(),t.contextMenuVisibleFor={point:d,...i};let{onContextMenu:f}=o();f&&f({...n,...u},a)}}function QS(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{target:a,column:l}=i;function s(){r(),o.filterOperatorMenuVisibleForColumnId=null}let u=a?.parentElement||a,c=_e.from(u.getBoundingClientRect());c.top-=xl,c.left-=xl,c.width+=2*xl,c.height+=2*xl,e.show(l.id,s,{constrainTo:gi(t()),id:"filter-operator-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=l.id}}var JS=require("react");function Do(){let{getState:n,menuPortalContainer:e}=te(r=>({getState:r.getState,menuPortalContainer:r.state.menuPortalContainer})),{portalDOMRef:t}=Mi(r=>({portalDOMRef:r.getMasterState().portalDOMRef}))||{},o=t?.current;return(0,JS.useMemo)(()=>BS(n,e,o),[n,e,o])}function eb(){let n=Ke(),{columnMenuVisibleForColumnId:e,columnMenuVisibleKey:t}=te(a=>({columnMenuVisibleForColumnId:a.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:a.state.columnMenuVisibleKey})),{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Do()});return(0,ac.useEffect)(()=>n.getState().onColumnMenuClick.onChange($S(n)),[]),(0,ac.useEffect)(()=>YS(n,{clearAll:i,show:(a,l,s)=>o(()=>HS(a,n,l),s)}),[e,t]),{menuPortal:r}}var tb=H(require("react")),nb=require("react");var Cv={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function ob(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=Ke(),{getDataSourceState:a,getDataSourceMasterContext:l}=on(),{focusDetectDOMRef:s}=n(),u=(0,nb.useCallback)(async()=>{zy({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return tb.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:Cv})}var Ir=require("react");function Iv(){let n=Ke(),{getState:e,editingCell:t}=te(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;(0,Ir.useEffect)(()=>{if(o){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=ai(n,i);if(!a){li("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[o])}function Rv(){let n=Ke(),{getState:e,editingCell:t}=te(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,Ir.useEffect)(()=>{if(o){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=ai(n,i);if(!a){li("onEditRejected",i);return}r({...a,value:i.value,error:o,initialValue:i.initialValue})}},[o])}function wv(){let n=Ke(),{editingCell:e}=te(r=>({editingCell:r.state.editingCell})),t=e?.active,o=On(t);(0,Ir.useEffect)(()=>{!t&&o&&n.api.focus()},[t,o])}function vv(){let n=Ke(),{editingCell:e,getState:t}=te(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,Ir.useEffect)(()=>{if(o){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=ai(n,i);s?r({...s,value:a,initialValue:l}):li("onEditAccepted",i)}n.api.persistEdit({value:a})}},[o])}function Pv(){let n=Ke(),{editingCell:e,getState:t}=te(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;(0,Ir.useEffect)(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=o instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=ai(n,r);if(!s){li(l,r);return}let u={...s,value:r.value,initialValue:r.initialValue};o instanceof Error?i?.({...u,error:o}):a?.(u)}},[o])}function rb(){Iv(),Rv(),vv(),Pv(),wv()}var uc=require("react");var Jn=H(require("react"));var lc=H(require("react"));var Ml=n=>lc.createElement(Ve,{...n,icon:"clear"},lc.createElement("path",{d:Ge.clear[0]}));var sc=H(require("react"));var ib=n=>sc.createElement(Ve,{...n,icon:"done"},sc.createElement("path",{d:Ge.done[0]}));function ab(n,e,t){let o=e.getState().components?.Menu??sn,r=FS(n,e,t,{renderOperatorIcon:i=>{let a=i.components?.Icon??Ko;return Jn.createElement(a,null)},renderOperatorLabel:i=>Jn.createElement(Jn.Fragment,null,i),renderClearIcon:()=>Jn.createElement(Ml,null),renderDoneIcon:()=>Jn.createElement(ib,{size:16})});return r?Jn.createElement(o,{...r}):null}function lb(){let n=Ke(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Do()});return(0,uc.useEffect)(()=>e().onFilterOperatorMenuClick.onChange(QS(n,{clearAll:i,show:(a,l,s)=>o(()=>ab(a,n,l),s)})),[]),(0,uc.useEffect)(()=>hi(e().filterOperatorMenuVisibleForColumnId,i,()=>{t.filterOperatorMenuVisibleForColumnId=null}),[e().filterOperatorMenuVisibleForColumnId]),{menuPortal:r}}var yi=require("react");var ub=H(require("react"));var cc=H(require("react"));function sb(n,e,t){if(!n)return null;let o=Se();return n.then(r=>{let i=AS(r,e);i&&o(cc.createElement(t,{...i}))}),cc.createElement(jn,{updater:o})}function cb(n){let e=n.getState().components?.Menu??sn;return{renderMenu:t=>ub.createElement(e,{...t}),renderLazyMenu:(t,o)=>sb(t,o,e)}}function db(n,e,t){return LS(n,e,t,cb(e))}function pb(n,e,t){return kS(n,e,t,cb(e))}function fb(){let n=Ke(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Do()});return(0,yi.useEffect)(()=>e().cellContextMenu.onChange(XS(n,{clearAll:i,getContent:(a,l)=>db(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),(0,yi.useEffect)(()=>hi(e().cellContextMenuVisibleFor,i,()=>{t.cellContextMenuVisibleFor=null}),[e().cellContextMenuVisibleFor]),{menuPortal:r}}function mb(){let n=Ke(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Do()});return(0,yi.useEffect)(()=>e().contextMenu.onChange(ZS(n,{clearAll:i,getContent:(a,l)=>pb(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),(0,yi.useEffect)(()=>hi(e().contextMenuVisibleFor,i,()=>{t.contextMenuVisibleFor=null}),[e().contextMenuVisibleFor]),{menuPortal:r}}var gb=require("react"),hb=H(require("react"));var El=require("react");function Al(n,e){let{brain:t}=te(r=>({brain:r.state.brain})),o=(0,El.useCallback)(n,e);(0,El.useEffect)(()=>t.onScroll(o),[t,o])}var dc="yzx0vj0";function yb(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=(0,gb.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=fe.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=fe.runtime.bodyWidth),o==="column"?l.minWidth=fe.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=fe.runtime.bodyWidth),t==="column"?l.maxWidth=fe.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=fe.runtime.bodyWidth),hb.createElement("div",{ref:a,...i,className:i.className?$(i.className,dc):dc,style:l},i.children)}var Dv=Y(q.columnWidthAtIndex),xv=Y(q.columnOffsetAtIndex);function Sb(){let{computedVisibleColumns:n}=te(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${Dv}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${xv}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var _l="InfiniteTable";var bb=require("react");function Tb(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=te(c=>({getState:c.getState,actions:c.actions,dataSourceActions:c.dataSourceActions,getDataSourceState:c.getDataSourceState})),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),(0,bb.useEffect)(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=o(),g=!1,h=l.rowsPerPage,S=(r&&r.length>0||i)&&h>0?h:null;return f!=S&&(t.rowsPerPage=S,g=!0),m!=u&&(t.repeatWrappedGroupRows=u??!1,g=!0),g};c();let d,p=l.onVerticalRenderRangeChange(()=>{c()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,u])}var xo=require("react");function Mv(){let n=[],e=t=>{Object.keys(t).forEach(o=>{let r=t[o];if(typeof r=="string"){let i=Y(r);if(i.includes("dont-override"))return;n.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...fe,loaded:void 0,runtime:void 0}),n}function Cb(n){if(!n)return{};let e=Mv(),t=getComputedStyle(n),o={};return e.forEach(r=>{o[r]=t.getPropertyValue(r).trim()}),o}var Si=he({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Ib="_143ofgf5",Rb="_143ofgf3";var Ev=Y(fe.loaded),pc={source:"infinite-table-page",target:"infinite-table-devtools-background"};function wb(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...pc,url:fc(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...pc,url:fc(),type:t,payload:{debugId:o,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(u=>u.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(u=>[u.id,{field:u.field,dataType:u.computedDataType,sortType:u.computedSortType,filtered:u.computedFiltered,sorted:u.computedSorted,width:u.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(u=>u.field?`${u.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(u=>typeof u.field=="string").map(u=>({field:`${u.field}`,dir:u.dir,type:Array.isArray(u.type)?u.type[0]:u.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:Cb(l.domRef.current),themeVarOverrides:{...rn.get(o)||{}}}}}var fc=ht(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function Av(n){window.postMessage(n)}var _v=ht(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){Tt.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(wb({type:"update",debugId:e},t))}else _h(e),window.postMessage(wb({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Ye.onLogIntent("IT:*",e=>{Av({...pc,url:fc(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let o="";try{o=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return o}return String(t)}),timestamp:e.timestamp}})}),n}),mc=Se(),Ov={revertAll:n=>{let e=Tt.get(n.debugId);if(e){let t=Xn.get(n.debugId);Xn.delete(n.debugId),Cn.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=Rn.get(n.debugId);Rn.delete(n.debugId),In.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=Tt.get(n.debugId);if(e){let t=n.property,o=Cn.get(n.debugId),r=Xn.get(n.debugId),i=In.get(n.debugId),a=Rn.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=Rn.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:n=>{let e=Tt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),Zn(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Zn(n.debugId))}}},discardAllWarnings:n=>{let e=Tt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Zn(n.debugId))},setColumnVisibility:n=>{Gu(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{sl(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{Gu(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{sl(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{sl(n.debugId,"multiSort",n.multiSort)},setCssVar:n=>{let e=Tt.get(n.debugId),t=e?.getState().domRef.current;!e||!t||!n.name?.startsWith("--infinite-")||(t.style.setProperty(n.name,n.value),rn.set(n.debugId,{...rn.get(n.debugId)||{},[n.name]:n.value}),Zn(n.debugId))},revertCssVar:n=>{let e=Tt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(n.name);let o={...rn.get(n.debugId)||{}};delete o[n.name],rn.set(n.debugId,o),Zn(n.debugId)},revertAllCssVars:n=>{let e=Tt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let o=rn.get(n.debugId)||{};Object.keys(o).forEach(r=>{t.style.removeProperty(r)}),rn.delete(n.debugId),Zn(n.debugId)},highlight:n=>{let e=Tt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${Si.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Si.classNames.base),r.innerHTML=[`<div class="${Rb}"></div>`,`<div class="${Ib}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Si.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Si.classNames.variants.active.true)}}}}};function Fv(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&typeof n.data.target=="string"&&n.data.target==="infinite-table-page"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(_v(),mc(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=Ov[e];t&&t(n.data.payload)}})}Fv();function vb(n,e){if(!e)return;getComputedStyle(e).getPropertyValue(Ev)!==`${$i}`&&si({debugId:n,key:"CSS001_CSS"})}function gc(){return mc.get()}function Pb(n){return mc.onChange(e=>{e&&n(e)})}function Db(n){let e=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;e&&e(n,null)}function xb(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=te(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),o=n(),{domRef:r,debugId:i}=o;return i&&vb(i,r.current),(0,xo.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),Nv()}function Nv(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=te(c=>({getState:c.getState,getComputed:c.getComputed,getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions,actions:c.actions,dataSourceApi:c.dataSourceApi,api:c.api})),s=n().debugId,u=(0,xo.useRef)(s);return u.current=s,(0,xo.useEffect)(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},p=gc();if(p){d(p);return}return Pb(d)},[]),(0,xo.useEffect)(()=>{let c=u.current;if(!c)return;let d=gc();d&&d(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),(0,xo.useEffect)(()=>{if(s)return()=>{Db(s)}},[s]),s}function Mb(){let{masterPortalDOMRef:n}=Mi(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=te(o=>o.state.portalDOMRef);return n?.current??e?.current}var Ot=H(require("react")),Ol=require("react");var Eb="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Ab=he({defaultClassName:"hs68h8e _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),_b="hs68h81",Ob=he({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 Mo=H(require("react"));function Fb(n){return Mo.createElement("div",{...n.domProps})}function Nb(n){let{active:e}=n;return Mo.createElement("div",{className:_b},e?"Drop to group":"Drag columns to group")}function Lb(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return Mo.createElement("div",{...n.domProps},n.label,Mo.createElement("div",{className:Fi[1]}),Mo.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:Eb,onKeyDown:e,onMouseDown:n.onClear},Mo.createElement(Ml,{size:20})))}var Lv=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};Fe().addEventListener("mousemove",i,{once:!0}),Fe().addEventListener("mouseup",()=>{r||(Fe().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function kv(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s,dragListId:u}=ho(),c=l===u,d=Ke(),p=(e?Wo(e.id,d,"grouping-toolbar"):r)??i,f=e?Ot.createElement(Sa,{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===u,h=$(Ab({draggingInProgress:c,active:g}),n.domProps?.className),S=Lv(a,n.domProps?.onMouseDown),y={...n.domProps,className:h,onMouseDown:S},C=o?.ToolbarItem??Lb;return Ot.createElement(C,{active:g,domProps:y,column:e,field:r,label:m,onClear:t})}function kb(n){let{groupBy:e}=Ne(b=>({groupBy:b.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=te(b=>({getComputed:b.getComputed,dataSourceApi:b.dataSourceApi,api:b.api})),{dropTargetListId:i,dragSourceListId:a}=fn(),{fieldsToColumn:l,computedColumnsMap:s}=t(),u=so(ta),c=so(ea),d=(0,Ol.useMemo)(()=>[c,u],[c,u]),p=i===u,f=a===u,m=n.components?.Placeholder??Nb,g=n.components?.Host??Fb,h=e.length?Ot.createElement(Ot.Fragment,null,e.map((b,R)=>{let w=b.field?l.get(b.field):void 0,v=`${b.field??`idx-${R}`}`;return Ot.createElement(Wn.DraggableItem,{key:v,id:v},P=>Ot.createElement(kv,{id:v,components:n.components,domProps:P,field:b.field,column:w,toggleSorting:()=>{w&&r.toggleSortingForColumn(w.id)},onClear:()=>{let x=e.filter(M=>M!==b).filter(Boolean);o.setGroupBy(x)}}))})):Ot.createElement(m,{draggingInProgress:f,active:p,groupBy:e}),S=b=>{let R=b.map(w=>e[w]);o.setGroupBy(R)},y=b=>{let{dragItemId:R}=b,w=R,v=s.get(w);if(!v||!v.field||!v.computedGroupable)return;let P=[...e];P.splice(b.dropIndex,0,{field:v.field}),o.setGroupBy(P)},C=(0,Ol.useCallback)(b=>{let{computedColumnsMap:R}=t(),w=b.dragItem.id,v=R.get(w);return!(!v||!v.computedGroupable||e.some(P=>P.field===v.field))},[e]),T=n.orientation??"horizontal",{domProps:I}=n;return Ot.createElement(Wn,{orientation:T,dragListId:u,acceptDropsFrom:d,onDrop:S,dragStrategy:"inline",onAcceptDrop:y,shouldAcceptDrop:C},(b,{draggingInProgress:R,status:w})=>{let v=$(Ob({active:p,orientation:T,draggingInProgress:R,dropRejected:w==="rejected"}),b.className,I?.className),P={...b,...I,className:v,children:h};return Ot.createElement(g,{active:p,rejectDrop:w==="rejected",domProps:P,orientation:T})})}var wr=H(require("react"));var Fl=require("react"),un=require("react"),Nl=H(require("react"));function zb(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return Ha(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}var vn=H(require("react"));var Vb=he({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var hc=require("react");function zv(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function Vv(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=bh(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function Gb(n,e){let t={current:!1};return{currentRowCache:{getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)},cacheCalledByRowDetailRenderer:t}}function Hb(n){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:o,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=n,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),u={registerDetail:ht(c=>{if(o.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)});return}zv(e.id,{masterState:r(),detailContext:c}),requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)}),c.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&Vv(e.id,{detailState:c.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return u.masterRowInfo=e,u.getMasterDataSourceState=r,u.getMasterState=a,u}function Kb(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=Ne(u=>({getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions})),{getMasterState:i}=te(u=>({getMasterState:u.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,hc.useMemo)(()=>Gb(t.id,e),[e,t.id]),s=(0,hc.useMemo)(()=>Hb({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:o,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Bb(){return Mn()}var{rootClassName:Gv}=ze,Hv=`${Gv}RowDetail`;function Kv(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=Kb({rowDetailsCache:a,rowInfo:r}),u=Lo(),[c]=vn.useState(()=>Bb());return c.setSnapshot(l),vn.useLayoutEffect(()=>{c.notify()},[l]),vn.createElement(u.Provider,{value:c},vn.createElement("div",{ref:e,className:$(Hv,Vb({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${q.bodyWidth} - ${q.scrollbarWidthVertical})`,height:o}},t(r,s)))}var Wb=vn.memo(Kv);var Bv=1;function jb(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:u,onRowMouseEnter:c,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:h,isRowDetailsEnabled:S,cellClassName:y,cellStyle:C,repaintCellsKey:T,rowStyle:I,rowDetailCache:b,rowClassName:R,onScrollToTop:w,onScrollToBottom:v,onScrollStop:P,scrollToBottomOffset:x,wrapRowsHorizontally:M,updatedAt:D,ready:E,editingCell:z}=te(O=>({actions:O.actions,getState:O.getState,getComputed:O.getComputed,getDataSourceMasterContext:O.getDataSourceMasterContext,rowHeight:O.state.rowHeight,rowDetailHeight:O.state.rowDetailHeight,onRowMouseEnter:O.state.onRowMouseEnter,onRowMouseLeave:O.state.onRowMouseLeave,groupRenderStrategy:O.state.groupRenderStrategy,brain:O.state.brain,showZebraRows:O.state.showZebraRows,rowDetailRenderer:O.state.rowDetailRenderer,isRowDetailsExpanded:O.state.isRowDetailExpanded,isRowDetailsEnabled:O.state.isRowDetailEnabled,cellClassName:O.state.cellClassName,cellStyle:O.state.cellStyle,repaintCellsKey:O.state.repaintCellsKey,rowStyle:O.state.rowStyle,rowDetailCache:O.state.rowDetailCache,rowClassName:O.state.rowClassName,onScrollToTop:O.state.onScrollToTop,onScrollToBottom:O.state.onScrollToBottom,onScrollStop:O.state.onScrollStop,scrollToBottomOffset:O.state.scrollToBottomOffset,wrapRowsHorizontally:O.state.wrapRowsHorizontally,updatedAt:O.state.updatedAt,ready:O.state.ready,editingCell:O.state.editingCell})),{computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:L,computedColumnsMap:F,computedColumnOrder:B,computedRowHeight:X,computedRowSizeCacheForDetails:_,fieldsToColumn:k,rowspan:K,toggleGroupRow:Q,columnSize:Ie}=e,se=(0,Fl.useMemo)(()=>L.map(O=>O.id),[L]),{dataArray:me,rowInfoStore:ve,selectionMode:Pe,cellSelection:ce,isNodeReadOnly:oe,getDataSourceState:ue,dataSourceApi:pe,dataSourceActions:Z}=Ne(O=>({dataSourceApi:O.dataSourceApi,dataSourceActions:O.dataSourceActions,getDataSourceState:O.getDataSourceState,dataArray:O.dataSourceState.dataArray,rowInfoStore:O.dataSourceState.rowInfoStore,selectionMode:O.dataSourceState.selectionMode,cellSelection:O.dataSourceState.cellSelection,isNodeReadOnly:O.dataSourceState.isNodeReadOnly})),J=Le(me);zb({columnSize:Ie,brain:f,computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:L,computedRowHeight:X,dataArray:me,bodySize:t,rowspan:K});let W=(0,un.useRef)(0);(0,un.useEffect)(()=>f.onRenderCountChange(()=>{W.current=f.scrollTopMax}),[f]),(0,un.useEffect)(()=>f.onRenderRangeChange(O=>{i().onRenderRangeChange?.(O)}),[f]),(0,un.useEffect)(()=>f.onScrollStop(O=>{let{scrollTop:A,scrollLeft:de}=O;if(A===0&&w?.(),A+(x??Bv)>=W.current){v?.();let{livePagination:be,livePaginationCursor:Me,dataArray:qe}=ue();be&&(Z.cursorId=Me!==void 0?Date.now():qe.length)}if(P){let be=f.getRenderRange();P({scrollTop:A,scrollLeft:de,renderRange:be,viewportSize:i().bodySize,firstVisibleRowIndex:be.start[0],lastVisibleRowIndex:be.end[0],firstVisibleColIndex:be.start[1],lastVisibleColIndex:be.end[1]})}}),[f,w,v,P]),(0,un.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,un.useEffect)(()=>{let{onReady:O}=i();O&&O({api:o,dataSourceApi:pe})},[E]);let ie=(0,Fl.useMemo)(()=>({isNodeReadOnly:oe,selectionMode:Pe,cellSelection:ce}),[oe,Pe,ce]),ne=(0,un.useCallback)(O=>{let{rowIndex:A,colIndex:de,heightWithRowspan:ye,domRef:we,hidden:be,width:Me,onMouseLeave:qe,onMouseEnter:We}=O,it=J()[A],et=L[de];if(!it||!et)return null;let Xe=_?_.getRowHeight(A):ye,G=!1;!S||typeof S=="function"&&!S(it)?G=!1:h&&(G=h(it)?"expanded":"collapsed");let ee=M?f.getRowIndexInPage(A):null,ge=M?f.getPageIndexForRow(A):null,Te=o.isEditorVisibleForCell({rowIndex:A,columnId:et.id}),ct={getData:J,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:ee,horizontalLayoutPageIndex:ge,rowIndex:A,rowInfoStore:ve,hidden:be,toggleGroupRow:Q,rowHeight:Xe,rowDetailState:G,onMouseEnter:We,onMouseLeave:qe,onRowMouseEnter:c,onRowMouseLeave:d,domRef:we,width:Me,column:et,columnsMap:F,fieldsToColumn:k,rowStyle:I,rowClassName:R,cellStyle:C,cellClassName:y,repaintCellsKey:et.repaintCellsKey!==void 0?et.repaintCellsKey:T,visibleColumnIds:se,computedColumnOrder:B,inEditMode:Te,getDataSourceState:ue,dataSourceApi:pe,dataSourceActions:Z,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:ie};return Nl.createElement(Gf,{...ct})},[s,u,c,d,_,X,h,J,L,F,k,p,M,Q,m,f,ve,I,R,y,C,T,ue,pe,Z,i,o,r,a,l,se,B,D,z,ie]),le=(0,Fl.useMemo)(()=>{if(h)return O=>{let{rowIndex:A,domRef:de}=O,we=J()[A];if(!we||!h(we)||!_)return Nl.createElement("div",{ref:de,className:dd.hidden});let{rowDetailHeight:be,rowHeight:Me}=_.getSize(A);return Nl.createElement(Wb,{rowInfo:we,rowDetailsCache:b,rowIndex:A,domRef:de,detailOffset:Me,rowDetailHeight:be,rowDetailRenderer:g})}},[E,ne,g,u,h,b]);return{renderCell:ne,renderDetailRow:le}}var Ub=require("react");function $b(){let{state:n,getState:e,actions:t}=te(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=On(o);(0,Ub.useEffect)(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=Yu(_l,!!o);t.brain=u.brain,t.headerBrain=u.headerBrain,t.renderer=u.renderer,t.onRenderUpdater=u.onRenderUpdater,t.headerRenderer=u.headerRenderer,t.headerOnRenderUpdater=u.headerOnRenderUpdater}},[r,o])}var Xb=H(require("react"));var Yb="_16lm1iw1 _16lm1iw1c _16lm1iwe";var qb=$(Yb,Ls);function Zb(n){return Xb.createElement("div",{...n,className:n.className?$(qb,n.className):qb})}var Rr=H(require("react"));var Qb={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Jb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",eT="qy58ya4";var{rootClassName:Wv}=ze,yc=`${Wv}-LoadMask`;function jv(n){let{visible:e,children:t="Loading"}=n;return Rr.createElement("div",{className:`${Qb[e?"visible":"hidden"]} ${yc}`},Rr.createElement("div",{className:`${Jb} ${yc}-Overlay`}),Rr.createElement("div",{className:`${eT} ${yc}-Text`},t))}var Ll=Rr.memo(jv);var tT=require("react");var Uv=[_f,`${nn}--hovered`];function $v(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function Eo(n){let e=Ke(),t=En(),{getComputed:o,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:h,activeCellIndex:S,rowDetailRenderer:y,showHoverRows:C,wrapRowsHorizontally:T,domProps:I,domRef:b,forceBodyRerenderTimestamp:R,rowHoverClassName:w,ready:v}=te(_=>({ready:_.state.ready,columnReorderDragColumnId:_.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:_.state.forceBodyRerenderTimestamp,renderer:_.state.renderer,onRenderUpdater:_.state.onRenderUpdater,debugId:_.state.debugId,keyboardNavigation:_.state.keyboardNavigation,activeRowIndex:_.state.activeRowIndex,loadingText:_.state.loadingText,scrollStopDelay:_.state.scrollStopDelay,brain:_.state.brain,scrollerDOMRef:_.state.scrollerDOMRef,components:_.state.components,bodySize:_.state.bodySize,activeCellIndex:_.state.activeCellIndex,rowDetailRenderer:_.state.rowDetailRenderer,showHoverRows:_.state.showHoverRows,wrapRowsHorizontally:_.state.wrapRowsHorizontally,domProps:_.state.domProps,domRef:_.state.domRef,rowHoverClassName:_.state.rowHoverClassName})),P=g?.LoadMask??Ll,x=o(),{computedRowHeight:M,computedRowSizeCacheForDetails:D}=x,E=D?.getRowHeight||M,{loading:z}=Ne(_=>({loading:_.dataSourceState.loading})),V=wr.useCallback(_=>{let k=e.getState(),K=_.target;if(!t&&_._from_row_detail)return;t&&(_._from_row_detail=!0);let Q=fp(K,$u(),k.domRef.current),Ie,se,me,ve;Q&&(se=Number(Q.dataset.colIndex),ve=Number(Q.dataset.rowIndex),Ie=e.getComputed().computedVisibleColumns[se].id,me=e.dataSourceApi.getRowInfoArray()[ve].id);let Pe={columnId:Ie,colIndex:se,rowId:me,rowIndex:ve,event:_,target:Q??_.target};Q&&k.cellContextMenu(Pe),k.contextMenu(Pe)},[]),{renderCell:N,renderDetailRow:L}=jb({imperativeApi:r,getComputed:o,domRef:b,bodySize:h,computed:x}),{autoFocus:F,tabIndex:B}=I??{};$b();let X=(0,tT.useMemo)(()=>{if(!C)return;let _=[];return w&&(_=_.concat(w)),n.rowHoverClassName&&(_=_.concat(n.rowHoverClassName)),Eo.rowHoverClassName&&(_=_.concat(Eo.rowHoverClassName)),$v(_)},[C,w,n.rowHoverClassName,Eo.rowHoverClassName]);return wr.createElement(Zb,{onContextMenu:V},wr.createElement(ng,{forceRerenderTimestamp:R,debugId:l,tabIndex:B??0,autoFocus:F??void 0,activeRowIndex:v&&s==="row"?u:null,activeCellIndex:v&&s==="cell"&&!d?S:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:f,activeCellRowHeight:E,renderCell:N,renderDetailRow:y?L:void 0,cellHoverClassNames:X,scrollerDOMRef:m,scrollVarHostRef:b}),wr.createElement(P,{visible:z},c))}Eo.rowHoverClassName=Uv;function nT(){return te(n=>n.api)}function oT(n){return te(e=>e.api.getColumnApi(n))}var Jt=ze.rootClassName,{ManagedComponentContextProvider:Yv}=Lt({initSetupState:$h,forwardProps:Yh,mapPropsToState:Qh,cleanup:qh,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Zh(),getParentState:()=>el(n=>n),debugName:n=>Un(n.debugId,_l)}),rT=xe.memo(function(){let e=Di(),{componentState:t,api:o,initialChildren:r}=te(F=>({componentState:F.state,api:F.api,initialChildren:F.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Ne(F=>({dataArrayLength:F.dataSourceState.dataArray.length,getDataSourceState:F.getDataSourceState,dataSourceActions:F.dataSourceActions,dataSourceApi:F.dataSourceApi})),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:S,scrollStopDelay:y,brain:C,activeRowIndex:T,activeCellIndex:I}=t,{licenseKey:b}=t;b===void 0&&cn.licenseKey&&(b=cn.licenseKey),My(T,i,o),xy(I,i,o);let{onKeyDown:R}=Uy();xe.useEffect(()=>{let F=a(),B=Yt(X=>{F.notifyRenderRangeChange({renderStartIndex:X[0],renderEndIndex:X[1]})},{wait:y});return C.onVerticalRenderRangeChange(B)},[C,y]);let w=Dy(b),{autoFocus:v,tabIndex:P,...x}=t.domProps??{},M=Op(x);xe.useEffect(()=>{C.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),jg(),Tb(),rb();let{menuPortal:D}=eb(),{menuPortal:E}=fb(),{menuPortal:z}=mb(),{menuPortal:V}=lb();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,o,{dataSourceApi:s})},[t.ready,o,s]);let N=xb();xe.useEffect(()=>{if(e){let F=e.getSnapshot();c.current=F.getMasterState().portalDOMRef.current}},[]);let L=r??xe.createElement(xe.Fragment,null,xe.createElement(yu,null),xe.createElement(Eo,null));return xe.createElement("div",{"data-debug-id":N,onKeyDown:R,ref:u,...M},L,xe.createElement("div",{ref:c,className:$(`${yt}Portal`,pd[1e7],Ni.absolute,ud[0],ad[0])},D,E,z,V),g?xe.createElement(Er,{key:"row-height",varName:g,onChange:d}):null,xe.createElement(Er,{key:"flashing-duration",allowInts:!0,varName:fe.components.Cell.flashingDuration,onChange:p}),h?xe.createElement(Er,{key:"row-detail-height",varName:h,onChange:f}):null,S?xe.createElement(Er,{key:"column-header-height",varName:S,onChange:m}):null,w==="valid"?null:xe.createElement(Dg,{invalid:w==="invalid"}),xe.createElement(ob,null))});function qv({children:n,store:e}){let{componentActions:t,componentState:o}=kt(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=Le(o),l=Ty({state:o,actions:t,getState:a}),s=Le(l),u=Di(),{getDataSourceState:c,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=on(),[m]=xe.useState(()=>Bg({getComputed:s,getState:a,getDataSourceState:c,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:c,getComputed:s,getState:a,api:m,dataSourceApi:f,children:n};return e.setSnapshot(g),xe.useLayoutEffect(()=>{e.notify()}),Ii(r,h=>{let S={width:h.width,height:h.height};t.bodySize=S},{earlyAttach:!0,debounce:50}),xe.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),xe.createElement(rT,null)}var cn=function(n){let[e]=xe.useState(()=>Ey()),t=Bi();return xe.createElement(Yv,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:pi,columnHeaderHeight:di,...n},xe.createElement(Ji,null,xe.createElement(t.Provider,{value:e},xe.createElement(qv,{children:n.children,store:e}))))};cn.Header=yu;cn.Body=Eo;cn.HScrollSyncContent=yb;cn.Footer=()=>xe.createElement(md,null);cn.GroupingToolbar=kb;var iT=H(require("react"));function Xv(n){let{DataSource:e}=fr({nodesKey:"children",...n});return iT.createElement(e,null,n.children??null)}var aT=H(require("react"));var Sc=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Je(i,{treePaths:o});r.forEachLeafNodePath((c,{selected:d})=>{l.setNodeSelection(c,d)}),a&&r.forEachLeafNodePath(c=>{l.setNodeSelection(c,a.selected)},a.nodePath);let u={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};n(u)};function lT(n){return aT.createElement(cn,{...n})}var kl=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Ye(`IT:${e}:DataQuery`)}};function Ao(n){if(Array.isArray(n))return n.map(Ao);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Ao(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var Pn=class Pn{constructor(e){this.queryCache=new U;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Ao(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new kl(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Ao(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Ao(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Ao(e);this.queryCache.delete(t)};if(this.options=e,Pn.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)}Pn.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Pn.clients.get(e);t&&t.destroy()}static destroyAll(){Pn.clients.forEach(e=>{Pn.destroy(e.name)})}destroy(){Pn.clients.delete(this.options.name)}};Pn.clients=new Map;var bc=Pn;var Zv={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},sT={instantEdit:Zv};var Qv=require("react");function uT(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var Vl=class Vl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Vl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Vl.DEFAULT_SIZE=10;var zl=Vl;var Hl=class Hl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Hl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};Hl.DEFAULT_SIZE=10;var Gl=Hl;var _o=require("react"),Jv=(n,e)=>n.every((t,o)=>t===e[o]),cT=(n,e)=>{let t=(0,_o.useRef)(e),o=Jv(e,t.current),r=(0,_o.useRef)(!0);t.current=e;let i=(0,_o.useRef)(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=(0,_o.useRef)(n);l.current=n,(0,_o.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var eo=require("react"),dT=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),Kl=(n,e)=>{let{same:t,different:o,compare:r}=e,i=(0,eo.useRef)(t),a=(0,eo.useRef)(o),l=dT(t,i.current,r),s=!dT(o,a.current,r),u=(0,eo.useRef)(!0);i.current=t,a.current=o;let c=(0,eo.useRef)(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=(0,eo.useRef)(n);p.current=n,l&&s&&(u.current=!1),(0,eo.useEffect)(()=>{if(!u.current)return p.current()},d)};var Ft=H(require("react"));var pT=Y(q.currentFlashingDuration),eP=({children:n})=>Ft.createElement(Ft.Fragment,null,n),fT=1e3,mT={up:na({direction:"up"}).split(" "),down:na({direction:"down"}).split(" "),neutral:na({direction:"neutral"}).split(" ")},Tc=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=eP}=n;return Ft.forwardRef((i,a)=>{let l=Ur(),{flashingDurationCSSVarValue:s}=te(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),u=typeof s=="number"?s??e??fT:e??fT,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,S=Ft.useRef(!0),y=Ft.useRef(d),C=S.current?null:y.current;S.current=!1;let T=Ft.useRef(void 0),I=Ft.useRef(void 0),b=Ft.useRef(void 0);return Kl(()=>{if(d===y.current)return;let R=()=>{let x=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),b.current&&(clearTimeout(b.current),b.current=void 0),I.current&&x){let M=I.current,D=mT[M];x.classList.remove(...t?[t,...D]:D),x.style.removeProperty(pT),I.current=void 0}};y.current=d;let w=m.current;if(!w)return;R();let v=typeof d=="number"?d>C?"up":"down":"neutral",P=mT[v];return w.style.setProperty(pT,`${u}`),w.classList.add(...t?[t,...P]:P),I.current=v,T.current=setTimeout(R,u),R},{same:[h,g],different:[d]}),Ft.createElement("div",{ref:c,...i,className:$(i.className)},o({children:i.children,oldValue:C}))})},gT=Tc();var ot=H(require("react")),vr=require("react");var hT=require("react-dom");function yT(n){let[e,t]=ot.useState(null);return(0,vr.useEffect)(()=>{let{debugTarget:o}=n,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[o]){let i=globalThis.INFINITE[o].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[n.debugTarget]),typeof e=="function"?ot.createElement(ST.Provider,{value:{getState:e}},ot.createElement(tP,null)):null}var ST=ot.createContext({getState:()=>null});function tP(){let n=ot.useContext(ST),{getState:e}=n,[,t]=qt(),o=e().renderer.cellManager;(0,vr.useEffect)(()=>{let s=Yt(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=(0,vr.useRef)(null),l=(0,vr.useRef)(null);return ot.createElement("div",{style:{overflow:"auto"}},(0,hT.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(u=>ot.createElement("td",{key:u,style:{padding:5,border:"1px solid gray",background:o.getCellAt([s,u])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":u},ot.createElement("button",{onClick:()=>{let c=o.getCellAt([s,u])?.getElement();if(!c)return;let d=c.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(c)},style:{cursor:"pointer"}},"(",s,",",u,")"))))))))}var nP={CheckBox:zn,LoadMask:Ll,MenuIcon:Yr,StringFilterEditor:$o,NumberFilterEditor:ji};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});
|
|
31
|
+
`,`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 _v=n=>{let e="",t=n.split("|").map(l=>{let s=l.indexOf("="),u=s===-1?l:l.slice(0,s),c=s===-1?"":l.slice(s+1);return u==="C"&&(e=c),{name:u,value:c}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let u=t[s];if(gc(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(gc(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),Av(t)};function tS(n="",e){if(e.isDetail)return"valid";let t=eS(n,{publishedAt:1796226104414,version:"11.1.0"});return t==="invalid"&&!n?"missing":t}var oS=(n="")=>{let t=!!On();return(0,nS.useMemo)(()=>tS(n,{isDetail:t}),[n,t])};var Cr=require("react");var Ov=10;function rS(n,e,t){let o=(0,Cr.useRef)(!1),r=(0,Cr.useRef)(null);(0,Cr.useEffect)(()=>{n!=null&&(o.current=!1,Wt(r.current))},[n]),(0,Cr.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Wt(r.current),r.current=Ke(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<Ov&&a(l)})};var i=a;a()}return()=>{Wt(r.current)}},[n,e])}var Ir=require("react"),Fv=10;function iS(n,e,t){let o=(0,Ir.useRef)(!1),r=(0,Ir.useRef)(null);(0,Ir.useEffect)(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),(0,Ir.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<Fv&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function aS(){return _n()}var Rr=require("react");function lS(n,e){n.getComputed().multiRowSelector.lastPointerDown={rowIndex:n.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var Nv={Enter:!0," ":!0,a:!0};function sS(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=n,{key:l,ctrlKey:s,metaKey:u}=e;if(!Nv[l])return!1;let c=t(),d=o(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=c,{selectionMode:h,rowSelection:S,treeSelectionState:y,isTree:C}=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 T={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return Pa({...n,rowIndex:b},T,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||u)){if(C&&y){let R=a(y);return R.selectAll(),r.treeSelection=R,!0}let T=i(S);return T.selectAll(),r.rowSelection=T,!0}return!1}var cS=H(co());async function uS(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var Lv=10,kv=(n,e)=>n-e;function Ml(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=o(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[n.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===n.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[n.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=St(p.id,e);return p.contentFocusable({column:p,...sr({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function hc(n,e,t){let o=t.getState().editingCell;return zv(n,e,t,{isCellFocusable:Ml,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function dS(n,e,t){let o=(0,cS.default)(t,n+e,kv);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=dS;function zv(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=n.rowIndex,c=n.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:dS(c,e,a),c===null){if(u+=e,u<0||u>=s.length)return null;continue}if(i({colIndex:c,rowIndex:u},t))return{colIndex:c,rowIndex:u}}return null}async function pS(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=Ml(e,n)?e:hc(e,-1,n);if(t){await yc([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;ua(o)?.focus();return}n.getState().scrollerDOMRef.current?.focus({preventScroll:!0})}async function yc([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=Lv,l=null,s=!1;function u(c=0){c++,Wt(l),l=Ke(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&c<a&&u(c),s){try{await uS(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var Vv=`.${rn}`;function fS(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r)return!1;if(i&&t===-1)return Sf(n);let a=i?null:Gn(o,Vv),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:c}=n.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&Ml({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:hc({rowIndex:l,colIndex:s},t,n);if(!u){if(t===-1)r.focus();else{let c=sa(document.body),d=n.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return yc([u.rowIndex,u.colIndex],n).then(()=>{let c=n.getState().getDOMNodeForCell(u);if(!c)return;ua(c)?.focus()}),!0}var mS={control:"ctrl"},gS={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},Gv={esc:"escape"},yS={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},SS=Object.keys(yS),Sc=new Set(SS),Hv=new Set(["shift","alt"]);function El(n,e){return Array.isArray(e)?e.some(t=>hS(n,t)):hS(n,e)}function hS(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(p=>p.toLowerCase().trim()),r=o.find(p=>gS[p]),i=o.map(p=>mS[p]||gS[p]||Gv[p]||p),a=i.filter(p=>Sc.has(p)),l=i.filter(p=>!Sc.has(p)),s=SS.reduce((p,f)=>(p[f]=yS[f](n),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!Hv.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Sc.has(t)||t==="meta"||mS[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function bS(n,e){let t={...n,cloneRowSelection:a=>lr(a,n.getDataSourceState),cloneTreeSelection:a=>ar(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(mf(n,e.target)){!r.preventNavigation&&vf(n,e)&&e.preventDefault();return}if(!r.preventSelection&&sS(t,e)&&e.preventDefault(),(fS(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&hh(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,u=n.getComputed().computedVisibleColumns[s];u.computedEditable&&n.api.startEdit({rowIndex:l,columnId:u.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!El(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function Kv(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=ze(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=an();return(0,Rr.useMemo)(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>ar(c,i),cloneRowSelection:c=>lr(c,i)}),[n,e,i,a,t,l,o])}function Bv(){let n=Kv();(0,Rr.useEffect)(()=>{let e=n.getState().keyDown.onChange(a=>{bS(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],u=St(s.id,n);Jf({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=n.getComputed().computedVisibleColumns[u],d=St(c.id,n);lS({...n,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function Wv(){let{getState:n}=ee(t=>({getState:t.getState}));return{onKeyDown:(0,Rr.useCallback)(t=>{n().keyDown(t)},[])}}function TS(){return Bv(),Wv()}var Rc=require("react");var Be=H(require("react")),Nt=require("react"),PS=require("react-dom");var Al="__is_infinite_menu_component";function bc(n){return!!n.tagName}function RS(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=_e.from(bc(e)?e.getBoundingClientRect():e),a=_e.from(bc(t)?t.getBoundingClientRect():t),l=o?_e.from(bc(o)?o.getBoundingClientRect():o):null;if(!l)return{...CS({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=CS({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s={...d,index:0}),d.valid)return{...d,index:u}}return s}function CS(n){let e=_e.from(n.targetRect),t=_e.from(n.anchorRect),o=n.constrainRect?_e.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=IS(e,i),s=IS(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function IS(n,e){return e==="TopLeft"?je.from({top:n.top,left:n.left}):e==="TopCenter"?je.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?je.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?je.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?je.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?je.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?je.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}function jv(n){return n&&typeof n.then=="function"||n instanceof Promise}function _l(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function wS(n){return typeof n=="function"&&(n=n()),jv(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&_l(n)&&(n=n.getBoundingClientRect()),n?_e.from(n):null}async function vS(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),_l(o)&&(r=o),r||null}return t(await e)}async function Ol(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await wS(t)||void 0,a=o?await wS(o):void 0,l=_e.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=RS({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=n.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=n.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function Uv(n){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function $v(n){let e=Be.useRef(null);return(0,Nt.useEffect)(()=>n.realign.onChange(t=>{e.current&&t&&Ol(e.current,t)}),[n.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,Nt.useCallback)(t=>{t&&Ol(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}function DS(n,e){let[t,o]=(0,Nt.useState)(null);(0,Nt.useLayoutEffect)(()=>{async function a(){let l=e?await vS(e):null;l!=null&&o(l)}e&&a()},[e]);let r=typeof e=="function"?e():null,i=_l(r)?r:t;return e?i?(0,PS.createPortal)(n,i):Be.createElement(Be.Fragment,null):e===null||e===!1?n:Be.createElement(Uv,null,n)}function Yv(n){if(Be.Children.count(n)===1){let e=Be.Children.only(n);if(Be.isValidElement(e))return e.props.id||e.key}return null}function qv(n,e,t){if(Be.Children.count(n)===1){let o=Be.Children.only(n);if(Be.isValidElement(o)&&o.type[Al]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),Be.cloneElement(o,r)}}return n}function un(n){let e=n,[t]=(0,Nt.useState)(()=>new Map),[o,r]=(0,Nt.useState)(null),[i,a]=(0,Nt.useState)(0),l=(0,Nt.useCallback)(()=>{let m=[];for(let[g,h]of t)m.push(Be.createElement($v,{...h,key:h.key}));return m},[]),[s,u]=Zt(),c=DS(l(),n.portalContainer),d=(0,Nt.useCallback)((m,g)=>{let S=`${g.id||Yv(m)||Ht()}`,y=t.get(S),C=T=>()=>{let R=typeof T=="function"?T():T;return qv(R,e.portalContainer,g.constrainTo??e.constrainTo)},b=C(m),I=(T,R)=>{if(!y)return;let v=C(T);Object.assign(y,{children:v}),u(),!!!R?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),I(m),I):(y={key:S,children:b,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:ye()},t.set(y.key,y),u(),I)},[t,e.portalContainer,u]);Be.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return Be.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}var mb=H(require("react"));var Pr=H(require("react"));var GS=H(require("react"));var zS=H(require("react"));function Fl(n){return null}Fl.defaultProps={__is_menu_item:!0};var xS="submenu",Xv="-";function MS(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ht(),focused:!1,destroyed:!1,domRef:{current:null}}}function ES(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var Tc=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===Xv?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:o,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:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}},Zv=[{name:"label"}],AS=(n,e)=>{let{props:t,state:o}=n,{activeItemKey:r,keyboardActiveItemKey:i}=o,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:u}=t,c=t.id||o.generatedId;u&&(c=`${u}-${c}`);let d=[...t.columns||Zv],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:c},f=[];a?f=a.map(g=>Tc(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==xS)&&d.push({name:xS,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:c}};var wr=H(require("react"));var _S="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",OS=ge({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"]]}),FS="db3arf1",NS="db3arfd";function LS(){return wr.createElement("hr",{className:NS})}var Nl={renderSeparator:()=>wr.createElement(LS,null),renderSubmenuColumn:({domProps:n,item:e})=>e.menu?wr.createElement("div",{...n},wr.createElement(yo,{expanded:!1})):wr.createElement("div",{...n})};var kS=(n,e)=>Tc(n,e,Nl);function VS(n,e){return zS.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Fl)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),kS(n,o)}return kS(n,t)})||[]}function HS(){return{...MS(),domRef:GS.createRef()}}var KS=()=>ES(),BS=n=>AS(n,{...Nl,childrenToRuntimeItems:VS});var qt=H(require("react")),Et=require("react");var Ll=require("react"),Cc=(0,Ll.createContext)(null);function Ic(){return(0,Ll.useContext)(Cc)}function WS(n,e){let t=jS(n,e);if(!t.length)return null;let o=_e.from(t[0]?.getBoundingClientRect()),r=_e.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function jS(n,e){let t=Gn(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function US(n,e){let t=jS(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function $S(n){let e=n();e.onHideIntent?.(e)}function YS(n,e,t){let{getState:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,hideAll:a}=t;i(e.key),r(e.key),e.originalMenuItem.onClick&&e.originalMenuItem.onClick(n);let l={key:e.key,item:e.originalMenuItem,hideMenu:a};e.originalMenuItem.onAction&&e.originalMenuItem.onAction(l);let{onAction:s}=o();s&&s(l),e.originalMenuItem.hideMenuOnAction&&a()}function qS(n,e){let{getState:t,setActiveItemKey:o,setKeyboardActiveItemKey:r,destroy:i,getSubmenuApi:a,isMounted:l,onItemClick:s}=e,{runtimeItems:u,runtimeSelectableItems:c,keyboardActiveItemKey:d}=t(),p=u.findIndex(S=>S.type==="item"&&S.key===d),f=d,m=u[p],g={ArrowUp:()=>{let S=u.slice(0,p).filter(y=>y.type==="item"&&!y.disabled).pop();S&&S.type==="item"&&S.key&&(f=S.key)},ArrowDown:()=>{let S=u.slice(p+1).filter(y=>y.type==="item"&&!y.disabled)[0];S&&S.type==="item"&&S.key&&(f=S.key)},Home:()=>{g.PageUp()},End:()=>{g.PageDown()},PageUp:()=>{f=c[0].key},PageDown:()=>{f=c[c.length-1].key},ArrowLeft:()=>{o(null),t().parentMenuId&&i()},ArrowRight:()=>{m&&(o(m.key),Ke(()=>{let S=a();l()&&S&&S.getParentMenuId()===t().menuId&&S.focus()}))},Enter:()=>{if(m)if(m.originalMenuItem?.menu){if(a()){g.ArrowLeft();return}o(m.key)}else s(n,m)}," ":()=>{if(!m)return;m.originalMenuItem.menu||s(n,m);let S=US(t().menuId,m.key);S&&S.click()},Escape:()=>{g.ArrowLeft();let S=t();S.parentMenuId||S.onHideIntent?.(S)}},h=g[n.key];h&&(h(),n.preventDefault()),f!=d&&r(f)}function XS(n){let{getState:e,setFocused:t,setKeyboardActiveItemKey:o,shouldSelectFirstItemOnFocus:r,hideAll:i}=n,a=()=>{t(!0),setTimeout(()=>{let s=e().domRef.current;r()&&s&&s===document.activeElement&&e().keyboardActiveItemKey==null&&o(e().runtimeSelectableItems[0]?.key??null)})};return{api:{hideMenu:i,focus:()=>{let s=e().domRef.current;s&&(s.focus(),setTimeout(()=>{let u=e().domRef.current;u&&u!==document.activeElement&&u.focus()},10),a())},getMenuId:()=>e().menuId,getParentMenuId:()=>e().parentMenuId},onMenuFocus:a}}var wi=class extends er{constructor(e){super(e.slice(0,3))}};var Qv=250;function Jv(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}Ke(i)};Ke(()=>{i()})})}var eP=Fe(),kl=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||Qv;this.getPointerMoveTarget=()=>document.documentElement||eP;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,c=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(c-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=c,(s?new wi([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new wi([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,Jv(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new je({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};function ZS(n,e){let t=n.filter(o=>o.type==="item"&&e===o.key)[0];return t&&t.menu?t:null}function QS(n,e,t){let o=WS(n,e.key);return o?{id:`${n}-submenu`,alignTo:o,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:t}:null}function JS(n,e){let{parentMenuId:t,constrainTo:o,api:r,hideAll:i,setSubmenuApi:a,setActiveItemKey:l,setKeyboardActiveItemKey:s}=e,u=n.menu;if(!u)return null;typeof u=="function"&&(u=u());let c=u;return{parentMenuItemKey:n.key,parentMenuId:t,constrainTo:o,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),a(p)},onHideIntent:d=>{c?.onHideIntent?.(d),i()},onHide:d=>{d.focused&&(l(null),s(n.key),r.focus())}}}function eb(n,e){return new kl({parentMenuId:n().parentMenuId,onItemActivate:e,itemHasSubMenu:t=>!!n().runtimeItems.filter(r=>r.type==="item"&&r.key===t&&r.menu)[0],getMenuRectFor:t=>{let o=`[data-submenu-for="${t}"]`,r=document.querySelector(o);if(r)return _e.from(r.getBoundingClientRect())}}).getHandlers()}function tb(n,e,t=o=>o){let{columns:o,runtimeItems:r,wrapLabels:i}=n,a=o.map(s=>t(s.width||(typeof s.flex=="number"?`${s.flex}fr`:s.flex)||"auto")).join(" "),l={...e,gridTemplateColumns:a,gridTemplateRows:r.map(()=>"auto").join(" ")};return i||(l.whiteSpace="nowrap"),l}function nb(n,e,t,o){let{active:r,keyboardActive:i,pressed:a}=o,l=n.value.key,s=$(OS({active:r,disabled:!!n.disabled,keyboardActive:i,pressed:a||r}),n.className),u=[],c=0;return e.forEach((d,p)=>{let f=n.value,m=d.field||d.name,g=p+1,h=g+n.span;g<c||(c=h,u.push({key:`${l}-${m}`,column:d,value:f[m],style:{...d.style,...n.style,gridColumnStart:g,gridColumnEnd:h},className:s,dataAttributes:{"data-menu-column-id":`${n.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${t}`,"data-menu-row-index":`${t}`,"data-menu-item-key":`${n.key}`}}))}),u}var vr=require("react");function ob(){let n=(0,vr.useRef)(!0);return(0,vr.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,vr.useCallback)(()=>n.current,[])}function tP(n,e){let t=`${e.parentMenuId}-submenu`,o=JS(n,e);return o?qt.createElement(cn,{key:t,...o}):null}function nP({onItemActivate:n}){let{getState:e}=Ic(),[{onItemEnter:t,onItemLeave:o}]=(0,Et.useState)(()=>eb(e,r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)}));return{onItemEnter:(0,Et.useCallback)(t,[]),onItemLeave:(0,Et.useCallback)(o,[])}}function rb(n){let{domProps:e}=n,{componentState:t,componentState:{columns:o,runtimeItems:r,menuId:i,activeItemKey:a,keyboardActiveItemKey:l,constrainTo:s,destroyed:u,onShow:c,onHide:d,autoFocus:p,parentMenuItemKey:f,domRef:m},componentActions:g,getState:h}=Ic(),S=(0,Et.useCallback)(_=>{g.keyboardActiveItemKey=_},[]),y=(0,Et.useCallback)(_=>{g.activeItemKey=_},[]),C=ob(),[b,I]=(0,Et.useState)(null),T=(0,Et.useRef)(!0),[{api:R,onMenuFocus:v,hideAll:w}]=(0,Et.useState)(()=>{let _=()=>$S(h);return{hideAll:_,...XS({getState:h,setFocused:K=>{g.focused=K},setKeyboardActiveItemKey:S,shouldSelectFirstItemOnFocus:()=>T.current,hideAll:_})}}),P=null;(0,Et.useLayoutEffect)(()=>{let{runtimeItems:_}=h(),K=ZS(_,a);if(!K){I(null),E();return}let z=QS(i,K,s);z&&M(()=>tP(K,{constrainTo:s,setSubmenuApi:I,setActiveItemKey:y,setKeyboardActiveItemKey:S,parentMenuId:i,hideAll:w,api:R}),z)},[a]);let x=(_,K)=>{YS(_,K,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,hideAll:w})},{showOverlay:M,portal:D,clearAll:E}=un({portalContainer:!1}),{onItemEnter:L,onItemLeave:V}=nP({onItemActivate:_=>{if(!C())return;let K=_?_.key:null;y(K)}});P=r.map((_,K)=>qt.createElement(oP,{key:_.type==="item"?_.key:K,onItemEnter:(z,Q)=>{L(z.key,Q)},onItemLeave:(z,Q)=>{V(z.key,Q)},columns:o,active:_.type==="item"&&_.key===a,keyboardActive:_.type==="item"&&_.key===l,item:_,index:K,onClick:x}));let N=tb(t,e.style);function k(_){qS(_,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,destroy:()=>{g.destroyed=!0},getSubmenuApi:()=>b,isMounted:C,onItemClick:x})}function F(){g.focused=!1}let W=(0,Et.useCallback)(_=>{_?(m.current=_,c?.(h(),R),p&&R.focus()):(d?.(h()),m.current=_)},[]),Y=qt.createElement("div",{className:Wo.contents},qt.createElement("div",{...e,"data-menu-id":i,"data-submenu-for":f,tabIndex:0,ref:W,onKeyDown:_=>{e.onKeyDown?.(_),k(_)},onMouseDown:_=>{T.current=!1,e.onMouseDown?.(_)},onMouseUp:_=>{T.current=!0,e.onMouseUp?.(_)},onFocus:v,onBlur:F,className:$(_S,e.className,"InfiniteMenu"),style:N},P),D);return u?null:Y}function oP(n){let[e,t]=qt.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=null;return r.type==="decoration"?s=qt.createElement("div",{style:r.style},r.value):s=nb(r,o,i,{active:a,keyboardActive:l,pressed:e}).map(u=>{let c=u.column,d={style:u.style,...u.dataAttributes,className:u.className,onPointerEnter:p=>{r.disabled||n.onItemEnter?.(r,p)},onPointerLeave:p=>{r.disabled||n.onItemLeave?.(r,p)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:p=>{r.disabled||n.onClick(p,r)}};return c.render?qt.createElement(oi,{key:u.key,render:c.render,renderParam:{item:r.value,column:c,value:u.value,domProps:d}}):qt.createElement("div",{key:u.key,...d},u.value)}),qt.createElement("div",{className:FS},s)}var{ManagedComponentContextProvider:rP}=Vt({initSetupState:HS,forwardProps:KS,mapPropsToState:BS,layoutEffect:!0});function iP(n){let{componentActions:e,componentState:t}=Gt(),o=Le(t);return Pr.createElement(Cc.Provider,{value:{componentActions:e,componentState:t,getState:o}},Pr.createElement(rb,{domProps:n.domProps}))}function cn(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:S,...y}=n;return Pr.createElement(rP,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...n},Pr.createElement(iP,{domProps:y}))}cn[Al]=!0;var pb=H(require("react"));function zl(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function Vl(n){let e=o=>{o.__insideMenu=!0},t=o=>{o.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{onShow:o=>{o.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:o=>{t(o),n?.()}}}function Gl(n){return{columns:[],items:[],autoFocus:!0,...Vl(n.onHideIntent)}}function ib(n,e){let{items:t,columns:o}=zl(n);return t&&t.length?{...e,items:t||[],columns:o}:null}function ab(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=n,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=e.getColumnLabel(p);c.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let h=!!g;i.setVisibilityForColumn(p.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}},"-",{key:"group-by",label:"Group by",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=e.getColumnLabel(p);c.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}}].filter(c=>!!c)}function lb(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i}=e,{getColumnMenuItems:a}=i(),l=r().computedColumnsMap.get(n);if(!l)return null;let s={column:l,columnApi:St(l.id,e),...e},u=o(s),c=a?a(u,s):u;return!c||!c.length?null:{autoFocus:!0,items:c,...Vl(t)}}function sb(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i,getDataSourceState:a,actions:l,dataSourceApi:s,dataSourceActions:u,api:c}=e,{getFilterOperatorMenuItems:d}=i(),p=r().computedColumnsMap.get(n);if(!p)return null;let{filterTypes:f}=a(),m=f[p.computedFilterType];if(!m)return null;let g=m.operators.map(b=>{let I=b.name,T=p.computedFilterValue?p.computedFilterValue.filter.operator===I:I===m.defaultOperator;return{key:I,icon:o.renderOperatorIcon(b),label:o.renderOperatorLabel(b.label??b.name),onAction:()=>{c.setColumnFilterOperator(n,I)},checked:T?o.renderDoneIcon():null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:o.renderClearIcon(),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(n)}},"-"],...g],y={column:p,api:c,getState:i,getDataSourceState:a,getComputed:r,actions:l,dataSourceApi:s,dataSourceActions:u,columnFilterValue:p.computedFilterValue,filterTypes:f},C=d?d(S,y):S;return{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,...Vl(t)}}function ub(n,e,t){let o=n instanceof Promise||Array.isArray(n)?!0:!!(n&&Array.isArray(n.items));if(n instanceof Promise)return{menu:t.renderLazyMenu(n,e),preventDefault:o};let{items:r,columns:i}=zl(n);return!r||!r.length?{menu:null,preventDefault:Array.isArray(r)}:{preventDefault:o,menu:t.renderMenu({...e,columns:i,items:r})}}function cb(n,e,t,o){let{columnId:r,rowIndex:i,event:a}=n,{getComputed:l,getState:s}=e,{getCellContextMenuItems:u}=s(),{computedColumnsMap:c}=l(),d=c.get(r),p={...on({...e,rowIndex:i,columnId:d.id}),event:a};if(!d||!u)return{cellContext:p,menu:null,preventDefault:!1};let f=Gl({onHideIntent:t}),m=u(p,e);return{cellContext:p,...ub(m,f,o)}}function db(n,e,t,o){let{getState:r,getComputed:i}=e,{getContextMenuItems:a}=r(),{computedColumnsMap:l}=i(),s=n.columnId?l.get(n.columnId):void 0,u=s?{...n,...on({...e,rowIndex:n.rowIndex,columnId:s.id})}:n;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let c=Gl({onHideIntent:t}),d=a(u,e);return{cellContext:u,...ub(d,c,o)}}function fb(n,e){let t=e.getState().components?.CheckBox||Bn;return ab(e,{renderCheckBox:({key:o,...r})=>pb.createElement(t,{key:o,...r}),getColumnLabel:o=>qo(o,e,"column-menu")})}function gb(n,e,t){let o=e.getState().components?.Menu??cn,r=lb(n,e,t,i=>fb([],i));return r?mb.createElement(o,{...r}):null}function hb(n){return typeof n=="function"?n():n}function vi(n){return hb(n.menuConstrainTo)??n.domRef.current}function yb(n,e,t){return e?()=>hb(e)??(t||n().portalDOMRef.current):t||!1}var Sb=5,bb=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]],Hl=10;function Tb(n){function e(t){t.__insideMenu!==!0&&n()}return document.documentElement.addEventListener("mousedown",e),()=>{document.documentElement.removeEventListener("mousedown",e)}}function Pi(n,e,t){if(n)return Tb(()=>{e(),t()});e()}function Cb(n){let{getState:e,actions:t}=n;return o=>{o&&(e().columnMenuTargetRef.current=o.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=o.column.id)}}function aP(n){let{columnId:e,context:t,clearAll:o,show:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){o(),a.columnMenuVisibleForColumnId=null}let c=n.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[data-column-id="${e}"] ${Rm}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(u,{constrainTo:vi(i()),id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Ib(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e,{columnMenuVisibleForColumnId:i,columnMenuTargetRef:a}=t();if(i){let l=Tb(()=>{r(),o.columnMenuVisibleForColumnId=null});return aP({columnId:i,context:n,clearAll:r,show:(s,u)=>e.show(i,s,u)}),l}a.current=null,r()}function Rb(n){let e={top:n.clientY,left:n.clientX},t=_e.fromPoint(e);return t.width+=Sb,t.height+=Sb,{point:e,rect:t}}function wb(n,e){let{actions:t,getState:o,getDataSourceState:r}=n,{clearAll:i}=e;return a=>{if(!a)return;let{event:l}=a;function s(){i(),t.cellContextMenuVisibleFor=null}let u=e.getContent(a,s),{cellContext:c,preventDefault:d}=u,{rect:p}=Rb(l);e.show(u,{constrainTo:vi(o()),id:"cell-context-menu",alignTo:p,alignPosition:bb}),d&&l.preventDefault(),t.cellContextMenuVisibleFor={columnId:a.columnId,rowId:a.rowId,rowIndex:a.rowIndex,colIndex:a.colIndex};let{onCellContextMenu:f}=o();f&&f({...c,getState:o,getDataSourceState:r},l)}}function vb(n,e){let{actions:t,getState:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{event:a}=i;function l(){r(),t.contextMenuVisibleFor=null}let s=e.getContent(i,l),{cellContext:u,preventDefault:c}=s,{point:d,rect:p}=Rb(a);e.show(s,{constrainTo:vi(o()),id:"table-context-menu",alignTo:p,alignPosition:bb}),c&&a.preventDefault(),t.contextMenuVisibleFor={point:d,...i};let{onContextMenu:f}=o();f&&f({...n,...u},a)}}function Pb(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{target:a,column:l}=i;function s(){r(),o.filterOperatorMenuVisibleForColumnId=null}let u=a?.parentElement||a,c=_e.from(u.getBoundingClientRect());c.top-=Hl,c.left-=Hl,c.width+=2*Hl,c.height+=2*Hl,e.show(l.id,s,{constrainTo:vi(t()),id:"filter-operator-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=l.id}}var Db=require("react");function _o(){let{getState:n,menuPortalContainer:e}=ee(r=>({getState:r.getState,menuPortalContainer:r.state.menuPortalContainer})),{portalDOMRef:t}=zi(r=>({portalDOMRef:r.getMasterState().portalDOMRef}))||{},o=t?.current;return(0,Db.useMemo)(()=>yb(n,e,o),[n,e,o])}function xb(){let n=ze(),{columnMenuVisibleForColumnId:e,columnMenuVisibleKey:t}=ee(a=>({columnMenuVisibleForColumnId:a.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:a.state.columnMenuVisibleKey})),{showOverlay:o,portal:r,clearAll:i}=un({portalContainer:_o()});return(0,Rc.useEffect)(()=>n.getState().onColumnMenuClick.onChange(Cb(n)),[]),(0,Rc.useEffect)(()=>Ib(n,{clearAll:i,show:(a,l,s)=>o(()=>gb(a,n,l),s)}),[e,t]),{menuPortal:r}}var Mb=H(require("react")),Eb=require("react");var lP={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function Ab(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=ze(),{getDataSourceState:a,getDataSourceMasterContext:l}=an(),{focusDetectDOMRef:s}=n(),u=(0,Eb.useCallback)(async()=>{pS({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return Mb.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:lP})}var Dr=require("react");function sP(){let n=ze(),{getState:e,editingCell:t}=ee(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;(0,Dr.useEffect)(()=>{if(o){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=hi(n,i);if(!a){yi("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[o])}function uP(){let n=ze(),{getState:e,editingCell:t}=ee(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,Dr.useEffect)(()=>{if(o){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=hi(n,i);if(!a){yi("onEditRejected",i);return}r({...a,value:i.value,error:o,initialValue:i.initialValue})}},[o])}function cP(){let n=ze(),{editingCell:e}=ee(r=>({editingCell:r.state.editingCell})),t=e?.active,o=Ln(t);(0,Dr.useEffect)(()=>{!t&&o&&n.api.focus()},[t,o])}function dP(){let n=ze(),{editingCell:e,getState:t}=ee(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,Dr.useEffect)(()=>{if(o){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=hi(n,i);s?r({...s,value:a,initialValue:l}):yi("onEditAccepted",i)}n.api.persistEdit({value:a})}},[o])}function pP(){let n=ze(),{editingCell:e,getState:t}=ee(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;(0,Dr.useEffect)(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=o instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=hi(n,r);if(!s){yi(l,r);return}let u={...s,value:r.value,initialValue:r.initialValue};o instanceof Error?i?.({...u,error:o}):a?.(u)}},[o])}function _b(){sP(),uP(),dP(),pP(),cP()}var Pc=require("react");var ro=H(require("react"));var wc=H(require("react"));var Kl=n=>wc.createElement(Ge,{...n,icon:"clear"},wc.createElement("path",{d:He.clear[0]}));var vc=H(require("react"));var Ob=n=>vc.createElement(Ge,{...n,icon:"done"},vc.createElement("path",{d:He.done[0]}));function Fb(n,e,t){let o=e.getState().components?.Menu??cn,r=sb(n,e,t,{renderOperatorIcon:i=>{let a=i.components?.Icon??$o;return ro.createElement(a,null)},renderOperatorLabel:i=>ro.createElement(ro.Fragment,null,i),renderClearIcon:()=>ro.createElement(Kl,null),renderDoneIcon:()=>ro.createElement(Ob,{size:16})});return r?ro.createElement(o,{...r}):null}function Nb(){let n=ze(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=un({portalContainer:_o()});return(0,Pc.useEffect)(()=>e().onFilterOperatorMenuClick.onChange(Pb(n,{clearAll:i,show:(a,l,s)=>o(()=>Fb(a,n,l),s)})),[]),(0,Pc.useEffect)(()=>Pi(e().filterOperatorMenuVisibleForColumnId,i,()=>{t.filterOperatorMenuVisibleForColumnId=null}),[e().filterOperatorMenuVisibleForColumnId]),{menuPortal:r}}var Di=require("react");var kb=H(require("react"));var Dc=H(require("react"));function Lb(n,e,t){if(!n)return null;let o=ye();return n.then(r=>{let i=ib(r,e);i&&o(Dc.createElement(t,{...i}))}),Dc.createElement(Xn,{updater:o})}function zb(n){let e=n.getState().components?.Menu??cn;return{renderMenu:t=>kb.createElement(e,{...t}),renderLazyMenu:(t,o)=>Lb(t,o,e)}}function Vb(n,e,t){return cb(n,e,t,zb(e))}function Gb(n,e,t){return db(n,e,t,zb(e))}function Hb(){let n=ze(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=un({portalContainer:_o()});return(0,Di.useEffect)(()=>e().cellContextMenu.onChange(wb(n,{clearAll:i,getContent:(a,l)=>Vb(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),(0,Di.useEffect)(()=>Pi(e().cellContextMenuVisibleFor,i,()=>{t.cellContextMenuVisibleFor=null}),[e().cellContextMenuVisibleFor]),{menuPortal:r}}function Kb(){let n=ze(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=un({portalContainer:_o()});return(0,Di.useEffect)(()=>e().contextMenu.onChange(vb(n,{clearAll:i,getContent:(a,l)=>Gb(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),(0,Di.useEffect)(()=>Pi(e().contextMenuVisibleFor,i,()=>{t.contextMenuVisibleFor=null}),[e().contextMenuVisibleFor]),{menuPortal:r}}var Bb=require("react"),Wb=H(require("react"));var Bl=require("react");function Wl(n,e){let{brain:t}=ee(r=>({brain:r.state.brain})),o=(0,Bl.useCallback)(n,e);(0,Bl.useEffect)(()=>t.onScroll(o),[t,o])}var xc="yzx0vj0";function jb(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=(0,Bb.useRef)(null);Wl(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=pe.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=pe.runtime.bodyWidth),o==="column"?l.minWidth=pe.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=pe.runtime.bodyWidth),t==="column"?l.maxWidth=pe.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=pe.runtime.bodyWidth),Wb.createElement("div",{ref:a,...i,className:i.className?$(i.className,xc):xc,style:l},i.children)}var fP=q(X.columnWidthAtIndex),mP=q(X.columnOffsetAtIndex);function Ub(){let{computedVisibleColumns:n}=ee(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${fP}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${mP}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var jl="InfiniteTable";var $b=require("react");function Yb(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=ee(c=>({getState:c.getState,actions:c.actions,dataSourceActions:c.dataSourceActions,getDataSourceState:c.getDataSourceState})),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),(0,$b.useEffect)(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=o(),g=!1,h=l.rowsPerPage,S=(r&&r.length>0||i)&&h>0?h:null;return f!=S&&(t.rowsPerPage=S,g=!0),m!=u&&(t.repeatWrappedGroupRows=u??!1,g=!0),g};c();let d,p=l.onVerticalRenderRangeChange(()=>{c()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,u])}var Oo=require("react");function gP(){let n=[],e=t=>{Object.keys(t).forEach(o=>{let r=t[o];if(typeof r=="string"){let i=q(r);if(i.includes("dont-override"))return;n.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...pe,loaded:void 0,runtime:void 0}),n}function qb(n){if(!n)return{};let e=gP(),t=getComputedStyle(n),o={};return e.forEach(r=>{o[r]=t.getPropertyValue(r).trim()}),o}var xi=ge({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Xb="_143ofgf5",Zb="_143ofgf3";var hP=q(pe.loaded),Mc={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Qb(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...Mc,url:Ec(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Mc,url:Ec(),type:t,payload:{debugId:o,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(u=>u.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(u=>[u.id,{field:u.field,dataType:u.computedDataType,sortType:u.computedSortType,filtered:u.computedFiltered,sorted:u.computedSorted,width:u.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(u=>u.field?`${u.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(u=>typeof u.field=="string").map(u=>({field:`${u.field}`,dir:u.dir,type:Array.isArray(u.type)?u.type[0]:u.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:qb(l.domRef.current),themeVarOverrides:{...ln.get(o)||{}}}}}var Ec=yt(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function yP(n){window.postMessage(n)}var SP=yt(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){Tt.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(Qb({type:"update",debugId:e},t))}else sy(e),window.postMessage(Qb({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,qe.onLogIntent("IT:*",e=>{yP({...Mc,url:Ec(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let o="";try{o=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return o}return String(t)}),timestamp:e.timestamp}})}),n}),Ac=ye(),bP={revertAll:n=>{let e=Tt.get(n.debugId);if(e){let t=to.get(n.debugId);to.delete(n.debugId),Rn.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=vn.get(n.debugId);vn.delete(n.debugId),wn.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=Tt.get(n.debugId);if(e){let t=n.property,o=Rn.get(n.debugId),r=to.get(n.debugId),i=wn.get(n.debugId),a=vn.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=vn.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:n=>{let e=Tt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),no(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),no(n.debugId))}}},discardAllWarnings:n=>{let e=Tt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),no(n.debugId))},setColumnVisibility:n=>{oc(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{Il(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{oc(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{Il(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{Il(n.debugId,"multiSort",n.multiSort)},setCssVar:n=>{let e=Tt.get(n.debugId),t=e?.getState().domRef.current;!e||!t||!n.name?.startsWith("--infinite-")||(t.style.setProperty(n.name,n.value),ln.set(n.debugId,{...ln.get(n.debugId)||{},[n.name]:n.value}),no(n.debugId))},revertCssVar:n=>{let e=Tt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(n.name);let o={...ln.get(n.debugId)||{}};delete o[n.name],ln.set(n.debugId,o),no(n.debugId)},revertAllCssVars:n=>{let e=Tt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let o=ln.get(n.debugId)||{};Object.keys(o).forEach(r=>{t.style.removeProperty(r)}),ln.delete(n.debugId),no(n.debugId)},highlight:n=>{let e=Tt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${xi.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(xi.classNames.base),r.innerHTML=[`<div class="${Zb}"></div>`,`<div class="${Xb}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(xi.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(xi.classNames.variants.active.true)}}}}};function TP(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&typeof n.data.target=="string"&&n.data.target==="infinite-table-page"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(SP(),Ac(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=bP[e];t&&t(n.data.payload)}})}TP();function Jb(n,e){if(!e)return;getComputedStyle(e).getPropertyValue(hP)!==`${ta}`&&Si({debugId:n,key:"CSS001_CSS"})}function _c(){return Ac.get()}function eT(n){return Ac.onChange(e=>{e&&n(e)})}function tT(n){let e=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;e&&e(n,null)}function nT(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=ee(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),o=n(),{domRef:r,debugId:i}=o;return i&&Jb(i,r.current),(0,Oo.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),CP()}function CP(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=ee(c=>({getState:c.getState,getComputed:c.getComputed,getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions,actions:c.actions,dataSourceApi:c.dataSourceApi,api:c.api})),s=n().debugId,u=(0,Oo.useRef)(s);return u.current=s,(0,Oo.useEffect)(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},p=_c();if(p){d(p);return}return eT(d)},[]),(0,Oo.useEffect)(()=>{let c=u.current;if(!c)return;let d=_c();d&&d(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),(0,Oo.useEffect)(()=>{if(s)return()=>{tT(s)}},[s]),s}function oT(){let{masterPortalDOMRef:n}=zi(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=ee(o=>o.state.portalDOMRef);return n?.current??e?.current}var Lt=H(require("react")),Ul=require("react");var rT="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",iT=ge({defaultClassName:"hs68h8e _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),aT="hs68h81",lT=ge({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 Fo=H(require("react"));function sT(n){return Fo.createElement("div",{...n.domProps})}function uT(n){let{active:e}=n;return Fo.createElement("div",{className:aT},e?"Drop to group":"Drag columns to group")}function cT(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return Fo.createElement("div",{...n.domProps},n.label,Fo.createElement("div",{className:Bi[1]}),Fo.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:rT,onKeyDown:e,onMouseDown:n.onClear},Fo.createElement(Kl,{size:20})))}var IP=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};Fe().addEventListener("mousemove",i,{once:!0}),Fe().addEventListener("mouseup",()=>{r||(Fe().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function RP(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s,dragListId:u}=Co(),c=l===u,d=ze(),p=(e?qo(e.id,d,"grouping-toolbar"):r)??i,f=e?Lt.createElement(_a,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,m=Lt.createElement(Lt.Fragment,null,p,f),g=s===i&&l===u,h=$(iT({draggingInProgress:c,active:g}),n.domProps?.className),S=IP(a,n.domProps?.onMouseDown),y={...n.domProps,className:h,onMouseDown:S},C=o?.ToolbarItem??cT;return Lt.createElement(C,{active:g,domProps:y,column:e,field:r,label:m,onClear:t})}function dT(n){let{groupBy:e}=Ne(T=>({groupBy:T.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=ee(T=>({getComputed:T.getComputed,dataSourceApi:T.dataSourceApi,api:T.api})),{dropTargetListId:i,dragSourceListId:a}=gn(),{fieldsToColumn:l,computedColumnsMap:s}=t(),u=go(ga),c=go(ma),d=(0,Ul.useMemo)(()=>[c,u],[c,u]),p=i===u,f=a===u,m=n.components?.Placeholder??uT,g=n.components?.Host??sT,h=e.length?Lt.createElement(Lt.Fragment,null,e.map((T,R)=>{let v=T.field?l.get(T.field):void 0,w=`${T.field??`idx-${R}`}`;return Lt.createElement(qn.DraggableItem,{key:w,id:w},P=>Lt.createElement(RP,{id:w,components:n.components,domProps:P,field:T.field,column:v,toggleSorting:()=>{v&&r.toggleSortingForColumn(v.id)},onClear:()=>{let x=e.filter(M=>M!==T).filter(Boolean);o.setGroupBy(x)}}))})):Lt.createElement(m,{draggingInProgress:f,active:p,groupBy:e}),S=T=>{let R=T.map(v=>e[v]);o.setGroupBy(R)},y=T=>{let{dragItemId:R}=T,v=R,w=s.get(v);if(!w||!w.field||!w.computedGroupable)return;let P=[...e];P.splice(T.dropIndex,0,{field:w.field}),o.setGroupBy(P)},C=(0,Ul.useCallback)(T=>{let{computedColumnsMap:R}=t(),v=T.dragItem.id,w=R.get(v);return!(!w||!w.computedGroupable||e.some(P=>P.field===w.field))},[e]),b=n.orientation??"horizontal",{domProps:I}=n;return Lt.createElement(qn,{orientation:b,dragListId:u,acceptDropsFrom:d,onDrop:S,dragStrategy:"inline",onAcceptDrop:y,shouldAcceptDrop:C},(T,{draggingInProgress:R,status:v})=>{let w=$(lT({active:p,orientation:b,draggingInProgress:R,dropRejected:v==="rejected"}),T.className,I?.className),P={...T,...I,className:w,children:h};return Lt.createElement(g,{active:p,rejectDrop:v==="rejected",domProps:P,orientation:b})})}var Mr=H(require("react"));var $l=require("react"),dn=require("react"),Yl=H(require("react"));function pT(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return tl(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}var Dn=H(require("react"));var fT=ge({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var Oc=require("react");function wP(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function vP(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=qh(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function mT(n,e){let t={current:!1};return{currentRowCache:{getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)},cacheCalledByRowDetailRenderer:t}}function gT(n){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:o,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=n,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),u={registerDetail:yt(c=>{if(o.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)});return}wP(e.id,{masterState:r(),detailContext:c}),requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)}),c.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&vP(e.id,{detailState:c.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return u.masterRowInfo=e,u.getMasterDataSourceState=r,u.getMasterState=a,u}function hT(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=Ne(u=>({getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions})),{getMasterState:i}=ee(u=>({getMasterState:u.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,Oc.useMemo)(()=>mT(t.id,e),[e,t.id]),s=(0,Oc.useMemo)(()=>gT({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:o,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function yT(){return _n()}var{rootClassName:PP}=Ve,DP=`${PP}RowDetail`;function xP(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=hT({rowDetailsCache:a,rowInfo:r}),u=Ho(),[c]=Dn.useState(()=>yT());return c.setSnapshot(l),Dn.useLayoutEffect(()=>{c.notify()},[l]),Dn.createElement(u.Provider,{value:c},Dn.createElement("div",{ref:e,className:$(DP,fT({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${X.bodyWidth} - ${X.scrollbarWidthVertical})`,height:o}},t(r,s)))}var ST=Dn.memo(xP);var MP=1;function bT(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:u,onRowMouseEnter:c,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:h,isRowDetailsEnabled:S,cellClassName:y,cellStyle:C,repaintCellsKey:b,rowStyle:I,rowDetailCache:T,rowClassName:R,onScrollToTop:v,onScrollToBottom:w,onScrollStop:P,scrollToBottomOffset:x,wrapRowsHorizontally:M,updatedAt:D,ready:E,editingCell:L}=ee(O=>({actions:O.actions,getState:O.getState,getComputed:O.getComputed,getDataSourceMasterContext:O.getDataSourceMasterContext,rowHeight:O.state.rowHeight,rowDetailHeight:O.state.rowDetailHeight,onRowMouseEnter:O.state.onRowMouseEnter,onRowMouseLeave:O.state.onRowMouseLeave,groupRenderStrategy:O.state.groupRenderStrategy,brain:O.state.brain,showZebraRows:O.state.showZebraRows,rowDetailRenderer:O.state.rowDetailRenderer,isRowDetailsExpanded:O.state.isRowDetailExpanded,isRowDetailsEnabled:O.state.isRowDetailEnabled,cellClassName:O.state.cellClassName,cellStyle:O.state.cellStyle,repaintCellsKey:O.state.repaintCellsKey,rowStyle:O.state.rowStyle,rowDetailCache:O.state.rowDetailCache,rowClassName:O.state.rowClassName,onScrollToTop:O.state.onScrollToTop,onScrollToBottom:O.state.onScrollToBottom,onScrollStop:O.state.onScrollStop,scrollToBottomOffset:O.state.scrollToBottomOffset,wrapRowsHorizontally:O.state.wrapRowsHorizontally,updatedAt:O.state.updatedAt,ready:O.state.ready,editingCell:O.state.editingCell})),{computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:k,computedColumnsMap:F,computedColumnOrder:W,computedRowHeight:Y,computedRowSizeCacheForDetails:_,fieldsToColumn:K,rowspan:z,toggleGroupRow:Q,columnSize:Te}=e,ue=(0,$l.useMemo)(()=>k.map(O=>O.id),[k]),{dataArray:fe,rowInfoStore:De,selectionMode:xe,cellSelection:de,isNodeReadOnly:ne,getDataSourceState:se,dataSourceApi:he,dataSourceActions:U}=Ne(O=>({dataSourceApi:O.dataSourceApi,dataSourceActions:O.dataSourceActions,getDataSourceState:O.getDataSourceState,dataArray:O.dataSourceState.dataArray,rowInfoStore:O.dataSourceState.rowInfoStore,selectionMode:O.dataSourceState.selectionMode,cellSelection:O.dataSourceState.cellSelection,isNodeReadOnly:O.dataSourceState.isNodeReadOnly})),te=Le(fe);pT({columnSize:Te,brain:f,computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:k,computedRowHeight:Y,dataArray:fe,bodySize:t,rowspan:z});let B=(0,dn.useRef)(0);(0,dn.useEffect)(()=>f.onRenderCountChange(()=>{B.current=f.scrollTopMax}),[f]),(0,dn.useEffect)(()=>f.onRenderRangeChange(O=>{i().onRenderRangeChange?.(O)}),[f]),(0,dn.useEffect)(()=>f.onScrollStop(O=>{let{scrollTop:A,scrollLeft:ce}=O;if(A===0&&v?.(),A+(x??MP)>=B.current){w?.();let{livePagination:be,livePaginationCursor:Me,dataArray:et}=se();be&&(U.cursorId=Me!==void 0?Date.now():et.length)}if(P){let be=f.getRenderRange();P({scrollTop:A,scrollLeft:ce,renderRange:be,viewportSize:i().bodySize,firstVisibleRowIndex:be.start[0],lastVisibleRowIndex:be.end[0],firstVisibleColIndex:be.start[1],lastVisibleColIndex:be.end[1]})}}),[f,v,w,P]),(0,dn.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,dn.useEffect)(()=>{let{onReady:O}=i();O&&O({api:o,dataSourceApi:he})},[E]);let ae=(0,$l.useMemo)(()=>({isNodeReadOnly:ne,selectionMode:xe,cellSelection:de}),[ne,xe,de]),oe=(0,dn.useCallback)(O=>{let{rowIndex:A,colIndex:ce,heightWithRowspan:Re,domRef:Se,hidden:be,width:Me,onMouseLeave:et,onMouseEnter:tt}=O,lt=te()[A],Xe=k[ce];if(!lt||!Xe)return null;let Ze=_?_.getRowHeight(A):Re,G=!1;!S||typeof S=="function"&&!S(lt)?G=!1:h&&(G=h(lt)?"expanded":"collapsed");let J=M?f.getRowIndexInPage(A):null,me=M?f.getPageIndexForRow(A):null,Ce=o.isEditorVisibleForCell({rowIndex:A,columnId:Xe.id}),st={getData:te,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:J,horizontalLayoutPageIndex:me,rowIndex:A,rowInfoStore:De,hidden:be,toggleGroupRow:Q,rowHeight:Ze,rowDetailState:G,onMouseEnter:tt,onMouseLeave:et,onRowMouseEnter:c,onRowMouseLeave:d,domRef:Se,width:Me,column:Xe,columnsMap:F,fieldsToColumn:K,rowStyle:I,rowClassName:R,cellStyle:C,cellClassName:y,repaintCellsKey:Xe.repaintCellsKey!==void 0?Xe.repaintCellsKey:b,visibleColumnIds:ue,computedColumnOrder:W,inEditMode:Ce,getDataSourceState:se,dataSourceApi:he,dataSourceActions:U,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:ae};return Yl.createElement(bm,{...st})},[s,u,c,d,_,Y,h,te,k,F,K,p,M,Q,m,f,De,I,R,y,C,b,se,he,U,i,o,r,a,l,ue,W,D,L,ae]),re=(0,$l.useMemo)(()=>{if(h)return O=>{let{rowIndex:A,domRef:ce}=O,Se=te()[A];if(!Se||!h(Se)||!_)return Yl.createElement("div",{ref:ce,className:Dd.hidden});let{rowDetailHeight:be,rowHeight:Me}=_.getSize(A);return Yl.createElement(ST,{rowInfo:Se,rowDetailsCache:T,rowIndex:A,domRef:ce,detailOffset:Me,rowDetailHeight:be,rowDetailRenderer:g})}},[E,oe,g,u,h,T]);return{renderCell:oe,renderDetailRow:re}}var TT=require("react");function CT(){let{state:n,getState:e,actions:t}=ee(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=Ln(o);(0,TT.useEffect)(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=dc(jl,!!o);t.brain=u.brain,t.headerBrain=u.headerBrain,t.renderer=u.renderer,t.onRenderUpdater=u.onRenderUpdater,t.headerRenderer=u.headerRenderer,t.headerOnRenderUpdater=u.headerOnRenderUpdater}},[r,o])}var wT=H(require("react"));var IT="_16lm1iw1 _16lm1iw1c _16lm1iwe";var RT=$(IT,Js);function vT(n){return wT.createElement("div",{...n,className:n.className?$(RT,n.className):RT})}var xr=H(require("react"));var PT={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},DT="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",xT="qy58ya4";var{rootClassName:EP}=Ve,Fc=`${EP}-LoadMask`;function AP(n){let{visible:e,children:t="Loading"}=n;return xr.createElement("div",{className:`${PT[e?"visible":"hidden"]} ${Fc}`},xr.createElement("div",{className:`${DT} ${Fc}-Overlay`}),xr.createElement("div",{className:`${xT} ${Fc}-Text`},t))}var ql=xr.memo(AP);var MT=require("react");var _P=[dm,`${rn}--hovered`];function OP(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function No(n){let e=ze(),t=On(),{getComputed:o,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:h,activeCellIndex:S,rowDetailRenderer:y,showHoverRows:C,wrapRowsHorizontally:b,domProps:I,domRef:T,forceBodyRerenderTimestamp:R,rowHoverClassName:v,ready:w}=ee(_=>({ready:_.state.ready,columnReorderDragColumnId:_.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:_.state.forceBodyRerenderTimestamp,renderer:_.state.renderer,onRenderUpdater:_.state.onRenderUpdater,debugId:_.state.debugId,keyboardNavigation:_.state.keyboardNavigation,activeRowIndex:_.state.activeRowIndex,loadingText:_.state.loadingText,scrollStopDelay:_.state.scrollStopDelay,brain:_.state.brain,scrollerDOMRef:_.state.scrollerDOMRef,components:_.state.components,bodySize:_.state.bodySize,activeCellIndex:_.state.activeCellIndex,rowDetailRenderer:_.state.rowDetailRenderer,showHoverRows:_.state.showHoverRows,wrapRowsHorizontally:_.state.wrapRowsHorizontally,domProps:_.state.domProps,domRef:_.state.domRef,rowHoverClassName:_.state.rowHoverClassName})),P=g?.LoadMask??ql,x=o(),{computedRowHeight:M,computedRowSizeCacheForDetails:D}=x,E=D?.getRowHeight||M,{loading:L}=Ne(_=>({loading:_.dataSourceState.loading})),V=Mr.useCallback(_=>{let K=e.getState(),z=_.target;if(!t&&_._from_row_detail)return;t&&(_._from_row_detail=!0);let Q=Mp(z,cc(),K.domRef.current),Te,ue,fe,De;Q&&(ue=Number(Q.dataset.colIndex),De=Number(Q.dataset.rowIndex),Te=e.getComputed().computedVisibleColumns[ue].id,fe=e.dataSourceApi.getRowInfoArray()[De].id);let xe={columnId:Te,colIndex:ue,rowId:fe,rowIndex:De,event:_,target:Q??_.target};Q&&K.cellContextMenu(xe),K.contextMenu(xe)},[]),{renderCell:N,renderDetailRow:k}=bT({imperativeApi:r,getComputed:o,domRef:T,bodySize:h,computed:x}),{autoFocus:F,tabIndex:W}=I??{};CT();let Y=(0,MT.useMemo)(()=>{if(!C)return;let _=[];return v&&(_=_.concat(v)),n.rowHoverClassName&&(_=_.concat(n.rowHoverClassName)),No.rowHoverClassName&&(_=_.concat(No.rowHoverClassName)),OP(_)},[C,v,n.rowHoverClassName,No.rowHoverClassName]);return Mr.createElement(vT,{onContextMenu:V},Mr.createElement(Ng,{forceRerenderTimestamp:R,debugId:l,tabIndex:W??0,autoFocus:F??void 0,activeRowIndex:w&&s==="row"?u:null,activeCellIndex:w&&s==="cell"&&!d?S:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:b,onRenderUpdater:a,brain:f,activeCellRowHeight:E,renderCell:N,renderDetailRow:y?k:void 0,cellHoverClassNames:Y,scrollerDOMRef:m,scrollVarHostRef:T}),Mr.createElement(P,{visible:L},c))}No.rowHoverClassName=_P;function ET(){return ee(n=>n.api)}function AT(n){return ee(e=>e.api.getColumnApi(n))}var tn=Ve.rootClassName,{ManagedComponentContextProvider:FP}=Vt({initSetupState:Ry,forwardProps:wy,mapPropsToState:xy,cleanup:vy,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Dy(),getParentState:()=>ml(n=>n),debugName:n=>Zn(n.debugId,jl)}),_T=Pe.memo(function(){let e=Li(),{componentState:t,api:o,initialChildren:r}=ee(F=>({componentState:F.state,api:F.api,initialChildren:F.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Ne(F=>({dataArrayLength:F.dataSourceState.dataArray.length,getDataSourceState:F.getDataSourceState,dataSourceActions:F.dataSourceActions,dataSourceApi:F.dataSourceApi})),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:S,scrollStopDelay:y,brain:C,activeRowIndex:b,activeCellIndex:I}=t,{licenseKey:T}=t;T===void 0&&pn.licenseKey&&(T=pn.licenseKey),iS(b,i,o),rS(I,i,o);let{onKeyDown:R}=TS();Pe.useEffect(()=>{let F=a(),W=Xt(Y=>{F.notifyRenderRangeChange({renderStartIndex:Y[0],renderEndIndex:Y[1]})},{wait:y});return C.onVerticalRenderRangeChange(W)},[C,y]);let v=oS(T),{autoFocus:w,tabIndex:P,...x}=t.domProps??{},M=qp(x);Pe.useEffect(()=>{C.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),Ch(),Yb(),_b();let{menuPortal:D}=xb(),{menuPortal:E}=Hb(),{menuPortal:L}=Kb(),{menuPortal:V}=Nb();Pe.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,o,{dataSourceApi:s})},[t.ready,o,s]);let N=nT();Pe.useEffect(()=>{if(e){let F=e.getSnapshot();c.current=F.getMasterState().portalDOMRef.current}},[]);let k=r??Pe.createElement(Pe.Fragment,null,Pe.createElement(Fu,null),Pe.createElement(No,null));return Pe.createElement("div",{"data-debug-id":N,onKeyDown:R,ref:u,...M},k,Pe.createElement("div",{ref:c,className:$(`${at}Portal`,xd[1e7],Wi.absolute,vd[0],Id[0])},D,E,L,V),g?Pe.createElement(Nr,{key:"row-height",varName:g,onChange:d}):null,Pe.createElement(Nr,{key:"flashing-duration",allowInts:!0,varName:pe.components.Cell.flashingDuration,onChange:p}),h?Pe.createElement(Nr,{key:"row-detail-height",varName:h,onChange:f}):null,S?Pe.createElement(Nr,{key:"column-header-height",varName:S,onChange:m}):null,v==="valid"?null:Pe.createElement(oh,{invalid:v==="invalid"}),Pe.createElement(Ab,null))});function NP({children:n,store:e}){let{componentActions:t,componentState:o}=Gt(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=Le(o),l=Xy({state:o,actions:t,getState:a}),s=Le(l),u=Li(),{getDataSourceState:c,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=an(),[m]=Pe.useState(()=>bh({getComputed:s,getState:a,getDataSourceState:c,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:c,getComputed:s,getState:a,api:m,dataSourceApi:f,children:n};return e.setSnapshot(g),Pe.useLayoutEffect(()=>{e.notify()}),_i(r,h=>{let S={width:h.width,height:h.height};t.bodySize=S},{earlyAttach:!0,debounce:50}),Pe.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),Pe.createElement(_T,null)}var pn=function(n){let[e]=Pe.useState(()=>aS()),t=Hr();return Pe.createElement(FP,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:Ii,columnHeaderHeight:Ci,...n},Pe.createElement(fa,null,Pe.createElement(t.Provider,{value:e},Pe.createElement(NP,{children:n.children,store:e}))))};pn.Header=Fu;pn.Body=No;pn.HScrollSyncContent=jb;pn.Footer=()=>Pe.createElement(Ed,null);pn.GroupingToolbar=dT;var OT=H(require("react"));function LP(n){let{DataSource:e}=Sr({nodesKey:"children",...n});return OT.createElement(e,null,n.children??null)}var FT=H(require("react"));var Nc=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Je(i,{treePaths:o});r.forEachLeafNodePath((c,{selected:d})=>{l.setNodeSelection(c,d)}),a&&r.forEachLeafNodePath(c=>{l.setNodeSelection(c,a.selected)},a.nodePath);let u={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};n(u)};function NT(n){return FT.createElement(pn,{...n})}var Xl=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=qe(`IT:${e}:DataQuery`)}};function Lo(n){if(Array.isArray(n))return n.map(Lo);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Lo(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var xn=class xn{constructor(e){this.queryCache=new j;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Lo(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new Xl(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Lo(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Lo(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Lo(e);this.queryCache.delete(t)};if(this.options=e,xn.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)}xn.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=xn.clients.get(e);t&&t.destroy()}static destroyAll(){xn.clients.forEach(e=>{xn.destroy(e.name)})}destroy(){xn.clients.delete(this.options.name)}};xn.clients=new Map;var Lc=xn;var kP={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},LT={instantEdit:kP};var zP=require("react");function kT(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var Ql=class Ql{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ql.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Ql.DEFAULT_SIZE=10;var Zl=Ql;var es=class es{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??es.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};es.DEFAULT_SIZE=10;var Jl=es;var ko=require("react"),VP=(n,e)=>n.every((t,o)=>t===e[o]),zT=(n,e)=>{let t=(0,ko.useRef)(e),o=VP(e,t.current),r=(0,ko.useRef)(!0);t.current=e;let i=(0,ko.useRef)(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=(0,ko.useRef)(n);l.current=n,(0,ko.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var io=require("react"),VT=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),ts=(n,e)=>{let{same:t,different:o,compare:r}=e,i=(0,io.useRef)(t),a=(0,io.useRef)(o),l=VT(t,i.current,r),s=!VT(o,a.current,r),u=(0,io.useRef)(!0);i.current=t,a.current=o;let c=(0,io.useRef)(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=(0,io.useRef)(n);p.current=n,l&&s&&(u.current=!1),(0,io.useEffect)(()=>{if(!u.current)return p.current()},d)};var kt=H(require("react"));var GT=q(X.currentFlashingDuration),GP=({children:n})=>kt.createElement(kt.Fragment,null,n),HT=1e3,KT={up:ha({direction:"up"}).split(" "),down:ha({direction:"down"}).split(" "),neutral:ha({direction:"neutral"}).split(" ")},kc=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=GP}=n;return kt.forwardRef((i,a)=>{let l=ni(),{flashingDurationCSSVarValue:s}=ee(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),u=typeof s=="number"?s??e??HT:e??HT,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,S=kt.useRef(!0),y=kt.useRef(d),C=S.current?null:y.current;S.current=!1;let b=kt.useRef(void 0),I=kt.useRef(void 0),T=kt.useRef(void 0);return ts(()=>{if(d===y.current)return;let R=()=>{let x=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),T.current&&(clearTimeout(T.current),T.current=void 0),I.current&&x){let M=I.current,D=KT[M];x.classList.remove(...t?[t,...D]:D),x.style.removeProperty(GT),I.current=void 0}};y.current=d;let v=m.current;if(!v)return;R();let w=typeof d=="number"?d>C?"up":"down":"neutral",P=KT[w];return v.style.setProperty(GT,`${u}`),v.classList.add(...t?[t,...P]:P),I.current=w,b.current=setTimeout(R,u),R},{same:[h,g],different:[d]}),kt.createElement("div",{ref:c,...i,className:$(i.className)},o({children:i.children,oldValue:C}))})},BT=kc();var rt=H(require("react")),Er=require("react");var WT=require("react-dom");function jT(n){let[e,t]=rt.useState(null);return(0,Er.useEffect)(()=>{let{debugTarget:o}=n,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[o]){let i=globalThis.INFINITE[o].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[n.debugTarget]),typeof e=="function"?rt.createElement(UT.Provider,{value:{getState:e}},rt.createElement(HP,null)):null}var UT=rt.createContext({getState:()=>null});function HP(){let n=rt.useContext(UT),{getState:e}=n,[,t]=Zt(),o=e().renderer.cellManager;(0,Er.useEffect)(()=>{let s=Xt(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=(0,Er.useRef)(null),l=(0,Er.useRef)(null);return rt.createElement("div",{style:{overflow:"auto"}},(0,WT.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(u=>rt.createElement("td",{key:u,style:{padding:5,border:"1px solid gray",background:o.getCellAt([s,u])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":u},rt.createElement("button",{onClick:()=>{let c=o.getCellAt([s,u])?.getElement();if(!c)return;let d=c.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(c)},style:{cursor:"pointer"}},"(",s,",",u,")"))))))))}var KP={CheckBox:Bn,LoadMask:ql,MenuIcon:ri,StringFilterEditor:Zo,NumberFilterEditor:Ji};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});
|
|
32
32
|
//!collapsed || lazyLoad;
|