@infinite-table/infinite-react 10.1.0 → 10.1.2

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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var hS=Object.create;var Cu=Object.defineProperty;var yS=Object.getOwnPropertyDescriptor;var SS=Object.getOwnPropertyNames;var bS=Object.getPrototypeOf,TS=Object.prototype.hasOwnProperty;var CS=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var RS=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of SS(e))!TS.call(o,r)&&r!==t&&Cu(o,r,{get:()=>e[r],enumerable:!(n=yS(e,r))||n.enumerable});return o};var rn=(o,e,t)=>(t=o!=null?hS(bS(o)):{},RS(e||!o||!o.__esModule?Cu(t,"default",{value:o,enumerable:!0}):t,o));var Go=CS((IM,Pd)=>{"use strict";Pd.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});function Et(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}import*as Pe from"react";var te=(...o)=>o.filter(e=>!!`${e}`).join(" ");import*as Fo from"react";import{useRef as Fu}from"react";import*as IS from"react";import{useMemo as jv,useRef as wS,useEffect as vS,useLayoutEffect as PS,useCallback as Uv}from"react";var an=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Et(e,{wait:n}):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=o.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(o),()=>{a.disconnect()}};var zr=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=wS({width:0,height:0}),r=i=>{let a;return o.current&&(a=an(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};vS(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),PS(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};function Se(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,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 lt(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Ru=(o,e)=>o-e;var Vr=(o,e)=>Ru(o.revision,e.revision),Z=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.mutations=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),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],y=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let S=t(f.value,h,l,y,f);if(n&&S===!0)return!0;l++}else y?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(n&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new o;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push(i)},t),n}getEntriesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push([r,i])},t),n}getLeafNodesStartingWith(e,t,n){let{respectOrder:r=!1}=n||{},i=[],a=[];return this.getStartingWith(e,(l,s,u)=>{!u.map&&u.hasOwnProperty("value")&&(r?i.push(u):a.push(t(u)))},n),r?i.sort(Vr).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},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(!n&&u.has(this.emptyKey))return[[]];return c&&c.value!==void 0&&(n||(s({...c,keys:e}),d=!0)),d?i?a.sort(Vr).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,u,r,n),i?a.sort(Vr).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let 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,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let n=this.map;this.mutations++,e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((n,r)=>{let{map:i}=n;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],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,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],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 n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],u=lt(()=>{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((n,r)=>{let i=e({...n,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Vr);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=Z;function De(){return globalThis}var Hr=["#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"],Iu=Symbol("color"),Gr=new WeakMap,za=Se();function Va(o=Hr){Gr.set(o,o.map(e=>0))}Va();var DS=(o=Hr)=>{let e=[];Gr.has(o)?e=Gr.get(o):(e=o.map(n=>0),Gr.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??Hr[0]},Bn=":",Ga="*",wu="-",xS=",",ES="debug",MS="diffdebug",Pu=!1,Kn=new Z,Wn=new Map;function Ha(o,e){let t=o.split(Bn),n=new Z;n.set(t,!0);let r=e.split(Bn),i=new Set(r).has(Ga),a=r.indexOf(Ga),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(Bn)):!0}}function Du(o,e){let t=`channel=${o}_permissions=${e}`;if(Wn.has(t))return Wn.get(t);let n=e.split(xS);function r(l){return Wn.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(Ga)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(wu);if(u&&(s=s.substring(wu.length)),Ha(o,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)),Ha(o,s))return r(!u)}return r(!1)}var Ka=()=>qe.enable??(De()&&De().localStorage?.getItem(ES))??"",AS=()=>qe.diffenable??(De()&&De().localStorage?.getItem(MS))??`${Pu}`,Ba="",xu=Pu;function Wa(o){xu=`${AS()}`=="true",Ba!==o&&(Ba=o,Wn.clear())}function Eu(o){Wa(Ka()),typeof De()<"u"&&De().addEventListener&&De().addEventListener("storage",function(){Wa(Ka())});function e(t,n){let r=n?`${n}${Bn}${t}`:t,i=r.split(Bn),a=Kn.get(i);if(a)return a;let l=Kn.get(i.slice(0,-1)),s=(l?l.logFn:qe.logFn)??Mu,u=s,c,d=0,p=()=>c??Du(r,Ba),f=DS(qe.colors),m=Object.defineProperties((...g)=>{let h=za.getListenersCount(),y;if(h>0&&(y=y??Date.now(),za({color:f,channel:r,args:g,timestamp:y})),p()){if(y=y??Date.now(),d&&xu){let b=y-d;u(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=y;let S=[],T;if(g.forEach(b=>{if(b[Iu])T===void 0&&(T=!0),S.push(...b);else{if(typeof b!="string"&&typeof b!="number"){T=!1;return}S.push(`${b}%s`)}}),T){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...S,""];u(...b)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let y=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return y.toString=()=>h.join(" "),y[Iu]=!0,y}},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:()=>{Kn.delete(i)}}});return Kn.set(i,m),m}return e(o)}var Mu=console.log.bind(console),vu;Object.defineProperty(Eu,"enable",{get:()=>vu,set:o=>{vu=o,Wa(Ka())}});var qe=Eu;qe.colors=Hr;qe.logFn=Mu;var _S=(o,e)=>za.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;Ha(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});qe.onLogIntent=_S;qe.isChannelEnabled=Du;qe.destroyAll=()=>{Va(),Va(qe.colors),Kn.clear(),Wn.clear()};var Pt=o=>{let e=qe(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},fo=o=>{let e=qe(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},jn=()=>jn;jn.extend=()=>jn;var ft=class{constructor(e){this.debug=jn,this.error=jn}};var Au=fo("CSSVariableWatch"),_u=Pt("CSSVariableWatch"),Ou={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var OS=o=>{let e=Fu(0),t=Fo.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);zr(o.ref,t,{earlyAttach:!0}),Fo.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,_u(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);Au(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Un=o=>{let e=Fu(null);OS({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return Fo.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Ou},Fo.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};import{useCallback as LS,useContext as Ua}from"react";function mo(){let o=null,e=new Set;return{getSnapshot(){return o},setSnapshot(t){o=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}import{useCallback as FS,useRef as Kr,useSyncExternalStore as NS}from"react";function mt(o,e,t){if(o===e)return!0;if(!o||!e)return!1;let n=typeof o;if(n!==typeof e||n!=="object")return!1;var i=Object.keys(o),a=Object.keys(e);t&&(i=i.filter(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))&&(o[u]!==e[u]||!Object.prototype.hasOwnProperty.call(e,u)))return!1}return!0}function Nu(o,e,t){let n=Kr(e);n.current=e;let r=Kr(t);r.current=t;let i=Kr(void 0),a=Kr(!1),l=FS(()=>{let s=o.getSnapshot(),u=n.current(s);return a.current&&r.current(i.current,u)?i.current:(i.current=u,a.current=!0,u)},[o]);return NS(o.subscribe,l,l)}function Br(o,e){return Nu(o,e,Object.is)}function ln(o,e){return Nu(o,e,mt)}import*as Lu from"react";var ja;function sn(){return ja||(ja=Lu.createContext(null))}var ku=mo(),zu=()=>{};function Wr(){let o=sn();return Ua(o)||void 0}function jr(){let o=Wr();return LS(()=>o?.getSnapshot(),[o])}function Yt(o){let e=sn(),t=Ua(e),n=ln(t||ku,t?o:zu);return t?n??void 0:void 0}function No(){let o=sn(),e=Ua(o),n=Br(e||ku,e?r=>r.masterRowInfo:zu);return e?n:void 0}import*as un from"react";import{useReducer as US,createContext as $S,useMemo as Xa,useEffect as YS,useState as $u,useRef as Yu,useLayoutEffect as qS}from"react";function go(o){if(o==null)return!1;let e=o;return!0}import{useCallback as VS,useEffect as GS,useRef as $a}from"react";import{useCallback as kS,useState as zS}from"react";var kt=()=>{let[o,e]=zS(0);return[o,kS(()=>{e(t=>t+1)},[e])]};var Vu=o=>{let e=VS(o,[]),t=$a(!1),n=$a(!1),r=$a(void 0),[i,a]=kt();t.current&&(n.current=!0),GS(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};import{useCallback as HS,useRef as KS}from"react";function Fe(o){let e=KS(o);return e.current=o,HS(()=>e.current,[])}import{useRef as BS,useLayoutEffect as WS}from"react";var Lo=(o,e)=>{let t=BS(e===void 0?o:e);return WS(()=>{t.current=o}),t.current};var $n={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 Ya=class o{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,n=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",u=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:u,color:r,properties:a.length>0?a.map(c=>[c.name,c.value]):void 0,tooltipText:l}}}),this};this.debugId=e}static create(e){return new o(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys($n).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:$n[n].track,label:i.label}),get label(){let i=$n[n];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,n,{get:()=>{let i=$n[n];return e.markerDetails.track=i.track,r}}),t},{})}};function ot(o){return Ya.create(o)}function Gu(o,e){let t=new Set;function n(...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 o.apply(this,s)}return{fn:n,propertyReads:t}}var qa=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Yn(o){return o!==void 0}function ho(o,e){let t=e[o];return Yn(t)}var Hu=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)};function jS(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=ho(r,e)?e[r]:e[`default${qa(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function Ku(o,e,t){let{fn:n,propertyReads:r}=Gu(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=n(e);return r.forEach(a=>t.add(a)),i}function Bu(o){let{props:e,initialSetupState:t,propsToForward:n,parentState:r,mapPropsToState:i,propsToStateSet:a}=o,l={};n&&(l=jS(n,e,t));let s={...t,...l};if(i){let u=Ku(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...u}}return s}function Wu(o,e,t){let{getProps:n,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,u=e.payload.mappedState,c=e.payload.updatedPropsToState,d={...o};if(u&&Object.assign(d,u),i){let f=Ku(i,{props:n(),state:d,oldState:o,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:o,state:d,updatedProps:c,parentState:s}):d}function ju(o){let{dispatch:e,getState:t,getProps:n,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=Hu}=o,u=t();return Object.keys(u).reduce((c,d)=>{let p=d;return Object.defineProperty(c,d,{set:m=>{let g=n(),h=t(),y=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:c,state:h})===!1&&(y=!1),y){let b=[m],R=`on${qa(d)}Change`;if(l&&l[p]){let C=l[p](m,h);R=C.callbackName||R,b=C.callbackParams}s(g,R,b)}let S=r[p];typeof S=="function"&&(m=S(m));let T=!!i?.[p];ho(d,g)&&!T||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),c},{})}function Uu(o){let{currentProps:e,prevProps:t,state:n,propsToForward:r,propsToStateSet:i}=o,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++,ho(m,e)||ho(m,t)))if(r.hasOwnProperty(f)){let y=h,S=r[f];typeof S=="function"&&(y=S(h)),n[m]!==y&&(a[m]=y,l++)}else i.has(f)&&(s[m]=e[m],u++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:u,rawUpdatedProps:c,rawUpdatedPropsCount:d}}var Za;function qu(){return Za||(Za=$S(null))}function Mt(o){let e=o.getParentState||(()=>null);function t(r){let[i]=$u(()=>o.initSetupState?o.initSetupState(r):{}),a=Yu(new Set),l=Xa(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),u=Fe(s);function c(){return Bu({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:o.mapPropsToState,propsToStateSet:a.current})}let[d]=$u(c),p=Fe(r),f=(P,D)=>Wu(P,D,{getProps:p,getParentState:()=>u?.()??null,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:a.current}),[m,g]=US(f,d),h=Fe(m),{allowedControlledPropOverrides:y}=o,S=Xa(()=>ju({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:y,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks}),[g,l,y]),T=o.Context??qu(),b=Xa(()=>({componentState:m,componentActions:S,getComponentState:h,replaceState:P=>{g({type:"REPLACE_STATE",payload:P})},assignState:P=>{g({type:"ASSIGN_STATE",payload:P})}}),[m,S,h]),R=Lo(r),C=Yu(!1);C.current=!1;let I=o.layoutEffect?qS:YS;return I(()=>{let P=r,{newMappedState:D,newMappedStateCount:w,updatedPropsToState:M,updatedPropsToStateCount:E,rawUpdatedProps:x,rawUpdatedPropsCount:v}=Uu({currentProps:P,prevProps:R,state:m,propsToForward:l,propsToStateSet:a.current});if(E>0||w>0){let _=m.debugId,F=_?ot(_).track.ComponentState.label.PropUpdate.start():void 0,L=o.debugName?typeof o.debugName=="function"?`${o.debugName(P)}:rerender`:`${o.debugName}:rerender`:"rerender";Pt(L)("Triggered by new values for the following props",...Object.keys(D??{}),...Object.keys(M??{})),F&&F.end({label:L,details:[w>0?{name:"Updated properties",value:Object.keys(D).join(", ")}:void 0,E>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,E>0||M?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(go)});let K={payload:{mappedState:w?D:null,updatedPropsToState:E?M:null}};if(C.current=!0,g(K),o.onPropChange){for(var A in x)if(x.hasOwnProperty(A)){let{newValue:W,oldValue:k}=x[A];o.onPropChange({name:A,newValue:W,oldValue:k},r,S,m)}}o.onPropsChange&&v&&o.onPropsChange(x,r,S,m)}}),I(()=>{s!=null&&!C.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Vu(()=>()=>{o.cleanup?.(h())}),{contextValue:b,ContextComponent:T}}return{ManagedComponentContextProvider:un.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return un.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function At(o){return o=o??qu(),un.useContext(o)}import*as sc from"react";var st="Infinite",Le={rootClassName:st};var Ur=()=>Le;var Xu="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Zu={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var _t="_16lm1iw3b _16lm1iw3c _16lm1iw35",Qu={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},cn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var $r={1:"_16lm1iw1c",none:"_16lm1iw1d"},qn={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Ju={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},ec={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},tc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var oc={none:"_16lm1iwd"},nc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Yr={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var rc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var ic={none:"_16lm1iw1x"};var ac={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var lc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function uc(o){let{rootClassName:e}=Ur();return sc.createElement("div",{...o,className:te(`${e}Footer`,Yr.relative,cn.flex,qn.row,o.className)})}import*as xe from"react";import{useCallback as qf,useContext as LC,useEffect as kC,useRef as zC}from"react";import{createPortal as VC}from"react-dom";function qr(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function J(o){return o.slice(4,-1)}import*as cc from"react";var ke=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return cc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};import*as Qa from"react";var ze={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 dc=o=>Qa.createElement(ke,{...o},ze.includesOperator.map(e=>Qa.createElement("path",{key:e,d:e})));import*as Ja from"react";var pc=o=>Ja.createElement(ke,{...o},Ja.createElement("path",{d:ze.endsWithOperator[0]}));import*as el from"react";var fc=o=>el.createElement(ke,{...o},el.createElement("path",{d:ze.eqOperator[0]}));import*as tl from"react";var mc=o=>tl.createElement(ke,{...o},tl.createElement("path",{d:ze.gteOperator[0]}));import*as ol from"react";var gc=o=>ol.createElement(ke,{...o},ol.createElement("path",{d:ze.gtOperator[0]}));import*as nl from"react";var hc=o=>nl.createElement(ke,{...o},nl.createElement("path",{d:ze.lteOperator[0]}));import*as rl from"react";var yc=o=>rl.createElement(ke,{...o},rl.createElement("path",{d:ze.ltOperator[0]}));import*as il from"react";var Sc=o=>il.createElement(ke,{...o},il.createElement("path",{d:ze.neqOperator[0]}));import*as al from"react";var bc=o=>al.createElement(ke,{...o},al.createElement("path",{d:ze.startsWithOperator[0]}));import*as hl from"react";import*as rt from"react";import{useEffect as pb,useState as ed}from"react";import*as dn from"react";import{useEffect as eb,useLayoutEffect as tb,useState as Kc}from"react";function XS(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function ZS(o){var e=XS(o,"string");return typeof e=="symbol"?e:String(e)}function QS(o,e,t){return e=ZS(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Tc(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function Cc(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tc(Object(t),!0).forEach(function(n){QS(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Tc(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Rc(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var JS=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},ye=o=>{var e=t=>{var n=o.defaultClassName,r=Cc(Cc({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=o.variantClassNames[i][s];u&&(n+=" "+u)}}for(var[c,d]of o.compoundVariants)JS(c,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Rc(o.variantClassNames,t=>Rc(t,n=>n.split(" ")[0]))}},e};var Ic="_1eexc2a6";var wc=ye({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:[]}),vc="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Pc=ye({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Dc=ye({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"]]}),xc=ye({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"]]}),Ec="_12zfob12u _16lm1iw22 _16lm1iw1z";var Mc="_12zfob17",Ac="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",_c=ye({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),ll=ye({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Oc="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Fc=ye({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Nc="_12zfob1b _16lm1iw2",Lc="_16lm1iw1",kc="_12zfob16",zc=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Vc="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Tt="InfiniteIcon";var Gc="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Hc={transition:"width 0.25s, opacity 0.25s"},Ax=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function pn(o){let[e,t]=Kc(!0),[n,r]=Kc(0),{lineWidth:i=1,style:a,className:l,index:s}=o,u=s!=null&&s>0,c=o.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...Hc,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if(eb(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),tb(()=>{t(!0)},[]),!e)return null;let m={};return dn.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:te(l,Tt,Gc,`${Tt}-filter`)},u?dn.createElement("div",{"data-name":"index",style:m,className:Mc},s):null,dn.createElement("div",{style:{width:p[0],...f}}),dn.createElement("div",{style:{width:p[1],...f}}),dn.createElement("div",{style:{width:p[2],...f}}))}var Xr=Object.freeze({}),ob={string:Xr,number:{}};function fn(o,e){let t=e.default||Xr;return o.type===void 0?t:o.type===null?Xr:typeof o.type=="string"?e[o.type]||ob[o.type]||Xr:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var ul=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((I,P)=>{let D=I.maxSize??r??void 0,w=I.minSize??n??void 0;s.push(w),u.push(D),I.size!=null&&(D!=null&&I.size>D&&(I.size=D),w!=null&&I.size<w&&(I.size=w));let M=I.flex==0?null:I.flex;if(I.size==null&&M==null)throw`Items must specify either a size or a flex property. Item at index ${P} doesn't have either of those.`;M!=null&&(l+=1),a+=M??0,i+=I.size??0});let c=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((I,P)=>{if(I.flex!=null){let D=d*I.flex,w=I.maxSize??r??void 0,M=I.minSize??n??void 0,E=!1,x=0;w!=null&&D>w&&(p[P]=!0,E=!0,x=w),M!=null&&D<M&&(f[P]=!0,E=!0,x=M),E&&(m+=1,l-=1,a-=I.flex,c-=x)}}),m&&(d=c/a);let g=[],h=0,y=c,S=a,T=0,b=0,R=[];return{items:t.map((I,P)=>{let D={...I},w=I.maxSize??r??void 0,M=I.minSize??n??void 0,E=0,x=p[P],v=f[P],A=x||v,_=I.size??0;if(I.flex!=null){if(A)v&&(E=M),x&&(E=w);else{h+=1;let F=L=>(w!=null&&L>w&&(L=w),M!=null&&L<M&&(L=M),L);h===l?E=F(y):(E=F(Math.round(I.flex*d)),b+=E,y=c-b,S-=I.flex,d=y/S)}_=E,D.flexSize=E}return g.push(E),R.push(_),D.computedSize=_,T+=_,D}),flexSizes:g,minSizes:s,maxSizes:u,computedSizes:R,remainingSize:Math.round(e-T)}};function Zr(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}function Wc(o,e,t){let n=!1,r=0;for(let i of o)i.computedFlex&&(n=!0),r+=i.computedWidth;return n&&Math.round(r)>Math.round(e-t)}function sl(o,e){return o.computedFlex&&!e?"flex":"width"}function Xn(o,e,t){if(e==="width"){let{flex:n,...r}=o??{};return{...r,width:t}}return{...o,flex:t}}var cl=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((M,E)=>(M[E]={...o.columnSizing[E]},M),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],u=l.id,c=s?.id,d=Wc(o.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=sl(l,d),h=s?.computedWidth,y=s?.computedMinWidth,S=s?.computedMaxWidth,T=s?sl(s,d):"width",b=!1,R=!1,C=r>0?1:-1,{value:I,clamped:P,diff:D}=Zr(Math.round(p+r),f,m,C);if(o.shareSpaceOnResize){if(s==null)return n[u]=Xn(n[u],g,I),R=P==="min",b=P==="max",{adjustedDiff:I-p,reservedWidth:t,columnSizing:n,minReached:R,maxReached:b,constrained:R||b};let{value:M,clamped:E,diff:x}=Zr(Math.round(h-r),y,S,C);if(P&&E&&(Math.abs(D)>Math.abs(x)?E=!1:P=!1),!(!P&&!E)){if(P){let v=Zr(Math.round(h-r-D),y,S,C);M=v.value,E=v.clamped,x=v.diff}else if(E){let v=Zr(Math.round(p+r+x),f,m,C);I=v.value,P=v.clamped,D=v.diff}}n[u]=Xn(n[u],g,I),n[c]=Xn(n[c],T,M),R=P==="min"||E==="min",b=P==="max"||E==="max"}else n[u]=Xn(n[u],g,I),R=P==="min",b=P==="max";let w=I-p;return{adjustedDiff:w,reservedWidth:o.shareSpaceOnResize?t:Math.round(t-w),columnSizing:n,minReached:R,maxReached:b,constrained:R||b}};function Bc(o,e){return o+e}function nb(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var jc=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((S,T)=>(S[T]={...o.columnSizing[T]},S),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((S,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(S=>o.items[S]),l=a.map(S=>S.computedWidth),s=Wc(o.items,e,t),u=a.map(S=>sl(S,s)),c=0,{computedSizes:d}=ul({items:a.map(S=>(S.resizable===!1&&(c+=S.computedWidth),{maxSize:S.computedMaxWidth,minSize:S.computedMinWidth,flex:S.resizable?S.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Bc,0)+r-c,0)}),p=a.map((S,T)=>d[T]-S.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((S,T)=>{let b=a[T];if(!b.resizable){h.push(0);return}let R=u[T],C=l[T],I=nb(n),{maxReached:P,minReached:D,constrained:w,adjustedDiff:M}=cl({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:S,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:I});n[b.id]=Xn(I[b.id],R,Math.round(C+M)),h.push(M),P||(m=!1),D||(f=!1),w||(g=!1)});let y=h.reduce(Bc,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:y,columnSizing:n,reservedWidth:Math.round(t-y)}};var Qr;function zt(){if(Qr!=null)return Qr;let o=De().document??null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),Qr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Qr}var Uc=["start",void 0,"end"],$c=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Uc.indexOf(r)-Uc.indexOf(i)}),o);function Yc(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function dl(o,...e){return Yc(t=>t!=null,o,...e)}function qc(o,e,...t){return Yc((n,r)=>!(r in o),e,...t)}var Jr=!0,rb=!0,ib=!0,Xc="string",qt="unknown";var ab=fo("getComputedVisibleColumns"),lb=(o,e,t)=>o[t]!==!1,pl=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1};function ko(o,e){if(o)return o[e]?o[e]:Object.values(o).find(t=>t.field===e)}function sb(o,e){let t=fn(o,e);return o.sortType?o.sortType:t.sortType?t.sortType:typeof o.type=="string"?o.type:Xc}function ub(o,e,t){let r=(Array.isArray(o)?o:o?[o]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[qt];let l=ko(e,a);if(!l)return[qt];let s=sb(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===qt)?qt:r.length===1?r[0]:r}function fl(o,e){let{colType:t,sortable:n,columnDefaultSortable:r}=e,i=o.defaultSortable??t.defaultSortable,a=!!o.groupByForColumn;if(i==null&&!a){let l=o.field??t.field,s=o.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return n??i??r??Jr}var Zc=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,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=zo,viewportReservedWidth:y,resizableColumns:S,draggableColumns:T,columnDefaultDraggable:b,columnOrder:R,columnPinning:C,editable:I,columnDefaultEditable:P,columnDefaultFilterable:D,columnDefaultGroupable:w,columnDefaultSortable:M,columnSizing:E,columnTypes:x,columnVisibility:v,columnVisibilityAssumeVisible:A,groupBy:_})=>{let F=0,L={};_.forEach((B,oe)=>{B.field&&(L[B.field]=oe)});let O=(p||[]).reduce((B,oe)=>{let{id:he,field:be}=oe;return be&&(B[be]=oe),he&&(B[he]=oe),B},{}),K=$c(R===!0?Object.keys(o):R,C),W=K.filter(B=>o[B]?lb(v,A,B):(ab(`Column with id "${B}" specified in columnOrder array cannot be found in the columns map.`),!1)),k=new Map,Q=W.map((B,oe)=>{let he=o[B];return k.set(B,oe),he}),V=(m??[]).reduce((B,oe,he)=>(oe.id?B[oe.id]={sortInfo:oe,index:he}:oe.field&&(B[oe.field]={sortInfo:oe,index:he}),B),{});function j(B){let oe=o[B],he=fn(oe,x),be={minWidth:he?.minWidth,maxWidth:he?.maxWidth,width:he?.defaultWidth,flex:he?.defaultFlex},nt={width:oe?.defaultWidth,flex:oe?.defaultFlex,minWidth:oe?.minWidth,maxWidth:oe?.maxWidth},H=E[B];H?.width!=null&&H.flex==null&&delete nt.flex,H?.flex!=null&&H.width==null&&delete nt.width;let Ne=dl(nt,H);Ne.width!=null&&delete be.flex,Ne.flex!=null&&delete be.width,Ne=dl(be,Ne);let pt=Ne.flex??void 0,le=Ne.minWidth??oe?.minWidth??n,_e=Ne.maxWidth??oe?.maxWidth??r,$e=pt!=null?void 0:Ne.width??(a?void 0:i);return!$e&&pt==null&&(a?pt=a:$e=le),{size:$e,flex:pt,minSize:le,maxSize:_e}}let re=ul({availableSize:Math.max(t.width-(y??0)-(l??zt()),0),maxSize:r,minSize:n,items:W.map(j)}),{computedSizes:de,flexSizes:se,minSizes:ae,maxSizes:ce}=re,ue=[],U=[],z=[],Y=[];Y.length=W.length;let $=new Map,X=new Map,q=0,fe=0,me=0,ie=null,G=[],N=0,ge=0,Ee=0;Q.forEach((B,oe)=>{let he=W[oe],be=de[oe],nt=G[oe]=pl(he,C);nt==="start"?N+=be:nt==="end"?Ee+=be:ge+=be});let Ce=t.width-Ee,Re=[],Ae=new Map;W.forEach((B,oe)=>{let he=Q[oe];Ae.set(B,he)});let Ge=[];Object.keys(o).forEach(B=>{let oe=o[B];Ge.push(B),Ae.has(B)||Ae.set(B,oe)});let et=new Map;Ae.forEach((B,oe)=>{let he=k.get(oe);he==null&&(he=-1);let be=he!=-1,nt=W[he+1],H=fn(B,x),Ne=he,pt=V[oe]?V[oe]:B.field?V[B.field]??null:null,le=pt?.sortInfo??null,_e=!!le,$e=_e&&le.dir===1,po=_e&&!$e,mu=pt?.index??-1,Fa=be?{}:j(oe),gu=be?de[he]:Fa.size||0,tS=be&&se[he]||null,oS=be?ae[he]||0:Fa.minSize||0,nS=be?ce[he]||1e4:Fa.maxSize||1e4,bt=be?pl(oe,C):!1,hu=be?he===W.length-1:!1,Lr=Ne,rS=be?bt==="start"?fe:bt==="end"?me:F-fe:0;bt=="start"?Lr=be?Ne:-1:bt==="end"?Lr=be?Ne-(ue.length+z.length):-1:Lr=be?Ne-ue.length:-1;let iS=be?bt==="start"||bt===!1?F:Ce+me:-1,aS=be?bt!==ie:!1,lS=be?hu||bt!==pl(nt,C):!1,yu=B.cssEllipsis??H.cssEllipsis??s,sS=B.headerCssEllipsis??H.cssEllipsis??B.cssEllipsis??H.headerCssEllipsis??u??yu,kr=be&&(O[oe]||B.field||B.groupByForColumn)&&(O[oe]||O[B.field||B.groupByForColumn])||null,uS=B.defaultFilterable??H.defaultFilterable??D??!0,cS=I??B.defaultEditable??H.defaultEditable??P??!1,Na=B.dataType||H.dataType||(Array.isArray(B.type)?B.type[0]:B.type)||Xc,dS=B.sortType||H.sortType||Na,Su=B.filterType||H.filterType||Na,bu=!1;if(kr!=null&&!kr.disabled){let ka=h[Su];ka&&(!ka.emptyValues||!ka.emptyValues.includes(kr.filter.value))&&(bu=!0)}let nn=B.field??H.field,pS=B.valueGetter??H.valueGetter,La=B.defaultGroupable??H.defaultGroupable??w??!!nn;nn||(La=!1),B.groupByForColumn&&(La=!1);let Tu=nn?L[nn]!==void 0:!1,fS=Tu?L[nn]:void 0,mS=fl(B,{colType:H,sortable:f,columnDefaultSortable:M}),gS=B.resizable??H.resizable??S??rb,Ye={colType:H,align:H.align,headerAlign:H.headerAlign,computedVisible:be,verticalAlign:H.verticalAlign,defaultHiddenWhenGroupedBy:H.defaultHiddenWhenGroupedBy,valueGetter:pS,valueFormatter:H.valueFormatter,renderValue:H.renderValue,render:H.render,style:H.style,className:H.className,contentFocusable:H.contentFocusable,renderMenuIcon:H.renderMenuIcon,renderSortIcon:H.renderSortIcon,renderRowDetailIcon:H.renderRowDetailIcon,renderSelectionCheckBox:H.renderSelectionCheckBox,renderHeaderSelectionCheckBox:H.renderHeaderSelectionCheckBox,headerStyle:H.headerStyle,headerClassName:H.headerClassName,columnGroup:H.columnGroup,getValueToEdit:H.getValueToEdit,getValueToPersist:H.getValueToPersist,shouldAcceptEdit:H.shouldAcceptEdit,field:nn,...B,components:{...H.components,...B.components},computedResizable:gS,computedMinWidth:oS,computedMaxWidth:nS,computedFlex:tS,computedDataType:Na,computedEditable:cS,computedSortType:dS,computedFilterType:Su,cssEllipsis:yu,headerCssEllipsis:sS,computedFilterValue:kr,computedFiltered:bu,computedFilterable:uS,computedGroupable:La,computedGroupedBy:Tu,computedGroupedByIndex:fS,computedWidth:gu,computedAbsoluteOffset:iS,computedPinningOffset:rS,computedVisibleIndexInCategory:Lr,computedOffset:F,computedSortable:mS,computedSortInfo:le,computedSortIndex:mu,computedMultiSort:g,computedSorted:_e,computedSortedAsc:$e,computedSortedDesc:po,computedVisibleIndex:Ne,computedPinned:bt,computedDraggable:T??B.defaultDraggable??b??ib,computedFirstInCategory:aS,computedLastInCategory:lS,computedFirst:he===0,computedLast:hu,id:oe,header:B.header??H.header??B.name??B.field};be&&(F+=gu,$.set(Ye.id,Ye),Y[he]=Ye,bt==="start"&&(ue.push(Ye),fe+=Ye.computedWidth),bt==="end"&&(U.push(Ye),me+=Ye.computedWidth),bt||(z.push(Ye),q+=Ye.computedWidth),ie=bt),Ye.groupByForColumn&&(Ye.computedSortType=B.sortType||H.sortType||ub(Ye.groupByForColumn,e,x),Re.push(Ye)),X.set(Ye.id,Ye),Ye.field&&!Ye.groupByForColumn&&!et.has(Ye.field)&&et.set(Ye.field,Ye)}),Re.forEach(B=>{B.computedSortable=Qc(B,{fieldsToColumn:et,userColumns:e,columnTypes:x,sortable:f,columnDefaultSortable:M})});let Xe=new Map;Ge.forEach(B=>{let oe=X.get(B);oe&&Xe.set(B,oe)}),X.forEach(B=>{Xe.has(B.id)||Xe.set(B.id,B)});let tt=c!=null?Math.min(c,fe):fe,Ze=d!=null?Math.min(d,me):me;return{computedRemainingSpace:t.width-(N+Ee+ge),computedPinnedStartColumnsWidth:fe,computedPinnedEndColumnsWidth:me,computedUnpinnedColumnsWidth:q,computedColumnOrder:K,computedPinnedStartColumns:ue,computedPinnedEndColumns:U,computedUnpinnedOffset:fe,computedPinnedEndOffset:fe+q,computedUnpinnedColumns:z,computedVisibleColumns:Y,computedColumnsMap:X,computedColumnsMapInInitialOrder:Xe,computedVisibleColumnsMap:$,computedPinnedEndWidth:Ze,computedPinnedStartWidth:tt,renderSelectionCheckBox:Y.reduce((B,oe)=>B||!!oe.renderSelectionCheckBox,!1),fieldsToColumn:et}};function Qc(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let s=r??Jr,u=o.sortType??o.colType.sortType;return u!=null&&u!==qt&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,h)=>{if(!g)return!1;let y=h.field||h.groupField,S;if(y){let T=n.get(y),b=T?f.getColumnApi(T.id):void 0;if(T&&b)S=b.isSortable();else{let R=ko(i,y);if(R){let C=fl(R,{colType:fn(R,a??{}),sortable:t,columnDefaultSortable:r});S=typeof C=="boolean"?C:void 0}else S=!1}}return S===void 0&&h.valueGetter&&(S=!0),S??r??Jr},!0)}}function ut(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function Vo(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:u}=e,c=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=c,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=ut(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:u});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:u,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}import*as Jc from"react";var mn=`${st}HeaderCell__filter`,ei=`${st}HeaderCell__filterOperator`,lE=`${mn}__input`;var ml=Jc.createContext(null);import{useContext as db}from"react";import{createContext as cb}from"react";var gl;function ti(){return gl||(gl=cb(null))}function ne(o){let e=ti(),t=db(e);return ln(t,o)}function He(){return ne(o=>({getState:o.getState,actions:o.actions,getComputed:o.getComputed,getDataSourceState:o.getDataSourceState,dataSourceApi:o.dataSourceApi,dataSourceActions:o.dataSourceActions,api:o.api,getDataSourceMasterContext:o.getDataSourceMasterContext}))}var fb=`${mn}__input`,oi=o=>o.stopPropagation();function td(o){let{filterOperatorMenuVisibleForColumnId:e}=ne(c=>({filterOperatorMenuVisibleForColumnId:c.state.filterOperatorMenuVisibleForColumnId})),{column:t}=ni(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=ed(!1),l=rt.useCallback(()=>{a(!0)},[]),s=rt.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return rt.createElement("div",{onPointerUp:oi,onPointerDown:oi,onFocus:l,onBlur:s,className:`${mn} ${ll({active:u})}`,style:{height:o.columnHeaderHeight}},rt.createElement(ml.Provider,{value:o},rt.createElement(r,null),rt.createElement(n,null)))}function od(){let{columnApi:o,disabled:e,operator:t}=Zn(),n=t?.components?.Icon??pn;return rt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:te(ei,Ac,e?`${ei}--disabled`:"")},rt.createElement(n,{size:20,className:`${_c({disabled:e})}`}))}function nd(){return rt.createElement("div",{onPointerUp:oi,onPointerDown:oi,className:`${mn} ${ll({active:!1})} ${Ju["50%"]}`})}function Zn(){let o=He(),{column:e,columnApi:t}=ni(),n=Vo(e,o,"column-filter"),r=rt.useContext(ml),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=ed(l?.filter.value??""),d=rt.useCallback(h=>{c(h),r.onChange(h)},[r.onChange]),p=rt.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=rt.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);pb(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==u&&c(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${Ec} ${fb}`}}function gn(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Zn();return hl.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function ri(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Zn();return hl.createElement("input",{"aria-label":o,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:n})}var Vt=(o,e)=>{let t=o?.[e];return t?{components:{Icon:t}}:{}};function rd(o={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Vt(n,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Vt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Vt(n,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Vt(n,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...Vt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Vt(n,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Vt(n,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Vt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Vt(n,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Vt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var zo=rd({StringFilterEditor:gn,NumberFilterEditor:ri,icons:{includes:dc,eq:fc,neq:Sc,startsWith:bc,endsWith:pc,gt:gc,gte:mc,lt:yc,lte:hc}});function ii(o,e,t,n){let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as Kd,useState as Bd}from"react";import{flushSync as Vb}from"react-dom";function yo(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function id(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var ee={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 ad="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)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},ld="column-header-height";var sd=`.${Le.rootClassName}`;function yl(o){return yo(o,sd)}var ud=J(ee.scrollLeft),mb=J(ee.scrollTop),gb=J(ee.columnWidthAtIndex),Sl=J(ee.columnOffsetAtIndex),cd=J(ee.columnReorderEffectDurationAtIndex),hb=J(ee.columnOffsetAtIndexWhileReordering),yb=J(ee.columnVisibilityAtIndex),Sb=J(ee.columnZIndexAtIndex);function Gt(o,e,t){let n=t?yl(t):document.querySelector(sd);bb(o,e,n)}function bb(o,e,t){if(t){let n=o,r=ee[n]?J(ee[n]):o;t.style.setProperty(r,`${e}`)}}function hn(o,e){if(e)for(var t in o){let n=ee[t]?J(ee[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function bl(o,e,t){Gt(`${Sl}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${ud}))`:`${o.computedAbsoluteOffset+e}px`,t)}function Tl(o,e,t){Gt(`${Sb}-${o}`,`${e}`,t)}function Qn(o,e,t){Gt(`${hb}-${o}`,typeof e=="number"?`calc( var(${Sl}-${o}) + ${e}px )`:e,t)}function Jn(o,e,t){Gt(`${yb}-${o}`,e,t)}function ai(o,e,t){Gt(`${cd}-${o}`,t??"",e)}function Cl(o,e){let t=`${cd}-${o}`;Gt(t,pe.components.Cell.reorderEffectDuration,e)}var Ie={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${gb}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Gt(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Sl}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Gt(this.varName.get(o),e,t)}}};function dd(o,e){hn({[ud]:`${o.scrollLeft}px`,[mb]:`${o.scrollTop}px`},e)}var pd="_16lm1iw1",fd="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",md="_1yeub2vs",gd="_1yeub2vr",hd=ye({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var Rl="_1yeub2vp";var rM=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});import{useMemo as Db}from"react";var er={bodyWidth:{name:J(pe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:J(pe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:J(pe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:J(pe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:J(pe.runtime.browserScrollbarWidth),value:""}},Tb=J(ee.scrollbarWidthHorizontal),yd=J(ee.scrollbarWidthVertical),Cb=J(ee.columnWidthAtIndex),Rb=J(ee.columnZIndexAtIndex),Sd=J(ee.scrollLeft),Ib=J(ee.activeCellColWidth),bd=J(ee.activeCellColOffset),Id=J(ee.baseZIndexForCells),wb=J(ee.pinnedStartWidth),Td=J(ee.bodyWidth),vb=J(ee.bodyHeight),Cd=J(ee.pinnedEndOffset),Rd=J(ee.pinnedEndWidth),Pb=J(ee.computedVisibleColumnsCount);function li(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${Id}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function wd(o){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:u,scrollbars:c}=o,d=zt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[Ie.columnWidths.varName.get(h)]=g.computedWidth+"px",m[Ie.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Sd}) )`:g.computedPinned==="end"?`calc( var(${Cd}) ${p.length?"+":""} ${p.map(S=>Ie.columnWidths.get(S.computedVisibleIndex)).join(" + ")} + var(${Sd}) )`:`${g.computedOffset}px`;let y=li(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${Rb}-${h}`]=`${y}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[er.browserScrollbarWidth.name]=`${zt()}px`),f[er.bodyWidth.name]=`calc(${ee.bodyWidth} - ${ee.scrollbarWidthVertical})`,f[er.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[er.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${Cb}-${g})`).join(" + ")})`,f[er.visibleColumnsCount.name]=e.length,s!=null){f[Ib]=Ie.columnWidths.get(s[1]);let m=Ie.columnOffsets.get(s[1]);if(u.isHorizontalLayoutBrain){let g=u.getPageIndexForRow(s[0]);f[bd]=g?`calc( ${pe.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[bd]=m}return f[Pb]=e.length,f[Tb]=c.horizontal?`${d}px`:"0px",f[yd]=c.vertical?`${d}px`:"0px",f[wb]="calc( "+t.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Rd]="calc( "+n.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Id]=e.length*10,f[Cd]=`calc( var(${Td}) - var(${Rd}) - var(${yd}) )`,f[Td]=`${l.width}px`,f[vb]=`${l.height}px`,f}var Il=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};function vd(o){let{actions:e,getState:t,focused:n,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:y,computedVisibleColumns:S,computedUnpinnedColumnsWidth:T,scrollbars:b,focusedClassName:R,focusedWithinClassName:C,computedPinnedStartOverflow:I,computedPinnedEndOverflow:P,focusedStyle:D,focusedWithinStyle:w,brain:M}=ne(O=>{let{state:K,computed:W}=O;return{brain:K.brain,actions:O.actions,getState:O.getState,focused:K.focused,focusedWithin:K.focusedWithin,domRef:K.domRef,scrollerDOMRef:K.scrollerDOMRef,onBlurWithin:K.onBlurWithin,onFocusWithin:K.onFocusWithin,onSelfFocus:K.onSelfFocus,onSelfBlur:K.onSelfBlur,bodySize:K.bodySize,activeCellIndex:K.activeCellIndex,wrapRowsHorizontally:K.wrapRowsHorizontally,computedPinnedStartColumnsWidth:W.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:W.computedPinnedEndColumnsWidth,computedPinnedStartColumns:W.computedPinnedStartColumns,computedPinnedEndColumns:W.computedPinnedEndColumns,computedVisibleColumns:W.computedVisibleColumns,computedUnpinnedColumnsWidth:W.computedUnpinnedColumnsWidth,scrollbars:W.scrollbars,focusedClassName:O.state.focusedClassName,focusedWithinClassName:O.state.focusedWithinClassName,computedPinnedStartOverflow:W.computedPinnedStartOverflow,computedPinnedEndOverflow:W.computedPinnedEndOverflow,focusedStyle:O.state.focusedStyle,focusedWithinStyle:O.state.focusedWithinStyle}}),E=Db(()=>wd({computedVisibleColumns:S,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:T,bodySize:d,activeCellIndex:p,brain:M,scrollbars:b}),[S,h,y,m,g,T,d,p,M,b]),x=Il(O=>{e.focused=O}),v=Il(O=>{e.focusedWithin=O}),F={...o,onFocus:O=>{if(o?.onFocus?.(O),O.target===i.current||O.target===a.current){if(t().focused)return;x(!0),u?.(O),r&&(v(!1),l?.(O));return}r||(v(!0),s?.(O))},onBlur:O=>{if(o?.onBlur?.(O),O.target===i.current||O.target===a.current){if(!t().focused)return;x(!1),c?.(O),r&&(v(!1),l?.(O));return}i.current?.contains(O.relatedTarget)||(v(!1),l?.(O))}},L=te(Xt,fd,f?`${Xt}--horizontal-layout`:null,F?.className,m?`${Xt}--has-pinned-start ${gd}`:null,g?`${Xt}--has-pinned-end ${md}`:null,n?`${Xt}--focused`:null,r?`${Xt}--focused-within`:null,n&&R?R:null,r&&C?C:null,I?`${Xt}--has-pinned-start-overflow`:null,P?`${Xt}--has-pinned-end-overflow`:null,hd({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:n,focusedWithin:r}));return F.className=L,F.style={...o?.style,...E},n&&D&&Object.assign(F.style,D),r&&w&&Object.assign(F.style,w),F}var Fd=rn(Go());function si(o){return o.map(e=>e instanceof So?e:new So(null,[e]))}var So=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>xb(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function xb(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var Eb=(...o)=>new So("+",si(o)),Dd=(...o)=>new So("-",si(o)),Mb=(...o)=>new So("*",si(o)),Ab=(...o)=>new So("/",si(o)),tr={add:Eb,subtract:Dd,minus:Dd,multiply:Mb,divide:Ab};var Ho=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var Ve=De().requestAnimationFrame||(o=>setTimeout(o,16)),Ot=De().cancelAnimationFrame||(o=>clearTimeout(o));var xd=o=>{let e=null,t=null;return{stop(){e!==null&&Ot(e),t!=null&&Ot(t)},scroll(n){e!==null&&Ot(e),t!=null&&Ot(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let 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 n.scrollLeft=n.scrollLeft-p,e=Ve(()=>{i.scroll(n)}),!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 n.scrollLeft=n.scrollLeft+p,t=Ve(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Be=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,n=e.left-this.left;return{top:t,left:n}}};function Ed(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Md(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function _b(o,e,t){let n=Ed(o,t),r=Ed(e,t);return n===r?Md(t,e)-Md(t,o):n-r}function Ad(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>_b(n,r,t)),e}function Ob(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function Fb(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=Ad(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function _d(o,e){if(Ob(o))return Fb(o,e);o=Ad(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(Nb([t,i,a],e))return!0}return!1}function Nb(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var yn=class{containsPoint(e){return _d(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Sn=class o extends yn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(Be.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function Lb(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,u=Math.max(l,s);return new we({top:n,left:t,width:a-t,height:u-n})}var we=class o extends yn{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=Lb(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new Sn(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(Be.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var Od=10,kb=J(ee.pinnedStartWidth);function Nd(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:h,horizontalLayoutPageIndex:y,pageWidth:S}=o;function T(z){let Y=z==="start"?L:O;return A===F?Y:F===z?Y+x.computedWidth:A===z?Y-x.computedWidth:Y}function b(z){if(z.columnIndex===v||y!=null)return!0;let Y=e[z.columnIndex];if(Y.computedPinned)return!0;let $=l.getScrollPosition().scrollLeft,X=Y.computedOffset+(y!=null&&S!=null?S*y:0);return X>=$+T("start")&&X+Y.computedWidth<=$+c.width-T("end")}let R=(z,Y)=>{let{restrictToParentGroup:$,dragColumn:X}=Y,q=[];if(z.forEach(me=>{if(me.computedVisibleIndex===v)return;let ie={columnId:me.id,columnIndex:me.computedVisibleIndex,offsetX:me.computedOffset+Math.round(me.computedWidth/2)};b(ie)&&q.push(ie)}),$){let ie=function(N,ge,Ee){let Ce=z[N];Ce&&(Ce.columnGroup!==X.columnGroup&&Ee.add(Ce.id),ie(N+ge,ge,Ee))};var fe=ie;let me=X.computedVisibleIndex,G=new Set;ie(me-1,-1,G),ie(me+1,1,G),q=q.filter(N=>!G.has(N.columnId))}return q},I=r.length,P={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},D={left:P.clientX-c.left-(P.clientX-s.left)+Od,top:P.clientY-c.top-(P.clientY-s.top)+Od},w=l.getScrollPosition(),M=e.map(z=>z.computedVisibleIndex),E=M,x=t.get(i),v=x.computedVisibleIndex,A=x?.computedPinned,_=v,F=A,L=l.getFixedStartColsWidth(),O=l.getFixedEndColsWidth(),K=P,W={x:0,y:0},k=1,Q=0;function V(z){let Y=Math.round(z.clientX),$=Math.round(z.clientY);if(Y===K.clientX&&$===K.clientY)return we.from(s).shift({left:W.x,top:W.y});K={clientX:Y,clientY:$};let q=l.getScrollPosition().scrollLeft-w.scrollLeft;return W.x=K.clientX-P.clientX,W.y=K.clientY-P.clientY,Q=W.x+q,k=Q<0?-1:1,f({left:D.left+W.x,top:D.top+W.y}),we.from(s).shift({left:W.x,top:W.y})}function j(z){let Y=0;A?A==="start"&&z.forEach(($,X)=>{Y||e[$]?.computedPinned!=="start"&&(Y=X)}):z.forEach(($,X)=>{e[$]?.computedPinned==="start"&&(Y=X+1)}),I=Y,re("start",z,Y)}function re(z,Y,$){if(z==="start"){let X=0;for(let q=0;q<$;q++){let fe=Y[q],me=e[fe];X+=me.computedWidth}Gt(kb,`${X}px`,a)}}function de(z){if(z==null||z===_)return;if(_===-1&&z!==-1&&(Jn(v,"",a),m(!1)),_=z,z===-1){se(v);return}let Y=Ho(M,v,_>v?_-1:_);I=0;let X=new Set;return Y.forEach((q,fe)=>{let me=E[fe];q!==me&&X.add(q),j(Y)}),E=Y,ae(X),{newColumnIndexes:Y,indexesWithTransition:X,pinnedStartCount:I}}function se(z){E=E.filter($=>$!==z),e.forEach($=>{let X=$.computedVisibleIndex,q=X>z;Cl(X,a);let fe="";q&&(fe=tr.minus(Ie.columnOffsets.get(X),Ie.columnWidths.get(z)).done()),Qn(X,fe,a)}),Jn(z,"hidden",a),m(!0)}function ae(z){e.forEach(Y=>{let $=Y.computedVisibleIndex;z.has($)?Cl($,a):ai($,a);let X=$===v,q=k===-1?$<_||$>v:$<v||$>=_,fe="";k===-1?fe=X?Ie.columnOffsets.get(_):q?Ie.columnOffsets.get($):tr.add(Ie.columnOffsets.get($),Ie.columnWidths.get(v)).done():fe=q?Ie.columnOffsets.get($):X?tr.add(Ie.columnOffsets.get(_-1),Ie.columnWidths.get(_-1)).minus(Ie.columnWidths.get(v)).done():tr.minus(Ie.columnOffsets.get($),Ie.columnWidths.get(v)).done(),Qn($,fe,a)})}let ce=c.left+T("start"),ue=c.right-T("end"),U=xd({scrollOffsetStart:ce,scrollOffsetEnd:ue});return V(P),{speedScroller:U,stop(){U.stop()},onMove(z){let Y=V(z);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(Y.getCenter()))return p&&de(-1),null;U.scroll({mousePosition:K,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ie){h.scrollLeft=ie}});let $=R(e,{dragColumn:x,restrictToParentGroup:u==="group"}),X=k===-1?x.computedOffset+Q:x.computedOffset+x.computedWidth+Q,q=(0,Fd.default)($,X,({offsetX:ie},G)=>ie<G?-1:ie>G?1:0);q<0&&(q=~q),$.length?q=$[q]?$[q].columnIndex:$[$.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),q=0),q===v+1&&(q=v),de(q);let fe={};n.forEach(ie=>{fe[ie.id]="end"});for(let ie=0;ie<I;ie++){let G=E[ie],N=e[G];fe[N.id]="start"}let me=E.map(ie=>e[ie].id);return{columnPinning:fe,columnOrder:me}}}}function wl(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return n;if(a>i){let l=e.indexOf(r),s=e[l-1],u=n.indexOf(s),c=n.indexOf(r);return Ho(n,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=n.indexOf(s),c=n.indexOf(r);return Ho(n,c,u)}return e}import*as ht from"react";var Ko=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var Ld=rn(Go());var kd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:u,dragIndex:c,dragRectangle:d}=n,p=u===a,f=Be.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,y=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),S=(0,Ld.default)(h,y,(I,P)=>I-P);S<0&&(S=~S),m===1&&S===c+1&&p&&S--;let T=Math.min(c,S),b=Math.max(c,S),R=p?i.map((I,P)=>{if(P===c&&p)return t;if(P<T||P>=b)return{left:0,top:0};let D=S<=P?1:-1;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}):i.map((I,P)=>{let D=S<=P?1:0;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}),C={offset:t,dropIndex:S,dragSourceListId:u,dropTargetListId:a,dragIndex:c,outside:!1,items:i,dragItem:s,offsetsForItems:R,dragRect:g,status:"accepted"};return e.acceptsDrop(C)?{event:C,error:null,success:!0}:(C.status="rejected",{event:C,error:"rejected by interaction target",success:!1})},zd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:u,listId:c}=n,d=Be.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?n.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((y,S)=>y.id===u.id?t:f?{left:0,top:0}:S>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-u.rect.width,top:0}:{left:0,top:-u.rect.height}:{left:0,top:0}):l.map(y=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var ve=class ve{static startDrag(e,t){let n=e instanceof bn?e:new bn(e),r=new vl({activeDragSource:n,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){if(ve.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return ve.dragInteractionTargetsMap.set(e.listId,e),ve.emit("register",e),()=>{ve.unregisterDragInteractionTarget(e)}}static unregisterAll(){ve.dragInteractionTargetsMap.forEach(e=>{ve.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!ve.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}ve.dragInteractionTargetsMap.delete(e.listId),e.unregister(),ve.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=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?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),ve.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=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=kd(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=zd(e,s);u&&t(s,u)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,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:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];ve.withDragMove(e,(s,{event:u})=>{s.drop(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null;ve.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),ve.currentDragOperation=null,ve.unregisterAll()}};ve.dragInteractionTargetsMap=new Map,ve.currentDragOperation=null,ve.emitter=new Ko;var gt=ve,bn=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){mt(this.data,e)||(this.data=e,this.dragRectangle=new we(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=we.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},vl=class extends Ko{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=bn.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=bn.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=gt;import{useEffect as zb}from"react";var Vd=ht.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),bo=()=>ht.useContext(Vd),Pl=o=>{let[e,t]=ht.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=ht.useRef(e);n.current=e;let r=ht.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=ht.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return zb(()=>{let a=gt.on("drag-start",u=>{t({dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:"accepted"})}),l=gt.on("drag-move",u=>{let c=n.current,d={dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:u.status};JSON.stringify(c)!==JSON.stringify(d)&&t(d)}),s=gt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[gt,t]),ht.createElement(Vd.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var Dl=`${st}Body`,Gd=o=>o.querySelector(`.${Dl}`);var Bo=`${st}HeaderCell`,xl=`${st}HeaderWrapper`,Hd=o=>Array.from(o.querySelectorAll(`.${xl}`));function or(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var Gb=J(ee.baseZIndexForCells),Hb=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:mt(o,e)},Wd=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=Bd(null),[a,l]=Bd(!1),{getCurrentDragSourceAndTarget:s}=bo(),{getComputed:u,getState:c,api:d,computedDraggable:p,rootRef:f,actions:m}=ne(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(o)?.computedDraggable,rootRef:y.state.domRef})),g=Kd(y=>{let S=u().computedVisibleColumnsMap.get(o);if(!S||!S.computedSortable)return;let{multiSortBehavior:T}=c();d.toggleSortingForColumn(o,{multiSortBehavior:T==="replace"&&(y.ctrlKey||y.metaKey)?"append":T})},[]),h=Kd(y=>{if(or(y.target))return;let{brain:S,draggableColumnsRestrictTo:T}=c(),{computedVisibleColumns:b,computedVisibleColumnsMap:R,computedPinnedStartColumns:C,computedUnpinnedColumns:I,computedPinnedEndColumns:P}=u(),D=R.get(o);if(!D.computedDraggable){g(y);return}let w=e.current,M=w.getBoundingClientRect(),E=f.current.getBoundingClientRect(),x=S.getAvailableSize(),v=D.computedVisibleIndex,A=S.getVirtualColIndex(D.computedVisibleIndex,{pageIndex:t||0}),_=S.isHorizontalLayoutBrain?S.getPageWidth():null,F=w.style.cursor??"auto",L=!1,O=f.current,K=we.from(Gd(O).getBoundingClientRect()),W=Hd(O).map(ce=>we.from(ce.getBoundingClientRect())),k=K.getMinimumBoundingRectangle(...W),Q=Nd({brain:S,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:_,draggableColumnsRestrictTo:T,computedPinnedEndColumns:P,computedPinnedStartColumns:C,computedUnpinnedColumns:I,computedVisibleColumns:b,computedVisibleColumnsMap:R,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:f.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:E,acceptDropToReorderRect:k,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),V=null,j,re;function de(ce){let{columnPinning:ue,columnOrder:U}=ce;Hb(c().columnPinning,ue)||(m.columnPinning=ue);let z=u().computedColumnOrder;JSON.stringify(U,z)&&(m.columnOrder=wl({newColumnOrder:U,visibleColumnOrder:u().computedVisibleColumns.map(Y=>Y.id),existingColumnOrder:z,dragColumnId:o}))}let se=ce=>{let{headerBrain:ue,brain:U}=c();if(!L){L=!0;let z=U.keepColumnRendered(A),Y=ue.keepColumnRendered(A);if(U.isHorizontalLayoutBrain){let X=U.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),q=ue.extendRenderRange({start:!0,end:!0,direction:"horizontal"});re=()=>{X(),q()}}j=()=>{z(),Y()},m.columnReorderDragColumnId=D.id,t!=null&&(m.columnReorderInPageIndex=t),Tl(v,`calc( var(${Gb}) + 10000 )`,f.current),f.current?.classList.add(Rl),w.style.cursor="grabbing"}V=Q.onMove(ce)},ae=ce=>{let ue=ce.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:U}=c(),z=f.current;z?.classList.remove(Rl),Q.stop(),S.update({...x}),j?.(),re?.(),w.style.cursor=F,w.hasPointerCapture?.(ue)&&w.releasePointerCapture(ue),w.removeEventListener("pointermove",se),w.removeEventListener("pointerup",ae),i(null);let Y=d.getColumnApi(D.id)?.isSortable()??!1;!L&&Y&&d.toggleSortingForColumn(D.id,{multiSortBehavior:U==="replace"&&(ce.ctrlKey||ce.metaKey)?"append":U}),Vb(()=>{V?de(V):L&&n&&d.setVisibilityForColumn(D.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),b.forEach($=>{ai($.computedVisibleIndex,z),Jn($.computedVisibleIndex,"",z),Qn($.computedVisibleIndex,"",z)}),Tl(v,li(D,{pinnedStartColsCount:C.length,visibleColsCount:b.length}),z)})};w.addEventListener("pointermove",se),w.addEventListener("pointerup",ae),w.setPointerCapture(y.pointerId)},[o,t]);return{onPointerDown:p?h:g,dragColumnOutside:a,proxyPosition:r}};import*as vn from"react";import*as Te from"react";import{useCallback as at,useContext as fT,useEffect as mT,useMemo as gT,useReducer as hT,useSyncExternalStore as yT}from"react";var Ud=Symbol("REPAINT_CELLS_KEY_NO_ROW");function $d(o){return typeof o=="function"}function jd(o,e){let{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(n);if(!a)return Ud;let l=r.getDataSourceStates();return o({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function Yd(o,e,t){let n=jd(o,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=jd(o,e);r!==Ud&&(Object.is(r,n)||(n=r,t()))})}var qd="_1eexc2a7 _1eexc2a6",Xd=ye({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),Zd=ye({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Qd="_1eexc2a5",ui=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Tn="_1eexc2a8";import*as ci from"react";import{useEffect as Kb,useRef as Bb}from"react";var Jd="qz8ht90 _16lm1iwk";function Wb(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:jb}=Mt({forwardProps:Wb,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function Ub(){let{componentState:o,componentActions:e}=At(),{checked:t,domProps:n,disabled:r}=o,i=Bb(null);return Kb(()=>{i.current.indeterminate=t==null},[t]),ci.createElement("input",{...n,className:te("InfiniteCheckBox",Jd,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function To(o){return ci.createElement(jb,{...o},ci.createElement(Ub,null))}var $b="*",We=class{constructor(e){this.wildcard=$b;this.cache=new Z;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let 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),n)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,n){if(n){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(n){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(n){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,n=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),n&&n.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let n=this.selectedRowsToColumns.get(e);if(n){if(n.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>n.has(r)):!1}return!1}error(e){fo(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),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((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function Co(o,e){return e().dataArray[o]}function di(o){return o().dataArray}var ct=class{constructor(e){this.collapsedPathsMap=new Z;this.expandedPathsMap=new Z;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:n,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?n.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?n.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var El=o=>Array.isArray(o)?new Z(o.map(e=>[e,!0])):o,Yb=(o,e)=>o.length-e.length,Qe=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new Z;this.cache=new Z;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?e.config:{treePaths:new Z})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?El(e):this.config.treePaths}withTreePaths(e,t){let n=this.config.treePaths;t=this.getTreePaths(t);let r=t!==n;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=n,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],n){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},n)}getSelectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&n.push(i.keys)})},t),n}getDeselectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||n.push(i.keys)})},t),n}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new o(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:El(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?El(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:n,treePaths:r}=this.config;return t!=="visible"||!n||n===r?!1:n.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:n,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{n.getAllChildrenSizeFor(i)>0||(this.selectionMap.delete(i),this.isNodeSelected(i)!==t&&this.setSelectionForPath(i,t))}),this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let n=this.cache.get(e);if(n)return n;if(this.isLeafNode(e)!==!1){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(Yb);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:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.hasFilteredOutLeavesInside(e)){this.setVisibleLeafNodesSelection(e,t);return}if(this.xcache(),this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function Rn(o,e){return new Qe(o,Cn(e))}function Cn(o){return()=>{let e=typeof o=="function"?o():o,{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}:{treePaths:n??t,multiRowSelectionTarget:r}}}var pi=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Qe))throw"Invalid tree selection";let a=new Qe(r,Cn(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!n)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new ct({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ct({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ct(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ct(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new ct(n.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?Co(n,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Qe))throw"Invalid node selection";let n=new Qe(e,Cn(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Qe))throw"Invalid node selection";let n=new Qe(e,Cn(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Qe))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};function Ml(o){return o.map(Ht)}function Ht(o){if(De().structuredClone)return De().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Ml(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Ml(Array.from(o)));if(o instanceof Map)return new Map(Ml(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Ht(o[t]));return e}function nr(o){return o}var fi="____not_loaded_yet____";function Al(o){return typeof o=="string"&&o.startsWith(fi)}var Wo=Object.seal({data:null,field:null});var yt="____root____";function Ro(){return!1}function _l(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function mi(o,e,t,n,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function tp(o,e){let{marker:t,reducers:n={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:u}=o;t&&t.start();let c=new Z;function d(y,S,T,b=0,R=[]){let C=!T.length||b===T.length-1,I=S[u?.values||"values"]||{};for(let P in I)if(I.hasOwnProperty(P)){let D=P;R.push(D),p.set(R,!0),y.set(R,{reducerResults:I[P][u?.totals||"totals"]||{},items:[]}),C||d(y,I[P],T,b+1,R),R.pop()}}let p=r?new Z:void 0,f=[],m=_l(n),g=Ht(m);e.visitDepthFirst((y,S,T,b)=>{let[R,...C]=S,I=y.children,P=c.get(C);if(P&&(P.cache=y.cache,P.childrenLoading=y.childrenLoading,P.childrenAvailable=y.childrenAvailable,P.error=y.error),C.length==i.length&&i.length){if(P){P.items=I;for(let w=0,M=C.length;w<M;w++){let E=C.slice(0,w),x=c.get(E);x&&(x.items=x.items||[],x.items=x.items.concat(I))}I=a.indexArray(I,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return b?.()}for(let D=0,w=I.length;D<w;D++){if(!I[D]){let v={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...C,`${fi}${D}`],v);continue}let M=I[D].data,E=I[D].keys||[];if(E.length){let v=E[E.length-1];C.push(v)}let x={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:M,totalChildrenCount:I[D].totalChildrenCount,totalChildrenCountUnfiltered:I[D].totalChildrenCountUnfiltered,reducerResults:I[D].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(C,x),r){let v=x.pivotDeepMap=new Z,A=I[D].pivot;d(v,A,r,0,f)}E.length&&C.pop()}b?.()});let h={deepMap:c,groupParams:o,initialData:e,reducerResults:g};return r&&(h.topLevelPivotColumns=p,h.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(y=>y.field).join(", ")}]}),h}function ep(o,e,t,n,r,i,a,l,s,u=nr){let{items:c,reducerResults:d,pivotDeepMap:p}=o.get(e);if(c.push(n),a&&mi(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:y}=i[f],S=g?n[g]:null;h&&(Wo.data=n,Wo.field=g,S=h(Wo));let T=(y||u)(S,n);t.push(T),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Ht(s),items:[]}));let{reducerResults:b,items:R}=p.get(t);R.push(n),a&&mi(n,r,a,b,e)}t.length=0}}function op(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=o,d=c(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let y=0,S=n.length;y<=S;y++){let T=n.slice(0,y),b=e.get(T),{reducerResults:R,items:C}=b;C.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&mi(r,i,a,R,T)}return}let m=Ht(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let h=u(r);if(!(!h||!Array.isArray(h))){for(let y=0,S=h.length;y<S;y++){let T=h[y];op(o,e,t,p,T,y,a,l)}a&&rr(a,m,g)}}function Ol(o,e){let{reducers:t,marker:n}=o;if(n){let u=Object.keys(t??{});n.start({details:u.length>0?[{name:"Reducers",value:u.join(", ")}]:void 0})}let r=_l(t),i=Ht(r),a=new Z,l=new Z;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let u=0,c=e.length;u<c;u++)op(o,a,l,[],e[u],u,t,r);t&&rr(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function Fl(o,e){let{marker:t,groupBy:n,defaultToKey:r=nr,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new Z:void 0,u=new Z,c=[],d=[],p=_l(a),f=Ht(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(p)};i&&(g.pivotDeepMap=new Z),u.set(c,g)}for(let g=0,h=e.length;g<h;g++){let y=e[g],S={};for(let T=0;T<l;T++){let{field:b,groupField:R,valueGetter:C,toKey:I}=n[T],P=b?y[b]:null;C&&(Wo.data=y,Wo.field=b,P=C(Wo));let D=(I||r)(P,y);if(S[b||R]=D,c.push(D),!u.has(c)){let w={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...S},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(p)};i&&(w.pivotDeepMap=new Z),u.set(c,w)}ep(u,c,d,y,g,i,a,s,p,r)}l||ep(u,c,d,y,g,i,a,s,p,r),a&&mi(y,g,a,f,c),c.length=0}a&&(u.visitDepthFirst((g,h,y,S)=>{rr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:b},R,C,I)=>{rr(a,b,T),I?.()}),S?.()}),rr(a,f,e));let m={deepMap:u,groupParams:o,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:n.map(g=>g.field).join(", ")}]}),m}function qb(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function Xb(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.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 S in i)if(i.hasOwnProperty(S)){let b=i[S].field;b&&(f[b]=u[S]),b&&p[b]==null&&(p[b]=u[S])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let S=t[n.length-1];S&&S.field&&(h=p[S.field]),S&&S.toKey&&(h=S.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(fi)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Ro,hasSelectedCells:Ro,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function gi(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function rr(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function np(o,e,t,n,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:y}=r,{deepMap:S}=c,T=o.length,b=t[t.length-1],R=b?b.nodeExpanded:!0;for(let C=0;C<T;C++){let I=o[C],P=u(I,C),D=[...e,P];if(l(I)){let _={id:P,nodePath:D,isGroupRow:!1,data:I,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Ro,hasSelectedCells:Ro,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,C],indexInParent:C,indexInAll:R?i.length:-1};p&&(_.rowSelected=p(_)),d&&(_.rowDisabled=d(_)),f&&f(_);let F=h&&y!=null&&y>0&&_.indexInAll%y===0?_.indexInAll/y:null;for(let L=0,O=t.length;L<O;L++){let K=t[L];if(R||(K.collapsedLeafNodesCount+=1),K.deepRowInfoArray.push(_),F!=null&&R){if(typeof h=="function"&&h(K)!==!0)continue;let W=gi(K,_.indexInAll,F);i[W.indexInAll]=W,_.indexInAll++}}R&&(i[_.indexInAll]=_);continue}let E=S.get(D)?.totalLeafNodesCount??0,x={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:D,id:P,data:I,indexInAll:i.length,indexInParent:C,indexInParentNodes:[...n,C],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Ro,hasSelectedCells:Ro,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(x.rowSelected=p(x),g)){let _=g.getSelectionCountFor(x.nodePath);x.selectedLeafNodesCount=_.selectedCount,x.deselectedLeafNodesCount=_.deselectedCount}d&&(x.rowDisabled=d(x)),f&&f(x);let v=!0;if(m&&(x.selfExpanded=v=m(x)),R||(v=!1),x.nodeExpanded=v,R&&h&&y!=null&&y>0){let _=x.indexInAll,F=x.parentNodes;if(F.length>0&&_%y===0){let L=_/y,O=0;F.forEach(K=>{typeof h=="function"&&h(K)!==!0||(i.push(gi(K,_+O,L)),O++,x.indexInAll++)})}}R&&(i[x.indexInAll]=x);let A=s(I);Array.isArray(A)&&np(A,D,[...t,x],x.indexInParentNodes,r,i)}return i}function rp(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return np(e,[],[],[],o,n),t&&t.end(),{data:n}}function ip(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:u,isRowSelected:c,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:h}=n,{groupBy:y}=m;e&&e.start({details:[{name:"Group by fields",value:y.map(C=>C.field).join(", ")}]});let S=[],T=[],b=[],R=[];return g.visitDepthFirst((C,I,P,D)=>{let w=C.items,M=I.length,E=s?.isGroupRowCollapsed(I)??!1;R.push(P);let x=Xb({lazyLoad:t,groupBy:y,parents:Array.from(b),reducers:f,indexInGroup:P,indexInParentGroups:Array.from(R),indexInAll:S.length,groupKeys:I,error:C.error,totalChildrenCount:C.totalChildrenCount,childrenLoading:(C.childrenLoading||!E&&!C.childrenAvailable)&&t,childrenAvailable:C.childrenAvailable,directChildrenCount:I.length===y.length?C.items.length:g.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},C);if(c&&(x.rowSelected=c(x),d)){let L=d.getSelectionCountFor(x.groupKeys);x.selectedChildredCount=L.selectedCount,x.deselectedChildredCount=L.deselectedCount}u&&(x.rowDisabled=u(x));let v=b[b.length-1],A=v?.collapsed??!1;A&&(E=!0),x.collapsed=E;let _=p||E;if(A&&(_=!1),_){if(i&&r!=null&&r>0){let L=x.indexInAll,O=x.parents;if(O.length>0&&L%r===0){let K=L/r,W=0;O.forEach(k=>{typeof i=="function"&&i(k)!==!0||(S.push(gi(k,L+W,K)),W++,x.indexInAll++)})}}S.push(x),T.push(S.length-1)}x.collapsedChildrenCount=0,b.forEach(L=>{L.deepRowInfoArray.push(x),L.collapsedGroupsCount+=E?1:0}),v&&x.selfLoaded&&t&&(v.directChildrenLoadedCount+=1),a&&a(x),b.push(x);let F=!0;if(F){if(D)D();else if(!h){let L=S.length;E||(S.length+=w.length);let O=0;for(let K=0,W=w.length;K<W;K++){let k=w[K];if(!E&&i&&r!=null&&r>0){let re=L+K+O;if(re%r===0){let de=re/r;b.forEach(se=>{if(typeof i=="function"&&i(se)!==!0)return;let ae=L+K+O;S[ae]=gi(se,ae,de),O++,S.length++})}}let Q=L+K+O,j={id:k?l(k,Q):`${I}-${K}`,data:k,isCellSelected:Ro,hasSelectedCells:Ro,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!k,rowSelected:!1,rowDisabled:!1,rootGroupBy:y,collapsed:E,groupKeys:I,parents:Array.from(b),indexInParentGroups:[...R,K],indexInGroup:K,indexInAll:Q,groupBy:y,groupNesting:M+1,groupCount:x.groupCount};c&&(j.rowSelected=c(j)),u&&(j.rowDisabled=u(j)),a&&a(j),b.forEach((re,de)=>{de===b.length-1&&k&&(re.directChildrenLoadedCount+=1),E&&(re.collapsedChildrenCount+=1),re.deepRowInfoArray.push(j)}),E||(S[L+K+O]=j)}}}b.pop(),R.pop()}),e&&e.end(),{data:S,groupRowsIndexes:T}}function Io(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||nr)(l,o);return t.push(s),t},[])}var Zb=new Z,ap=new WeakMap;function hi(o){let{originalDataArray:e,groupBy:t,toPrimaryKey:n}=o;if(!e||!t.length)return Zb;let r=ap.get(e);if(r&&r.groupBy===t)return r.groups;let i=new Z,a=t.length,l=[];return e.forEach(s=>{let u=Io(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(n(s))}}),ap.set(e,{groupBy:t,groups:i}),i}function Qb(o,e){let t=[];return o.getLeafNodesStartingWith(e,n=>{let r=n.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var Me=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new Z;this.deselectedMap=new Z;this.onlyUsePrimaryKeys=!1;this.selectionCache=new Z;this.selectionCountCache=new Z;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Io(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e==="visible"&&!!t}targetsFilteredOutRows(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e!=="visible"&&!!t}getVisibleDataInsideGroup(e){let{postFilterDataArray:t,groupDeepMap:n}=this.getConfig();return e.length?n?.get(e)?.items??[]:t??[]}hasFilteredOutRowsInsideGroup(e){let t=this.getConfig();return t.someRowsFilteredOut?(e.length?hi(t).get(e)?.count??0:t.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(e).length:!1}setVisibleRowsSelection(e,t){let{groupBy:n,toPrimaryKey:r}=this.getConfig(),i=t?this.selectedMap:this.deselectedMap,a=t?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(e).forEach(l=>{let s=Io(l,n),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:n}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(n?.get(i)?.totalChildrenCount||0)}),Math.max(t-r,0)}getLazyEntries(){let e=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==e){let t=new Z;this.selectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new Z;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let n=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,n??null),n}computeLazyRowCount(e){let t=this.getConfig(),n=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!n)return t.totalCount;let i=e.length?t.groupDeepMap?.get(e):void 0,a=e.length?i?.totalChildrenCount:t.lazyGroupedRowCount;if(a!=null)return a;if(e.length===n)return i?.childrenAvailable?i.items.length:void 0;let l=t.groupDeepMap?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((s,u)=>s+(Al(u[u.length-1])?1:this.getLazyRowCount(u)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new Z;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let n=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,n),n}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),n=e.length?t?.get(e):void 0;return e.length&&!n?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!Al(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new Z;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:n,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?n?.get(e):void 0,s=l?l.items:r??[],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(),n=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>n?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getLazyEntries(),i=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,s=0;r.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0,respectOrder:!1}).forEach(p=>{if(!a&&this.isLazyEntryFilteredOut(p))return;let f=r.get(p);if(p.length>=i){f?l++:s++;return}let m=this.getLazySelectionCountFor(p,f);l+=m.selectedCount,s+=m.deselectedCount});let 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 hi(this.getConfig()).get(e)?.count??0;let n=this.getGroupDeepMap()?.get(e);return n?this.getLazyUnfilteredCount(e)??n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),n={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?hi(t).getKeysStartingWith(e,n):t.groupDeepMap?.getKeysStartingWith(e,n)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:n,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?Qb(hi(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(n?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=n?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys||i===0&&a.length===1?a[0]:a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!0);return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)}),this.xcache()}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!1);return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)}),this.xcache()}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let 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 In(o,e){return new Me(o,it(e))}function it(o){return()=>{let e=typeof o=="function"?o():o,{originalDataArray:t,postFilterDataArray:n}=e,r=!!e.lazyLoad,i=r?e.originalLazyGroupData.get([yt]):void 0;return{lazyLoad:r,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:r?t?.length??0:e.unfilteredCount,lazyGroupedRowCount:e.groupBy.length?i?.totalChildrenCount:void 0,lazyUnfilteredCount:e.groupBy.length?i?.totalChildrenCountUnfiltered:i?.totalCountUnfiltered,multiRowSelectionTarget:e.multiRowSelectionTarget,someRowsFilteredOut:!e.lazyLoad&&!!t&&!!n&&n.length<t.length,originalDataArray:t,postFilterDataArray:n}}}function lp(o){let{getDataSourceState:e,dataSourceActions:t}=o;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Me))throw"Invalid row selection";let a=new Me(r,it(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 Me))throw"Invalid row selection";let a=new Me(r,it(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 Me))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?Io(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 Me))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Io(d,u):[]}let c=new Me(a,it(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 Me))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Io(d,u):[]}let c=new Me(l,it(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 Me))throw"Invalid row selection";let s=new Me(a,it(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 Me))throw"Invalid row selection";let s=new Me(a,it(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 Me))throw"Invalid row selection";let s=new Me(a,it(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Me(i,it(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Me))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Me(r,it(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 sp(o,e){yi(o,e),eT(o,e),e.detail===2&&Jb(o,e),o.getState().onCellClick?.(o,e)}function Jb(o,e){if(or(e.target))return;let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function eT(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,y=new We(c);y.debugId=m??"",d.cellSelectionState=y;let S={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(S);else if(e.shiftKey){let T=!!n().wrapRowsHorizontally;d.multiSelectClick(S,T?{horizontalLayout:T,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:T})}else d.resetClick(S);l.cellSelection=y}function tT(o){return o.getState().multiRowSelectionWith!=="click"&&o.getComputed().renderSelectionCheckBox?"checkbox":"click"}function oT(o){return o?or(o)?!0:typeof o.closest!="function"?!1:!!o.closest(`.${Tn}, [data-name="expand-collapse-icon"]`):!1}function yi(o,e,t=e.key?"keyboard":"click"){let{rowIndex:n,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:u,cloneTreeSelection:c}=o,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&oT(e.target))return!1;let h=m[n];if(!h||h.rowDisabled)return!1;if(g){if(!h.isTreeNode||!h.nodePath)return!1;let{isNodeSelectable:y}=p;if(y&&!y(h))return!1}if(f==="multi-row"){let y=tT(o);if(t==="click"&&y==="checkbox")return!1;let S=t==="checkbox"||t==="keyboard"&&y==="checkbox",T=()=>{e.shiftKey?d.multiSelectClick(n):S||e.metaKey||e.ctrlKey?d.singleAddClick(n):d.resetClick(n)};if(g){let{treeSelectionState:R}=p;if(!(R instanceof Qe))return!1;let C=c(R);d.treeSelectionState=C,T(),d.treeSelectionState=void 0;let I=!e.shiftKey&&(S||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=I?{nodePath:h.nodePath,selected:!!C.isNodeSelected(h.nodePath)}:null),a.treeSelection=C,!0}let{rowSelection:b}=p;return!b||typeof b!="object"?!1:(b=u(b),d.rowSelectionState=b,T(),a.rowSelection=b,!0)}else if(f==="single-row"){if(h.isGroupRow)return!1;let y=e.metaKey||e.ctrlKey||t!=="click";if(g){let{treeApi:T}=l;return y?T.toggleNodeSelection(h.nodePath):T.selectNode(h.nodePath),!0}let S=h.id;return y?s.rowSelectionApi.toggleRowSelection(S):s.rowSelectionApi.selectRow(S),!0}return!1}function up(o,e){let{getComputed:t,dataSourceActions:n,dataSourceApi:r}=o,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=o.getDataSourceState;return yi({rowIndex:e,api:o,getComputed:t,getState:o.getState,getDataSourceState:l,dataSourceActions:n,dataSourceApi:r,cloneRowSelection:s=>In(s,l),cloneTreeSelection:s=>Rn(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}import*as ir from"react";import{useState as nT}from"react";var cp="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",dp=ye({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 pp="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",Y1=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Si=`${Tt}-expand-collapse`;function jo(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=nT(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),ho("expanded",o)||i(!r)};ir.useEffect(()=>{ho("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return ir.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:te(o.className,cp,dp({direction:t||"start",expanded:r,disabled:n}),`${Tt}`,`${Si}`,`${Si}--${l}`,`${Si}--${t==="end"?"end":"start"}`,n?`${Si}--disabled`:"")},ir.createElement("path",{d:pp}))}function fp(o){return typeof o.field=="string"}function mp(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?n.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=n.get(e.field))}return r}function Kt(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",y=!g||typeof g=="function"&&!g(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:S,formattedValueContext:{rawValue:T}}=wn({column:p,rowInfo:u,rowDetailState:y,columnsMap:e().computedColumnsMap,context:o}),b=ut(p.id,o);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:S,rawValue:T}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:y,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:S,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:y,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:S,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:y,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:S,rawValue:T}}function gp(o){return yp(o.column,o.rowInfo)}function hp(o){let{column:e,context:t,rowInfo:n,visibleColumnIds:r}=o,i=mp({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=wn(o),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit: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:rT({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function rT(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=o,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,y=p(),{selectionMode:S,cellSelection:T}=y,b=mp({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),R=d.toggleGroupRow,C=T?.isCellSelected(n.id,e.id)??!1,I={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:C,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...u,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:b,selectionMode:S,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:h,toggleGroupRow:R,toggleCurrentGroupRow:()=>{n.isGroupRow&&R(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:y.groupBy,pivotBy:y.pivotBy};return Object.defineProperty(I,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),I}function iT(o,e){if(!o.isGroupRow)return;let t=o.groupData;if(!t.length)return;let n=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==n)return;return n}function yp(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:fp(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),a===void 0&&e.isGroupRow&&o.groupByForColumn&&fp(o)&&(a=iT(e,o.field)),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function aT(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.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:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}}function wn(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=yp(e,t),a=aT(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Sp=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),bp="_7pupv00",Tp=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Cp}=Le,Zt=`${Cp}Cell`,ar=`${Cp}Cell_content`;var{rootClassName:lT}=Le,Bt=`${lT}ColumnCell`;var sT=J(ee.columnZIndexAtIndex),uT=J(ee.columnVisibilityAtIndex);function Rp({rowInfo:o,column:e}){let t=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=e?.groupByForColumn,r=o.groupBy[o.groupBy.length-1],i=!!o.pivotValuesMap,a=i&&!!e?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;t=a||l?o.groupNesting:o.groupNesting-1}else t=o.groupNesting;return{[J(pe.components.Row.groupNesting)]:t}}function Ip({rowInfo:o}){return{[J(pe.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function Nl(o,e){return o?typeof o=="function"?o(e):o:void 0}function Ll(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function wp(o){let{column:e,rowInfo:t,rowIndex:n,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:y,rowDisabled:S,rowSelected:T,cellSelected:b,cellSelection:R,getData:C,computedVisibleColumns:I,visibleColumnIds:P,computedColumnOrder:D,columnReorderInPageIndex:w}=o,M=P??I.map(se=>se.id),E=D,x,v={...c,visibleColumnIds:M,allColumnIds:E,rowIndex:n,get rowHasSelectedCells(){return x===void 0&&(x=t.hasSelectedCells(M)),x}},A=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),_=typeof f=="function"?f(v):f,F;d?.className&&(F=Nl(d.className,u)),g&&(F=te(F,Nl(g,u))),e.className&&(F=te(F,Nl(e.className,u))),A&&(F=te(F,Tp({align:l})));let L;t.dataSourceHasGrouping&&e.groupByForColumn&&(L=Rp({rowInfo:t,column:e})),A&&(L=Ip({rowInfo:t})),p&&(L=typeof p=="function"?{...L,...p(v)}:{...L,...p}),m&&(L=Ll(L,m,u)),d?.style&&(L=Ll(L,d.style,u)),e.style&&(L=Ll(L,e.style,u)),L=L||{},L.height=r,L.zIndex=`var(${sT}-${e.computedVisibleIndex})`,L.visibility=`var(${uT}-${e.computedVisibleIndex}, visible)`;let O=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:n)%2===1,K=h?O?"odd":"even":!1,W=!1,k=!1,Q=!1,V=!1;if(R&&b){let se=C(),ae=se[t.indexInAll-1],ce=se[t.indexInAll+1],ue=I[e.computedVisibleIndex+1],U=I[e.computedVisibleIndex-1];W=ae?!R.isCellSelected(ae.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?k=!0:k=U?!R.isCellSelected(t.id,U.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?Q=!0:Q=ue?!R.isCellSelected(t.id,ue.id):!0,V=ce?!R.isCellSelected(ce.id,e.id):!0}let j=R&&b?{top:W,left:k,right:Q,bottom:V}:null,re=w!=null?a!==w:!1,de=te(j?Zd(j):"",ii(e,[Bt,Zt],Xd,{dragging:!1,insideDisabledDraggingPage:re,zebra:K,align:l,verticalAlign:s,rowDisabled:S,rowActive:y,cellSelected:b,rowSelected:T,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),F,_);return{style:L,className:de,cellSelectionBorders:j,zebra:K,columnIsTree:A}}import*as Qt from"react";var cT=J(ee.columnWidthAtIndex),dT=J(ee.columnReorderEffectDurationAtIndex);function pT(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!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}=o,y=typeof m=="function"?m():m,S={width:`var(${cT}-${i.computedVisibleIndex})`,transition:`transform var(${dT}-${i.computedVisibleIndex}, 0s)`,...h.style},T={...h,style:S,"data-column-id":i.id,"data-z-index":S.zIndex,className:te(h.className,Zt,qd),children:Qt.createElement(Qt.Fragment,null,d,Qt.createElement("div",{className:te(ar,e?_t:nc.hidden,s),style:r},y),c)};u!=null&&(T["data-row-id"]=`${u}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?Qt.createElement(b,{...T,ref:a}):Qt.createElement("div",{...T,ref:a})}var bi=Qt.memo(pT);import*as Uo from"react";import{useCallback as kl,useRef as vp}from"react";function Pp(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=zl(),i=vp(null),a=vp(!1),l=Uo.useCallback(c=>{i.current=c,c&&c.focus()},[]),s=kl(c=>{let{key:d}=c;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,n()):c.stopPropagation()},[]),u=kl(()=>{a.current||t()},[]);return Uo.createElement(Uo.Fragment,null,Uo.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:u,className:te(Xu,oc.none),type:"text",defaultValue:o,onChange:kl(c=>{e(c.target.value)},[])}))}function Dp(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var lr=Te.createContext(null),ST=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return Te.createElement(jo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},bT={display:"inline-block",visibility:"visible"},Vl=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return Te.createElement(jo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:bT,expanded:n,onChange:t})},TT=o=>{let{rowInfo:e,rowIndex:t,column:n,api:r}=o;e.isGroupRow&&n.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||To;return Te.createElement(l,{domProps:{className:Tn},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{up(r,t)},checked:e.rowSelected})};function CT(o){let{repaintCellsKey:e,column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=o,[,a]=hT(s=>s+1,0),l=$d(e)?e:void 0;mT(()=>{if(l)return Yd(l,{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i},a)},[l,t,n,r,i])}function RT(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,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:y,onRowMouseEnter:S,onRowMouseLeave:T,rowIndex:b,rowHeight:R,columnsMap:C,fieldsToColumn:I,domRef:P,hidden:D,showZebraRows:w,getDataSourceState:M,dataSourceApi:E,dataSourceActions:x,getState:v,imperativeApi:A,componentActions:_,getComputed:F,getDataSourceMasterContext:L}=o,O=yT(at(le=>t.subscribeToRowIndex(b,le),[t,b]),at(()=>t.getRowInfoAtIndex(b),[t,b]));CT({repaintCellsKey:p,column:g,rowIndex:b,rowInfoStore:t,getDataSourceState:M});let K=!O,W=!g,k=Te.useRef(null),Q=at(le=>{k.current=le,P&&P(le)},[P]),V=O??{id:"",indexInAll:b,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:j}=V,re=F(),{activeRowIndex:de,keyboardNavigation:se,columnReorderInPageIndex:ae}=v(),ce=b===de&&se==="row",ue={getState:v,getDataSourceState:M,getDataSourceMasterContext:L,actions:_,dataSourceActions:x,api:A,dataSourceApi:E},U=V.rowDisabled,z=hp({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:V,rowDetailState:f,columnsMap:C,visibleColumnIds:s,fieldsToColumn:I,context:ue}),{stylingParam:Y,renderParams:$,formattedValueContext:X,renderFunctions:q,groupByColumnReference:fe,inEdit:me}=z,{align:ie,verticalAlign:G}=$,N=$,ge=Te.useRef(N),Ee=S&&y?le=>{let $e={...X,rowIndex:b};S($e,le),y(le)}:y,Ce=T&&h?le=>{let _e={...X,rowIndex:b,rowInfo:V};T(_e,le),h(le)}:h,Re=at(le=>{let _e=g.computedVisibleIndex;v().cellClick({rowIndex:b,colIndex:_e,event:le})},[b,g.computedVisibleIndex,se]),Ae=at(le=>{let _e=g.computedVisibleIndex;if(v().cellMouseDown({rowIndex:b,colIndex:_e,event:le}),se==="row"){U||(_.activeRowIndex=b);return}se==="cell"&&(_.activeCellIndex=[b,_e])},[b,U,g.computedVisibleIndex,se]),{selectionMode:Ge,cellSelection:et,isNodeReadOnly:Xe}=e,tt=N.cellSelected;N.domRef=Q,N.htmlElementRef=k,N.toggleCurrentTreeNode=at(N.toggleCurrentTreeNode,[V]),N.selectCell=at(N.selectCell,[V]),N.deselectCell=at(N.deselectCell,[V]),N.selectCurrentRow=at(N.selectCurrentRow,[V]),N.deselectCurrentRow=at(N.deselectCurrentRow,[V]),N.toggleCurrentGroupRow=at(N.toggleCurrentGroupRow,[V]),N.toggleCurrentRowSelection=at(N.toggleCurrentRowSelection,[V]),N.toggleCurrentGroupRowSelection=at(N.toggleCurrentGroupRowSelection,[V]),N.toggleCurrentTreeNodeSelection=at(N.toggleCurrentTreeNodeSelection,[V]);let Ze=g.components?.Editor??Pp,Ue=me?Te.createElement(Ep,{contextValue:N},Te.createElement(Ze,null)):null,B=at(lt(()=>{if(D||me)return null;if(ge.current=N,q.renderGroupIcon&&(N.renderBag.groupIcon=Te.createElement(St,{render:q.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),q.renderSelectionCheckBox&&Ge=="multi-row"&&(N.renderBag.selectionCheckBox=Te.createElement(St,{render:TT,renderParam:N}),q.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=Te.createElement(St,{render:q.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),V.isTreeNode){let{isParentNode:$e}=V,po;po=($e?q.renderTreeIconForParentNode:q.renderTreeIconForLeafNode)||typeof q.renderTreeIcon=="function"?q.renderTreeIcon:$e&&q.renderTreeIcon===!0?Vl:void 0,po===!0?po=Vl:po&&(N.renderBag.treeIcon=Te.createElement(St,{render:Vl,renderParam:N})),po&&(N.renderBag.treeIcon=Te.createElement(St,{render:po,renderParam:{...N,renderBag:{...N.renderBag}}}))}q.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=Te.createElement(St,{render:ST,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof q.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=Te.createElement(St,{render:q.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),q.renderValue&&(N.renderBag.value=Te.createElement(St,{render:q.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),V.isGroupRow&&q.renderGroupValue&&(N.renderBag.value=Te.createElement(St,{render:q.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!V.isGroupRow&&q.renderLeafValue&&(N.renderBag.value=Te.createElement(St,{render:q.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),ge.current=N;let le=N.renderBag.value;le instanceof Date&&(le=le.toLocaleDateString());let _e=Te.createElement(Te.Fragment,null,ie!=="end"?N.renderBag.treeIcon:null,ie!=="end"?N.renderBag.groupIcon:null,ie!=="end"?N.renderBag.rowDetailsIcon:null,ie!=="end"?N.renderBag.selectionCheckBox:null,le,ie==="end"?N.renderBag.selectionCheckBox:null,ie==="end"?N.renderBag.rowDetailsIcon:null,ie==="end"?N.renderBag.groupIcon:null,ie==="end"?N.renderBag.treeIcon:null);return g.render?Te.createElement(St,{render:g.render,renderParam:{...N,renderBag:{...N.renderBag,all:_e}}}):_e}),[g,D,me,f,g.renderTreeIcon||g.renderTreeIconForParentNode?Xe:!1,...Dp(N,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:oe,className:he}=wp({column:g,rowInfo:V,rowIndex:b,rowHeight:R,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:ie,verticalAlign:G,stylingParam:Y,formattedValueContext:X,groupByColumnReference:fe,rowStyle:n,rowClassName:r,cellStyle:c,cellClassName:d,showZebraRows:w,rowActive:ce,rowDisabled:U,rowSelected:j,cellSelected:tt,cellSelection:et,getData:l,visibleColumnIds:s,computedVisibleColumns:re.computedVisibleColumns,computedColumnOrder:u,columnReorderInPageIndex:ae}),be=gT(()=>oe,[oe?JSON.stringify(oe):null]),nt=Ue,H=B(),Ne={domRef:Q,cellType:"body",column:g,width:m,rowId:V.id,horizontalLayoutPageIndex:a,style:be,onMouseLeave:Ce,onMouseEnter:Ee,onClick:Re,afterChildren:nt,onMouseDown:Ae,cssEllipsis:g.cssEllipsis??!0,className:he,renderChildren:at(()=>H,[B])},pt=lr.Provider;return W||K?Te.createElement("div",{ref:Q,style:{display:"none"}}):Te.createElement(pt,{value:ge.current},Te.createElement(bi,{...Ne}))}var xp=Te.memo(RT);function Ti(){return fT(lr)}function zl(){let{api:o,editingValueRef:e,editingCell:t}=ne(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:n,rowInfo:r}=Ti(),[i]=Te.useState(()=>t?.value),[a,l]=Te.useState(i),s=t?!t.active&&!!t.waiting:!1,u=Te.useCallback(f=>{e.current=f,l(f)},[]);Te.useLayoutEffect(()=>{e.current=i},[]);let c=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function sr(o){return o.render(o.renderParam)??null}function St(o){let e=lr.Provider;return vn.createElement(e,{value:o.renderParam},vn.createElement(sr,{render:o.render,renderParam:o.renderParam}))}function Ep(o){let e=lr.Provider;return vn.createElement(e,{value:o.contextValue},o.children)}function wo(o){let e=Ci.Provider;return vn.createElement(e,{value:o.renderParam},vn.createElement(sr,{render:o.render,renderParam:o.renderParam}))}import*as vo from"react";var ur=qr({"data-name":""}),cr={[ur["data-name"]]:"menu-icon"},aO=`[${ur["data-name"]}="${cr["data-name"]}"]`;var IT={width:"100%",pointerEvents:"none"},Gl=`${Tt}-menu`;function dr(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...IT,borderTop:`${pe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return vo.createElement("div",{...n,style:e,...cr,onPointerDown:s=>s.stopPropagation(),className:te(t,Fc({menuVisible:i,reserveSpaceWhenHidden:r}),Tt,`${Tt}-menu`)},a??vo.createElement(vo.Fragment,null,vo.createElement("div",{className:Gl,style:l}),vo.createElement("div",{className:Gl,style:l}),vo.createElement("div",{className:Gl,style:l})))}import*as Pn from"react";import{useEffect as wT,useState as _p}from"react";var Mp="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Ap={transition:"width 0.25s, opacity 0.25s"},bO=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Ri(o){let[e,t]=_p(!0),[n,r]=_p(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=o,c=u!=null&&u>0,d=o.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Ap,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};wT(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==n){let S=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(S)}}return()=>{}},[i,e]);let g=()=>{let S=!(n===0&&i===0);S!==e&&t(S)};if(!e&&!o.forceSize)return null;let h={};return i===-1&&(h.top="100%"),Pn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:te(s,Tt,Mp,`${Tt}-sort`)},c?Pn.createElement("div",{"data-name":"index",style:h,className:kc},u):null,Pn.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),Pn.createElement("div",{style:{width:f[1],...m}}),Pn.createElement("div",{style:{width:f[2],...m}}))}import*as Vp from"react";import{useCallback as zp}from"react";function Hl(o){return Math.max(o.width-zt(),0)}function Op(o){let{context:e,column:t,diff:n,shareSpaceOnResize:r}=o,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 cl({shareSpaceOnResize:r,availableSize:Hl(s),reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:u.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}import{useRef as Lp,useState as vT}from"react";import*as pr from"react";function Fp(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Ie.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Ie.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?bl(l,i,n.current):Ie.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){bl(u,i,n.current);continue}u.computedPinned!=="end"&&Ie.columnOffsets.set(l,u.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Ie.columnOffsets.set(l,u.computedOffset+i,n.current)}}}}}function Np(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,u=i.current;if(n.forEach((c,d)=>{s+=c;let p=o[d],f=r[p],m=f.computedWidth+c;Ie.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Ie.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"&&Ie.columnOffsets.set(c,d.computedOffset+s,u)}}}}var Ii="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",wi=ye({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"]]}),vi=ye({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:PT}=Le,DT=`${PT}HeaderCell_ResizeHandle`;function xT(o){let{brain:e,headerBrain:t}=ne(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),n=Lp(null),[r,i]=vT(!1),a=Lp(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,y=g.pointerId,S=g.clientX,T=g.target;if(e.isHorizontalLayoutBrain){let P=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),D=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{P(),D()}}T.setPointerCapture(y);let b=Fp(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),R=(P,{done:D}={})=>{s&&(P=P/(s+1),D&&(P=Math.round(P))),u==="end"&&(P*=-1);let{adjustedDiff:w,constrained:M}=o.computeResize({diff:P,shareSpaceOnResize:h});return a.current!==M&&i(M),b.resize(w),w},C=P=>{R(Math.round(P.clientX-S))},I=P=>{T.releasePointerCapture(y),T.removeEventListener("pointermove",C),T.removeEventListener("pointerup",I);let D=Math.round(P.clientX-S),w=R(D,{done:!0});p(),b.resize(0),o.onResize({diff:w,shareSpaceOnResize:h})};T.addEventListener("pointermove",C),T.addEventListener("pointerup",I)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return pr.createElement("div",{ref:n,className:`${DT} ${Ii} ${vi({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},pr.createElement("div",{style:m,className:wi({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var kp=pr.memo(xT);function Gp(o,e){let{computedVisibleColumns:t,getState:n,getComputed:r,actions:i}=ne(u=>({computedVisibleColumns:u.computed.computedVisibleColumns,getState:u.getState,getComputed:u.getComputed,actions:u.actions})),a=zp(({diff:u,shareSpaceOnResize:c})=>Op({context:{getState:n,getComputed:r},column:o,diff:u,shareSpaceOnResize:c}),[o,n,r]),l=zp(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return o.computedResizable?Vp.createElement(kp,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}import*as je from"react";import{useCallback as Kl,useEffect as Bl,useState as FT}from"react";var Hp=ye({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Kp=ye({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Bp(o,e){return mt(o,e)}var fr=class extends Ko{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 Bp(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Bp(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}adjustForScroll(t){this.breakpoints=this.breakpoints.map(n=>n-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:u}=t,c=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=c.filter(f=>f!==r):d=Ho(c,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:u,status:t.status};this.emit("drop",p)}};var ET={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:o=>o**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function MT(o,e){let t=getComputedStyle(o),n=e==="vertical"?t.overflowY:t.overflowX;return n!=="auto"&&n!=="scroll"?!1:e==="vertical"?o.scrollHeight>o.clientHeight:o.scrollWidth>o.clientWidth}function AT(o,e){let t=o;for(;t&&!(t===document.documentElement||t===document.body);){if(MT(t,e))return t;t=t.parentElement}return null}function _T(o,e){return{startScrollingFrom:o*e.startFromPercentage,maxScrollValueAt:o*e.maxScrollAtPercentage}}var Up=1;function Wp(o,e,t){if(o>e.startScrollingFrom)return 0;if(o<=e.maxScrollValueAt)return t.maxPixelScroll;if(o===e.startScrollingFrom)return Up;let r=1-(o-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function OT(o,e,t){let{accelerateAt:n,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return o;if(i<n)return Up;let a=(i-n)/(r-n);return Math.ceil(o*t.ease(a))}function jp(o,e,t,n,r,i,a){if(o<e||o>t)return 0;let l=_T(n,r),s=o-e,u=t-o,c=u<s,d;return c?d=Wp(u,l,r):d=-Wp(s,l,r),d===0?0:a?(d>0?1:-1)*OT(Math.abs(d),i,r):d}var Dn=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={...ET,...e.config}}start(e){this.scrollContainer=AT(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},n=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=n,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,n=0;return this.orientation==="vertical"?t=jp(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):n=jp(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:n}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var qp=je.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),xn=()=>je.useContext(qp),NT=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},LT=o=>`${o.getAttribute(Ct)}`;function Wl(o,e){let t=o.current?.querySelectorAll(Jp)??[];return Array.from(t).filter(r=>r.getAttribute(mr)===`${e}`)}function kT(o,e){let t=Wl(o,e);return!t||t.length,Array.from(t).map(r=>{let i=LT(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function zT(o){let{domRef:e,orientation:t,dragListId:n}=o,r=kT(e,n),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=we.from({top:a,left:l,width:u-l,height:s-a});return{draggableItems:r,orientation:t,listId:n,listRectangle:c,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial,preserveDragSpace:o.preserveDragSpace}}function Xp(o){return new fr(zT(o))}function VT(o,e){let t=Fe(e),[n,r]=je.useState(null),i=Kl(l=>{if(l)gt.registerDragInteractionTarget(l);else{let s=a();s&&gt.unregisterDragInteractionTarget(s)}r(l)},[]),a=Fe(n);return Bl(()=>gt.on("register",l=>{let{dragListId:s,acceptDropsFrom:u,orientation:c,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&u?.includes(p.listId)){let f=Xp({domRef:o,orientation:c,dragListId:s,initial:!1,acceptDropsFrom:u,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}function Zp(o,e){let t=o.cloneNode(!0);return t.removeAttribute(Ct),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 Qp({proxyElement:o,dx:e,dy:t}){o.style.transform=`translate3d(${e}px, ${t}px, 0)`}function $p(o){let e=o.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",o.current=null)}var $o=o=>{let e=je.useRef(null),t=je.useRef(null),[n,r]=FT(null),i=je.useRef({top:0,left:0}),a=je.useRef(null),l=je.useCallback(w=>{a.current=w},[]),{dropTargetListId:s,dragSourceListId:u}=bo(),{updateDragOperationSourceAndTarget:c,dragItemId:d,status:p}=bo(),f=Fe(o.onDrop),m=Fe(o.onAcceptDrop),g=Fe(o.onRemove),h=Fe(o.updatePosition??NT),{interactionTarget:y,setInteractionTarget:S}=VT(e,o);Bl(()=>{let w=document.querySelector(`[${Yp}="${o.dragListId}"]`);w?e.current=w:console.warn(`DragList with id "${o.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[o.dragListId]),Bl(()=>{if(y){let w=o.dragListId,M=y.on("start",({dragItem:L,dragSourceListId:O,dropTargetListId:K})=>{c({dragSourceListId:O,dropTargetListId:K,dragItemId:L.id,status:"accepted"})}),E=y.on("move",({offsetsForItems:L,items:O,status:K,dragItem:W})=>{if(K==="rejected")return;let k=b(),Q=h(),V=t.current;O.forEach((j,re)=>{let de=L[re],se=k[re];if(se&&!(V&&j.id===V.dragItemId)){if(!V&&j.id===W.id){let ae=i.current;de={left:de.left+ae.left,top:de.top+ae.top}}Q({id:j.id,node:se,offset:de})}})}),x=y.on("drop",L=>{let{sortedIndexes:O,dragIndex:K,dropIndex:W,dragItem:k,items:Q,dragSourceListId:V,dropTargetListId:j,outside:re,status:de}=L,se=b();T.current=[];let ae=m(),ce=g(),ue=f(),U=h();Q.forEach(($,X)=>{let q=se[X];q&&U({id:$.id,node:q,offset:null})}),$p(t),r($=>$&&(requestAnimationFrame(()=>r(null)),{...$,dragItemId:null})),w===j&&V!==w&&ae&&de==="accepted"&&ae({dragItemId:k.id,dragSourceListId:V,dropTargetListId:j,dragIndex:K,dropIndex:W,dropItemId:Q[W]?.id});let Y=null;W===-1&&V===w&&j===w&&re&&(Y=ce),W!==-1&&j===w&&V===w&&(Y=ue),Y&&Y?.(O,{dragIndex:K,dropIndex:W,dragItemId:Q[K].id,dropItemId:Q[W]?.id})}),v=null,A=null,_=null,F=null;if(!y.getData().initial&&e.current){if(v=new Dn({orientation:o.orientation,onScroll:()=>{}}),v.start(e.current),A=v.getScrollContainer(),A){let L=o.orientation==="vertical"?A.scrollTop:A.scrollLeft;_=()=>{let O=o.orientation==="vertical"?A.scrollTop:A.scrollLeft,K=O-L;L=O,K!==0&&(y.adjustForScroll(K),gt.retriggerMove())},A.addEventListener("scroll",_)}F=L=>{v.updatePointer({left:L.clientX,top:L.clientY})},De().addEventListener("pointermove",F)}return()=>{M(),E(),x(),v&&v.stop(),A&&_&&A.removeEventListener("scroll",_),F&&De().removeEventListener("pointermove",F)}}},[y,o.dragListId]);let T=je.useRef([]),b=Kl(()=>{let w=T.current;return(!w||w.length===0)&&(w=Wl(e,o.dragListId),T.current=w),w},[o.dragListId]),R=Kl(w=>{let M=w.currentTarget,E=M.getAttribute(Ct);if(E==null){let z=yo(M,Jp);z&&(E=z.getAttribute(Ct))}if(E==null){console.warn("Could not find drag item id for element",M,`Make sure you have a parent element with a ${Ct} attribute`);return}E=`${E}`;let x=null,v=Wl(e,o.dragListId);T.current=v;let A=Xp({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0,preserveDragSpace:o.preserveDragSpace}),_=A.getData().draggableItems,F=_.findIndex(z=>z.id===E);if(F===-1)return;let L=_[F],O=v[F]?.getAttribute(Ct)===`${E}`?v[F]:v.find(z=>z.getAttribute(Ct)===`${E}`);S(A);let K={left:w.clientX,top:w.clientY},W={left:w.clientX,top:w.clientY};i.current={top:0,left:0};let k=new Dn({orientation:o.orientation,onScroll:()=>{}});e.current&&k.start(e.current);let Q=k.getScrollContainer(),V=Q?o.orientation==="vertical"?Q.scrollTop:Q.scrollLeft:0;function j(){x&&x.move({left:W.left,top:W.top})}let re=()=>{if(!Q)return;let z=o.orientation==="vertical"?Q.scrollTop:Q.scrollLeft,Y=z-V;V=z,Y!==0&&(A.adjustForScroll(Y),o.orientation==="vertical"?i.current.top+=Y:i.current.left+=Y),j()};Q?.addEventListener("scroll",re);let de=o.dragStrategy??"proxy",se=de==="proxy"&&!o.renderDragProxy,ae=de==="proxy"&&!!o.renderDragProxy,ce=o.onDragProxyMove??Qp,ue=z=>{if(W={left:z.clientX,top:z.clientY},!x){if(x=gt.startDrag({listId:o.dragListId,dragItem:L,dragIndex:F},K),O&&se){let X=O.getBoundingClientRect(),q=null,fe={dragItemNode:O,dragItemId:`${E}`,initialRect:X,initialCoords:K,get proxyElement(){return q||(q=Zp(O,X)),q}},me=o.onDragProxySetup?.(fe),ie=me?.proxyElement??fe.proxyElement;O.style.visibility="hidden",t.current={proxyElement:ie,originalNode:O,dragItemId:`${E}`,initialRect:X,cleanup:me?.cleanup}}if(O&&ae){let X=O.getBoundingClientRect();O.style.visibility="hidden",t.current={proxyElement:O,originalNode:O,dragItemId:`${E}`,initialRect:X,cleanup:()=>{}},r({dragItemId:`${E}`,initialRect:X,dx:0,dy:0})}}let Y=z.clientX-K.left,$=z.clientY-K.top;if(ae)r(X=>X&&{...X,dx:Y,dy:$});else{let X=t.current;X&&ce({proxyElement:X.proxyElement,dx:Y,dy:$})}k.updatePointer({left:z.clientX,top:z.clientY}),j()},U=()=>{if(k.stop(),Q?.removeEventListener("scroll",re),De().removeEventListener("pointermove",ue),ae&&(r(z=>z&&{...z,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!x){$p(t),S(null);return}x.drop(),x=null};De().addEventListener("pointermove",ue),De().addEventListener("pointerup",U,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside,o.dragStrategy,o.renderDragProxy,o.onDragProxySetup,o.onDragProxyMove]),C=!!d,I=je.useMemo(()=>({dragItemId:d,onDragItemPointerDown:R,dragSourceListId:u,dropTargetListId:s,status:p,dragListId:o.dragListId,draggingInProgress:C}),[d,R,C,u,s,o.dragListId]),P={className:te("DragList",C?"DragList--dragging":"",Hp({dragging:C})),[Yp]:o.dragListId},D=typeof o.children=="function"?o.children(P,I):o.children;return je.createElement(qp.Provider,{value:I},D,n&&o.renderDragProxy?o.renderDragProxy({...n,ref:l}):null)},Yp="data-drag-list-id",Ct="data-drag-item-id",mr="data-drag-item-list-id",Jp=`[${Ct}]`,GT=je.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),HT=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=xn(),l=o.dragListId??n,s=i===l&&r===`${o.id}`,u=je.useMemo(()=>({dragItemId:o.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,s,l,t,i,a]),c={[Ct]:`${o.id}`,[mr]:l,onPointerDown:e,className:te("DraggableItem",s?"DraggableItem--active":"",Kp({active:s,draggingInProgress:t}))},d=typeof o.children=="function"?o.children(c,u):o.children;return je.createElement(GT.Provider,{value:u},d)};$o.DraggableItem=HT;import*as jl from"react";var ef=o=>jl.createElement(ke,{...o,viewBox:"0 -960 960 960"},jl.createElement("path",{d:ze.hidden[0]}));import*as Cr from"react";function tf(){return{}}var of=o=>({allowColumnHideWhileDragging:e=>e??!0});import{createContext as KT}from"react";var BT=KT(null);function Ul(){return BT}import*as Ft from"react";import*as Xo from"react";import{useCallback as Mf,useEffect as os,useRef as bC,useState as TC}from"react";import*as Pi from"react";function WT(o){let{height:e,width:t,count:n}=o;return Pi.createElement("div",{"data-count":n,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var nf=Pi.memo(WT);var rf="mlx2t3";import*as Di from"react";import{useRef as UT}from"react";import{useEffect as jT}from"react";var af=(o,e)=>{jT(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var lf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},sf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},uf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},$l="_1ueijco1",cf="_1ueijco0 _16lm1iw0";var df=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=lf[`${o}`]:e=te(sf[`${o.horizontal}`],uf[`${o.vertical}`]),e};var $T="InfiniteVirtualScrollContainer";var pf=Di.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??UT(null);return af(c,i),Di.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:te(a,$T,cf,df(r))},n)});import*as Vi from"react";import{useLayoutEffect as zi,useMemo as tC}from"react";import*as ff from"react";import{useLayoutEffect as YT,useRef as qT,useState as XT}from"react";function ZT(o){let[e,t]=XT(o.updater.get),n=qT(null);return YT(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var Po=ff.memo(ZT);var mf=rn(Go());var Yl=(o,e)=>o-e,Jt={horizontal:!0,vertical:!0};function xi(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var ql="DebugID=";function Do(o,e){return e&&e.startsWith(ql)?e:e?`${ql}${o}:${e}`:`${ql}${o}`}var Ei={start:0,end:0},Xl=o=>{o()},Zl=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},gf=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},gr=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function QT(o){return o.horizontalChange||o.verticalChange}var Yo=class extends ft{constructor(t){let n=Do(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Ei;this.verticalExtendRangeBy=Ei;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{gr(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Xl:gr;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Xl:gr;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let 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:n);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:n}=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:n);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 n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=Jt)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Jt)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,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=n.startIndex,u=n.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=Jt)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",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,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,n),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,mf.default)(a,t,Yl);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let 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:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let y=f;for(;h>1;)y+=1,d[y]=f,p[y]=0,h-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Zl;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Jt){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height: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,y=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let S=a!=null,T=l!=null,b=S&&a!==this.rowHeight,R=T&&l!==this.colWidth;S&&(this.rowHeight=a),T&&(this.colWidth=l);let C=t.rowspan!=null,I=t.colspan!=null,P=C&&t.rowspan!=this.rowspan,D=I&&t.colspan!=this.colspan;P&&(this.rowspan=t.rowspan),D&&(this.colspan=t.colspan);let w=y||R||p||D,M=h||b||f||P;(n||QT)({horizontalChange:w,verticalChange:M,colsChanged:y,colWidthChanged:R,widthChanged:p,colspanChanged:D,rowsChanged:h,rowHeightChanged:b,heightChanged:f,rowspanChanged:P})&&this.updateRenderCount({horizontal:w,vertical:M})}extendRenderRange(t){let{direction:n}=t,r=n==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(t=Jt){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Jt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(n?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Xl:gr;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="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=xi(l,c)}else a=(n?Math.ceil(l/n):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:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{gr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let n=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Ei,this.verticalExtendRangeBy=Ei,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Ql=rn(Go());function hf(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function yf(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function hr(o,e){for(let t of o)if(e(t))return t}var Mi=(o,e)=>o-e,Ai=class extends ft{constructor(t,n){super(`${t}:GridCellManager`);this.matrix=new Z;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,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,y=f>=s;(m||g||h||y)&&u.add(c)}),u};this.debugId=t,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=hr(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=hr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,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(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Mi)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Mi)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((n,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,Ql.default)(n,t,Mi);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,Ql.default)(n,t,Mi);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return hr(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return hr(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Sf=rn(Go());var _i=class extends ft{constructor(t,n){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,Sf.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var bf=!0,qo=J(ee.y),Tf=J(ee.scrollTop),LN=J(ee.columnOffsetAtIndex),Jl=J(ee.columnOffsetAtIndexWhileReordering),En=class extends ft{constructor(t,n,r){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(qo,i?`calc( ${r}px + var(${Tf}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${qo}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Ie.columnOffsets.get(r),d=`${Jl}-${r}`,p=s?`calc( ${a}px + var(${Tf}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(qo,p));let f=`translate3d(var(${d}, ${c}), var(${qo}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),u!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let 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 y=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),S=this.getScrollPositionForScrollColumnIntoView(y,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});S&&(a=S.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let 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,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,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-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let h={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),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(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ve(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:u,y:c}=s;if(r){let d=()=>{this.updateHoverClassNamesForRow(a);let p=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=p.rowIndex,r.dataset.colIndex=p.colIndex,bf){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,bf&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,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(v=>{let A=i.getRowIndex(v);if(A!=null){let _=this.brain.getItemOffsetFor(A,"vertical");if(_==null)return;let F=v.getElement();if(!F)return;this.setDetailTransform(F,A,{y:_,scrollLeft:t.scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&dd(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:h}=this.brain.getRenderRange(),[y,S]=g,[T,b]=h;function R(v,A,_){let F=r.getCellAt([v,A]);if(F==null)return;let L=n.getCellOffset(v,A),O=F.getElement();O&&L&&_(v,A,O,L)}let C=(v,A,_,{x:F,y:L})=>{this.setTransform(_,v,A,{x:F,y:L,scrollLeft:!0},s-A)},I=(v,A,_,F)=>{this.setTransform(_,v,A,{x:F.x,y:F.y,scrollTop:!0},c-v)},P=(v,A,_,{y:F})=>{let L=f[A];this.setTransform(_,v,A,{x:L,y:F,scrollLeft:!0},a-A)},D=(v,A,_,F)=>{this.setTransform(_,v,A,{x:F.x,y:m[v],scrollTop:!0},l-v)},w=(v,A,_,{x:F,y:L})=>{this.setTransform(_,v,A,{x:F,scrollLeft:!0,y:L,scrollTop:!0},1e5)},M=(v,A,_,{x:F})=>{this.setTransform(_,v,A,{x:F,scrollLeft:!0,y:m[v],scrollTop:!0},2e5)},E=(v,A,_,F)=>{this.setTransform(_,v,A,{x:f[A],y:F.y,scrollLeft:!0,scrollTop:!0},3e5)},x=(v,A,_)=>{this.setTransform(_,v,A,{x:f[A],y:m[v],scrollLeft:!0,scrollTop:!0},4e5)};if(s||u)for(let v=y;v<T;v++){for(let A=0;A<s;A++)R(v,A,C);if(u){let A=a-u;for(let _=A;_<a;_++)R(v,_,P)}}if(c||d)for(let v=S;v<b;v++){for(let A=0;A<c;A++)R(A,v,I);if(d){let A=l-d;for(let _=A;_<l;_++)R(_,v,D)}}if(s&&c)for(let v=0;v<c;v++)for(let A=0;A<s;A++)R(v,A,w);if(s&&d){let v=l-d;for(let A=v;A<l;A++)for(let _=0;_<s;_++)R(A,_,M)}if(u&&c){let v=a-u;for(let A=0;A<c;A++)for(let _=v;_<a;_++)R(A,_,E)}if(u&&d){let v=l-d,A=a-u;for(let _=v;_<l;_++)for(let F=A;F<a;F++)R(_,F,x)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new Ai(n,r.cellPool),this.cellManager.onCellAttachmentChange((u,c)=>{c?this.onCellAttached(u):this.onCellDetached(u)}),this.rowManager=new _i(n,r.rowPool),this.rowManager.onRowAttachmentChange((u,c)=>{c?this.onRowAttached(u):this.onRowDetached(u)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ve(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=yl(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,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 w=t.start[1],M=t.end[1];m.forEach(E=>{w<=E&&E<M||f.push({start:[t.start[0],E],end:[t.end[0],E+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([w,M])=>{g.set(`${w}:${M}`,!0)});let y=f.reduce((w,M)=>w+Zl(M),0),S=r?f.reduce((w,M)=>w+gf(M),0):0,T=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([T,b]);let R=Math.min(T*b,y);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>S&&(c.poolSize=S));let C=hf(...f.map(w=>d.getCellsOutsideRenderRange(w)));C=yf(C,w=>{let M=d.getCellPosition(w);return!(M&&g.has(`${M[0]}:${M[1]}`))}),d.detachCells(C),d.poolSize=R;let I=new Map,P=new Map;f.forEach(w=>{let{start:M,end:E}=w,[x,v]=M,[A,_]=E;for(let F=x;F<A;F++){for(let O=v;O<_;O++){let K=`${F}:${O}`;if(I.has(K))continue;I.set(K,!0);let{rendered:W,mapped:k}=this.isCellRenderedAndMappedCorrectly(F,O);if(F===x||O===v){let V=this.isCellCovered(F,O);if(V&&g.has(`${V[0]}:${V[1]}`)){let j=d.getCellAt([F,O]);j!=null&&d.detachCell(j);continue}}if(W&&!i&&k)continue;let Q;W?Q=d.getCellAt([F,O]):Q=d.getCellFor([F,O],u?"row":"column"),Q==null&&(Q=d.getDetachedCell()),this.renderCellAt(F,O,Q,n)}!r||P.has(F)||(P.set(F,!0),c.isRowAttachedAt(F)&&!i)||this.renderDetailRowAtElement(F,this.rowManager.getRowFor(F),r)}}),h.forEach(([w,M])=>{let{rendered:E,mapped:x}=this.isCellRenderedAndMappedCorrectly(w,M);if(E){if(i||!x){let A=[w,M],_=d.getCellAt(A);this.renderCellAt(w,M,_,n)}return}let v=d.getCellFor([w,M],u?"row":"column");v!=null&&this.renderCellAt(w,M,v,n)});let D=d.getAllCells().map(w=>w.getNode());return r&&c.getAllRows().forEach(w=>{D.push(w.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(D),D}renderDetailRowAtElement(t,n,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(u,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}getMatrixRowIndexFromElement(t){let n=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),u=this.brain.getRowspan(t,n),c=this.brain.getColspan(t,n),d=u===1?l:this.brain.getRowHeightWithSpan(t,n,u),p=c===1?s:this.brain.getColWidthWithSpan(t,n,c),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:y}=this.getCellRealCoordinates(t,n),S=i({rowIndex:h,colIndex:y,height:l,width:s,rowspan: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(R=>{let C=R.getElement();C&&(C.style.position="absolute",C.style.left="0px",C.style.top="0px"),this.updateElementPosition(R)});let T=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:y}:void 0,b=this.brain.isHorizontalLayoutBrain;if(!S){b?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(S,r,[t,n],T),this.updateElementPosition(r,{hidden:g,rowspan:u,colspan:c})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Oi=class extends En{constructor(t,n,r){super(t,n,r);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage),c=pe.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Ie.columnOffsets.get(l.colIndex),f=`${Jl}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(qo,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${qo})`,y=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==y&&(t.__transformValue=y,t.style.transform=y)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};import*as Rf from"react";var Mn=class Mn extends ft{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,n=t.values().next().value;return n||(this.poolSize+=Mn.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/Mn.POOL_SIZE_INCREMENT)*Mn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};Mn.POOL_SIZE_INCREMENT=1;var Fi=Mn;var Cf=new Map,JT=()=>{},es=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Se();let n=Cf.get(e)??0,r=`${e}:GridCellReact:${n}`;Cf.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=Se(),this.node=Rf.createElement(Po,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=JT,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}},Ni=class extends Fi{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new es(this.cellDebugId)}};import*as wf from"react";var An=class An extends ft{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,n=t.values().next().value;return n||(this.poolSize+=An.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/An.POOL_SIZE_INCREMENT)*An.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};An.POOL_SIZE_INCREMENT=1;var Li=An;var If=new Map,eC=()=>{},ts=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Se();let t=If.get(e)??0,n=`${e}:ListRowReact:${t}`;If.set(e,t+1),this.debugId=n,this.updater=Se(),this.node=wf.createElement(Po,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=eC,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},ki=class extends Li{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new ts(this.rowDebugId)}};function vf(o){return{cellPool:new Ni(o),rowPool:new ki(o)}}function yr(o){let e=o.isHorizontalLayoutBrain?new Oi(o,`${o.name}:HorizontalLayoutTableRenderer`,vf(`${o.name}:HorizontalLayoutTableRenderer`)):new En(o,`${o.name}:ReactHeadlessTableRenderer`,vf(`${o.name}:ReactHeadlessTableRenderer`)),t=Se();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function oC(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=tC(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:yr(e),[e,o.onRenderUpdater,o.renderer]);return zi(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),zi(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),zi(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),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:n})})},[i,e,t,n,a,r]),zi(()=>{i.flushPendingAfterCommitWork()}),Vi.createElement(Po,{updater:a})}var Gi=Vi.memo(oC);import*as Sr from"react";import{useEffect as nC,useLayoutEffect as rC,useRef as iC}from"react";var Pf=ye({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Hi="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Df=ye({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:aC}=Le,lC=`${aC}-ActiveRowIndicator`,sC=`calc(${ee.activeCellRowOffsetX} + var(${J(ee.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,uC={[J(ee.activeCellOffsetY)]:ee.activeCellRowOffset,transform:`translate3d(${sC}, calc( ${ee.activeCellOffsetY} + var(${J(ee.scrollTopForActiveRow)}, 0px)), 0px)`,height:ee.activeCellRowHeight,maxWidth:pe.runtime.totalVisibleColumnsWidthVar},cC=o=>{let{brain:e}=o,t=iC(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=kt();return rC(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${pe.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),u=e.getItemOffsetFor(l,"vertical"),c=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${u}px`,activeCellRowOffsetX:a};hn(d,c)},[o.activeRowIndex,e]),nC(()=>{let a=u=>{hn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),Sr.createElement("div",{className:Hi,"data-name":"active-row"},Sr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${lC} ${Df({active:n})}`,style:n?uC:void 0}))},xf=Sr.memo(cC);import*as br from"react";import{useEffect as dC,useLayoutEffect as pC,useRef as fC}from"react";var{rootClassName:mC}=Le,gC=`${mC}-ActiveCellIndicator`,hC=J(ee.columnZIndexAtIndex),yC=(o,e,t,n)=>{if(e==null)return;let[r]=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(r=r%o.rowsPerPage);let i=typeof t=="function"?t(r):t??o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;hn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},SC=o=>{let{brain:e}=o,[t,n]=kt(),r=fC(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return pC(()=>{yC(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),dC(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),br.createElement("div",{className:Hi,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${hC}-${o.activeCellIndex[1]})`}:void 0},br.createElement("div",{"data-name":"active-cell-indicator",className:`${gC} ${Pf({visible:i})}`}))},Ef=br.memo(SC);var Ki=[Qd,`${st}DetachedCell`];function Bi(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var CC=te(rf,$l);function Af(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,y=bC(null),[S,T]=TC({width:0,height:0});os(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),os(()=>{let C=y.current?.parentNode;return C?(h&&document.activeElement!==C&&C.focus(),an(C,()=>{let D={height:C.clientHeight,width:C.clientWidth};e.update(D)},{debounce:50})):void 0},[p,e]);let b=Mf(C=>{requestAnimationFrame(()=>{y.current&&y.current.style.setProperty("transform",`translate3d(${-C.scrollLeft}px, ${-C.scrollTop}px, 0px)`)})},[]),R=Mf(C=>{e.setScrollPosition(C,b)},[e,b]);return os(()=>{let C=e.onRenderCountChange(()=>{T(e.getVirtualizedContentSize())});return T(e.getVirtualizedContentSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),C},[e]),Xo.createElement(pf,{onContainerScroll:R,...g,ref:t},Xo.createElement("div",{ref:y,className:CC,"data-name":"scroll-transform-target"},Xo.createElement(Gi,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Ki}),c!=null?Xo.createElement(Ef,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?Xo.createElement(xf,{brain:e,activeRowIndex:u}):null,Xo.createElement(nf,{width:S.width,height:S.height}))}function _f(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((c,d)=>{let p=c.id,f=o[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 y={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],y);let S=c.columnGroup,T,b=y;for(;S;){let R=e[S];if(R){g.add(S);let C=[p,...g];T=h.has(S)?i.get(S):void 0,T||(T={id:S,type:"group",ref:R,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[S],computedWidth:0,computedPinned:y.computedPinned,depth:t.get(S)??0},r.set(C,T),i.set(S,T)),T.columnItems.push(y),T.uniqueGroupId.push(y.id),b&&!h.has(b.id)&&T.children.push(b),b=T,S=R.columnGroup}else break}});let l=[],s=new Z,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"&&Of(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<=n+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Of(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&Of(t.children),e+=n})}import*as xo from"react";import{useCallback as Kf,useEffect as xC,useMemo as EC,useRef as MC}from"react";import*as ns from"react";import*as kf from"react";import{useCallback as Lf}from"react";import{useRef as Ff,useState as RC}from"react";import*as Tr from"react";var{rootClassName:IC}=Le,wC=`${IC}HeaderCell_ResizeHandle`;function vC(o){let e=Ff(null),[t,n]=RC(!1),r=Ff(t);r.current=t;let i=o.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=Np(o.groupColumns.map(b=>b.computedVisibleIndex),{columns:o.columns,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{constrained:R,adjustedDiffs:C,adjustedDiff:I}=o.computeResize(b);return r.current!==R&&n(R),h.resize(C),I},S=b=>{if(g){let R=o.groupColumns.reduce((P,D)=>P+D.computedWidth-D.computedMinWidth,0),C=o.brain.getAvailableSize(),I={width:C.width+R,height:C.height};o.brain.update(I),g=!1}y(Math.round(b.clientX-f))},T=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",S),m.removeEventListener("pointerup",T);let R=Math.round(b.clientX-f),C=y(R);h.resize(o.groupColumns.map(()=>0)),o.onResize(C)};m.addEventListener("pointermove",S),m.addEventListener("pointerup",T)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:pe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Tr.createElement("div",{ref:e,className:`${wC} ${Ii} ${vi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},Tr.createElement("div",{style:{...c,...o.style},className:wi({constrained:t})}))}var Nf=Tr.memo(vC);function zf(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:u}=ne(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),c=o[o.length-1],d=Lf(g=>{let h=l(),{columnSizing:y,viewportReservedWidth:S,bodySize:T}=h,b=s().computedVisibleColumns,R=!1,C=b.reduce((D,w)=>(w.computedFlex&&(D[w.id]={...y[w.id],flex:w.computedWidth},R=!0),D),{}),I=R?{...y,...C}:y;return jc({availableSize:Hl(T),reservedWidth:S||0,dragHandleOffset:g,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:I,columnGroupSize:o.length,items:b.map(D=>({id:D.id,resizable:D.computedResizable,computedFlex:D.computedFlex,computedWidth:D.computedWidth,computedMinWidth:D.computedMinWidth,computedMaxWidth:D.computedMaxWidth}))})},[c]),p=Lf(g=>{let{columnSizing:h,reservedWidth:y}=d(g);u.viewportReservedWidth=y,u.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?kf.createElement(Nf,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var Vf=`${st}HeaderGroup`,Gf=J(ee.columnWidthAtIndex),PC=J(ee.columnZIndexAtIndex);function Hf(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=zf(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=n[0],c=n.length>1?"calc( "+n.map(f=>`var(${Gf}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${Gf}-${u.computedVisibleIndex})`,d=`calc(var(${PC}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,ns.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:te(Oc,Vf),style:p,"data-z-index":d},ns.createElement("div",{className:te(`${Vf}__header-content`,_t)},a),s)}import{useContext as DC}from"react";import*as as from"react";var rs;function ls(){return rs||(rs=as.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var is;function Wi(){return is||(is=as.createContext(null))}function Oe(o){let e=Wi(),t=DC(e);return ln(t,o)}function Wt(){return Oe(o=>({getDataSourceState:o.getDataSourceState,getDataSourceMasterContext:o.getDataSourceMasterContext,dataSourceActions:o.dataSourceActions,dataSourceApi:o.dataSourceApi,assignState:o.assignState}))}var{rootClassName:AC}=Le,_C=[],Bf=`${AC}Header`,OC=xc({overflow:!1}),Wf=()=>{};function FC(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{getState:u,headerOptions:c,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=ne(E=>({computedColumnsMap:E.computed.computedColumnsMap,getState:E.getState,headerOptions:E.state.headerOptions,headerRenderer:E.state.headerRenderer,headerOnRenderUpdater:E.state.headerOnRenderUpdater,showColumnFilters:E.state.showColumnFilters})),g=MC(null),h=Kf(E=>{g.current&&(g.current.style.transform=`translate3d(-${E.scrollLeft}px, 0px, 0px)`)},[]);xC(()=>{let E=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),E},[t]);let y={ref:g,className:te(Bf,`${Bf}--virtualized`,i,OC),style:{...r,height:a}},{getDataSourceState:S,dataSourceApi:T,dataSourceActions:b}=Wt(),{allRowsSelected:R,someRowsSelected:C,selectionMode:I,filterTypes:P,filterDelay:D}=Oe(E=>({allRowsSelected:E.dataSourceState.allRowsSelected,someRowsSelected:E.dataSourceState.someRowsSelected,selectionMode:E.dataSourceState.selectionMode,filterTypes:E.dataSourceState.filterTypes,filterDelay:E.dataSourceState.filterDelay})),w=EC(()=>({allRowsSelected:R,someRowsSelected:C,selectionMode:I}),[R,C,I]),M=Kf(E=>{let{rowIndex:x,colIndex:v,domRef:A,height:_,widthWithColspan:F,heightWithRowspan:L,hidden:O}=E,K=n[v];if(!K||O)return null;let W=t.isHorizontalLayoutBrain?t.getPageIndexForRow(x):null,k=l?l.pathsToCells.get([x,v]):null;if(k&&k.type==="group"){let Q=k.columnItems.map(re=>re.ref),V={...k.ref,id:k.id,uniqueGroupId:k.uniqueGroupId,depth:k.depth,columns:Q.map(re=>re.id),computedWidth:k.computedWidth,groupOffset:k.groupOffset};return u().columnGroupVisibility[k.id]!==!1?xo.createElement(Hf,{horizontalLayoutPageIndex:W,bodyBrain:e,columnGroupsMaxDepth:s,domRef:A,columns:Q,width:F,height:_,columnGroup:V}):null}return xo.createElement(Uf,{domRef:A,column:K,horizontalLayoutPageIndex:W,headerOptions:c,dataSourceStatePartialForHeaderCell:w,filterTypes:P,filterDelay:D,getDataSourceState:S,dataSourceApi:T,dataSourceActions:b,width:F,height:L,columnsMap:m})},[c,n,a,l,s,f,t,S,T,b,P,D,w]);return xo.createElement($o,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:Wf,updatePosition:Wf},E=>xo.createElement("div",{...E,...y,className:te(E.className,y.className)},xo.createElement(Gi,{name:"header",renderCell:M,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:_C,cellDetachedClassNames:Ki})))}var jf=xo.memo(FC);function $f(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=ne(C=>({computedPinnedStartColumns:C.computed.computedPinnedStartColumns,computedPinnedEndColumns:C.computed.computedPinnedEndColumns,computedVisibleColumns:C.computed.computedVisibleColumns,columnSize:C.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:u,columnGroupsMaxDepth:c,computedColumnGroups:d,showColumnFilters:p}=ne(C=>({columnHeaderHeight:C.state.columnHeaderHeight,columnGroupsDepthsMap:C.state.columnGroupsDepthsMap,columnGroupsMaxDepth:C.state.columnGroupsMaxDepth,computedColumnGroups:C.state.computedColumnGroups,showColumnFilters:C.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:c+2,m=f*s+(p?s:0),g=Ft.useMemo(()=>{if(!(!d||!Object.keys(d).length))return _f(a,d,u,c)},[a,d,u]),h=Ft.useCallback(({rowIndex:C,colIndex:I})=>{let P=a[I],D=1,w=1;if(!P||!g)return{rowspan:D,colspan:w};let M=g.pathsToCells.get([C,I]);if(!M)return{rowspan:D,colspan:w};if(M.type==="column")return{colspan:w,rowspan:f-M.depth};let E=M.columnItems.findIndex(x=>x.id===P.id);return{rowspan:D,colspan:E===0?M.columnItems.length:1}},[d,c,a,g,f,u]),y=Ft.useCallback(({rowIndex:C,colIndex:I})=>h({rowIndex:C,colIndex:I}).rowspan,[h]),S=Ft.useCallback(({rowIndex:C,colIndex:I})=>h({rowIndex:C,colIndex:I}).colspan,[h]),T=Ft.useCallback(C=>p?C<f-1?s:2*s:s,[f,p,s]);Bi(e,{colWidth:l,rowHeight:T,rows:f,cols:a.length,height:m,rowspan:y,colspan:S},{fixedColsEnd:i.length,fixedColsStart:r.length});let b=Ft.createElement(jf,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:c,columnAndGroupTreeInfo:g}),R=n.vertical&&zt()?Ft.createElement("div",{className:Nc,style:{zIndex:1e3,width:zt()}}):null;return Ft.createElement("div",{className:`${xl} ${Vc}`,style:{height:m}},b,R)}var{ManagedComponentContextProvider:NC}=Mt({initSetupState:tf,forwardProps:of,Context:Ul()});function ss(o){let{getComputed:e,header:t,brain:n,headerBrain:r,wrapRowsHorizontally:i}=ne(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?Cr.createElement(NC,{...o},Cr.createElement($f,{wrapRowsHorizontally:!!i,bodyBrain:n,headerBrain:r,scrollbars:a})):null}function Yf(){return Cr.useContext(Ul()).componentState}var GC=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||To;return xe.createElement(s,{domProps:{className:Tn},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Ci=xe.createContext(null);var HC=J(ee.columnZIndexAtIndex),KC=J(ee.columnVisibilityAtIndex),us=xe.createElement("div",{className:$r[1]}),Xf=qr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[Ct]:"",[mr]:""});function BC(o){let e=o.column,{allowColumnHideWhileDragging:t}=Yf(),{dataSourceStatePartialForHeaderCell:n,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:u}=o,{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=n,{onDragItemPointerDown:f}=xn(),{api:m,getComputed:g,getState:h,actions:y,getDataSourceMasterContext:S,showColumnFilters:T,components:b,portalDOMRef:R,columnHeaderHeight:C,columnReorderDragColumnId:I,columnMenuVisibleForColumnId:P,columnReorderInPageIndex:D}=ne(H=>({api:H.api,getComputed:H.getComputed,getState:H.getState,actions:H.actions,getDataSourceMasterContext:H.getDataSourceMasterContext,showColumnFilters:H.state.showColumnFilters,components:H.state.components,portalDOMRef:H.state.portalDOMRef,columnHeaderHeight:H.state.columnHeaderHeight,columnReorderDragColumnId:H.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:H.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:H.state.columnReorderInPageIndex})),w=I===e.id,M=D!=null?r!==D:!1,{onResize:E,height:x,width:v,headerOptions:A,columnsMap:_}=o,F=e.computedSortInfo,L=e.header,O=qf(H=>{z.current=H,o.domRef?.(H)},[o.domRef]),K=A.alwaysReserveSpaceForSortIcon,W=e.headerAlign??e.align,k=(typeof W=="function"?W({isHeader:!0,column:e}):W)??"start",Q=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",V=ut(e,{actions:y,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:S,getState:h}),j=V.isSortable(),re=j&&(e.computedSorted||K)?xe.createElement(Ri,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:pe.spacing[2],marginInlineEnd:pe.spacing[2]},className:`${Bo}__sort-icon ${Lc} ${zc({align:k})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,se=e.computedFilterable&&e.computedFiltered?xe.createElement(pn,null):null,ae=e.headerCssEllipsis??e.cssEllipsis??!0,ce={reserveSpaceWhenHidden:k==="center",menuVisible:P===e.id,style:k==="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:H=>{H.stopPropagation(),V.toggleContextMenu(H.target)}}},ue=e.components?.MenuIcon||b?.MenuIcon||dr,U=xe.createElement(ue,{...ce}),z=zC(null),Y={horizontalLayoutPageIndex:r,dragging:w,domRef:O,htmlElementRef:z,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:F,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:c,selectionMode:p,api:m,dataSourceApi:a,columnApi:V,renderBag:{sortIcon:re,filterIcon:se,menuIcon:U,menuIconProps:ce,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},$=Y,X=$.renderBag.header,q=()=>{let H={...Y,renderBag:{...Y.renderBag}};if(e.renderSortIcon&&(H.renderBag.sortIcon=xe.createElement(wo,{render:e.renderSortIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderFilterIcon&&(H.renderBag.filterIcon=xe.createElement(wo,{render:e.renderFilterIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),typeof e.renderMenuIcon=="function"&&(H.renderBag.menuIcon=xe.createElement(wo,{render:_e=>{if(typeof e.renderMenuIcon!="function")return null;let $e=e.renderMenuIcon(_e);return $e?$e.type===ue||$e.type===dr?$e:xe.createElement(ue,{...ce},$e):null},renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){H.renderBag.selectionCheckBox=xe.createElement(wo,{render:GC,renderParam:{...H,renderBag:{...H.renderBag}}});let _e=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;_e&&_e!==!0&&(H.renderBag.selectionCheckBox=xe.createElement(wo,{render:_e,renderParam:{...H,renderBag:{...H.renderBag}}}))}L instanceof Function&&(H.renderBag.header=X=xe.createElement(wo,{render:L,renderParam:{...H,renderBag:{...H.renderBag}}}));let Ne=e.renderMenuIcon===!1?null:H.renderBag.menuIcon,pt=ae?xe.createElement("div",{className:_t},H.renderBag.header):H.renderBag.header,le=xe.createElement(xe.Fragment,null,k==="center"?us:null,H.renderBag.selectionCheckBox,pt,H.renderBag.sortIcon,H.renderBag.filterIcon,k==="center"?us:null,k!=="center"?us:null,Ne);return e.renderHeader?xe.createElement(wo,{render:e.renderHeader,renderParam:{...H,renderBag:{...H.renderBag,all:le}}}):le};kC(()=>{let H=null,Ne=z.current;return E&&Ne&&(H=an(Ne,E)),()=>{H?.()}},[z.current,o.onResize]);let fe={height:x};e.headerStyle&&(fe=typeof e.headerStyle=="function"?{...fe,...e.headerStyle($)||{}}:{...fe,...e.headerStyle});let me=typeof e.headerClassName=="function"?e.headerClassName($):e.headerClassName,{onPointerDown:ie,proxyPosition:G,dragColumnOutside:N}=Wd({columnId:e.id,domRef:z,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),ge=null,Ee=Ci.Provider,Ce={filtered:e.computedFiltered,verticalAlign:Q,align:k},Re=xe.useMemo(()=>{let H=Ne=>{m.setColumnFilter(e.id,Ne)};return u>0?Et(H,{wait:u}):H},[u,e.id]),Ae=e.computedFilterType,Ge=s[Ae],et=e.computedFilterable?e.computedFilterValue?.filter.operator??Ge?.defaultOperator:void 0,Xe=e.computedFilterable&&Ge?Ge.operators.find(H=>H.name===et):void 0,tt=Xe?.components?.FilterEditor||Ge?.components?.FilterEditor||e.components?.FilterEditor||gn,Ze=Ge?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,Ue=Gp(e,{horizontalLayoutPageIndex:r}),B=`var(${HC}-${e.computedVisibleIndex})`;fe.zIndex=B,fe.visibility=`var(${KC}-${e.computedVisibleIndex}, visible)`;let oe={"data-field":`${e.field||""}`,"data-column-id":e.id,[Ct]:e.id,[mr]:"header","data-header-align":k,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},he=e.computedFilterable?xe.createElement(td,{horizontalLayoutPageIndex:r,filterEditor:tt,filterOperatorSwitch:Ze??od,operator:Xe,filterTypes:s,onChange:Re,columnFilterType:Ae,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:C}):xe.createElement(nd,null);$.renderBag.filterEditor=he;let be=qf(H=>{ie(H),f(H)},[ie,f]),nt=q();return w&&G&&(ge=xe.createElement("div",{key:e.id,className:`${Bo}Proxy ${vc}`,style:{height:x,width:v,left:G.left??0,top:G.top??0}},xe.createElement("div",{className:Pc({visible:N})},xe.createElement(ef,{size:16})),X),ge=VC(ge,R.current)),xe.createElement(Ee,{value:$},xe.createElement(bi,{domRef:O,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...oe,"data-z-index":B,style:fe,width:v,onPointerDown:be,contentClassName:te(wc(Ce),ec[k]),contentStyle:T?{height:x/2}:void 0,className:te(Bo,ic.none,j?Qu.pointer:"",me,ii(e,[Bo,Zt],Dc,{dragging:w,insideDisabledDraggingPage:M,align:k,verticalAlign:Q,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Ic),cssEllipsis:ae,afterChildren:xe.createElement(xe.Fragment,null,T?he:null,Ue),renderChildren:nt}),ge)}var Uf=xe.memo(BC);function ni(){return LC(Ci)}import*as eo from"react";import{useEffect as WC}from"react";function Zf(o,e){let{separator:t}=e??{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Qf={padding:pe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},jC={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Jf=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Zf(t),n,"important")},em=eo.forwardRef(function(e,t){let{rootClassName:n}=Ur(),r=eo.useRef(null),i=eo.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return WC(()=>{let a=()=>{setTimeout(()=>{Jf(r.current,Qf),Jf(r.current?.firstElementChild,jC)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),eo.createElement("div",{ref:i,...e,className:te(`${n}-Footer`,pd,e.className),style:Qf},"Powered by"," ",eo.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});var ji=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new Z(n.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new Z(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Rt=class extends ji{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 Dt(){let o=De().performance?.now();return`${Date.now()}:${o}`}function Ui(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var tm=new WeakMap;function $i(o,e){if(!o||!o.length)return[];let t=tm.get(o);t||(t=new WeakMap,tm.set(o,t));let n=t.get(e);if(n)return n;let r=[],i=Ui(o,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 cs(o,e){if(!o.length)return!0;let{data:t}=e,n={data:t,index:e.index,dataArray:e.dataArray,primaryKey:e.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let r=0,i=o.length;r<i;r++){let a=o[r];if(n.field=a.field,n.filterValue=a.value,n.currentValue=a.valueGetter?a.valueGetter(n):a.field?t[a.field]:t,n.emptyValues=a.emptyValues,!a.fn(n))return!1}return!0}var UC=0;function om(o){return UC++,cs($i(o.filterValue,o.filterTypes),o)}function ds(o){return $i(o.filterValue,o.filterTypes).length?o.isLeafNode?om(o):o.filterTreeNode(o.data):!0}var $C="group-by",nm="group-by-";function rm(o){let e=o.map(t=>t.valueGetter?n=>t.valueGetter({data:n,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function Yi(o,e){if(!o?.length||!e?.length)return o;let t=!1,n=o.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===$C){let i=rm(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(nm)){let i=r.id.slice(nm.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=rm([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?n:o}var im=!0,YC={originalDataArray:!0,changes:!0},qC={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function Nt(o,e,t){let n=Yi(o.sortInfo,o.groupBy),r=o.multiSort?n:n?.[0]??null,i={append:!1,originalDataArray:o.originalDataArray,sortInfo:r,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(i.livePaginationCursor=o.livePaginationCursor,i.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=o.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],o.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=o.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=ps(i.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=o.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!YC[s]){let u=s,c=qC[u],d=i[u],p=l[u];(c?c(d,p):d===p)||(a[u]=!0)}return i.changes=a,i}function to(o,e,t,n,r){let i=Nt(e,n,r),a=i.append;if(e.lazyLoad){let c=e.originalLazyGroupData,d=[yt,...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:im,totalCount:0}),t.originalLazyGroupDataChangeDetect=Dt()}if(typeof o=="function")try{o=o(i)}catch(c){o=Promise.reject(c)}let s=typeof o=="object"&&typeof o.then=="function"&&(!e.lazyLoad||e.lazyLoad&&!a);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([yt,...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=Dt();else{let m=e.lazyLoadCacheOfLoadedBatches,g=[...d,i.lazyLoadStartIndex??0];m.has(g)&&m.set(g,"failed"),p&&(p.childrenLoading=!1,p.error=f)}}s&&(t.loading=!1)};return Promise.resolve(o).then(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(y,S,T){let b=[yt,...y],R=S.data,C={cache:S.cache??im,childrenLoading:!1,childrenAvailable:!0,totalCount:S.totalCount??R.length,totalCountUnfiltered:S.totalCountUnfiltered,totalChildrenCount:S.totalChildrenCount,totalChildrenCountUnfiltered:S.totalChildrenCountUnfiltered,children:R,error:S.error},I=[];if(i.lazyLoadBatchSize&&!T){let D=g.get(b),w=!D,M=qc({children:!0},D||{},C);w&&(M.chidren=[]),M.children.length=M.totalCount;let E=i.lazyLoadStartIndex??0,x=Math.min(S.totalCount??R.length,E+i.lazyLoadBatchSize);for(let v=E;v<x;v++){let A=C.children[v-E];if(!A)throw`lazily loaded item not found at index ${v-E}`;M.children[v]=A,A.dataset&&I.push({keys:A.keys,dataset:A.dataset})}w&&g.set(b,M)}else C.children.forEach(D=>{D&&D.dataset&&I.push({keys:D.keys,dataset:D.dataset})}),C.children.length=C.totalCount,g.set(b,C);let P=!1;if(!y||!y.length){let D=g.get([yt]);t.originalDataArray=[...D.children],P=!0}if(P||(t.originalLazyGroupDataChangeDetect=Dt()),I.length){let D=y;I.forEach(({keys:w,dataset:M})=>{h(w,M,D)})}};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 ps(o,{filterTypes:e,filterMode:t}){return t==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(am):(Ui(o,e)||[]).map(am)}function am(o){if(!o.valueGetter)return o;let e={...o};return delete e.valueGetter,e}function lm(){let o;return(e,t,n)=>{if(o&&o.filterValue===e&&o.filterTypes===t&&o.filterMode===n)return o.result;let r=ps(e,{filterTypes:t,filterMode:n});return o&&o.filterValue===e&&JSON.stringify(o.result)===JSON.stringify(r)&&(r=o.result),o={filterValue:e,filterTypes:t,filterMode:n,result:r},r}}var XC=()=>new Promise(o=>{Ve(o)});function fs(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function sm(o){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:n}=o;if(!e||!t||t<=0)return!1;for(let r of n.keys())if(r.length===1)return!0;return!1}function um(o){for(let[e,t]of o.entries())t==="failed"&&o.delete(e)}function cm(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,u=l?()=>!1:g=>s[g].data!=null,c=!l,d=new Z,p=["_______xxx______"];for(let g=t;g<=n;g++){let h=s[g];if(!h)continue;let y=u(g),S=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&S.pop();let T=S.length?S:p,b=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let R={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:c},C=h.groupKeys,I=d.get(C);if(!I?.[h.id]){let P=!I;I=I||{},I[h.id]||(I[h.id]=R),P&&d.set(C,I)}}if(!y&&r!=null){let R=d.get(T),C=Math.floor(b/r)*r,I=b-C,P=s[h.indexInAll-I].indexInAll,D=u(P),w=s[P].id;if(D||R?.[w])continue;let M=!R;R=R||{};let E={lazyLoadStartIndex:C,lazyLoadBatchSize:r,groupKeys:S,append:c};R[w]||(R[w]=E),M&&d.set(T,R)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let y=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(y))return g;e?.set(y,!0);let S=[i.data,i,a,h];return g.then(()=>XC()).then(()=>to(...S))},f)}function ms(o,e){let{rowIndex:t,primaryKey:n}=e,{dataArray:r}=o.getDataSourceState();if(n!==void 0){let i=o.dataSourceApi.getIndexByPrimaryKey(n);if(i!==-1)return i;if(r[t]?.id!==n)return-1}return r[t]?t:-1}function Rr(o,e){let t=ms(o,e);return t===-1?null:Kt({...o,rowIndex:t,columnId:e.columnId})}function Ir(o,e){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function gs(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[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&&(n.columnMenuVisibleForColumnId=p),p}function qi(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function hs(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function dm(o,e,t){if(hs(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/n),p=Math.floor(u/n),f=l%n,m=u%n,g=Math.min(f,m),h=Math.max(f,m),y=[];for(let S=d;S<=p;S++)for(let T=g;T<=h;T++){let b=S*n+T;if(S===d)for(let R=s;R<r;R++)y.push({rowIndex:b,colIndex:R});else if(S===p)for(let R=0;R<=c;R++)y.push({rowIndex:b,colIndex:R});else for(let R=0;R<r;R++)y.push({rowIndex:b,colIndex:R})}return y}function ZC(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var ys=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Co(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new We(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=Co(l,this.getDataSourceState),h=Co(u,this.getDataSourceState);if(!g||!h)return;let y=g.indexInAll,S=h.indexInAll,[T,b]=qi({rowIndex:y,colIndex:f},{rowIndex:S,colIndex:m});for(let R=T.rowIndex;R<=b.rowIndex;R++)for(let C=T.colIndex;C<=b.colIndex;C++){let I={rowIndex:R,colIndex:C},[P,D]=this.getCellSelectionPosition(I);n?a.selectCell(P,D):a.deselectCell(P,D)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=di(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=ZC(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 n=new We(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new We(t);n.debugId=e.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new We:new We(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new We(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new We(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new We(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function pm(o){return new ys(o)}var _n=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var xt=class extends _n{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function fm(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new xt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new xt({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 xt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new xt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Eo(o,e,t){return Math.min(Math.max(o,e),t)}function Xi(o,e,t){let n=o().dataArray,r=0,i=n.length-1,a=e;do{a+=t;let l=n[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Eo(a,r,i)}function QC(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().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,y=0,S=u-1,T={ArrowDown:()=>{p=Xi(n,p,1)},ArrowUp:()=>{p=Xi(n,p,-1)},ArrowLeft:()=>{let R=s[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p-C>=y?p=p-C:T.ArrowUp();return}return R&&R.isGroupRow?i.collapseGroupRow(R.groupKeys):R&&i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.collapseRowDetail(R.id):!1},ArrowRight:()=>{let R=s[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p+C<=S?p=p+C:T.ArrowDown();return}return R&&R.isGroupRow?i.expandGroupRow(R.groupKeys):R&&i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.expandRowDetail(R.id):!1},Enter:()=>{let R=s[p];return R&&R.isGroupRow?i.toggleGroupRow(R.groupKeys):R&&R.isTreeNode&&R.isParentNode?a.treeApi.toggleNode(R.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.toggleRowDetail(R.id):!1},PageDown:()=>{p=Math.min(p+h,u-1)},PageUp:()=>{p=Math.max(p-h,y)},End:()=>{p=S},Home:()=>{p=y}},b=T[l];return b?(b(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Ss(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,u=i().dataArray,c=n(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[y,S]}=p.getRenderRange(),T=y-g-1,b=S-h-1,R=i().dataArray.length-1,C=r().computedVisibleColumns.length-1,I=0,P=0;f=Eo(f,0,R),m=Eo(m,0,C);let D={ArrowDown:()=>{f=Eo(f+1,I,R)},ArrowUp:()=>{f=Eo(f-1,I,R)},ArrowLeft:()=>{if(m===P)if(f!==I&&(m=C),p.isHorizontalLayoutBrain){let M=p.rowsPerPage;f-M>=I?f=f-M:D.ArrowUp()}else D.ArrowUp();else m=Eo(m-1,P,C)},ArrowRight:()=>{if(m===C)if(f!==R&&(m=P),p.isHorizontalLayoutBrain){let M=p.rowsPerPage;f+M<=R?f=f+M:D.ArrowDown()}else D.ArrowDown();else m=Eo(m+1,P,C)},Enter:()=>{let M=u[f];return M&&M.isGroupRow?t.toggleGroupRow(M.groupKeys):M&&M.isTreeNode&&M.isParentNode?a.treeApi.toggleNode(M.nodePath):M&&t.rowDetailApi.isRowDetailEnabledForRow(M.id)?t.rowDetailApi.toggleRowDetail(M.id):!1},PageDown:()=>{s?m=Math.min(m+b,C):f=Math.min(f+T,R)},PageUp:()=>{s?m=Math.max(m-b,P):f=Math.max(f-T,I)},End:()=>{s?m=C:f=R},Home:()=>{s?m=P:f=I}},w=D[l];return w?(w(),[f,m]):!1}function JC(o,e){let t=Ss(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var eR={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function mm(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!eR[t]?!1:i!=null&&l==="row"?QC(o,e):a!=null&&l==="cell"?JC(o,e):!1}var bs=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:n}=this.param,{activeRowIndex:r,keyboardNavigation:i}=n();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Xi(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,n=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Ss(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function gm(o){return new bs(o)}function hm(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var Ts=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(p=>requestAnimationFrame(p));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a=ms({...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={...Kt({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;n.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let 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:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...Kt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(Kt({...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,n=this.columnApiById.get(t);if(n)return n;let r=ut(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),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=wn({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 n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new Rt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),n=new Rt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[yt,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||to(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=Z.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Dt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let g=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let 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+(n.offset||0),m=u.scrollTop>p+(n.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=lp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=gm({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=fm({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=pm({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(gs(t),e?.()),setTimeout(()=>{this.isDestroyed()||(gs(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??gp({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(Kt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,n){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,n);return}let l=!!i.pivotColumn,s=i.groupByForColumn,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(go);d.length&&(u=d);let p=i.computedSortType;if(c.length&&p===qt){let m=this.getState().initialColumns;p=c.flatMap(h=>{let y=h.field??h.groupField,S=y?r.get(y):null;if(S)return S.computedSortType;let T=y?ko(m,y):void 0;return T?T.sortType||(typeof T.type=="string"?T.type:"string"):[qt]})}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,n)}setSortInfoForColumn(e,t,n){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!hm(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:hm(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 n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;n.computedFilterValue?(c={...n.computedFilterValue,filter:{...n.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:n.valueGetter},n.field&&(c.field=n.field)),c.id=n.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],u=n.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(go),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n={...this.getState().columnVisibility};t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollLeft=Math.max(e,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollTop=Math.max(e,0))}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=n.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),c&&(n.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),u=n.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function ym(o){return new Ts(o)}import{useEffect as bm,useRef as oR,useState as nR}from"react";var tR=10;function Sm(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${Zt} > .${ar}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${Bo}`);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(..._t.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let g=De().getComputedStyle(c);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+tR}if(m+=s[p],d){let g=0;c.childNodes.forEach(h=>{if(h!==u&&h.nodeType===1){let y=h,S=Math.max(y.offsetWidth,parseInt(y.style.width,10));if(isNaN(S)&&(S=0),g+=S,S>0){let T=De().getComputedStyle(y);g+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Tm(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=At(),[a,l]=nR(0),s=typeof r=="object"?r.key:r,u=Fe(s),c=oR(null);bm(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),bm(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let g=Sm(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let y=o().columnSizing,S={...y},T=!1;h.forEach(b=>{S[b]={width:g[b]},T=T||S[b].width!==y[b]?.width}),T&&(e.columnSizing=S)},[s,n,a])}import{useEffect as _I,useMemo as OI,useState as Gs}from"react";var Zi=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,n,r){if(r.horizontalLayout&&!hs(e,t,r)){dm(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=qi(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&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function rR(o,e){return o<e?[o,e]:[e,o]}var Qi=class{constructor(e){this.multiSelectStartIndex=0;this.getRowAt=e.getRowAt,this.isNodeSelectable=e.isNodeSelectable??(()=>!0)}set rowSelectionState(e){this._rowSelectionState=e,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(e){this._treeSelectionState=e}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(e){return e.isGroupRow||!!e.isParentNode}isExpanded(e){return e.isGroupRow?!e.collapsed:!!e.nodeExpanded}getPath(e){if(e)return this._treeSelectionState?e.nodePath:this.getGroupKeys(e)}getGroupKeys(e){return e.groupKeys&&e.groupKeys.length?e.groupKeys:void 0}setSelectedAt(e,t){let n=this.getRowAt(e);if(!n||n.rowDisabled||n.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){n.nodePath&&this.isNodeSelectable(n)&&r.setNodeSelection(n.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(n);if(n.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(n.id,a):i.deselectRow(n.id,a)}isSelectedAt(e){let t=this.getRowAt(e);if(!t)return!1;if(this._treeSelectionState)return t.nodePath?this._treeSelectionState.isNodeSelected(t.nodePath):!1;let n=this.getGroupKeys(t);return t.isGroupRow?n?this.rowSelectionState.isGroupRowSelected(n):!1:this.rowSelectionState.isRowSelected(t.id,n)}setRangeSelected(e,t,n){let[r,i]=rR(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,n))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let n=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!n||!r||r.length<n.length?!1:n.every((i,a)=>i===r[a])}resetClick(e){this.deselectAll(),this.setSelectedAt(e,!0),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){if(this.isSelectedAt(e))this.setSelectedAt(e,!1),this.isSelectedAt(e+1)&&(this.multiSelectStartIndex=e+1);else{this.setSelectedAt(e,!0),this.multiSelectStartIndex=e;let t;for(let n=e-1;n>=0&&this.isSelectedAt(n);n--)t=n;this.multiSelectEndIndex=t}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,e,!0),this.multiSelectEndIndex=e}};import{useMemo as mI}from"react";import*as pg from"react";var iR=()=>{};function aR(o,e){let t=new Z,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let 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[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function Cm(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(n),d=[...t,c],p=r(n),f=lt(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let y=m[g];Cm(o,e,d,y)}});p?(u?.(n),s?.(n,iR)):(l?.(n,f,i(n)),s?.(n,f))}function Rm(o,e,t){for(let n=0,r=t.length;n<r;n++)Cm(o,e,[],t[n])}var lR=function(o,e){return o-e},sR=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},uR=function(o,e){return o-e},cR={number:lR,string:sR,date:uR},Mo=cR;function Im(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var oo=(o,e,t)=>{let n=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(wm(Im(o),n)),r&&r.end(),e},Cs=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=wm(Im(o),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,u=d=>d[l],c=d=>d[l]===void 0;return Rm({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)),n&&n.end(),e};oo.knownTypes=Mo;var dR=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=oo.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(oo.knownTypes).join(", ")}`)}return r||(r=Mo.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:n*u}},pR=o=>o.map(dR).filter(e=>e instanceof Function),wm=(o,e)=>{let t=pR(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};import*as fR from"react";function Rs(o){return Oe(e=>o(e.dataSourceState))}var mR=qe("IT:InfiniteTable"),gR="#dc3545",hR="#eb9316";var Pm="Warn",Dm="Error",yR="Info",SR="Success",bR="Logs",Ji=mR.extend(bR),AV=Ji.extend(yR),TR=Ji.extend(Pm),CR=Ji.extend(Dm),_V=Ji.extend(SR);var RR=hR,IR=gR;var wR=(o,e)=>{e=e?e.extend?e.extend(Pm):e:TR,e(typeof e.color=="function"?e.color(RR,o):o)},vR=(o,e)=>{e=e?e.extend?e.extend(Dm):e:CR,e(typeof e.color=="function"?e.color(IR,o):o)};var vm=new Z,xm=(o,...e)=>{vm.has(e)||(vm.set(e,!0),o())};var Em=(o,e=o,t)=>{xm(()=>wR(o,t),e,"warn")},Mm=(o,e=o,t)=>{xm(()=>vR(o,t),e,"error")};var Is=new WeakMap,PR=o=>o;function Am(o,e=50,t){Is.set(o,{lastCallTime:0,lastCallArg:null});let n=t??PR;return r=>{let{lastCallTime:i,lastCallArg:a}=Is.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=mt(n(a),n(r));s<e&&u||(Is.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var ea=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new Z;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let u=n&&!n.isEmpty();if(u&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let c=[...n.getMutationsArray(),...n.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)}}n?.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),y=s?[...p,h]:void 0,S=s&&!!y,T=S?n?.getMutationsForNodePath(y):n?.getMutationsForPrimaryKey(h);if(T&&T.length){for(let b=0,R=T.length;b<R;b++){let C=T[b];if(C.type==="delete"&&!g&&(S?this.removeNodePath(y,t):this.remove(h),g=!0,d.splice(f,1),f--),C.type==="update"&&!g&&(m={...m,...C.data},d[f]=m),C.type==="update-children"&&!g){let I=C.children(m[l],m);m={...m},I!==void 0?m[l]=I:delete m[l],d[f]=m}C.type==="insert"&&(C.position==="before"?(d.splice(f,0,C.data),f--):d.splice(f+1,0,C.data))}S?n?.removeNodePathInfo(y):n?.removeInfo(h)}if(!g)if(S){this.addNodePath(y,m);let b=a(m),R=b?null:i(m);!b&&Array.isArray(R)&&(p.push(h),u&&(m[l]=R=R.concat()),c(R,p),p.pop())}else this.add(h,m)}}};c(e,[])}return e}}};var DR=Object.freeze([]),_m=(o,e)=>{let t=o??DR,n=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===n.length)return r}return e&&t&&e.set(t,n),n};var It=class extends _n{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function ta(o,e){if(o===e)return!0;if(o==null||e==null)return o===e;if(typeof o!=typeof e)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0,n=o.length;t<n;t++)if(!ta(o[t],e[t]))return!1;return!0}if(typeof o=="object"){let t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!ta(o[r],e[r]))return!1;return!0}return!1}function xR(o,e){return!(o===void 0||e===void 0||o.isGroupRow!==e.isGroupRow||o.dataSourceHasGrouping!==e.dataSourceHasGrouping||o.isTreeNode!==e.isTreeNode||o.isTreeNode&&o.isParentNode!==e.isParentNode)}var oa={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Om={...oa,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},ER={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},MR={...oa,...ER,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},Fm={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},AR={...oa,...Fm,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},_R={...oa,...Fm,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},OR=Object.entries(Om).map(([o,e])=>e?o:void 0).filter(Boolean),FR=Object.entries(Om).map(([o,e])=>e?o:void 0),NR=Object.entries(MR).map(([o,e])=>e?o:void 0),LR=Object.entries(AR).map(([o,e])=>e?o:void 0),kR=Object.entries(_R).map(([o,e])=>e?o:void 0);function zR(o,e){if(o===e)return!0;if(!o||!e||!xR(o,e)||o.id!==e.id||o.data!==e.data&&!ta(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?NR:FR:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?kR:LR:t=OR;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!ta(r,i))return!1}return!0}function Nm(){let o=[],e=new Map,t=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=o,g=f?.marker,y=p!==m&&t.size>0;y&&(n={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let S=[],T=l();for(let b of T){let R=m[b],C=p[b];if(C===void 0){S.push(b);continue}zR(R,C)||S.push(b)}o=p,(S.length>0||y)&&queueMicrotask(()=>{for(let b=0,R=S.length;b<R;b++){let C=S[b],I=e.get(C);if(I)for(let P of I)P()}if(y)for(let b of Array.from(t))b()}),g&&g.end({details:[{name:"updated row infos",value:S.length}]})},i=p=>o[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],e.clear(),t.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var no=new Map,ro=new Map,Ao=new Map,io=new Map,jt=new Map;var VR=Symbol("cursorId"),Lm=o=>o.totalLeafNodesCount===0,GR=o=>o.isParentNode?!Lm(o):!0;function km(o){let e=Date.now(),t=[],n=[],r=new Z;return{logger:Pt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Nm(),indexer:new ea,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new Z,waitForNodePathPromises:new Z,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new Z,dataParams:void 0,onCleanup:Se(),notifyScrollbarsChange:Se(),notifyScrollStop:Se(),notifyRenderRangeChange:Se(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:VR,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function HR(o){let e={...o};return delete e.originalDataArray,e}var KR=[],zm=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},Vm=(o,e)=>({onDataParamsChange:t=>t?Am(t,100,HR):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Lm,isNodeSelectable:t=>t??GR,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=>({...zo,...t}),sortTypes:t=>({...Mo,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,n)=>{let r={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(n.idToPathMap.set(s.id,s.nodePath),e.debugId&&n.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),n.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof It)return t;let n=o.propsCache.get("rowDisabledState"),r=n.get(t);return r||(r=new It(t),n.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>_m(t,o.propsCache.get("sortInfo")),groupBy:t=>t??KR});function BR(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}function WR(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let e={};return o.filterValue!=null&&(e.filterValue=o.filterValue),o.sortInfo!=null&&(e.sortInfo=o.sortInfo),o.groupBy!=null&&(e.groupBy=o.groupBy),o.pivotBy!=null&&(e.pivotBy=o.pivotBy),e}var jR={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Gm(o,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
1
+ var hS=Object.create;var Cu=Object.defineProperty;var yS=Object.getOwnPropertyDescriptor;var SS=Object.getOwnPropertyNames;var bS=Object.getPrototypeOf,TS=Object.prototype.hasOwnProperty;var CS=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var RS=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of SS(e))!TS.call(o,r)&&r!==t&&Cu(o,r,{get:()=>e[r],enumerable:!(n=yS(e,r))||n.enumerable});return o};var rn=(o,e,t)=>(t=o!=null?hS(bS(o)):{},RS(e||!o||!o.__esModule?Cu(t,"default",{value:o,enumerable:!0}):t,o));var Go=CS((IM,Pd)=>{"use strict";Pd.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});function Et(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}import*as Pe from"react";var te=(...o)=>o.filter(e=>!!`${e}`).join(" ");import*as Fo from"react";import{useRef as Fu}from"react";import*as IS from"react";import{useMemo as jv,useRef as wS,useEffect as vS,useLayoutEffect as PS,useCallback as Uv}from"react";var an=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Et(e,{wait:n}):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=o.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(o),()=>{a.disconnect()}};var zr=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=wS({width:0,height:0}),r=i=>{let a;return o.current&&(a=an(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};vS(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),PS(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};function Se(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,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 lt(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Ru=(o,e)=>o-e;var Vr=(o,e)=>Ru(o.revision,e.revision),Z=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.mutations=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),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],y=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let S=t(f.value,h,l,y,f);if(n&&S===!0)return!0;l++}else y?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(n&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new o;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push(i)},t),n}getEntriesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push([r,i])},t),n}getLeafNodesStartingWith(e,t,n){let{respectOrder:r=!1}=n||{},i=[],a=[];return this.getStartingWith(e,(l,s,u)=>{!u.map&&u.hasOwnProperty("value")&&(r?i.push(u):a.push(t(u)))},n),r?i.sort(Vr).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},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(!n&&u.has(this.emptyKey))return[[]];return c&&c.value!==void 0&&(n||(s({...c,keys:e}),d=!0)),d?i?a.sort(Vr).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,u,r,n),i?a.sort(Vr).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let 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,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let n=this.map;this.mutations++,e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((n,r)=>{let{map:i}=n;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],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,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],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 n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],u=lt(()=>{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((n,r)=>{let i=e({...n,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Vr);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=Z;function De(){return globalThis}var Hr=["#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"],Iu=Symbol("color"),Gr=new WeakMap,za=Se();function Va(o=Hr){Gr.set(o,o.map(e=>0))}Va();var DS=(o=Hr)=>{let e=[];Gr.has(o)?e=Gr.get(o):(e=o.map(n=>0),Gr.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??Hr[0]},Bn=":",Ga="*",wu="-",xS=",",ES="debug",MS="diffdebug",Pu=!1,Kn=new Z,Wn=new Map;function Ha(o,e){let t=o.split(Bn),n=new Z;n.set(t,!0);let r=e.split(Bn),i=new Set(r).has(Ga),a=r.indexOf(Ga),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(Bn)):!0}}function Du(o,e){let t=`channel=${o}_permissions=${e}`;if(Wn.has(t))return Wn.get(t);let n=e.split(xS);function r(l){return Wn.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(Ga)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(wu);if(u&&(s=s.substring(wu.length)),Ha(o,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)),Ha(o,s))return r(!u)}return r(!1)}var Ka=()=>qe.enable??(De()&&De().localStorage?.getItem(ES))??"",AS=()=>qe.diffenable??(De()&&De().localStorage?.getItem(MS))??`${Pu}`,Ba="",xu=Pu;function Wa(o){xu=`${AS()}`=="true",Ba!==o&&(Ba=o,Wn.clear())}function Eu(o){Wa(Ka()),typeof De()<"u"&&De().addEventListener&&De().addEventListener("storage",function(){Wa(Ka())});function e(t,n){let r=n?`${n}${Bn}${t}`:t,i=r.split(Bn),a=Kn.get(i);if(a)return a;let l=Kn.get(i.slice(0,-1)),s=(l?l.logFn:qe.logFn)??Mu,u=s,c,d=0,p=()=>c??Du(r,Ba),f=DS(qe.colors),m=Object.defineProperties((...g)=>{let h=za.getListenersCount(),y;if(h>0&&(y=y??Date.now(),za({color:f,channel:r,args:g,timestamp:y})),p()){if(y=y??Date.now(),d&&xu){let b=y-d;u(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=y;let S=[],T;if(g.forEach(b=>{if(b[Iu])T===void 0&&(T=!0),S.push(...b);else{if(typeof b!="string"&&typeof b!="number"){T=!1;return}S.push(`${b}%s`)}}),T){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...S,""];u(...b)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let y=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return y.toString=()=>h.join(" "),y[Iu]=!0,y}},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:()=>{Kn.delete(i)}}});return Kn.set(i,m),m}return e(o)}var Mu=console.log.bind(console),vu;Object.defineProperty(Eu,"enable",{get:()=>vu,set:o=>{vu=o,Wa(Ka())}});var qe=Eu;qe.colors=Hr;qe.logFn=Mu;var _S=(o,e)=>za.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;Ha(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});qe.onLogIntent=_S;qe.isChannelEnabled=Du;qe.destroyAll=()=>{Va(),Va(qe.colors),Kn.clear(),Wn.clear()};var Pt=o=>{let e=qe(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},fo=o=>{let e=qe(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},jn=()=>jn;jn.extend=()=>jn;var ft=class{constructor(e){this.debug=jn,this.error=jn}};var Au=fo("CSSVariableWatch"),_u=Pt("CSSVariableWatch"),Ou={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var OS=o=>{let e=Fu(0),t=Fo.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);zr(o.ref,t,{earlyAttach:!0}),Fo.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,_u(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);Au(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Un=o=>{let e=Fu(null);OS({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return Fo.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Ou},Fo.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};import{useCallback as LS,useContext as Ua}from"react";function mo(){let o=null,e=new Set;return{getSnapshot(){return o},setSnapshot(t){o=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}import{useCallback as FS,useRef as Kr,useSyncExternalStore as NS}from"react";function mt(o,e,t){if(o===e)return!0;if(!o||!e)return!1;let n=typeof o;if(n!==typeof e||n!=="object")return!1;var i=Object.keys(o),a=Object.keys(e);t&&(i=i.filter(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))&&(o[u]!==e[u]||!Object.prototype.hasOwnProperty.call(e,u)))return!1}return!0}function Nu(o,e,t){let n=Kr(e);n.current=e;let r=Kr(t);r.current=t;let i=Kr(void 0),a=Kr(!1),l=FS(()=>{let s=o.getSnapshot(),u=n.current(s);return a.current&&r.current(i.current,u)?i.current:(i.current=u,a.current=!0,u)},[o]);return NS(o.subscribe,l,l)}function Br(o,e){return Nu(o,e,Object.is)}function ln(o,e){return Nu(o,e,mt)}import*as Lu from"react";var ja;function sn(){return ja||(ja=Lu.createContext(null))}var ku=mo(),zu=()=>{};function Wr(){let o=sn();return Ua(o)||void 0}function jr(){let o=Wr();return LS(()=>o?.getSnapshot(),[o])}function Yt(o){let e=sn(),t=Ua(e),n=ln(t||ku,t?o:zu);return t?n??void 0:void 0}function No(){let o=sn(),e=Ua(o),n=Br(e||ku,e?r=>r.masterRowInfo:zu);return e?n:void 0}import*as un from"react";import{useReducer as US,createContext as $S,useMemo as Xa,useEffect as YS,useState as $u,useRef as Yu,useLayoutEffect as qS}from"react";function go(o){if(o==null)return!1;let e=o;return!0}import{useCallback as VS,useEffect as GS,useRef as $a}from"react";import{useCallback as kS,useState as zS}from"react";var kt=()=>{let[o,e]=zS(0);return[o,kS(()=>{e(t=>t+1)},[e])]};var Vu=o=>{let e=VS(o,[]),t=$a(!1),n=$a(!1),r=$a(void 0),[i,a]=kt();t.current&&(n.current=!0),GS(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};import{useCallback as HS,useRef as KS}from"react";function Fe(o){let e=KS(o);return e.current=o,HS(()=>e.current,[])}import{useRef as BS,useLayoutEffect as WS}from"react";var Lo=(o,e)=>{let t=BS(e===void 0?o:e);return WS(()=>{t.current=o}),t.current};var $n={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 Ya=class o{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,n=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",u=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:u,color:r,properties:a.length>0?a.map(c=>[c.name,c.value]):void 0,tooltipText:l}}}),this};this.debugId=e}static create(e){return new o(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys($n).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:$n[n].track,label:i.label}),get label(){let i=$n[n];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,n,{get:()=>{let i=$n[n];return e.markerDetails.track=i.track,r}}),t},{})}};function ot(o){return Ya.create(o)}function Gu(o,e){let t=new Set;function n(...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 o.apply(this,s)}return{fn:n,propertyReads:t}}var qa=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Yn(o){return o!==void 0}function ho(o,e){let t=e[o];return Yn(t)}var Hu=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)};function jS(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=ho(r,e)?e[r]:e[`default${qa(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function Ku(o,e,t){let{fn:n,propertyReads:r}=Gu(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=n(e);return r.forEach(a=>t.add(a)),i}function Bu(o){let{props:e,initialSetupState:t,propsToForward:n,parentState:r,mapPropsToState:i,propsToStateSet:a}=o,l={};n&&(l=jS(n,e,t));let s={...t,...l};if(i){let u=Ku(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...u}}return s}function Wu(o,e,t){let{getProps:n,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,u=e.payload.mappedState,c=e.payload.updatedPropsToState,d={...o};if(u&&Object.assign(d,u),i){let f=Ku(i,{props:n(),state:d,oldState:o,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:o,state:d,updatedProps:c,parentState:s}):d}function ju(o){let{dispatch:e,getState:t,getProps:n,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=Hu}=o,u=t();return Object.keys(u).reduce((c,d)=>{let p=d;return Object.defineProperty(c,d,{set:m=>{let g=n(),h=t(),y=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:c,state:h})===!1&&(y=!1),y){let b=[m],R=`on${qa(d)}Change`;if(l&&l[p]){let C=l[p](m,h);R=C.callbackName||R,b=C.callbackParams}s(g,R,b)}let S=r[p];typeof S=="function"&&(m=S(m));let T=!!i?.[p];ho(d,g)&&!T||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),c},{})}function Uu(o){let{currentProps:e,prevProps:t,state:n,propsToForward:r,propsToStateSet:i}=o,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++,ho(m,e)||ho(m,t)))if(r.hasOwnProperty(f)){let y=h,S=r[f];typeof S=="function"&&(y=S(h)),n[m]!==y&&(a[m]=y,l++)}else i.has(f)&&(s[m]=e[m],u++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:u,rawUpdatedProps:c,rawUpdatedPropsCount:d}}var Za;function qu(){return Za||(Za=$S(null))}function Mt(o){let e=o.getParentState||(()=>null);function t(r){let[i]=$u(()=>o.initSetupState?o.initSetupState(r):{}),a=Yu(new Set),l=Xa(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),u=Fe(s);function c(){return Bu({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:o.mapPropsToState,propsToStateSet:a.current})}let[d]=$u(c),p=Fe(r),f=(P,D)=>Wu(P,D,{getProps:p,getParentState:()=>u?.()??null,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:a.current}),[m,g]=US(f,d),h=Fe(m),{allowedControlledPropOverrides:y}=o,S=Xa(()=>ju({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:y,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks}),[g,l,y]),T=o.Context??qu(),b=Xa(()=>({componentState:m,componentActions:S,getComponentState:h,replaceState:P=>{g({type:"REPLACE_STATE",payload:P})},assignState:P=>{g({type:"ASSIGN_STATE",payload:P})}}),[m,S,h]),R=Lo(r),C=Yu(!1);C.current=!1;let I=o.layoutEffect?qS:YS;return I(()=>{let P=r,{newMappedState:D,newMappedStateCount:w,updatedPropsToState:M,updatedPropsToStateCount:E,rawUpdatedProps:x,rawUpdatedPropsCount:v}=Uu({currentProps:P,prevProps:R,state:m,propsToForward:l,propsToStateSet:a.current});if(E>0||w>0){let _=m.debugId,F=_?ot(_).track.ComponentState.label.PropUpdate.start():void 0,L=o.debugName?typeof o.debugName=="function"?`${o.debugName(P)}:rerender`:`${o.debugName}:rerender`:"rerender";Pt(L)("Triggered by new values for the following props",...Object.keys(D??{}),...Object.keys(M??{})),F&&F.end({label:L,details:[w>0?{name:"Updated properties",value:Object.keys(D).join(", ")}:void 0,E>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,E>0||M?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(go)});let K={payload:{mappedState:w?D:null,updatedPropsToState:E?M:null}};if(C.current=!0,g(K),o.onPropChange){for(var A in x)if(x.hasOwnProperty(A)){let{newValue:W,oldValue:k}=x[A];o.onPropChange({name:A,newValue:W,oldValue:k},r,S,m)}}o.onPropsChange&&v&&o.onPropsChange(x,r,S,m)}}),I(()=>{s!=null&&!C.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Vu(()=>()=>{o.cleanup?.(h())}),{contextValue:b,ContextComponent:T}}return{ManagedComponentContextProvider:un.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return un.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function At(o){return o=o??qu(),un.useContext(o)}import*as sc from"react";var st="Infinite",Le={rootClassName:st};var Ur=()=>Le;var Xu="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Zu={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var _t="_16lm1iw3b _16lm1iw3c _16lm1iw35",Qu={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},cn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var $r={1:"_16lm1iw1c",none:"_16lm1iw1d"},qn={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Ju={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},ec={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},tc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var oc={none:"_16lm1iwd"},nc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Yr={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var rc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var ic={none:"_16lm1iw1x"};var ac={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var lc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function uc(o){let{rootClassName:e}=Ur();return sc.createElement("div",{...o,className:te(`${e}Footer`,Yr.relative,cn.flex,qn.row,o.className)})}import*as xe from"react";import{useCallback as qf,useContext as LC,useEffect as kC,useRef as zC}from"react";import{createPortal as VC}from"react-dom";function qr(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function J(o){return o.slice(4,-1)}import*as cc from"react";var ke=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return cc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};import*as Qa from"react";var ze={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 dc=o=>Qa.createElement(ke,{...o},ze.includesOperator.map(e=>Qa.createElement("path",{key:e,d:e})));import*as Ja from"react";var pc=o=>Ja.createElement(ke,{...o},Ja.createElement("path",{d:ze.endsWithOperator[0]}));import*as el from"react";var fc=o=>el.createElement(ke,{...o},el.createElement("path",{d:ze.eqOperator[0]}));import*as tl from"react";var mc=o=>tl.createElement(ke,{...o},tl.createElement("path",{d:ze.gteOperator[0]}));import*as ol from"react";var gc=o=>ol.createElement(ke,{...o},ol.createElement("path",{d:ze.gtOperator[0]}));import*as nl from"react";var hc=o=>nl.createElement(ke,{...o},nl.createElement("path",{d:ze.lteOperator[0]}));import*as rl from"react";var yc=o=>rl.createElement(ke,{...o},rl.createElement("path",{d:ze.ltOperator[0]}));import*as il from"react";var Sc=o=>il.createElement(ke,{...o},il.createElement("path",{d:ze.neqOperator[0]}));import*as al from"react";var bc=o=>al.createElement(ke,{...o},al.createElement("path",{d:ze.startsWithOperator[0]}));import*as hl from"react";import*as rt from"react";import{useEffect as pb,useState as ed}from"react";import*as dn from"react";import{useEffect as eb,useLayoutEffect as tb,useState as Kc}from"react";function XS(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function ZS(o){var e=XS(o,"string");return typeof e=="symbol"?e:String(e)}function QS(o,e,t){return e=ZS(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Tc(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function Cc(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tc(Object(t),!0).forEach(function(n){QS(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Tc(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Rc(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var JS=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},ye=o=>{var e=t=>{var n=o.defaultClassName,r=Cc(Cc({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=o.variantClassNames[i][s];u&&(n+=" "+u)}}for(var[c,d]of o.compoundVariants)JS(c,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Rc(o.variantClassNames,t=>Rc(t,n=>n.split(" ")[0]))}},e};var Ic="_1eexc2a6";var wc=ye({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:[]}),vc="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Pc=ye({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Dc=ye({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"]]}),xc=ye({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"]]}),Ec="_12zfob12u _16lm1iw22 _16lm1iw1z";var Mc="_12zfob17",Ac="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",_c=ye({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),ll=ye({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Oc="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Fc=ye({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Nc="_12zfob1b _16lm1iw2",Lc="_16lm1iw1",kc="_12zfob16",zc=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Vc="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Tt="InfiniteIcon";var Gc="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Hc={transition:"width 0.25s, opacity 0.25s"},Ax=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function pn(o){let[e,t]=Kc(!0),[n,r]=Kc(0),{lineWidth:i=1,style:a,className:l,index:s}=o,u=s!=null&&s>0,c=o.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...Hc,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if(eb(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),tb(()=>{t(!0)},[]),!e)return null;let m={};return dn.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:te(l,Tt,Gc,`${Tt}-filter`)},u?dn.createElement("div",{"data-name":"index",style:m,className:Mc},s):null,dn.createElement("div",{style:{width:p[0],...f}}),dn.createElement("div",{style:{width:p[1],...f}}),dn.createElement("div",{style:{width:p[2],...f}}))}var Xr=Object.freeze({}),ob={string:Xr,number:{}};function fn(o,e){let t=e.default||Xr;return o.type===void 0?t:o.type===null?Xr:typeof o.type=="string"?e[o.type]||ob[o.type]||Xr:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var ul=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((I,P)=>{let D=I.maxSize??r??void 0,w=I.minSize??n??void 0;s.push(w),u.push(D),I.size!=null&&(D!=null&&I.size>D&&(I.size=D),w!=null&&I.size<w&&(I.size=w));let M=I.flex==0?null:I.flex;if(I.size==null&&M==null)throw`Items must specify either a size or a flex property. Item at index ${P} doesn't have either of those.`;M!=null&&(l+=1),a+=M??0,i+=I.size??0});let c=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((I,P)=>{if(I.flex!=null){let D=d*I.flex,w=I.maxSize??r??void 0,M=I.minSize??n??void 0,E=!1,x=0;w!=null&&D>w&&(p[P]=!0,E=!0,x=w),M!=null&&D<M&&(f[P]=!0,E=!0,x=M),E&&(m+=1,l-=1,a-=I.flex,c-=x)}}),m&&(d=c/a);let g=[],h=0,y=c,S=a,T=0,b=0,R=[];return{items:t.map((I,P)=>{let D={...I},w=I.maxSize??r??void 0,M=I.minSize??n??void 0,E=0,x=p[P],v=f[P],A=x||v,_=I.size??0;if(I.flex!=null){if(A)v&&(E=M),x&&(E=w);else{h+=1;let F=L=>(w!=null&&L>w&&(L=w),M!=null&&L<M&&(L=M),L);h===l?E=F(y):(E=F(Math.round(I.flex*d)),b+=E,y=c-b,S-=I.flex,d=y/S)}_=E,D.flexSize=E}return g.push(E),R.push(_),D.computedSize=_,T+=_,D}),flexSizes:g,minSizes:s,maxSizes:u,computedSizes:R,remainingSize:Math.round(e-T)}};function Zr(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}function Wc(o,e,t){let n=!1,r=0;for(let i of o)i.computedFlex&&(n=!0),r+=i.computedWidth;return n&&Math.round(r)>Math.round(e-t)}function sl(o,e){return o.computedFlex&&!e?"flex":"width"}function Xn(o,e,t){if(e==="width"){let{flex:n,...r}=o??{};return{...r,width:t}}return{...o,flex:t}}var cl=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((M,E)=>(M[E]={...o.columnSizing[E]},M),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],u=l.id,c=s?.id,d=Wc(o.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=sl(l,d),h=s?.computedWidth,y=s?.computedMinWidth,S=s?.computedMaxWidth,T=s?sl(s,d):"width",b=!1,R=!1,C=r>0?1:-1,{value:I,clamped:P,diff:D}=Zr(Math.round(p+r),f,m,C);if(o.shareSpaceOnResize){if(s==null)return n[u]=Xn(n[u],g,I),R=P==="min",b=P==="max",{adjustedDiff:I-p,reservedWidth:t,columnSizing:n,minReached:R,maxReached:b,constrained:R||b};let{value:M,clamped:E,diff:x}=Zr(Math.round(h-r),y,S,C);if(P&&E&&(Math.abs(D)>Math.abs(x)?E=!1:P=!1),!(!P&&!E)){if(P){let v=Zr(Math.round(h-r-D),y,S,C);M=v.value,E=v.clamped,x=v.diff}else if(E){let v=Zr(Math.round(p+r+x),f,m,C);I=v.value,P=v.clamped,D=v.diff}}n[u]=Xn(n[u],g,I),n[c]=Xn(n[c],T,M),R=P==="min"||E==="min",b=P==="max"||E==="max"}else n[u]=Xn(n[u],g,I),R=P==="min",b=P==="max";let w=I-p;return{adjustedDiff:w,reservedWidth:o.shareSpaceOnResize?t:Math.round(t-w),columnSizing:n,minReached:R,maxReached:b,constrained:R||b}};function Bc(o,e){return o+e}function nb(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var jc=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((S,T)=>(S[T]={...o.columnSizing[T]},S),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((S,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(S=>o.items[S]),l=a.map(S=>S.computedWidth),s=Wc(o.items,e,t),u=a.map(S=>sl(S,s)),c=0,{computedSizes:d}=ul({items:a.map(S=>(S.resizable===!1&&(c+=S.computedWidth),{maxSize:S.computedMaxWidth,minSize:S.computedMinWidth,flex:S.resizable?S.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Bc,0)+r-c,0)}),p=a.map((S,T)=>d[T]-S.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((S,T)=>{let b=a[T];if(!b.resizable){h.push(0);return}let R=u[T],C=l[T],I=nb(n),{maxReached:P,minReached:D,constrained:w,adjustedDiff:M}=cl({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:S,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:I});n[b.id]=Xn(I[b.id],R,Math.round(C+M)),h.push(M),P||(m=!1),D||(f=!1),w||(g=!1)});let y=h.reduce(Bc,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:y,columnSizing:n,reservedWidth:Math.round(t-y)}};var Qr;function zt(){if(Qr!=null)return Qr;let o=De().document??null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),Qr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Qr}var Uc=["start",void 0,"end"],$c=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Uc.indexOf(r)-Uc.indexOf(i)}),o);function Yc(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function dl(o,...e){return Yc(t=>t!=null,o,...e)}function qc(o,e,...t){return Yc((n,r)=>!(r in o),e,...t)}var Jr=!0,rb=!0,ib=!0,Xc="string",qt="unknown";var ab=fo("getComputedVisibleColumns"),lb=(o,e,t)=>o[t]!==!1,pl=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1};function ko(o,e){if(o)return o[e]?o[e]:Object.values(o).find(t=>t.field===e)}function sb(o,e){let t=fn(o,e);return o.sortType?o.sortType:t.sortType?t.sortType:typeof o.type=="string"?o.type:Xc}function ub(o,e,t){let r=(Array.isArray(o)?o:o?[o]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[qt];let l=ko(e,a);if(!l)return[qt];let s=sb(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===qt)?qt:r.length===1?r[0]:r}function fl(o,e){let{colType:t,sortable:n,columnDefaultSortable:r}=e,i=o.defaultSortable??t.defaultSortable,a=!!o.groupByForColumn;if(i==null&&!a){let l=o.field??t.field,s=o.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return n??i??r??Jr}var Zc=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,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=zo,viewportReservedWidth:y,resizableColumns:S,draggableColumns:T,columnDefaultDraggable:b,columnOrder:R,columnPinning:C,editable:I,columnDefaultEditable:P,columnDefaultFilterable:D,columnDefaultGroupable:w,columnDefaultSortable:M,columnSizing:E,columnTypes:x,columnVisibility:v,columnVisibilityAssumeVisible:A,groupBy:_})=>{let F=0,L={};_.forEach((B,oe)=>{B.field&&(L[B.field]=oe)});let O=(p||[]).reduce((B,oe)=>{let{id:he,field:be}=oe;return be&&(B[be]=oe),he&&(B[he]=oe),B},{}),K=$c(R===!0?Object.keys(o):R,C),W=K.filter(B=>o[B]?lb(v,A,B):(ab(`Column with id "${B}" specified in columnOrder array cannot be found in the columns map.`),!1)),k=new Map,Q=W.map((B,oe)=>{let he=o[B];return k.set(B,oe),he}),V=(m??[]).reduce((B,oe,he)=>(oe.id?B[oe.id]={sortInfo:oe,index:he}:oe.field&&(B[oe.field]={sortInfo:oe,index:he}),B),{});function j(B){let oe=o[B],he=fn(oe,x),be={minWidth:he?.minWidth,maxWidth:he?.maxWidth,width:he?.defaultWidth,flex:he?.defaultFlex},nt={width:oe?.defaultWidth,flex:oe?.defaultFlex,minWidth:oe?.minWidth,maxWidth:oe?.maxWidth},H=E[B];H?.width!=null&&H.flex==null&&delete nt.flex,H?.flex!=null&&H.width==null&&delete nt.width;let Ne=dl(nt,H);Ne.width!=null&&delete be.flex,Ne.flex!=null&&delete be.width,Ne=dl(be,Ne);let pt=Ne.flex??void 0,le=Ne.minWidth??oe?.minWidth??n,_e=Ne.maxWidth??oe?.maxWidth??r,$e=pt!=null?void 0:Ne.width??(a?void 0:i);return!$e&&pt==null&&(a?pt=a:$e=le),{size:$e,flex:pt,minSize:le,maxSize:_e}}let re=ul({availableSize:Math.max(t.width-(y??0)-(l??zt()),0),maxSize:r,minSize:n,items:W.map(j)}),{computedSizes:de,flexSizes:se,minSizes:ae,maxSizes:ce}=re,ue=[],U=[],z=[],Y=[];Y.length=W.length;let $=new Map,X=new Map,q=0,fe=0,me=0,ie=null,G=[],N=0,ge=0,Ee=0;Q.forEach((B,oe)=>{let he=W[oe],be=de[oe],nt=G[oe]=pl(he,C);nt==="start"?N+=be:nt==="end"?Ee+=be:ge+=be});let Ce=t.width-Ee,Re=[],Ae=new Map;W.forEach((B,oe)=>{let he=Q[oe];Ae.set(B,he)});let Ge=[];Object.keys(o).forEach(B=>{let oe=o[B];Ge.push(B),Ae.has(B)||Ae.set(B,oe)});let et=new Map;Ae.forEach((B,oe)=>{let he=k.get(oe);he==null&&(he=-1);let be=he!=-1,nt=W[he+1],H=fn(B,x),Ne=he,pt=V[oe]?V[oe]:B.field?V[B.field]??null:null,le=pt?.sortInfo??null,_e=!!le,$e=_e&&le.dir===1,po=_e&&!$e,mu=pt?.index??-1,Fa=be?{}:j(oe),gu=be?de[he]:Fa.size||0,tS=be&&se[he]||null,oS=be?ae[he]||0:Fa.minSize||0,nS=be?ce[he]||1e4:Fa.maxSize||1e4,bt=be?pl(oe,C):!1,hu=be?he===W.length-1:!1,Lr=Ne,rS=be?bt==="start"?fe:bt==="end"?me:F-fe:0;bt=="start"?Lr=be?Ne:-1:bt==="end"?Lr=be?Ne-(ue.length+z.length):-1:Lr=be?Ne-ue.length:-1;let iS=be?bt==="start"||bt===!1?F:Ce+me:-1,aS=be?bt!==ie:!1,lS=be?hu||bt!==pl(nt,C):!1,yu=B.cssEllipsis??H.cssEllipsis??s,sS=B.headerCssEllipsis??H.cssEllipsis??B.cssEllipsis??H.headerCssEllipsis??u??yu,kr=be&&(O[oe]||B.field||B.groupByForColumn)&&(O[oe]||O[B.field||B.groupByForColumn])||null,uS=B.defaultFilterable??H.defaultFilterable??D??!0,cS=I??B.defaultEditable??H.defaultEditable??P??!1,Na=B.dataType||H.dataType||(Array.isArray(B.type)?B.type[0]:B.type)||Xc,dS=B.sortType||H.sortType||Na,Su=B.filterType||H.filterType||Na,bu=!1;if(kr!=null&&!kr.disabled){let ka=h[Su];ka&&(!ka.emptyValues||!ka.emptyValues.includes(kr.filter.value))&&(bu=!0)}let nn=B.field??H.field,pS=B.valueGetter??H.valueGetter,La=B.defaultGroupable??H.defaultGroupable??w??!!nn;nn||(La=!1),B.groupByForColumn&&(La=!1);let Tu=nn?L[nn]!==void 0:!1,fS=Tu?L[nn]:void 0,mS=fl(B,{colType:H,sortable:f,columnDefaultSortable:M}),gS=B.resizable??H.resizable??S??rb,Ye={colType:H,align:H.align,headerAlign:H.headerAlign,computedVisible:be,verticalAlign:H.verticalAlign,defaultHiddenWhenGroupedBy:H.defaultHiddenWhenGroupedBy,valueGetter:pS,valueFormatter:H.valueFormatter,renderValue:H.renderValue,render:H.render,style:H.style,className:H.className,contentFocusable:H.contentFocusable,renderMenuIcon:H.renderMenuIcon,renderSortIcon:H.renderSortIcon,renderRowDetailIcon:H.renderRowDetailIcon,renderSelectionCheckBox:H.renderSelectionCheckBox,renderHeaderSelectionCheckBox:H.renderHeaderSelectionCheckBox,headerStyle:H.headerStyle,headerClassName:H.headerClassName,columnGroup:H.columnGroup,getValueToEdit:H.getValueToEdit,getValueToPersist:H.getValueToPersist,shouldAcceptEdit:H.shouldAcceptEdit,field:nn,...B,components:{...H.components,...B.components},computedResizable:gS,computedMinWidth:oS,computedMaxWidth:nS,computedFlex:tS,computedDataType:Na,computedEditable:cS,computedSortType:dS,computedFilterType:Su,cssEllipsis:yu,headerCssEllipsis:sS,computedFilterValue:kr,computedFiltered:bu,computedFilterable:uS,computedGroupable:La,computedGroupedBy:Tu,computedGroupedByIndex:fS,computedWidth:gu,computedAbsoluteOffset:iS,computedPinningOffset:rS,computedVisibleIndexInCategory:Lr,computedOffset:F,computedSortable:mS,computedSortInfo:le,computedSortIndex:mu,computedMultiSort:g,computedSorted:_e,computedSortedAsc:$e,computedSortedDesc:po,computedVisibleIndex:Ne,computedPinned:bt,computedDraggable:T??B.defaultDraggable??b??ib,computedFirstInCategory:aS,computedLastInCategory:lS,computedFirst:he===0,computedLast:hu,id:oe,header:B.header??H.header??B.name??B.field};be&&(F+=gu,$.set(Ye.id,Ye),Y[he]=Ye,bt==="start"&&(ue.push(Ye),fe+=Ye.computedWidth),bt==="end"&&(U.push(Ye),me+=Ye.computedWidth),bt||(z.push(Ye),q+=Ye.computedWidth),ie=bt),Ye.groupByForColumn&&(Ye.computedSortType=B.sortType||H.sortType||ub(Ye.groupByForColumn,e,x),Re.push(Ye)),X.set(Ye.id,Ye),Ye.field&&!Ye.groupByForColumn&&!et.has(Ye.field)&&et.set(Ye.field,Ye)}),Re.forEach(B=>{B.computedSortable=Qc(B,{fieldsToColumn:et,userColumns:e,columnTypes:x,sortable:f,columnDefaultSortable:M})});let Xe=new Map;Ge.forEach(B=>{let oe=X.get(B);oe&&Xe.set(B,oe)}),X.forEach(B=>{Xe.has(B.id)||Xe.set(B.id,B)});let tt=c!=null?Math.min(c,fe):fe,Ze=d!=null?Math.min(d,me):me;return{computedRemainingSpace:t.width-(N+Ee+ge),computedPinnedStartColumnsWidth:fe,computedPinnedEndColumnsWidth:me,computedUnpinnedColumnsWidth:q,computedColumnOrder:K,computedPinnedStartColumns:ue,computedPinnedEndColumns:U,computedUnpinnedOffset:fe,computedPinnedEndOffset:fe+q,computedUnpinnedColumns:z,computedVisibleColumns:Y,computedColumnsMap:X,computedColumnsMapInInitialOrder:Xe,computedVisibleColumnsMap:$,computedPinnedEndWidth:Ze,computedPinnedStartWidth:tt,renderSelectionCheckBox:Y.reduce((B,oe)=>B||!!oe.renderSelectionCheckBox,!1),fieldsToColumn:et}};function Qc(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let s=r??Jr,u=o.sortType??o.colType.sortType;return u!=null&&u!==qt&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,h)=>{if(!g)return!1;let y=h.field||h.groupField,S;if(y){let T=n.get(y),b=T?f.getColumnApi(T.id):void 0;if(T&&b)S=b.isSortable();else{let R=ko(i,y);if(R){let C=fl(R,{colType:fn(R,a??{}),sortable:t,columnDefaultSortable:r});S=typeof C=="boolean"?C:void 0}else S=!1}}return S===void 0&&h.valueGetter&&(S=!0),S??r??Jr},!0)}}function ut(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function Vo(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:u}=e,c=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=c,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=ut(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:u});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:u,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}import*as Jc from"react";var mn=`${st}HeaderCell__filter`,ei=`${st}HeaderCell__filterOperator`,lE=`${mn}__input`;var ml=Jc.createContext(null);import{useContext as db}from"react";import{createContext as cb}from"react";var gl;function ti(){return gl||(gl=cb(null))}function ne(o){let e=ti(),t=db(e);return ln(t,o)}function He(){return ne(o=>({getState:o.getState,actions:o.actions,getComputed:o.getComputed,getDataSourceState:o.getDataSourceState,dataSourceApi:o.dataSourceApi,dataSourceActions:o.dataSourceActions,api:o.api,getDataSourceMasterContext:o.getDataSourceMasterContext}))}var fb=`${mn}__input`,oi=o=>o.stopPropagation();function td(o){let{filterOperatorMenuVisibleForColumnId:e}=ne(c=>({filterOperatorMenuVisibleForColumnId:c.state.filterOperatorMenuVisibleForColumnId})),{column:t}=ni(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=ed(!1),l=rt.useCallback(()=>{a(!0)},[]),s=rt.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return rt.createElement("div",{onPointerUp:oi,onPointerDown:oi,onFocus:l,onBlur:s,className:`${mn} ${ll({active:u})}`,style:{height:o.columnHeaderHeight}},rt.createElement(ml.Provider,{value:o},rt.createElement(r,null),rt.createElement(n,null)))}function od(){let{columnApi:o,disabled:e,operator:t}=Zn(),n=t?.components?.Icon??pn;return rt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:te(ei,Ac,e?`${ei}--disabled`:"")},rt.createElement(n,{size:20,className:`${_c({disabled:e})}`}))}function nd(){return rt.createElement("div",{onPointerUp:oi,onPointerDown:oi,className:`${mn} ${ll({active:!1})} ${Ju["50%"]}`})}function Zn(){let o=He(),{column:e,columnApi:t}=ni(),n=Vo(e,o,"column-filter"),r=rt.useContext(ml),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=ed(l?.filter.value??""),d=rt.useCallback(h=>{c(h),r.onChange(h)},[r.onChange]),p=rt.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=rt.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);pb(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==u&&c(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${Ec} ${fb}`}}function gn(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Zn();return hl.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function ri(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Zn();return hl.createElement("input",{"aria-label":o,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:n})}var Vt=(o,e)=>{let t=o?.[e];return t?{components:{Icon:t}}:{}};function rd(o={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Vt(n,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Vt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Vt(n,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Vt(n,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...Vt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Vt(n,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Vt(n,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Vt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Vt(n,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Vt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var zo=rd({StringFilterEditor:gn,NumberFilterEditor:ri,icons:{includes:dc,eq:fc,neq:Sc,startsWith:bc,endsWith:pc,gt:gc,gte:mc,lt:yc,lte:hc}});function ii(o,e,t,n){let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected===null?r.push(...e.map(l=>`${l}--row-partially-selected`)):n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as Kd,useState as Bd}from"react";import{flushSync as Vb}from"react-dom";function yo(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function id(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var ee={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 ad="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)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},ld="column-header-height";var sd=`.${Le.rootClassName}`;function yl(o){return yo(o,sd)}var ud=J(ee.scrollLeft),mb=J(ee.scrollTop),gb=J(ee.columnWidthAtIndex),Sl=J(ee.columnOffsetAtIndex),cd=J(ee.columnReorderEffectDurationAtIndex),hb=J(ee.columnOffsetAtIndexWhileReordering),yb=J(ee.columnVisibilityAtIndex),Sb=J(ee.columnZIndexAtIndex);function Gt(o,e,t){let n=t?yl(t):document.querySelector(sd);bb(o,e,n)}function bb(o,e,t){if(t){let n=o,r=ee[n]?J(ee[n]):o;t.style.setProperty(r,`${e}`)}}function hn(o,e){if(e)for(var t in o){let n=ee[t]?J(ee[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function bl(o,e,t){Gt(`${Sl}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${ud}))`:`${o.computedAbsoluteOffset+e}px`,t)}function Tl(o,e,t){Gt(`${Sb}-${o}`,`${e}`,t)}function Qn(o,e,t){Gt(`${hb}-${o}`,typeof e=="number"?`calc( var(${Sl}-${o}) + ${e}px )`:e,t)}function Jn(o,e,t){Gt(`${yb}-${o}`,e,t)}function ai(o,e,t){Gt(`${cd}-${o}`,t??"",e)}function Cl(o,e){let t=`${cd}-${o}`;Gt(t,pe.components.Cell.reorderEffectDuration,e)}var Ie={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${gb}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Gt(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Sl}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Gt(this.varName.get(o),e,t)}}};function dd(o,e){hn({[ud]:`${o.scrollLeft}px`,[mb]:`${o.scrollTop}px`},e)}var pd="_16lm1iw1",fd="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",md="_1yeub2vs",gd="_1yeub2vr",hd=ye({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var Rl="_1yeub2vp";var rM=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});import{useMemo as Db}from"react";var er={bodyWidth:{name:J(pe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:J(pe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:J(pe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:J(pe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:J(pe.runtime.browserScrollbarWidth),value:""}},Tb=J(ee.scrollbarWidthHorizontal),yd=J(ee.scrollbarWidthVertical),Cb=J(ee.columnWidthAtIndex),Rb=J(ee.columnZIndexAtIndex),Sd=J(ee.scrollLeft),Ib=J(ee.activeCellColWidth),bd=J(ee.activeCellColOffset),Id=J(ee.baseZIndexForCells),wb=J(ee.pinnedStartWidth),Td=J(ee.bodyWidth),vb=J(ee.bodyHeight),Cd=J(ee.pinnedEndOffset),Rd=J(ee.pinnedEndWidth),Pb=J(ee.computedVisibleColumnsCount);function li(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${Id}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function wd(o){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:u,scrollbars:c}=o,d=zt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[Ie.columnWidths.varName.get(h)]=g.computedWidth+"px",m[Ie.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Sd}) )`:g.computedPinned==="end"?`calc( var(${Cd}) ${p.length?"+":""} ${p.map(S=>Ie.columnWidths.get(S.computedVisibleIndex)).join(" + ")} + var(${Sd}) )`:`${g.computedOffset}px`;let y=li(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${Rb}-${h}`]=`${y}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[er.browserScrollbarWidth.name]=`${zt()}px`),f[er.bodyWidth.name]=`calc(${ee.bodyWidth} - ${ee.scrollbarWidthVertical})`,f[er.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[er.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${Cb}-${g})`).join(" + ")})`,f[er.visibleColumnsCount.name]=e.length,s!=null){f[Ib]=Ie.columnWidths.get(s[1]);let m=Ie.columnOffsets.get(s[1]);if(u.isHorizontalLayoutBrain){let g=u.getPageIndexForRow(s[0]);f[bd]=g?`calc( ${pe.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[bd]=m}return f[Pb]=e.length,f[Tb]=c.horizontal?`${d}px`:"0px",f[yd]=c.vertical?`${d}px`:"0px",f[wb]="calc( "+t.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Rd]="calc( "+n.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Id]=e.length*10,f[Cd]=`calc( var(${Td}) - var(${Rd}) - var(${yd}) )`,f[Td]=`${l.width}px`,f[vb]=`${l.height}px`,f}var Il=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};function vd(o){let{actions:e,getState:t,focused:n,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:y,computedVisibleColumns:S,computedUnpinnedColumnsWidth:T,scrollbars:b,focusedClassName:R,focusedWithinClassName:C,computedPinnedStartOverflow:I,computedPinnedEndOverflow:P,focusedStyle:D,focusedWithinStyle:w,brain:M}=ne(O=>{let{state:K,computed:W}=O;return{brain:K.brain,actions:O.actions,getState:O.getState,focused:K.focused,focusedWithin:K.focusedWithin,domRef:K.domRef,scrollerDOMRef:K.scrollerDOMRef,onBlurWithin:K.onBlurWithin,onFocusWithin:K.onFocusWithin,onSelfFocus:K.onSelfFocus,onSelfBlur:K.onSelfBlur,bodySize:K.bodySize,activeCellIndex:K.activeCellIndex,wrapRowsHorizontally:K.wrapRowsHorizontally,computedPinnedStartColumnsWidth:W.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:W.computedPinnedEndColumnsWidth,computedPinnedStartColumns:W.computedPinnedStartColumns,computedPinnedEndColumns:W.computedPinnedEndColumns,computedVisibleColumns:W.computedVisibleColumns,computedUnpinnedColumnsWidth:W.computedUnpinnedColumnsWidth,scrollbars:W.scrollbars,focusedClassName:O.state.focusedClassName,focusedWithinClassName:O.state.focusedWithinClassName,computedPinnedStartOverflow:W.computedPinnedStartOverflow,computedPinnedEndOverflow:W.computedPinnedEndOverflow,focusedStyle:O.state.focusedStyle,focusedWithinStyle:O.state.focusedWithinStyle}}),E=Db(()=>wd({computedVisibleColumns:S,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:T,bodySize:d,activeCellIndex:p,brain:M,scrollbars:b}),[S,h,y,m,g,T,d,p,M,b]),x=Il(O=>{e.focused=O}),v=Il(O=>{e.focusedWithin=O}),F={...o,onFocus:O=>{if(o?.onFocus?.(O),O.target===i.current||O.target===a.current){if(t().focused)return;x(!0),u?.(O),r&&(v(!1),l?.(O));return}r||(v(!0),s?.(O))},onBlur:O=>{if(o?.onBlur?.(O),O.target===i.current||O.target===a.current){if(!t().focused)return;x(!1),c?.(O),r&&(v(!1),l?.(O));return}i.current?.contains(O.relatedTarget)||(v(!1),l?.(O))}},L=te(Xt,fd,f?`${Xt}--horizontal-layout`:null,F?.className,m?`${Xt}--has-pinned-start ${gd}`:null,g?`${Xt}--has-pinned-end ${md}`:null,n?`${Xt}--focused`:null,r?`${Xt}--focused-within`:null,n&&R?R:null,r&&C?C:null,I?`${Xt}--has-pinned-start-overflow`:null,P?`${Xt}--has-pinned-end-overflow`:null,hd({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:n,focusedWithin:r}));return F.className=L,F.style={...o?.style,...E},n&&D&&Object.assign(F.style,D),r&&w&&Object.assign(F.style,w),F}var Fd=rn(Go());function si(o){return o.map(e=>e instanceof So?e:new So(null,[e]))}var So=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>xb(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function xb(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var Eb=(...o)=>new So("+",si(o)),Dd=(...o)=>new So("-",si(o)),Mb=(...o)=>new So("*",si(o)),Ab=(...o)=>new So("/",si(o)),tr={add:Eb,subtract:Dd,minus:Dd,multiply:Mb,divide:Ab};var Ho=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var Ve=De().requestAnimationFrame||(o=>setTimeout(o,16)),Ot=De().cancelAnimationFrame||(o=>clearTimeout(o));var xd=o=>{let e=null,t=null;return{stop(){e!==null&&Ot(e),t!=null&&Ot(t)},scroll(n){e!==null&&Ot(e),t!=null&&Ot(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let 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 n.scrollLeft=n.scrollLeft-p,e=Ve(()=>{i.scroll(n)}),!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 n.scrollLeft=n.scrollLeft+p,t=Ve(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Be=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,n=e.left-this.left;return{top:t,left:n}}};function Ed(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Md(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function _b(o,e,t){let n=Ed(o,t),r=Ed(e,t);return n===r?Md(t,e)-Md(t,o):n-r}function Ad(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>_b(n,r,t)),e}function Ob(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function Fb(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=Ad(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function _d(o,e){if(Ob(o))return Fb(o,e);o=Ad(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(Nb([t,i,a],e))return!0}return!1}function Nb(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var yn=class{containsPoint(e){return _d(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Sn=class o extends yn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(Be.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function Lb(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,u=Math.max(l,s);return new we({top:n,left:t,width:a-t,height:u-n})}var we=class o extends yn{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=Lb(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new Sn(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(Be.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var Od=10,kb=J(ee.pinnedStartWidth);function Nd(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:h,horizontalLayoutPageIndex:y,pageWidth:S}=o;function T(z){let Y=z==="start"?L:O;return A===F?Y:F===z?Y+x.computedWidth:A===z?Y-x.computedWidth:Y}function b(z){if(z.columnIndex===v||y!=null)return!0;let Y=e[z.columnIndex];if(Y.computedPinned)return!0;let $=l.getScrollPosition().scrollLeft,X=Y.computedOffset+(y!=null&&S!=null?S*y:0);return X>=$+T("start")&&X+Y.computedWidth<=$+c.width-T("end")}let R=(z,Y)=>{let{restrictToParentGroup:$,dragColumn:X}=Y,q=[];if(z.forEach(me=>{if(me.computedVisibleIndex===v)return;let ie={columnId:me.id,columnIndex:me.computedVisibleIndex,offsetX:me.computedOffset+Math.round(me.computedWidth/2)};b(ie)&&q.push(ie)}),$){let ie=function(N,ge,Ee){let Ce=z[N];Ce&&(Ce.columnGroup!==X.columnGroup&&Ee.add(Ce.id),ie(N+ge,ge,Ee))};var fe=ie;let me=X.computedVisibleIndex,G=new Set;ie(me-1,-1,G),ie(me+1,1,G),q=q.filter(N=>!G.has(N.columnId))}return q},I=r.length,P={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},D={left:P.clientX-c.left-(P.clientX-s.left)+Od,top:P.clientY-c.top-(P.clientY-s.top)+Od},w=l.getScrollPosition(),M=e.map(z=>z.computedVisibleIndex),E=M,x=t.get(i),v=x.computedVisibleIndex,A=x?.computedPinned,_=v,F=A,L=l.getFixedStartColsWidth(),O=l.getFixedEndColsWidth(),K=P,W={x:0,y:0},k=1,Q=0;function V(z){let Y=Math.round(z.clientX),$=Math.round(z.clientY);if(Y===K.clientX&&$===K.clientY)return we.from(s).shift({left:W.x,top:W.y});K={clientX:Y,clientY:$};let q=l.getScrollPosition().scrollLeft-w.scrollLeft;return W.x=K.clientX-P.clientX,W.y=K.clientY-P.clientY,Q=W.x+q,k=Q<0?-1:1,f({left:D.left+W.x,top:D.top+W.y}),we.from(s).shift({left:W.x,top:W.y})}function j(z){let Y=0;A?A==="start"&&z.forEach(($,X)=>{Y||e[$]?.computedPinned!=="start"&&(Y=X)}):z.forEach(($,X)=>{e[$]?.computedPinned==="start"&&(Y=X+1)}),I=Y,re("start",z,Y)}function re(z,Y,$){if(z==="start"){let X=0;for(let q=0;q<$;q++){let fe=Y[q],me=e[fe];X+=me.computedWidth}Gt(kb,`${X}px`,a)}}function de(z){if(z==null||z===_)return;if(_===-1&&z!==-1&&(Jn(v,"",a),m(!1)),_=z,z===-1){se(v);return}let Y=Ho(M,v,_>v?_-1:_);I=0;let X=new Set;return Y.forEach((q,fe)=>{let me=E[fe];q!==me&&X.add(q),j(Y)}),E=Y,ae(X),{newColumnIndexes:Y,indexesWithTransition:X,pinnedStartCount:I}}function se(z){E=E.filter($=>$!==z),e.forEach($=>{let X=$.computedVisibleIndex,q=X>z;Cl(X,a);let fe="";q&&(fe=tr.minus(Ie.columnOffsets.get(X),Ie.columnWidths.get(z)).done()),Qn(X,fe,a)}),Jn(z,"hidden",a),m(!0)}function ae(z){e.forEach(Y=>{let $=Y.computedVisibleIndex;z.has($)?Cl($,a):ai($,a);let X=$===v,q=k===-1?$<_||$>v:$<v||$>=_,fe="";k===-1?fe=X?Ie.columnOffsets.get(_):q?Ie.columnOffsets.get($):tr.add(Ie.columnOffsets.get($),Ie.columnWidths.get(v)).done():fe=q?Ie.columnOffsets.get($):X?tr.add(Ie.columnOffsets.get(_-1),Ie.columnWidths.get(_-1)).minus(Ie.columnWidths.get(v)).done():tr.minus(Ie.columnOffsets.get($),Ie.columnWidths.get(v)).done(),Qn($,fe,a)})}let ce=c.left+T("start"),ue=c.right-T("end"),U=xd({scrollOffsetStart:ce,scrollOffsetEnd:ue});return V(P),{speedScroller:U,stop(){U.stop()},onMove(z){let Y=V(z);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(Y.getCenter()))return p&&de(-1),null;U.scroll({mousePosition:K,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ie){h.scrollLeft=ie}});let $=R(e,{dragColumn:x,restrictToParentGroup:u==="group"}),X=k===-1?x.computedOffset+Q:x.computedOffset+x.computedWidth+Q,q=(0,Fd.default)($,X,({offsetX:ie},G)=>ie<G?-1:ie>G?1:0);q<0&&(q=~q),$.length?q=$[q]?$[q].columnIndex:$[$.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),q=0),q===v+1&&(q=v),de(q);let fe={};n.forEach(ie=>{fe[ie.id]="end"});for(let ie=0;ie<I;ie++){let G=E[ie],N=e[G];fe[N.id]="start"}let me=E.map(ie=>e[ie].id);return{columnPinning:fe,columnOrder:me}}}}function wl(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return n;if(a>i){let l=e.indexOf(r),s=e[l-1],u=n.indexOf(s),c=n.indexOf(r);return Ho(n,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=n.indexOf(s),c=n.indexOf(r);return Ho(n,c,u)}return e}import*as ht from"react";var Ko=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var Ld=rn(Go());var kd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:u,dragIndex:c,dragRectangle:d}=n,p=u===a,f=Be.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,y=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),S=(0,Ld.default)(h,y,(I,P)=>I-P);S<0&&(S=~S),m===1&&S===c+1&&p&&S--;let T=Math.min(c,S),b=Math.max(c,S),R=p?i.map((I,P)=>{if(P===c&&p)return t;if(P<T||P>=b)return{left:0,top:0};let D=S<=P?1:-1;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}):i.map((I,P)=>{let D=S<=P?1:0;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}),C={offset:t,dropIndex:S,dragSourceListId:u,dropTargetListId:a,dragIndex:c,outside:!1,items:i,dragItem:s,offsetsForItems:R,dragRect:g,status:"accepted"};return e.acceptsDrop(C)?{event:C,error:null,success:!0}:(C.status="rejected",{event:C,error:"rejected by interaction target",success:!1})},zd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:u,listId:c}=n,d=Be.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?n.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((y,S)=>y.id===u.id?t:f?{left:0,top:0}:S>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-u.rect.width,top:0}:{left:0,top:-u.rect.height}:{left:0,top:0}):l.map(y=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var ve=class ve{static startDrag(e,t){let n=e instanceof bn?e:new bn(e),r=new vl({activeDragSource:n,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){if(ve.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return ve.dragInteractionTargetsMap.set(e.listId,e),ve.emit("register",e),()=>{ve.unregisterDragInteractionTarget(e)}}static unregisterAll(){ve.dragInteractionTargetsMap.forEach(e=>{ve.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!ve.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}ve.dragInteractionTargetsMap.delete(e.listId),e.unregister(),ve.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=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?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),ve.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=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=kd(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=zd(e,s);u&&t(s,u)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,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:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];ve.withDragMove(e,(s,{event:u})=>{s.drop(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null;ve.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),ve.currentDragOperation=null,ve.unregisterAll()}};ve.dragInteractionTargetsMap=new Map,ve.currentDragOperation=null,ve.emitter=new Ko;var gt=ve,bn=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){mt(this.data,e)||(this.data=e,this.dragRectangle=new we(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=we.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},vl=class extends Ko{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=bn.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=bn.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=gt;import{useEffect as zb}from"react";var Vd=ht.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),bo=()=>ht.useContext(Vd),Pl=o=>{let[e,t]=ht.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=ht.useRef(e);n.current=e;let r=ht.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=ht.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return zb(()=>{let a=gt.on("drag-start",u=>{t({dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:"accepted"})}),l=gt.on("drag-move",u=>{let c=n.current,d={dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:u.status};JSON.stringify(c)!==JSON.stringify(d)&&t(d)}),s=gt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[gt,t]),ht.createElement(Vd.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var Dl=`${st}Body`,Gd=o=>o.querySelector(`.${Dl}`);var Bo=`${st}HeaderCell`,xl=`${st}HeaderWrapper`,Hd=o=>Array.from(o.querySelectorAll(`.${xl}`));function or(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var Gb=J(ee.baseZIndexForCells),Hb=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:mt(o,e)},Wd=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=Bd(null),[a,l]=Bd(!1),{getCurrentDragSourceAndTarget:s}=bo(),{getComputed:u,getState:c,api:d,computedDraggable:p,rootRef:f,actions:m}=ne(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(o)?.computedDraggable,rootRef:y.state.domRef})),g=Kd(y=>{let S=u().computedVisibleColumnsMap.get(o);if(!S||!S.computedSortable)return;let{multiSortBehavior:T}=c();d.toggleSortingForColumn(o,{multiSortBehavior:T==="replace"&&(y.ctrlKey||y.metaKey)?"append":T})},[]),h=Kd(y=>{if(or(y.target))return;let{brain:S,draggableColumnsRestrictTo:T}=c(),{computedVisibleColumns:b,computedVisibleColumnsMap:R,computedPinnedStartColumns:C,computedUnpinnedColumns:I,computedPinnedEndColumns:P}=u(),D=R.get(o);if(!D.computedDraggable){g(y);return}let w=e.current,M=w.getBoundingClientRect(),E=f.current.getBoundingClientRect(),x=S.getAvailableSize(),v=D.computedVisibleIndex,A=S.getVirtualColIndex(D.computedVisibleIndex,{pageIndex:t||0}),_=S.isHorizontalLayoutBrain?S.getPageWidth():null,F=w.style.cursor??"auto",L=!1,O=f.current,K=we.from(Gd(O).getBoundingClientRect()),W=Hd(O).map(ce=>we.from(ce.getBoundingClientRect())),k=K.getMinimumBoundingRectangle(...W),Q=Nd({brain:S,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:_,draggableColumnsRestrictTo:T,computedPinnedEndColumns:P,computedPinnedStartColumns:C,computedUnpinnedColumns:I,computedVisibleColumns:b,computedVisibleColumnsMap:R,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:f.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:E,acceptDropToReorderRect:k,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),V=null,j,re;function de(ce){let{columnPinning:ue,columnOrder:U}=ce;Hb(c().columnPinning,ue)||(m.columnPinning=ue);let z=u().computedColumnOrder;JSON.stringify(U,z)&&(m.columnOrder=wl({newColumnOrder:U,visibleColumnOrder:u().computedVisibleColumns.map(Y=>Y.id),existingColumnOrder:z,dragColumnId:o}))}let se=ce=>{let{headerBrain:ue,brain:U}=c();if(!L){L=!0;let z=U.keepColumnRendered(A),Y=ue.keepColumnRendered(A);if(U.isHorizontalLayoutBrain){let X=U.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),q=ue.extendRenderRange({start:!0,end:!0,direction:"horizontal"});re=()=>{X(),q()}}j=()=>{z(),Y()},m.columnReorderDragColumnId=D.id,t!=null&&(m.columnReorderInPageIndex=t),Tl(v,`calc( var(${Gb}) + 10000 )`,f.current),f.current?.classList.add(Rl),w.style.cursor="grabbing"}V=Q.onMove(ce)},ae=ce=>{let ue=ce.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:U}=c(),z=f.current;z?.classList.remove(Rl),Q.stop(),S.update({...x}),j?.(),re?.(),w.style.cursor=F,w.hasPointerCapture?.(ue)&&w.releasePointerCapture(ue),w.removeEventListener("pointermove",se),w.removeEventListener("pointerup",ae),i(null);let Y=d.getColumnApi(D.id)?.isSortable()??!1;!L&&Y&&d.toggleSortingForColumn(D.id,{multiSortBehavior:U==="replace"&&(ce.ctrlKey||ce.metaKey)?"append":U}),Vb(()=>{V?de(V):L&&n&&d.setVisibilityForColumn(D.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),b.forEach($=>{ai($.computedVisibleIndex,z),Jn($.computedVisibleIndex,"",z),Qn($.computedVisibleIndex,"",z)}),Tl(v,li(D,{pinnedStartColsCount:C.length,visibleColsCount:b.length}),z)})};w.addEventListener("pointermove",se),w.addEventListener("pointerup",ae),w.setPointerCapture(y.pointerId)},[o,t]);return{onPointerDown:p?h:g,dragColumnOutside:a,proxyPosition:r}};import*as vn from"react";import*as Te from"react";import{useCallback as at,useContext as fT,useEffect as mT,useMemo as gT,useReducer as hT,useSyncExternalStore as yT}from"react";var Ud=Symbol("REPAINT_CELLS_KEY_NO_ROW");function $d(o){return typeof o=="function"}function jd(o,e){let{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(n);if(!a)return Ud;let l=r.getDataSourceStates();return o({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function Yd(o,e,t){let n=jd(o,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=jd(o,e);r!==Ud&&(Object.is(r,n)||(n=r,t()))})}var qd="_1eexc2a7 _1eexc2a6",Xd=ye({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),Zd=ye({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Qd="_1eexc2a5",ui=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Tn="_1eexc2a8";import*as ci from"react";import{useEffect as Kb,useRef as Bb}from"react";var Jd="qz8ht90 _16lm1iwk";function Wb(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:jb}=Mt({forwardProps:Wb,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function Ub(){let{componentState:o,componentActions:e}=At(),{checked:t,domProps:n,disabled:r}=o,i=Bb(null);return Kb(()=>{i.current.indeterminate=t==null},[t]),ci.createElement("input",{...n,className:te("InfiniteCheckBox",Jd,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function To(o){return ci.createElement(jb,{...o},ci.createElement(Ub,null))}var $b="*",We=class{constructor(e){this.wildcard=$b;this.cache=new Z;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let 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),n)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,n){if(n){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(n){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(n){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,n=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),n&&n.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let n=this.selectedRowsToColumns.get(e);if(n){if(n.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>n.has(r)):!1}return!1}error(e){fo(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),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((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function Co(o,e){return e().dataArray[o]}function di(o){return o().dataArray}var ct=class{constructor(e){this.collapsedPathsMap=new Z;this.expandedPathsMap=new Z;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:n,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?n.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?n.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var El=o=>Array.isArray(o)?new Z(o.map(e=>[e,!0])):o,Yb=(o,e)=>o.length-e.length,Qe=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new Z;this.cache=new Z;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?e.config:{treePaths:new Z})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?El(e):this.config.treePaths}withTreePaths(e,t){let n=this.config.treePaths;t=this.getTreePaths(t);let r=t!==n;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=n,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],n){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},n)}getSelectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&n.push(i.keys)})},t),n}getDeselectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||n.push(i.keys)})},t),n}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new o(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:El(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?El(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:n,treePaths:r}=this.config;return t!=="visible"||!n||n===r?!1:n.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:n,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{n.getAllChildrenSizeFor(i)>0||(this.selectionMap.delete(i),this.isNodeSelected(i)!==t&&this.setSelectionForPath(i,t))}),this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let n=this.cache.get(e);if(n)return n;if(this.isLeafNode(e)!==!1){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(Yb);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:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.hasFilteredOutLeavesInside(e)){this.setVisibleLeafNodesSelection(e,t);return}if(this.xcache(),this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function Rn(o,e){return new Qe(o,Cn(e))}function Cn(o){return()=>{let e=typeof o=="function"?o():o,{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}:{treePaths:n??t,multiRowSelectionTarget:r}}}var pi=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Qe))throw"Invalid tree selection";let a=new Qe(r,Cn(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!n)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new ct({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ct({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ct(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ct(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new ct(n.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?Co(n,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Qe))throw"Invalid node selection";let n=new Qe(e,Cn(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Qe))throw"Invalid node selection";let n=new Qe(e,Cn(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Qe))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};function Ml(o){return o.map(Ht)}function Ht(o){if(De().structuredClone)return De().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Ml(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Ml(Array.from(o)));if(o instanceof Map)return new Map(Ml(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Ht(o[t]));return e}function nr(o){return o}var fi="____not_loaded_yet____";function Al(o){return typeof o=="string"&&o.startsWith(fi)}var Wo=Object.seal({data:null,field:null});var yt="____root____";function Ro(){return!1}function _l(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function mi(o,e,t,n,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function tp(o,e){let{marker:t,reducers:n={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:u}=o;t&&t.start();let c=new Z;function d(y,S,T,b=0,R=[]){let C=!T.length||b===T.length-1,I=S[u?.values||"values"]||{};for(let P in I)if(I.hasOwnProperty(P)){let D=P;R.push(D),p.set(R,!0),y.set(R,{reducerResults:I[P][u?.totals||"totals"]||{},items:[]}),C||d(y,I[P],T,b+1,R),R.pop()}}let p=r?new Z:void 0,f=[],m=_l(n),g=Ht(m);e.visitDepthFirst((y,S,T,b)=>{let[R,...C]=S,I=y.children,P=c.get(C);if(P&&(P.cache=y.cache,P.childrenLoading=y.childrenLoading,P.childrenAvailable=y.childrenAvailable,P.error=y.error),C.length==i.length&&i.length){if(P){P.items=I;for(let w=0,M=C.length;w<M;w++){let E=C.slice(0,w),x=c.get(E);x&&(x.items=x.items||[],x.items=x.items.concat(I))}I=a.indexArray(I,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return b?.()}for(let D=0,w=I.length;D<w;D++){if(!I[D]){let v={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...C,`${fi}${D}`],v);continue}let M=I[D].data,E=I[D].keys||[];if(E.length){let v=E[E.length-1];C.push(v)}let x={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:M,totalChildrenCount:I[D].totalChildrenCount,totalChildrenCountUnfiltered:I[D].totalChildrenCountUnfiltered,reducerResults:I[D].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(C,x),r){let v=x.pivotDeepMap=new Z,A=I[D].pivot;d(v,A,r,0,f)}E.length&&C.pop()}b?.()});let h={deepMap:c,groupParams:o,initialData:e,reducerResults:g};return r&&(h.topLevelPivotColumns=p,h.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(y=>y.field).join(", ")}]}),h}function ep(o,e,t,n,r,i,a,l,s,u=nr){let{items:c,reducerResults:d,pivotDeepMap:p}=o.get(e);if(c.push(n),a&&mi(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:y}=i[f],S=g?n[g]:null;h&&(Wo.data=n,Wo.field=g,S=h(Wo));let T=(y||u)(S,n);t.push(T),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Ht(s),items:[]}));let{reducerResults:b,items:R}=p.get(t);R.push(n),a&&mi(n,r,a,b,e)}t.length=0}}function op(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=o,d=c(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let y=0,S=n.length;y<=S;y++){let T=n.slice(0,y),b=e.get(T),{reducerResults:R,items:C}=b;C.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&mi(r,i,a,R,T)}return}let m=Ht(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let h=u(r);if(!(!h||!Array.isArray(h))){for(let y=0,S=h.length;y<S;y++){let T=h[y];op(o,e,t,p,T,y,a,l)}a&&rr(a,m,g)}}function Ol(o,e){let{reducers:t,marker:n}=o;if(n){let u=Object.keys(t??{});n.start({details:u.length>0?[{name:"Reducers",value:u.join(", ")}]:void 0})}let r=_l(t),i=Ht(r),a=new Z,l=new Z;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let u=0,c=e.length;u<c;u++)op(o,a,l,[],e[u],u,t,r);t&&rr(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function Fl(o,e){let{marker:t,groupBy:n,defaultToKey:r=nr,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new Z:void 0,u=new Z,c=[],d=[],p=_l(a),f=Ht(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(p)};i&&(g.pivotDeepMap=new Z),u.set(c,g)}for(let g=0,h=e.length;g<h;g++){let y=e[g],S={};for(let T=0;T<l;T++){let{field:b,groupField:R,valueGetter:C,toKey:I}=n[T],P=b?y[b]:null;C&&(Wo.data=y,Wo.field=b,P=C(Wo));let D=(I||r)(P,y);if(S[b||R]=D,c.push(D),!u.has(c)){let w={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...S},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(p)};i&&(w.pivotDeepMap=new Z),u.set(c,w)}ep(u,c,d,y,g,i,a,s,p,r)}l||ep(u,c,d,y,g,i,a,s,p,r),a&&mi(y,g,a,f,c),c.length=0}a&&(u.visitDepthFirst((g,h,y,S)=>{rr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:b},R,C,I)=>{rr(a,b,T),I?.()}),S?.()}),rr(a,f,e));let m={deepMap:u,groupParams:o,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:n.map(g=>g.field).join(", ")}]}),m}function qb(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function Xb(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.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 S in i)if(i.hasOwnProperty(S)){let b=i[S].field;b&&(f[b]=u[S]),b&&p[b]==null&&(p[b]=u[S])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let S=t[n.length-1];S&&S.field&&(h=p[S.field]),S&&S.toKey&&(h=S.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(fi)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Ro,hasSelectedCells:Ro,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function gi(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function rr(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function np(o,e,t,n,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:y}=r,{deepMap:S}=c,T=o.length,b=t[t.length-1],R=b?b.nodeExpanded:!0;for(let C=0;C<T;C++){let I=o[C],P=u(I,C),D=[...e,P];if(l(I)){let _={id:P,nodePath:D,isGroupRow:!1,data:I,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Ro,hasSelectedCells:Ro,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,C],indexInParent:C,indexInAll:R?i.length:-1};p&&(_.rowSelected=p(_)),d&&(_.rowDisabled=d(_)),f&&f(_);let F=h&&y!=null&&y>0&&_.indexInAll%y===0?_.indexInAll/y:null;for(let L=0,O=t.length;L<O;L++){let K=t[L];if(R||(K.collapsedLeafNodesCount+=1),K.deepRowInfoArray.push(_),F!=null&&R){if(typeof h=="function"&&h(K)!==!0)continue;let W=gi(K,_.indexInAll,F);i[W.indexInAll]=W,_.indexInAll++}}R&&(i[_.indexInAll]=_);continue}let E=S.get(D)?.totalLeafNodesCount??0,x={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:D,id:P,data:I,indexInAll:i.length,indexInParent:C,indexInParentNodes:[...n,C],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Ro,hasSelectedCells:Ro,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(x.rowSelected=p(x),g)){let _=g.getSelectionCountFor(x.nodePath);x.selectedLeafNodesCount=_.selectedCount,x.deselectedLeafNodesCount=_.deselectedCount}d&&(x.rowDisabled=d(x)),f&&f(x);let v=!0;if(m&&(x.selfExpanded=v=m(x)),R||(v=!1),x.nodeExpanded=v,R&&h&&y!=null&&y>0){let _=x.indexInAll,F=x.parentNodes;if(F.length>0&&_%y===0){let L=_/y,O=0;F.forEach(K=>{typeof h=="function"&&h(K)!==!0||(i.push(gi(K,_+O,L)),O++,x.indexInAll++)})}}R&&(i[x.indexInAll]=x);let A=s(I);Array.isArray(A)&&np(A,D,[...t,x],x.indexInParentNodes,r,i)}return i}function rp(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return np(e,[],[],[],o,n),t&&t.end(),{data:n}}function ip(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:u,isRowSelected:c,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:h}=n,{groupBy:y}=m;e&&e.start({details:[{name:"Group by fields",value:y.map(C=>C.field).join(", ")}]});let S=[],T=[],b=[],R=[];return g.visitDepthFirst((C,I,P,D)=>{let w=C.items,M=I.length,E=s?.isGroupRowCollapsed(I)??!1;R.push(P);let x=Xb({lazyLoad:t,groupBy:y,parents:Array.from(b),reducers:f,indexInGroup:P,indexInParentGroups:Array.from(R),indexInAll:S.length,groupKeys:I,error:C.error,totalChildrenCount:C.totalChildrenCount,childrenLoading:(C.childrenLoading||!E&&!C.childrenAvailable)&&t,childrenAvailable:C.childrenAvailable,directChildrenCount:I.length===y.length?C.items.length:g.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},C);if(c&&(x.rowSelected=c(x),d)){let L=d.getSelectionCountFor(x.groupKeys);x.selectedChildredCount=L.selectedCount,x.deselectedChildredCount=L.deselectedCount}u&&(x.rowDisabled=u(x));let v=b[b.length-1],A=v?.collapsed??!1;A&&(E=!0),x.collapsed=E;let _=p||E;if(A&&(_=!1),_){if(i&&r!=null&&r>0){let L=x.indexInAll,O=x.parents;if(O.length>0&&L%r===0){let K=L/r,W=0;O.forEach(k=>{typeof i=="function"&&i(k)!==!0||(S.push(gi(k,L+W,K)),W++,x.indexInAll++)})}}S.push(x),T.push(S.length-1)}x.collapsedChildrenCount=0,b.forEach(L=>{L.deepRowInfoArray.push(x),L.collapsedGroupsCount+=E?1:0}),v&&x.selfLoaded&&t&&(v.directChildrenLoadedCount+=1),a&&a(x),b.push(x);let F=!0;if(F){if(D)D();else if(!h){let L=S.length;E||(S.length+=w.length);let O=0;for(let K=0,W=w.length;K<W;K++){let k=w[K];if(!E&&i&&r!=null&&r>0){let re=L+K+O;if(re%r===0){let de=re/r;b.forEach(se=>{if(typeof i=="function"&&i(se)!==!0)return;let ae=L+K+O;S[ae]=gi(se,ae,de),O++,S.length++})}}let Q=L+K+O,j={id:k?l(k,Q):`${I}-${K}`,data:k,isCellSelected:Ro,hasSelectedCells:Ro,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!k,rowSelected:!1,rowDisabled:!1,rootGroupBy:y,collapsed:E,groupKeys:I,parents:Array.from(b),indexInParentGroups:[...R,K],indexInGroup:K,indexInAll:Q,groupBy:y,groupNesting:M+1,groupCount:x.groupCount};c&&(j.rowSelected=c(j)),u&&(j.rowDisabled=u(j)),a&&a(j),b.forEach((re,de)=>{de===b.length-1&&k&&(re.directChildrenLoadedCount+=1),E&&(re.collapsedChildrenCount+=1),re.deepRowInfoArray.push(j)}),E||(S[L+K+O]=j)}}}b.pop(),R.pop()}),e&&e.end(),{data:S,groupRowsIndexes:T}}function Io(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||nr)(l,o);return t.push(s),t},[])}var Zb=new Z,ap=new WeakMap;function hi(o){let{originalDataArray:e,groupBy:t,toPrimaryKey:n}=o;if(!e||!t.length)return Zb;let r=ap.get(e);if(r&&r.groupBy===t)return r.groups;let i=new Z,a=t.length,l=[];return e.forEach(s=>{let u=Io(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(n(s))}}),ap.set(e,{groupBy:t,groups:i}),i}function Qb(o,e){let t=[];return o.getLeafNodesStartingWith(e,n=>{let r=n.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var Me=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new Z;this.deselectedMap=new Z;this.onlyUsePrimaryKeys=!1;this.selectionCache=new Z;this.selectionCountCache=new Z;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Io(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e==="visible"&&!!t}targetsFilteredOutRows(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e!=="visible"&&!!t}getVisibleDataInsideGroup(e){let{postFilterDataArray:t,groupDeepMap:n}=this.getConfig();return e.length?n?.get(e)?.items??[]:t??[]}hasFilteredOutRowsInsideGroup(e){let t=this.getConfig();return t.someRowsFilteredOut?(e.length?hi(t).get(e)?.count??0:t.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(e).length:!1}setVisibleRowsSelection(e,t){let{groupBy:n,toPrimaryKey:r}=this.getConfig(),i=t?this.selectedMap:this.deselectedMap,a=t?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(e).forEach(l=>{let s=Io(l,n),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:n}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(n?.get(i)?.totalChildrenCount||0)}),Math.max(t-r,0)}getLazyEntries(){let e=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==e){let t=new Z;this.selectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new Z;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let n=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,n??null),n}computeLazyRowCount(e){let t=this.getConfig(),n=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!n)return t.totalCount;let i=e.length?t.groupDeepMap?.get(e):void 0,a=e.length?i?.totalChildrenCount:t.lazyGroupedRowCount;if(a!=null)return a;if(e.length===n)return i?.childrenAvailable?i.items.length:void 0;let l=t.groupDeepMap?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((s,u)=>s+(Al(u[u.length-1])?1:this.getLazyRowCount(u)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new Z;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let n=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,n),n}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),n=e.length?t?.get(e):void 0;return e.length&&!n?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!Al(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new Z;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:n,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?n?.get(e):void 0,s=l?l.items:r??[],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(),n=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>n?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getLazyEntries(),i=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,s=0;r.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0,respectOrder:!1}).forEach(p=>{if(!a&&this.isLazyEntryFilteredOut(p))return;let f=r.get(p);if(p.length>=i){f?l++:s++;return}let m=this.getLazySelectionCountFor(p,f);l+=m.selectedCount,s+=m.deselectedCount});let 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 hi(this.getConfig()).get(e)?.count??0;let n=this.getGroupDeepMap()?.get(e);return n?this.getLazyUnfilteredCount(e)??n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),n={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?hi(t).getKeysStartingWith(e,n):t.groupDeepMap?.getKeysStartingWith(e,n)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:n,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?Qb(hi(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(n?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=n?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys||i===0&&a.length===1?a[0]:a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!0);return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)}),this.xcache()}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!1);return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)}),this.xcache()}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let 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 In(o,e){return new Me(o,it(e))}function it(o){return()=>{let e=typeof o=="function"?o():o,{originalDataArray:t,postFilterDataArray:n}=e,r=!!e.lazyLoad,i=r?e.originalLazyGroupData.get([yt]):void 0;return{lazyLoad:r,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:r?t?.length??0:e.unfilteredCount,lazyGroupedRowCount:e.groupBy.length?i?.totalChildrenCount:void 0,lazyUnfilteredCount:e.groupBy.length?i?.totalChildrenCountUnfiltered:i?.totalCountUnfiltered,multiRowSelectionTarget:e.multiRowSelectionTarget,someRowsFilteredOut:!e.lazyLoad&&!!t&&!!n&&n.length<t.length,originalDataArray:t,postFilterDataArray:n}}}function lp(o){let{getDataSourceState:e,dataSourceActions:t}=o;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Me))throw"Invalid row selection";let a=new Me(r,it(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 Me))throw"Invalid row selection";let a=new Me(r,it(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 Me))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?Io(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 Me))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Io(d,u):[]}let c=new Me(a,it(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 Me))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Io(d,u):[]}let c=new Me(l,it(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 Me))throw"Invalid row selection";let s=new Me(a,it(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 Me))throw"Invalid row selection";let s=new Me(a,it(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 Me))throw"Invalid row selection";let s=new Me(a,it(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Me(i,it(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Me))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Me(r,it(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 sp(o,e){yi(o,e),eT(o,e),e.detail===2&&Jb(o,e),o.getState().onCellClick?.(o,e)}function Jb(o,e){if(or(e.target))return;let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function eT(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,y=new We(c);y.debugId=m??"",d.cellSelectionState=y;let S={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(S);else if(e.shiftKey){let T=!!n().wrapRowsHorizontally;d.multiSelectClick(S,T?{horizontalLayout:T,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:T})}else d.resetClick(S);l.cellSelection=y}function tT(o){return o.getState().multiRowSelectionWith!=="click"&&o.getComputed().renderSelectionCheckBox?"checkbox":"click"}function oT(o){return o?or(o)?!0:typeof o.closest!="function"?!1:!!o.closest(`.${Tn}, [data-name="expand-collapse-icon"]`):!1}function yi(o,e,t=e.key?"keyboard":"click"){let{rowIndex:n,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:u,cloneTreeSelection:c}=o,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&oT(e.target))return!1;let h=m[n];if(!h||h.rowDisabled)return!1;if(g){if(!h.isTreeNode||!h.nodePath)return!1;let{isNodeSelectable:y}=p;if(y&&!y(h))return!1}if(f==="multi-row"){let y=tT(o);if(t==="click"&&y==="checkbox")return!1;let S=t==="checkbox"||t==="keyboard"&&y==="checkbox",T=()=>{e.shiftKey?d.multiSelectClick(n):S||e.metaKey||e.ctrlKey?d.singleAddClick(n):d.resetClick(n)};if(g){let{treeSelectionState:R}=p;if(!(R instanceof Qe))return!1;let C=c(R);d.treeSelectionState=C,T(),d.treeSelectionState=void 0;let I=!e.shiftKey&&(S||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=I?{nodePath:h.nodePath,selected:!!C.isNodeSelected(h.nodePath)}:null),a.treeSelection=C,!0}let{rowSelection:b}=p;return!b||typeof b!="object"?!1:(b=u(b),d.rowSelectionState=b,T(),a.rowSelection=b,!0)}else if(f==="single-row"){if(h.isGroupRow)return!1;let y=e.metaKey||e.ctrlKey||t!=="click";if(g){let{treeApi:T}=l;return y?T.toggleNodeSelection(h.nodePath):T.selectNode(h.nodePath),!0}let S=h.id;return y?s.rowSelectionApi.toggleRowSelection(S):s.rowSelectionApi.selectRow(S),!0}return!1}function up(o,e){let{getComputed:t,dataSourceActions:n,dataSourceApi:r}=o,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=o.getDataSourceState;return yi({rowIndex:e,api:o,getComputed:t,getState:o.getState,getDataSourceState:l,dataSourceActions:n,dataSourceApi:r,cloneRowSelection:s=>In(s,l),cloneTreeSelection:s=>Rn(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}import*as ir from"react";import{useState as nT}from"react";var cp="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",dp=ye({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 pp="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",Y1=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Si=`${Tt}-expand-collapse`;function jo(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=nT(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),ho("expanded",o)||i(!r)};ir.useEffect(()=>{ho("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return ir.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:te(o.className,cp,dp({direction:t||"start",expanded:r,disabled:n}),`${Tt}`,`${Si}`,`${Si}--${l}`,`${Si}--${t==="end"?"end":"start"}`,n?`${Si}--disabled`:"")},ir.createElement("path",{d:pp}))}function fp(o){return typeof o.field=="string"}function mp(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?n.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=n.get(e.field))}return r}function Kt(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",y=!g||typeof g=="function"&&!g(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:S,formattedValueContext:{rawValue:T}}=wn({column:p,rowInfo:u,rowDetailState:y,columnsMap:e().computedColumnsMap,context:o}),b=ut(p.id,o);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:S,rawValue:T}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:y,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:S,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:y,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:S,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:y,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:S,rawValue:T}}function gp(o){return yp(o.column,o.rowInfo)}function hp(o){let{column:e,context:t,rowInfo:n,visibleColumnIds:r}=o,i=mp({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=wn(o),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit: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:rT({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function rT(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=o,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,y=p(),{selectionMode:S,cellSelection:T}=y,b=mp({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),R=d.toggleGroupRow,C=T?.isCellSelected(n.id,e.id)??!1,I={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:C,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...u,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:b,selectionMode:S,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:h,toggleGroupRow:R,toggleCurrentGroupRow:()=>{n.isGroupRow&&R(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:y.groupBy,pivotBy:y.pivotBy};return Object.defineProperty(I,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),I}function iT(o,e){if(!o.isGroupRow)return;let t=o.groupData;if(!t.length)return;let n=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==n)return;return n}function yp(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:fp(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),a===void 0&&e.isGroupRow&&o.groupByForColumn&&fp(o)&&(a=iT(e,o.field)),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function aT(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.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:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}}function wn(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=yp(e,t),a=aT(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Sp=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),bp="_7pupv00",Tp=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Cp}=Le,Zt=`${Cp}Cell`,ar=`${Cp}Cell_content`;var{rootClassName:lT}=Le,Bt=`${lT}ColumnCell`;var sT=J(ee.columnZIndexAtIndex),uT=J(ee.columnVisibilityAtIndex);function Rp({rowInfo:o,column:e}){let t=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=e?.groupByForColumn,r=o.groupBy[o.groupBy.length-1],i=!!o.pivotValuesMap,a=i&&!!e?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;t=a||l?o.groupNesting:o.groupNesting-1}else t=o.groupNesting;return{[J(pe.components.Row.groupNesting)]:t}}function Ip({rowInfo:o}){return{[J(pe.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function Nl(o,e){return o?typeof o=="function"?o(e):o:void 0}function Ll(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function wp(o){let{column:e,rowInfo:t,rowIndex:n,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:y,rowDisabled:S,rowSelected:T,cellSelected:b,cellSelection:R,getData:C,computedVisibleColumns:I,visibleColumnIds:P,computedColumnOrder:D,columnReorderInPageIndex:w}=o,M=P??I.map(se=>se.id),E=D,x,v={...c,visibleColumnIds:M,allColumnIds:E,rowIndex:n,get rowHasSelectedCells(){return x===void 0&&(x=t.hasSelectedCells(M)),x}},A=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),_=typeof f=="function"?f(v):f,F;d?.className&&(F=Nl(d.className,u)),g&&(F=te(F,Nl(g,u))),e.className&&(F=te(F,Nl(e.className,u))),A&&(F=te(F,Tp({align:l})));let L;t.dataSourceHasGrouping&&e.groupByForColumn&&(L=Rp({rowInfo:t,column:e})),A&&(L=Ip({rowInfo:t})),p&&(L=typeof p=="function"?{...L,...p(v)}:{...L,...p}),m&&(L=Ll(L,m,u)),d?.style&&(L=Ll(L,d.style,u)),e.style&&(L=Ll(L,e.style,u)),L=L||{},L.height=r,L.zIndex=`var(${sT}-${e.computedVisibleIndex})`,L.visibility=`var(${uT}-${e.computedVisibleIndex}, visible)`;let O=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:n)%2===1,K=h?O?"odd":"even":!1,W=!1,k=!1,Q=!1,V=!1;if(R&&b){let se=C(),ae=se[t.indexInAll-1],ce=se[t.indexInAll+1],ue=I[e.computedVisibleIndex+1],U=I[e.computedVisibleIndex-1];W=ae?!R.isCellSelected(ae.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?k=!0:k=U?!R.isCellSelected(t.id,U.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?Q=!0:Q=ue?!R.isCellSelected(t.id,ue.id):!0,V=ce?!R.isCellSelected(ce.id,e.id):!0}let j=R&&b?{top:W,left:k,right:Q,bottom:V}:null,re=w!=null?a!==w:!1,de=te(j?Zd(j):"",ii(e,[Bt,Zt],Xd,{dragging:!1,insideDisabledDraggingPage:re,zebra:K,align:l,verticalAlign:s,rowDisabled:S,rowActive:y,cellSelected:b,rowSelected:T,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),F,_);return{style:L,className:de,cellSelectionBorders:j,zebra:K,columnIsTree:A}}import*as Qt from"react";var cT=J(ee.columnWidthAtIndex),dT=J(ee.columnReorderEffectDurationAtIndex);function pT(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!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}=o,y=typeof m=="function"?m():m,S={width:`var(${cT}-${i.computedVisibleIndex})`,transition:`transform var(${dT}-${i.computedVisibleIndex}, 0s)`,...h.style},T={...h,style:S,"data-column-id":i.id,"data-z-index":S.zIndex,className:te(h.className,Zt,qd),children:Qt.createElement(Qt.Fragment,null,d,Qt.createElement("div",{className:te(ar,e?_t:nc.hidden,s),style:r},y),c)};u!=null&&(T["data-row-id"]=`${u}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?Qt.createElement(b,{...T,ref:a}):Qt.createElement("div",{...T,ref:a})}var bi=Qt.memo(pT);import*as Uo from"react";import{useCallback as kl,useRef as vp}from"react";function Pp(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=zl(),i=vp(null),a=vp(!1),l=Uo.useCallback(c=>{i.current=c,c&&c.focus()},[]),s=kl(c=>{let{key:d}=c;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,n()):c.stopPropagation()},[]),u=kl(()=>{a.current||t()},[]);return Uo.createElement(Uo.Fragment,null,Uo.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:u,className:te(Xu,oc.none),type:"text",defaultValue:o,onChange:kl(c=>{e(c.target.value)},[])}))}function Dp(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var lr=Te.createContext(null),ST=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return Te.createElement(jo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},bT={display:"inline-block",visibility:"visible"},Vl=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return Te.createElement(jo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:bT,expanded:n,onChange:t})},TT=o=>{let{rowInfo:e,rowIndex:t,column:n,api:r}=o;e.isGroupRow&&n.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||To;return Te.createElement(l,{domProps:{className:Tn},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{up(r,t)},checked:e.rowSelected})};function CT(o){let{repaintCellsKey:e,column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=o,[,a]=hT(s=>s+1,0),l=$d(e)?e:void 0;mT(()=>{if(l)return Yd(l,{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i},a)},[l,t,n,r,i])}function RT(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,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:y,onRowMouseEnter:S,onRowMouseLeave:T,rowIndex:b,rowHeight:R,columnsMap:C,fieldsToColumn:I,domRef:P,hidden:D,showZebraRows:w,getDataSourceState:M,dataSourceApi:E,dataSourceActions:x,getState:v,imperativeApi:A,componentActions:_,getComputed:F,getDataSourceMasterContext:L}=o,O=yT(at(le=>t.subscribeToRowIndex(b,le),[t,b]),at(()=>t.getRowInfoAtIndex(b),[t,b]));CT({repaintCellsKey:p,column:g,rowIndex:b,rowInfoStore:t,getDataSourceState:M});let K=!O,W=!g,k=Te.useRef(null),Q=at(le=>{k.current=le,P&&P(le)},[P]),V=O??{id:"",indexInAll:b,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:j}=V,re=F(),{activeRowIndex:de,keyboardNavigation:se,columnReorderInPageIndex:ae}=v(),ce=b===de&&se==="row",ue={getState:v,getDataSourceState:M,getDataSourceMasterContext:L,actions:_,dataSourceActions:x,api:A,dataSourceApi:E},U=V.rowDisabled,z=hp({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:V,rowDetailState:f,columnsMap:C,visibleColumnIds:s,fieldsToColumn:I,context:ue}),{stylingParam:Y,renderParams:$,formattedValueContext:X,renderFunctions:q,groupByColumnReference:fe,inEdit:me}=z,{align:ie,verticalAlign:G}=$,N=$,ge=Te.useRef(N),Ee=S&&y?le=>{let $e={...X,rowIndex:b};S($e,le),y(le)}:y,Ce=T&&h?le=>{let _e={...X,rowIndex:b,rowInfo:V};T(_e,le),h(le)}:h,Re=at(le=>{let _e=g.computedVisibleIndex;v().cellClick({rowIndex:b,colIndex:_e,event:le})},[b,g.computedVisibleIndex,se]),Ae=at(le=>{let _e=g.computedVisibleIndex;if(v().cellMouseDown({rowIndex:b,colIndex:_e,event:le}),se==="row"){U||(_.activeRowIndex=b);return}se==="cell"&&(_.activeCellIndex=[b,_e])},[b,U,g.computedVisibleIndex,se]),{selectionMode:Ge,cellSelection:et,isNodeReadOnly:Xe}=e,tt=N.cellSelected;N.domRef=Q,N.htmlElementRef=k,N.toggleCurrentTreeNode=at(N.toggleCurrentTreeNode,[V]),N.selectCell=at(N.selectCell,[V]),N.deselectCell=at(N.deselectCell,[V]),N.selectCurrentRow=at(N.selectCurrentRow,[V]),N.deselectCurrentRow=at(N.deselectCurrentRow,[V]),N.toggleCurrentGroupRow=at(N.toggleCurrentGroupRow,[V]),N.toggleCurrentRowSelection=at(N.toggleCurrentRowSelection,[V]),N.toggleCurrentGroupRowSelection=at(N.toggleCurrentGroupRowSelection,[V]),N.toggleCurrentTreeNodeSelection=at(N.toggleCurrentTreeNodeSelection,[V]);let Ze=g.components?.Editor??Pp,Ue=me?Te.createElement(Ep,{contextValue:N},Te.createElement(Ze,null)):null,B=at(lt(()=>{if(D||me)return null;if(ge.current=N,q.renderGroupIcon&&(N.renderBag.groupIcon=Te.createElement(St,{render:q.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),q.renderSelectionCheckBox&&Ge=="multi-row"&&(N.renderBag.selectionCheckBox=Te.createElement(St,{render:TT,renderParam:N}),q.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=Te.createElement(St,{render:q.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),V.isTreeNode){let{isParentNode:$e}=V,po;po=($e?q.renderTreeIconForParentNode:q.renderTreeIconForLeafNode)||typeof q.renderTreeIcon=="function"?q.renderTreeIcon:$e&&q.renderTreeIcon===!0?Vl:void 0,po===!0?po=Vl:po&&(N.renderBag.treeIcon=Te.createElement(St,{render:Vl,renderParam:N})),po&&(N.renderBag.treeIcon=Te.createElement(St,{render:po,renderParam:{...N,renderBag:{...N.renderBag}}}))}q.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=Te.createElement(St,{render:ST,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof q.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=Te.createElement(St,{render:q.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),q.renderValue&&(N.renderBag.value=Te.createElement(St,{render:q.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),V.isGroupRow&&q.renderGroupValue&&(N.renderBag.value=Te.createElement(St,{render:q.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!V.isGroupRow&&q.renderLeafValue&&(N.renderBag.value=Te.createElement(St,{render:q.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),ge.current=N;let le=N.renderBag.value;le instanceof Date&&(le=le.toLocaleDateString());let _e=Te.createElement(Te.Fragment,null,ie!=="end"?N.renderBag.treeIcon:null,ie!=="end"?N.renderBag.groupIcon:null,ie!=="end"?N.renderBag.rowDetailsIcon:null,ie!=="end"?N.renderBag.selectionCheckBox:null,le,ie==="end"?N.renderBag.selectionCheckBox:null,ie==="end"?N.renderBag.rowDetailsIcon:null,ie==="end"?N.renderBag.groupIcon:null,ie==="end"?N.renderBag.treeIcon:null);return g.render?Te.createElement(St,{render:g.render,renderParam:{...N,renderBag:{...N.renderBag,all:_e}}}):_e}),[g,D,me,f,g.renderTreeIcon||g.renderTreeIconForParentNode?Xe:!1,...Dp(N,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:oe,className:he}=wp({column:g,rowInfo:V,rowIndex:b,rowHeight:R,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:ie,verticalAlign:G,stylingParam:Y,formattedValueContext:X,groupByColumnReference:fe,rowStyle:n,rowClassName:r,cellStyle:c,cellClassName:d,showZebraRows:w,rowActive:ce,rowDisabled:U,rowSelected:j,cellSelected:tt,cellSelection:et,getData:l,visibleColumnIds:s,computedVisibleColumns:re.computedVisibleColumns,computedColumnOrder:u,columnReorderInPageIndex:ae}),be=gT(()=>oe,[oe?JSON.stringify(oe):null]),nt=Ue,H=B(),Ne={domRef:Q,cellType:"body",column:g,width:m,rowId:V.id,horizontalLayoutPageIndex:a,style:be,onMouseLeave:Ce,onMouseEnter:Ee,onClick:Re,afterChildren:nt,onMouseDown:Ae,cssEllipsis:g.cssEllipsis??!0,className:he,renderChildren:at(()=>H,[B])},pt=lr.Provider;return W||K?Te.createElement("div",{ref:Q,style:{display:"none"}}):Te.createElement(pt,{value:ge.current},Te.createElement(bi,{...Ne}))}var xp=Te.memo(RT);function Ti(){return fT(lr)}function zl(){let{api:o,editingValueRef:e,editingCell:t}=ne(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:n,rowInfo:r}=Ti(),[i]=Te.useState(()=>t?.value),[a,l]=Te.useState(i),s=t?!t.active&&!!t.waiting:!1,u=Te.useCallback(f=>{e.current=f,l(f)},[]);Te.useLayoutEffect(()=>{e.current=i},[]);let c=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function sr(o){return o.render(o.renderParam)??null}function St(o){let e=lr.Provider;return vn.createElement(e,{value:o.renderParam},vn.createElement(sr,{render:o.render,renderParam:o.renderParam}))}function Ep(o){let e=lr.Provider;return vn.createElement(e,{value:o.contextValue},o.children)}function wo(o){let e=Ci.Provider;return vn.createElement(e,{value:o.renderParam},vn.createElement(sr,{render:o.render,renderParam:o.renderParam}))}import*as vo from"react";var ur=qr({"data-name":""}),cr={[ur["data-name"]]:"menu-icon"},aO=`[${ur["data-name"]}="${cr["data-name"]}"]`;var IT={width:"100%",pointerEvents:"none"},Gl=`${Tt}-menu`;function dr(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...IT,borderTop:`${pe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return vo.createElement("div",{...n,style:e,...cr,onPointerDown:s=>s.stopPropagation(),className:te(t,Fc({menuVisible:i,reserveSpaceWhenHidden:r}),Tt,`${Tt}-menu`)},a??vo.createElement(vo.Fragment,null,vo.createElement("div",{className:Gl,style:l}),vo.createElement("div",{className:Gl,style:l}),vo.createElement("div",{className:Gl,style:l})))}import*as Pn from"react";import{useEffect as wT,useState as _p}from"react";var Mp="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Ap={transition:"width 0.25s, opacity 0.25s"},bO=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Ri(o){let[e,t]=_p(!0),[n,r]=_p(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=o,c=u!=null&&u>0,d=o.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Ap,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};wT(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==n){let S=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(S)}}return()=>{}},[i,e]);let g=()=>{let S=!(n===0&&i===0);S!==e&&t(S)};if(!e&&!o.forceSize)return null;let h={};return i===-1&&(h.top="100%"),Pn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:te(s,Tt,Mp,`${Tt}-sort`)},c?Pn.createElement("div",{"data-name":"index",style:h,className:kc},u):null,Pn.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),Pn.createElement("div",{style:{width:f[1],...m}}),Pn.createElement("div",{style:{width:f[2],...m}}))}import*as Vp from"react";import{useCallback as zp}from"react";function Hl(o){return Math.max(o.width-zt(),0)}function Op(o){let{context:e,column:t,diff:n,shareSpaceOnResize:r}=o,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 cl({shareSpaceOnResize:r,availableSize:Hl(s),reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:u.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}import{useRef as Lp,useState as vT}from"react";import*as pr from"react";function Fp(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Ie.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Ie.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?bl(l,i,n.current):Ie.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){bl(u,i,n.current);continue}u.computedPinned!=="end"&&Ie.columnOffsets.set(l,u.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Ie.columnOffsets.set(l,u.computedOffset+i,n.current)}}}}}function Np(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,u=i.current;if(n.forEach((c,d)=>{s+=c;let p=o[d],f=r[p],m=f.computedWidth+c;Ie.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Ie.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"&&Ie.columnOffsets.set(c,d.computedOffset+s,u)}}}}var Ii="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",wi=ye({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"]]}),vi=ye({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:PT}=Le,DT=`${PT}HeaderCell_ResizeHandle`;function xT(o){let{brain:e,headerBrain:t}=ne(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),n=Lp(null),[r,i]=vT(!1),a=Lp(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,y=g.pointerId,S=g.clientX,T=g.target;if(e.isHorizontalLayoutBrain){let P=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),D=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{P(),D()}}T.setPointerCapture(y);let b=Fp(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),R=(P,{done:D}={})=>{s&&(P=P/(s+1),D&&(P=Math.round(P))),u==="end"&&(P*=-1);let{adjustedDiff:w,constrained:M}=o.computeResize({diff:P,shareSpaceOnResize:h});return a.current!==M&&i(M),b.resize(w),w},C=P=>{R(Math.round(P.clientX-S))},I=P=>{T.releasePointerCapture(y),T.removeEventListener("pointermove",C),T.removeEventListener("pointerup",I);let D=Math.round(P.clientX-S),w=R(D,{done:!0});p(),b.resize(0),o.onResize({diff:w,shareSpaceOnResize:h})};T.addEventListener("pointermove",C),T.addEventListener("pointerup",I)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return pr.createElement("div",{ref:n,className:`${DT} ${Ii} ${vi({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},pr.createElement("div",{style:m,className:wi({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var kp=pr.memo(xT);function Gp(o,e){let{computedVisibleColumns:t,getState:n,getComputed:r,actions:i}=ne(u=>({computedVisibleColumns:u.computed.computedVisibleColumns,getState:u.getState,getComputed:u.getComputed,actions:u.actions})),a=zp(({diff:u,shareSpaceOnResize:c})=>Op({context:{getState:n,getComputed:r},column:o,diff:u,shareSpaceOnResize:c}),[o,n,r]),l=zp(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return o.computedResizable?Vp.createElement(kp,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}import*as je from"react";import{useCallback as Kl,useEffect as Bl,useState as FT}from"react";var Hp=ye({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Kp=ye({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Bp(o,e){return mt(o,e)}var fr=class extends Ko{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 Bp(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Bp(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}adjustForScroll(t){this.breakpoints=this.breakpoints.map(n=>n-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:u}=t,c=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=c.filter(f=>f!==r):d=Ho(c,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:u,status:t.status};this.emit("drop",p)}};var ET={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:o=>o**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function MT(o,e){let t=getComputedStyle(o),n=e==="vertical"?t.overflowY:t.overflowX;return n!=="auto"&&n!=="scroll"?!1:e==="vertical"?o.scrollHeight>o.clientHeight:o.scrollWidth>o.clientWidth}function AT(o,e){let t=o;for(;t&&!(t===document.documentElement||t===document.body);){if(MT(t,e))return t;t=t.parentElement}return null}function _T(o,e){return{startScrollingFrom:o*e.startFromPercentage,maxScrollValueAt:o*e.maxScrollAtPercentage}}var Up=1;function Wp(o,e,t){if(o>e.startScrollingFrom)return 0;if(o<=e.maxScrollValueAt)return t.maxPixelScroll;if(o===e.startScrollingFrom)return Up;let r=1-(o-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function OT(o,e,t){let{accelerateAt:n,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return o;if(i<n)return Up;let a=(i-n)/(r-n);return Math.ceil(o*t.ease(a))}function jp(o,e,t,n,r,i,a){if(o<e||o>t)return 0;let l=_T(n,r),s=o-e,u=t-o,c=u<s,d;return c?d=Wp(u,l,r):d=-Wp(s,l,r),d===0?0:a?(d>0?1:-1)*OT(Math.abs(d),i,r):d}var Dn=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={...ET,...e.config}}start(e){this.scrollContainer=AT(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},n=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=n,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,n=0;return this.orientation==="vertical"?t=jp(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):n=jp(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:n}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var qp=je.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),xn=()=>je.useContext(qp),NT=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},LT=o=>`${o.getAttribute(Ct)}`;function Wl(o,e){let t=o.current?.querySelectorAll(Jp)??[];return Array.from(t).filter(r=>r.getAttribute(mr)===`${e}`)}function kT(o,e){let t=Wl(o,e);return!t||t.length,Array.from(t).map(r=>{let i=LT(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function zT(o){let{domRef:e,orientation:t,dragListId:n}=o,r=kT(e,n),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=we.from({top:a,left:l,width:u-l,height:s-a});return{draggableItems:r,orientation:t,listId:n,listRectangle:c,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial,preserveDragSpace:o.preserveDragSpace}}function Xp(o){return new fr(zT(o))}function VT(o,e){let t=Fe(e),[n,r]=je.useState(null),i=Kl(l=>{if(l)gt.registerDragInteractionTarget(l);else{let s=a();s&&gt.unregisterDragInteractionTarget(s)}r(l)},[]),a=Fe(n);return Bl(()=>gt.on("register",l=>{let{dragListId:s,acceptDropsFrom:u,orientation:c,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&u?.includes(p.listId)){let f=Xp({domRef:o,orientation:c,dragListId:s,initial:!1,acceptDropsFrom:u,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}function Zp(o,e){let t=o.cloneNode(!0);return t.removeAttribute(Ct),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 Qp({proxyElement:o,dx:e,dy:t}){o.style.transform=`translate3d(${e}px, ${t}px, 0)`}function $p(o){let e=o.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",o.current=null)}var $o=o=>{let e=je.useRef(null),t=je.useRef(null),[n,r]=FT(null),i=je.useRef({top:0,left:0}),a=je.useRef(null),l=je.useCallback(w=>{a.current=w},[]),{dropTargetListId:s,dragSourceListId:u}=bo(),{updateDragOperationSourceAndTarget:c,dragItemId:d,status:p}=bo(),f=Fe(o.onDrop),m=Fe(o.onAcceptDrop),g=Fe(o.onRemove),h=Fe(o.updatePosition??NT),{interactionTarget:y,setInteractionTarget:S}=VT(e,o);Bl(()=>{let w=document.querySelector(`[${Yp}="${o.dragListId}"]`);w?e.current=w:console.warn(`DragList with id "${o.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[o.dragListId]),Bl(()=>{if(y){let w=o.dragListId,M=y.on("start",({dragItem:L,dragSourceListId:O,dropTargetListId:K})=>{c({dragSourceListId:O,dropTargetListId:K,dragItemId:L.id,status:"accepted"})}),E=y.on("move",({offsetsForItems:L,items:O,status:K,dragItem:W})=>{if(K==="rejected")return;let k=b(),Q=h(),V=t.current;O.forEach((j,re)=>{let de=L[re],se=k[re];if(se&&!(V&&j.id===V.dragItemId)){if(!V&&j.id===W.id){let ae=i.current;de={left:de.left+ae.left,top:de.top+ae.top}}Q({id:j.id,node:se,offset:de})}})}),x=y.on("drop",L=>{let{sortedIndexes:O,dragIndex:K,dropIndex:W,dragItem:k,items:Q,dragSourceListId:V,dropTargetListId:j,outside:re,status:de}=L,se=b();T.current=[];let ae=m(),ce=g(),ue=f(),U=h();Q.forEach(($,X)=>{let q=se[X];q&&U({id:$.id,node:q,offset:null})}),$p(t),r($=>$&&(requestAnimationFrame(()=>r(null)),{...$,dragItemId:null})),w===j&&V!==w&&ae&&de==="accepted"&&ae({dragItemId:k.id,dragSourceListId:V,dropTargetListId:j,dragIndex:K,dropIndex:W,dropItemId:Q[W]?.id});let Y=null;W===-1&&V===w&&j===w&&re&&(Y=ce),W!==-1&&j===w&&V===w&&(Y=ue),Y&&Y?.(O,{dragIndex:K,dropIndex:W,dragItemId:Q[K].id,dropItemId:Q[W]?.id})}),v=null,A=null,_=null,F=null;if(!y.getData().initial&&e.current){if(v=new Dn({orientation:o.orientation,onScroll:()=>{}}),v.start(e.current),A=v.getScrollContainer(),A){let L=o.orientation==="vertical"?A.scrollTop:A.scrollLeft;_=()=>{let O=o.orientation==="vertical"?A.scrollTop:A.scrollLeft,K=O-L;L=O,K!==0&&(y.adjustForScroll(K),gt.retriggerMove())},A.addEventListener("scroll",_)}F=L=>{v.updatePointer({left:L.clientX,top:L.clientY})},De().addEventListener("pointermove",F)}return()=>{M(),E(),x(),v&&v.stop(),A&&_&&A.removeEventListener("scroll",_),F&&De().removeEventListener("pointermove",F)}}},[y,o.dragListId]);let T=je.useRef([]),b=Kl(()=>{let w=T.current;return(!w||w.length===0)&&(w=Wl(e,o.dragListId),T.current=w),w},[o.dragListId]),R=Kl(w=>{let M=w.currentTarget,E=M.getAttribute(Ct);if(E==null){let z=yo(M,Jp);z&&(E=z.getAttribute(Ct))}if(E==null){console.warn("Could not find drag item id for element",M,`Make sure you have a parent element with a ${Ct} attribute`);return}E=`${E}`;let x=null,v=Wl(e,o.dragListId);T.current=v;let A=Xp({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0,preserveDragSpace:o.preserveDragSpace}),_=A.getData().draggableItems,F=_.findIndex(z=>z.id===E);if(F===-1)return;let L=_[F],O=v[F]?.getAttribute(Ct)===`${E}`?v[F]:v.find(z=>z.getAttribute(Ct)===`${E}`);S(A);let K={left:w.clientX,top:w.clientY},W={left:w.clientX,top:w.clientY};i.current={top:0,left:0};let k=new Dn({orientation:o.orientation,onScroll:()=>{}});e.current&&k.start(e.current);let Q=k.getScrollContainer(),V=Q?o.orientation==="vertical"?Q.scrollTop:Q.scrollLeft:0;function j(){x&&x.move({left:W.left,top:W.top})}let re=()=>{if(!Q)return;let z=o.orientation==="vertical"?Q.scrollTop:Q.scrollLeft,Y=z-V;V=z,Y!==0&&(A.adjustForScroll(Y),o.orientation==="vertical"?i.current.top+=Y:i.current.left+=Y),j()};Q?.addEventListener("scroll",re);let de=o.dragStrategy??"proxy",se=de==="proxy"&&!o.renderDragProxy,ae=de==="proxy"&&!!o.renderDragProxy,ce=o.onDragProxyMove??Qp,ue=z=>{if(W={left:z.clientX,top:z.clientY},!x){if(x=gt.startDrag({listId:o.dragListId,dragItem:L,dragIndex:F},K),O&&se){let X=O.getBoundingClientRect(),q=null,fe={dragItemNode:O,dragItemId:`${E}`,initialRect:X,initialCoords:K,get proxyElement(){return q||(q=Zp(O,X)),q}},me=o.onDragProxySetup?.(fe),ie=me?.proxyElement??fe.proxyElement;O.style.visibility="hidden",t.current={proxyElement:ie,originalNode:O,dragItemId:`${E}`,initialRect:X,cleanup:me?.cleanup}}if(O&&ae){let X=O.getBoundingClientRect();O.style.visibility="hidden",t.current={proxyElement:O,originalNode:O,dragItemId:`${E}`,initialRect:X,cleanup:()=>{}},r({dragItemId:`${E}`,initialRect:X,dx:0,dy:0})}}let Y=z.clientX-K.left,$=z.clientY-K.top;if(ae)r(X=>X&&{...X,dx:Y,dy:$});else{let X=t.current;X&&ce({proxyElement:X.proxyElement,dx:Y,dy:$})}k.updatePointer({left:z.clientX,top:z.clientY}),j()},U=()=>{if(k.stop(),Q?.removeEventListener("scroll",re),De().removeEventListener("pointermove",ue),ae&&(r(z=>z&&{...z,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!x){$p(t),S(null);return}x.drop(),x=null};De().addEventListener("pointermove",ue),De().addEventListener("pointerup",U,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside,o.dragStrategy,o.renderDragProxy,o.onDragProxySetup,o.onDragProxyMove]),C=!!d,I=je.useMemo(()=>({dragItemId:d,onDragItemPointerDown:R,dragSourceListId:u,dropTargetListId:s,status:p,dragListId:o.dragListId,draggingInProgress:C}),[d,R,C,u,s,o.dragListId]),P={className:te("DragList",C?"DragList--dragging":"",Hp({dragging:C})),[Yp]:o.dragListId},D=typeof o.children=="function"?o.children(P,I):o.children;return je.createElement(qp.Provider,{value:I},D,n&&o.renderDragProxy?o.renderDragProxy({...n,ref:l}):null)},Yp="data-drag-list-id",Ct="data-drag-item-id",mr="data-drag-item-list-id",Jp=`[${Ct}]`,GT=je.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),HT=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=xn(),l=o.dragListId??n,s=i===l&&r===`${o.id}`,u=je.useMemo(()=>({dragItemId:o.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,s,l,t,i,a]),c={[Ct]:`${o.id}`,[mr]:l,onPointerDown:e,className:te("DraggableItem",s?"DraggableItem--active":"",Kp({active:s,draggingInProgress:t}))},d=typeof o.children=="function"?o.children(c,u):o.children;return je.createElement(GT.Provider,{value:u},d)};$o.DraggableItem=HT;import*as jl from"react";var ef=o=>jl.createElement(ke,{...o,viewBox:"0 -960 960 960"},jl.createElement("path",{d:ze.hidden[0]}));import*as Cr from"react";function tf(){return{}}var of=o=>({allowColumnHideWhileDragging:e=>e??!0});import{createContext as KT}from"react";var BT=KT(null);function Ul(){return BT}import*as Ft from"react";import*as Xo from"react";import{useCallback as Mf,useEffect as os,useRef as bC,useState as TC}from"react";import*as Pi from"react";function WT(o){let{height:e,width:t,count:n}=o;return Pi.createElement("div",{"data-count":n,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var nf=Pi.memo(WT);var rf="mlx2t3";import*as Di from"react";import{useRef as UT}from"react";import{useEffect as jT}from"react";var af=(o,e)=>{jT(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var lf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},sf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},uf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},$l="_1ueijco1",cf="_1ueijco0 _16lm1iw0";var df=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=lf[`${o}`]:e=te(sf[`${o.horizontal}`],uf[`${o.vertical}`]),e};var $T="InfiniteVirtualScrollContainer";var pf=Di.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??UT(null);return af(c,i),Di.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:te(a,$T,cf,df(r))},n)});import*as Vi from"react";import{useLayoutEffect as zi,useMemo as tC}from"react";import*as ff from"react";import{useLayoutEffect as YT,useRef as qT,useState as XT}from"react";function ZT(o){let[e,t]=XT(o.updater.get),n=qT(null);return YT(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var Po=ff.memo(ZT);var mf=rn(Go());var Yl=(o,e)=>o-e,Jt={horizontal:!0,vertical:!0};function xi(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var ql="DebugID=";function Do(o,e){return e&&e.startsWith(ql)?e:e?`${ql}${o}:${e}`:`${ql}${o}`}var Ei={start:0,end:0},Xl=o=>{o()},Zl=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},gf=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},gr=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function QT(o){return o.horizontalChange||o.verticalChange}var Yo=class extends ft{constructor(t){let n=Do(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Ei;this.verticalExtendRangeBy=Ei;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{gr(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Xl:gr;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Xl:gr;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let 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:n);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:n}=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:n);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 n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=Jt)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Jt)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,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=n.startIndex,u=n.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=Jt)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",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,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,n),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,mf.default)(a,t,Yl);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let 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:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let y=f;for(;h>1;)y+=1,d[y]=f,p[y]=0,h-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Zl;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Jt){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height: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,y=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let S=a!=null,T=l!=null,b=S&&a!==this.rowHeight,R=T&&l!==this.colWidth;S&&(this.rowHeight=a),T&&(this.colWidth=l);let C=t.rowspan!=null,I=t.colspan!=null,P=C&&t.rowspan!=this.rowspan,D=I&&t.colspan!=this.colspan;P&&(this.rowspan=t.rowspan),D&&(this.colspan=t.colspan);let w=y||R||p||D,M=h||b||f||P;(n||QT)({horizontalChange:w,verticalChange:M,colsChanged:y,colWidthChanged:R,widthChanged:p,colspanChanged:D,rowsChanged:h,rowHeightChanged:b,heightChanged:f,rowspanChanged:P})&&this.updateRenderCount({horizontal:w,vertical:M})}extendRenderRange(t){let{direction:n}=t,r=n==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(t=Jt){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Jt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(n?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Xl:gr;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="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=xi(l,c)}else a=(n?Math.ceil(l/n):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:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{gr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let n=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Ei,this.verticalExtendRangeBy=Ei,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Ql=rn(Go());function hf(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function yf(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function hr(o,e){for(let t of o)if(e(t))return t}var Mi=(o,e)=>o-e,Ai=class extends ft{constructor(t,n){super(`${t}:GridCellManager`);this.matrix=new Z;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,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,y=f>=s;(m||g||h||y)&&u.add(c)}),u};this.debugId=t,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=hr(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=hr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,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(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Mi)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Mi)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((n,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,Ql.default)(n,t,Mi);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,Ql.default)(n,t,Mi);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return hr(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return hr(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Sf=rn(Go());var _i=class extends ft{constructor(t,n){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,Sf.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var bf=!0,qo=J(ee.y),Tf=J(ee.scrollTop),LN=J(ee.columnOffsetAtIndex),Jl=J(ee.columnOffsetAtIndexWhileReordering),En=class extends ft{constructor(t,n,r){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(qo,i?`calc( ${r}px + var(${Tf}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${qo}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Ie.columnOffsets.get(r),d=`${Jl}-${r}`,p=s?`calc( ${a}px + var(${Tf}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(qo,p));let f=`translate3d(var(${d}, ${c}), var(${qo}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),u!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let 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 y=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),S=this.getScrollPositionForScrollColumnIntoView(y,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});S&&(a=S.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let 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,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,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-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let h={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),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(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ve(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:u,y:c}=s;if(r){let d=()=>{this.updateHoverClassNamesForRow(a);let p=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=p.rowIndex,r.dataset.colIndex=p.colIndex,bf){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,bf&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,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(v=>{let A=i.getRowIndex(v);if(A!=null){let _=this.brain.getItemOffsetFor(A,"vertical");if(_==null)return;let F=v.getElement();if(!F)return;this.setDetailTransform(F,A,{y:_,scrollLeft:t.scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&dd(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:h}=this.brain.getRenderRange(),[y,S]=g,[T,b]=h;function R(v,A,_){let F=r.getCellAt([v,A]);if(F==null)return;let L=n.getCellOffset(v,A),O=F.getElement();O&&L&&_(v,A,O,L)}let C=(v,A,_,{x:F,y:L})=>{this.setTransform(_,v,A,{x:F,y:L,scrollLeft:!0},s-A)},I=(v,A,_,F)=>{this.setTransform(_,v,A,{x:F.x,y:F.y,scrollTop:!0},c-v)},P=(v,A,_,{y:F})=>{let L=f[A];this.setTransform(_,v,A,{x:L,y:F,scrollLeft:!0},a-A)},D=(v,A,_,F)=>{this.setTransform(_,v,A,{x:F.x,y:m[v],scrollTop:!0},l-v)},w=(v,A,_,{x:F,y:L})=>{this.setTransform(_,v,A,{x:F,scrollLeft:!0,y:L,scrollTop:!0},1e5)},M=(v,A,_,{x:F})=>{this.setTransform(_,v,A,{x:F,scrollLeft:!0,y:m[v],scrollTop:!0},2e5)},E=(v,A,_,F)=>{this.setTransform(_,v,A,{x:f[A],y:F.y,scrollLeft:!0,scrollTop:!0},3e5)},x=(v,A,_)=>{this.setTransform(_,v,A,{x:f[A],y:m[v],scrollLeft:!0,scrollTop:!0},4e5)};if(s||u)for(let v=y;v<T;v++){for(let A=0;A<s;A++)R(v,A,C);if(u){let A=a-u;for(let _=A;_<a;_++)R(v,_,P)}}if(c||d)for(let v=S;v<b;v++){for(let A=0;A<c;A++)R(A,v,I);if(d){let A=l-d;for(let _=A;_<l;_++)R(_,v,D)}}if(s&&c)for(let v=0;v<c;v++)for(let A=0;A<s;A++)R(v,A,w);if(s&&d){let v=l-d;for(let A=v;A<l;A++)for(let _=0;_<s;_++)R(A,_,M)}if(u&&c){let v=a-u;for(let A=0;A<c;A++)for(let _=v;_<a;_++)R(A,_,E)}if(u&&d){let v=l-d,A=a-u;for(let _=v;_<l;_++)for(let F=A;F<a;F++)R(_,F,x)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new Ai(n,r.cellPool),this.cellManager.onCellAttachmentChange((u,c)=>{c?this.onCellAttached(u):this.onCellDetached(u)}),this.rowManager=new _i(n,r.rowPool),this.rowManager.onRowAttachmentChange((u,c)=>{c?this.onRowAttached(u):this.onRowDetached(u)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ve(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=yl(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,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 w=t.start[1],M=t.end[1];m.forEach(E=>{w<=E&&E<M||f.push({start:[t.start[0],E],end:[t.end[0],E+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([w,M])=>{g.set(`${w}:${M}`,!0)});let y=f.reduce((w,M)=>w+Zl(M),0),S=r?f.reduce((w,M)=>w+gf(M),0):0,T=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([T,b]);let R=Math.min(T*b,y);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>S&&(c.poolSize=S));let C=hf(...f.map(w=>d.getCellsOutsideRenderRange(w)));C=yf(C,w=>{let M=d.getCellPosition(w);return!(M&&g.has(`${M[0]}:${M[1]}`))}),d.detachCells(C),d.poolSize=R;let I=new Map,P=new Map;f.forEach(w=>{let{start:M,end:E}=w,[x,v]=M,[A,_]=E;for(let F=x;F<A;F++){for(let O=v;O<_;O++){let K=`${F}:${O}`;if(I.has(K))continue;I.set(K,!0);let{rendered:W,mapped:k}=this.isCellRenderedAndMappedCorrectly(F,O);if(F===x||O===v){let V=this.isCellCovered(F,O);if(V&&g.has(`${V[0]}:${V[1]}`)){let j=d.getCellAt([F,O]);j!=null&&d.detachCell(j);continue}}if(W&&!i&&k)continue;let Q;W?Q=d.getCellAt([F,O]):Q=d.getCellFor([F,O],u?"row":"column"),Q==null&&(Q=d.getDetachedCell()),this.renderCellAt(F,O,Q,n)}!r||P.has(F)||(P.set(F,!0),c.isRowAttachedAt(F)&&!i)||this.renderDetailRowAtElement(F,this.rowManager.getRowFor(F),r)}}),h.forEach(([w,M])=>{let{rendered:E,mapped:x}=this.isCellRenderedAndMappedCorrectly(w,M);if(E){if(i||!x){let A=[w,M],_=d.getCellAt(A);this.renderCellAt(w,M,_,n)}return}let v=d.getCellFor([w,M],u?"row":"column");v!=null&&this.renderCellAt(w,M,v,n)});let D=d.getAllCells().map(w=>w.getNode());return r&&c.getAllRows().forEach(w=>{D.push(w.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(D),D}renderDetailRowAtElement(t,n,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(u,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}getMatrixRowIndexFromElement(t){let n=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),u=this.brain.getRowspan(t,n),c=this.brain.getColspan(t,n),d=u===1?l:this.brain.getRowHeightWithSpan(t,n,u),p=c===1?s:this.brain.getColWidthWithSpan(t,n,c),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:y}=this.getCellRealCoordinates(t,n),S=i({rowIndex:h,colIndex:y,height:l,width:s,rowspan: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(R=>{let C=R.getElement();C&&(C.style.position="absolute",C.style.left="0px",C.style.top="0px"),this.updateElementPosition(R)});let T=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:y}:void 0,b=this.brain.isHorizontalLayoutBrain;if(!S){b?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(S,r,[t,n],T),this.updateElementPosition(r,{hidden:g,rowspan:u,colspan:c})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Oi=class extends En{constructor(t,n,r){super(t,n,r);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage),c=pe.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Ie.columnOffsets.get(l.colIndex),f=`${Jl}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(qo,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${qo})`,y=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==y&&(t.__transformValue=y,t.style.transform=y)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};import*as Rf from"react";var Mn=class Mn extends ft{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,n=t.values().next().value;return n||(this.poolSize+=Mn.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/Mn.POOL_SIZE_INCREMENT)*Mn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};Mn.POOL_SIZE_INCREMENT=1;var Fi=Mn;var Cf=new Map,JT=()=>{},es=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Se();let n=Cf.get(e)??0,r=`${e}:GridCellReact:${n}`;Cf.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=Se(),this.node=Rf.createElement(Po,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=JT,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}},Ni=class extends Fi{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new es(this.cellDebugId)}};import*as wf from"react";var An=class An extends ft{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,n=t.values().next().value;return n||(this.poolSize+=An.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/An.POOL_SIZE_INCREMENT)*An.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};An.POOL_SIZE_INCREMENT=1;var Li=An;var If=new Map,eC=()=>{},ts=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Se();let t=If.get(e)??0,n=`${e}:ListRowReact:${t}`;If.set(e,t+1),this.debugId=n,this.updater=Se(),this.node=wf.createElement(Po,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=eC,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},ki=class extends Li{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new ts(this.rowDebugId)}};function vf(o){return{cellPool:new Ni(o),rowPool:new ki(o)}}function yr(o){let e=o.isHorizontalLayoutBrain?new Oi(o,`${o.name}:HorizontalLayoutTableRenderer`,vf(`${o.name}:HorizontalLayoutTableRenderer`)):new En(o,`${o.name}:ReactHeadlessTableRenderer`,vf(`${o.name}:ReactHeadlessTableRenderer`)),t=Se();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function oC(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=tC(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:yr(e),[e,o.onRenderUpdater,o.renderer]);return zi(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),zi(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),zi(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),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:n})})},[i,e,t,n,a,r]),zi(()=>{i.flushPendingAfterCommitWork()}),Vi.createElement(Po,{updater:a})}var Gi=Vi.memo(oC);import*as Sr from"react";import{useEffect as nC,useLayoutEffect as rC,useRef as iC}from"react";var Pf=ye({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Hi="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Df=ye({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:aC}=Le,lC=`${aC}-ActiveRowIndicator`,sC=`calc(${ee.activeCellRowOffsetX} + var(${J(ee.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,uC={[J(ee.activeCellOffsetY)]:ee.activeCellRowOffset,transform:`translate3d(${sC}, calc( ${ee.activeCellOffsetY} + var(${J(ee.scrollTopForActiveRow)}, 0px)), 0px)`,height:ee.activeCellRowHeight,maxWidth:pe.runtime.totalVisibleColumnsWidthVar},cC=o=>{let{brain:e}=o,t=iC(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=kt();return rC(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${pe.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),u=e.getItemOffsetFor(l,"vertical"),c=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${u}px`,activeCellRowOffsetX:a};hn(d,c)},[o.activeRowIndex,e]),nC(()=>{let a=u=>{hn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),Sr.createElement("div",{className:Hi,"data-name":"active-row"},Sr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${lC} ${Df({active:n})}`,style:n?uC:void 0}))},xf=Sr.memo(cC);import*as br from"react";import{useEffect as dC,useLayoutEffect as pC,useRef as fC}from"react";var{rootClassName:mC}=Le,gC=`${mC}-ActiveCellIndicator`,hC=J(ee.columnZIndexAtIndex),yC=(o,e,t,n)=>{if(e==null)return;let[r]=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(r=r%o.rowsPerPage);let i=typeof t=="function"?t(r):t??o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;hn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},SC=o=>{let{brain:e}=o,[t,n]=kt(),r=fC(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return pC(()=>{yC(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),dC(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),br.createElement("div",{className:Hi,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${hC}-${o.activeCellIndex[1]})`}:void 0},br.createElement("div",{"data-name":"active-cell-indicator",className:`${gC} ${Pf({visible:i})}`}))},Ef=br.memo(SC);var Ki=[Qd,`${st}DetachedCell`];function Bi(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var CC=te(rf,$l);function Af(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,y=bC(null),[S,T]=TC({width:0,height:0});os(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),os(()=>{let C=y.current?.parentNode;return C?(h&&document.activeElement!==C&&C.focus(),an(C,()=>{let D={height:C.clientHeight,width:C.clientWidth};e.update(D)},{debounce:50})):void 0},[p,e]);let b=Mf(C=>{requestAnimationFrame(()=>{y.current&&y.current.style.setProperty("transform",`translate3d(${-C.scrollLeft}px, ${-C.scrollTop}px, 0px)`)})},[]),R=Mf(C=>{e.setScrollPosition(C,b)},[e,b]);return os(()=>{let C=e.onRenderCountChange(()=>{T(e.getVirtualizedContentSize())});return T(e.getVirtualizedContentSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),C},[e]),Xo.createElement(pf,{onContainerScroll:R,...g,ref:t},Xo.createElement("div",{ref:y,className:CC,"data-name":"scroll-transform-target"},Xo.createElement(Gi,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Ki}),c!=null?Xo.createElement(Ef,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?Xo.createElement(xf,{brain:e,activeRowIndex:u}):null,Xo.createElement(nf,{width:S.width,height:S.height}))}function _f(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((c,d)=>{let p=c.id,f=o[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 y={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],y);let S=c.columnGroup,T,b=y;for(;S;){let R=e[S];if(R){g.add(S);let C=[p,...g];T=h.has(S)?i.get(S):void 0,T||(T={id:S,type:"group",ref:R,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[S],computedWidth:0,computedPinned:y.computedPinned,depth:t.get(S)??0},r.set(C,T),i.set(S,T)),T.columnItems.push(y),T.uniqueGroupId.push(y.id),b&&!h.has(b.id)&&T.children.push(b),b=T,S=R.columnGroup}else break}});let l=[],s=new Z,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"&&Of(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<=n+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Of(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&Of(t.children),e+=n})}import*as xo from"react";import{useCallback as Kf,useEffect as xC,useMemo as EC,useRef as MC}from"react";import*as ns from"react";import*as kf from"react";import{useCallback as Lf}from"react";import{useRef as Ff,useState as RC}from"react";import*as Tr from"react";var{rootClassName:IC}=Le,wC=`${IC}HeaderCell_ResizeHandle`;function vC(o){let e=Ff(null),[t,n]=RC(!1),r=Ff(t);r.current=t;let i=o.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=Np(o.groupColumns.map(b=>b.computedVisibleIndex),{columns:o.columns,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{constrained:R,adjustedDiffs:C,adjustedDiff:I}=o.computeResize(b);return r.current!==R&&n(R),h.resize(C),I},S=b=>{if(g){let R=o.groupColumns.reduce((P,D)=>P+D.computedWidth-D.computedMinWidth,0),C=o.brain.getAvailableSize(),I={width:C.width+R,height:C.height};o.brain.update(I),g=!1}y(Math.round(b.clientX-f))},T=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",S),m.removeEventListener("pointerup",T);let R=Math.round(b.clientX-f),C=y(R);h.resize(o.groupColumns.map(()=>0)),o.onResize(C)};m.addEventListener("pointermove",S),m.addEventListener("pointerup",T)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:pe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Tr.createElement("div",{ref:e,className:`${wC} ${Ii} ${vi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},Tr.createElement("div",{style:{...c,...o.style},className:wi({constrained:t})}))}var Nf=Tr.memo(vC);function zf(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:u}=ne(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),c=o[o.length-1],d=Lf(g=>{let h=l(),{columnSizing:y,viewportReservedWidth:S,bodySize:T}=h,b=s().computedVisibleColumns,R=!1,C=b.reduce((D,w)=>(w.computedFlex&&(D[w.id]={...y[w.id],flex:w.computedWidth},R=!0),D),{}),I=R?{...y,...C}:y;return jc({availableSize:Hl(T),reservedWidth:S||0,dragHandleOffset:g,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:I,columnGroupSize:o.length,items:b.map(D=>({id:D.id,resizable:D.computedResizable,computedFlex:D.computedFlex,computedWidth:D.computedWidth,computedMinWidth:D.computedMinWidth,computedMaxWidth:D.computedMaxWidth}))})},[c]),p=Lf(g=>{let{columnSizing:h,reservedWidth:y}=d(g);u.viewportReservedWidth=y,u.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?kf.createElement(Nf,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var Vf=`${st}HeaderGroup`,Gf=J(ee.columnWidthAtIndex),PC=J(ee.columnZIndexAtIndex);function Hf(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=zf(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=n[0],c=n.length>1?"calc( "+n.map(f=>`var(${Gf}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${Gf}-${u.computedVisibleIndex})`,d=`calc(var(${PC}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,ns.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:te(Oc,Vf),style:p,"data-z-index":d},ns.createElement("div",{className:te(`${Vf}__header-content`,_t)},a),s)}import{useContext as DC}from"react";import*as as from"react";var rs;function ls(){return rs||(rs=as.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var is;function Wi(){return is||(is=as.createContext(null))}function Oe(o){let e=Wi(),t=DC(e);return ln(t,o)}function Wt(){return Oe(o=>({getDataSourceState:o.getDataSourceState,getDataSourceMasterContext:o.getDataSourceMasterContext,dataSourceActions:o.dataSourceActions,dataSourceApi:o.dataSourceApi,assignState:o.assignState}))}var{rootClassName:AC}=Le,_C=[],Bf=`${AC}Header`,OC=xc({overflow:!1}),Wf=()=>{};function FC(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{getState:u,headerOptions:c,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=ne(E=>({computedColumnsMap:E.computed.computedColumnsMap,getState:E.getState,headerOptions:E.state.headerOptions,headerRenderer:E.state.headerRenderer,headerOnRenderUpdater:E.state.headerOnRenderUpdater,showColumnFilters:E.state.showColumnFilters})),g=MC(null),h=Kf(E=>{g.current&&(g.current.style.transform=`translate3d(-${E.scrollLeft}px, 0px, 0px)`)},[]);xC(()=>{let E=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),E},[t]);let y={ref:g,className:te(Bf,`${Bf}--virtualized`,i,OC),style:{...r,height:a}},{getDataSourceState:S,dataSourceApi:T,dataSourceActions:b}=Wt(),{allRowsSelected:R,someRowsSelected:C,selectionMode:I,filterTypes:P,filterDelay:D}=Oe(E=>({allRowsSelected:E.dataSourceState.allRowsSelected,someRowsSelected:E.dataSourceState.someRowsSelected,selectionMode:E.dataSourceState.selectionMode,filterTypes:E.dataSourceState.filterTypes,filterDelay:E.dataSourceState.filterDelay})),w=EC(()=>({allRowsSelected:R,someRowsSelected:C,selectionMode:I}),[R,C,I]),M=Kf(E=>{let{rowIndex:x,colIndex:v,domRef:A,height:_,widthWithColspan:F,heightWithRowspan:L,hidden:O}=E,K=n[v];if(!K||O)return null;let W=t.isHorizontalLayoutBrain?t.getPageIndexForRow(x):null,k=l?l.pathsToCells.get([x,v]):null;if(k&&k.type==="group"){let Q=k.columnItems.map(re=>re.ref),V={...k.ref,id:k.id,uniqueGroupId:k.uniqueGroupId,depth:k.depth,columns:Q.map(re=>re.id),computedWidth:k.computedWidth,groupOffset:k.groupOffset};return u().columnGroupVisibility[k.id]!==!1?xo.createElement(Hf,{horizontalLayoutPageIndex:W,bodyBrain:e,columnGroupsMaxDepth:s,domRef:A,columns:Q,width:F,height:_,columnGroup:V}):null}return xo.createElement(Uf,{domRef:A,column:K,horizontalLayoutPageIndex:W,headerOptions:c,dataSourceStatePartialForHeaderCell:w,filterTypes:P,filterDelay:D,getDataSourceState:S,dataSourceApi:T,dataSourceActions:b,width:F,height:L,columnsMap:m})},[c,n,a,l,s,f,t,S,T,b,P,D,w]);return xo.createElement($o,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:Wf,updatePosition:Wf},E=>xo.createElement("div",{...E,...y,className:te(E.className,y.className)},xo.createElement(Gi,{name:"header",renderCell:M,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:_C,cellDetachedClassNames:Ki})))}var jf=xo.memo(FC);function $f(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=ne(C=>({computedPinnedStartColumns:C.computed.computedPinnedStartColumns,computedPinnedEndColumns:C.computed.computedPinnedEndColumns,computedVisibleColumns:C.computed.computedVisibleColumns,columnSize:C.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:u,columnGroupsMaxDepth:c,computedColumnGroups:d,showColumnFilters:p}=ne(C=>({columnHeaderHeight:C.state.columnHeaderHeight,columnGroupsDepthsMap:C.state.columnGroupsDepthsMap,columnGroupsMaxDepth:C.state.columnGroupsMaxDepth,computedColumnGroups:C.state.computedColumnGroups,showColumnFilters:C.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:c+2,m=f*s+(p?s:0),g=Ft.useMemo(()=>{if(!(!d||!Object.keys(d).length))return _f(a,d,u,c)},[a,d,u]),h=Ft.useCallback(({rowIndex:C,colIndex:I})=>{let P=a[I],D=1,w=1;if(!P||!g)return{rowspan:D,colspan:w};let M=g.pathsToCells.get([C,I]);if(!M)return{rowspan:D,colspan:w};if(M.type==="column")return{colspan:w,rowspan:f-M.depth};let E=M.columnItems.findIndex(x=>x.id===P.id);return{rowspan:D,colspan:E===0?M.columnItems.length:1}},[d,c,a,g,f,u]),y=Ft.useCallback(({rowIndex:C,colIndex:I})=>h({rowIndex:C,colIndex:I}).rowspan,[h]),S=Ft.useCallback(({rowIndex:C,colIndex:I})=>h({rowIndex:C,colIndex:I}).colspan,[h]),T=Ft.useCallback(C=>p?C<f-1?s:2*s:s,[f,p,s]);Bi(e,{colWidth:l,rowHeight:T,rows:f,cols:a.length,height:m,rowspan:y,colspan:S},{fixedColsEnd:i.length,fixedColsStart:r.length});let b=Ft.createElement(jf,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:c,columnAndGroupTreeInfo:g}),R=n.vertical&&zt()?Ft.createElement("div",{className:Nc,style:{zIndex:1e3,width:zt()}}):null;return Ft.createElement("div",{className:`${xl} ${Vc}`,style:{height:m}},b,R)}var{ManagedComponentContextProvider:NC}=Mt({initSetupState:tf,forwardProps:of,Context:Ul()});function ss(o){let{getComputed:e,header:t,brain:n,headerBrain:r,wrapRowsHorizontally:i}=ne(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?Cr.createElement(NC,{...o},Cr.createElement($f,{wrapRowsHorizontally:!!i,bodyBrain:n,headerBrain:r,scrollbars:a})):null}function Yf(){return Cr.useContext(Ul()).componentState}var GC=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||To;return xe.createElement(s,{domProps:{className:Tn},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Ci=xe.createContext(null);var HC=J(ee.columnZIndexAtIndex),KC=J(ee.columnVisibilityAtIndex),us=xe.createElement("div",{className:$r[1]}),Xf=qr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[Ct]:"",[mr]:""});function BC(o){let e=o.column,{allowColumnHideWhileDragging:t}=Yf(),{dataSourceStatePartialForHeaderCell:n,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:u}=o,{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=n,{onDragItemPointerDown:f}=xn(),{api:m,getComputed:g,getState:h,actions:y,getDataSourceMasterContext:S,showColumnFilters:T,components:b,portalDOMRef:R,columnHeaderHeight:C,columnReorderDragColumnId:I,columnMenuVisibleForColumnId:P,columnReorderInPageIndex:D}=ne(H=>({api:H.api,getComputed:H.getComputed,getState:H.getState,actions:H.actions,getDataSourceMasterContext:H.getDataSourceMasterContext,showColumnFilters:H.state.showColumnFilters,components:H.state.components,portalDOMRef:H.state.portalDOMRef,columnHeaderHeight:H.state.columnHeaderHeight,columnReorderDragColumnId:H.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:H.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:H.state.columnReorderInPageIndex})),w=I===e.id,M=D!=null?r!==D:!1,{onResize:E,height:x,width:v,headerOptions:A,columnsMap:_}=o,F=e.computedSortInfo,L=e.header,O=qf(H=>{z.current=H,o.domRef?.(H)},[o.domRef]),K=A.alwaysReserveSpaceForSortIcon,W=e.headerAlign??e.align,k=(typeof W=="function"?W({isHeader:!0,column:e}):W)??"start",Q=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",V=ut(e,{actions:y,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:S,getState:h}),j=V.isSortable(),re=j&&(e.computedSorted||K)?xe.createElement(Ri,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:pe.spacing[2],marginInlineEnd:pe.spacing[2]},className:`${Bo}__sort-icon ${Lc} ${zc({align:k})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,se=e.computedFilterable&&e.computedFiltered?xe.createElement(pn,null):null,ae=e.headerCssEllipsis??e.cssEllipsis??!0,ce={reserveSpaceWhenHidden:k==="center",menuVisible:P===e.id,style:k==="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:H=>{H.stopPropagation(),V.toggleContextMenu(H.target)}}},ue=e.components?.MenuIcon||b?.MenuIcon||dr,U=xe.createElement(ue,{...ce}),z=zC(null),Y={horizontalLayoutPageIndex:r,dragging:w,domRef:O,htmlElementRef:z,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:F,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:c,selectionMode:p,api:m,dataSourceApi:a,columnApi:V,renderBag:{sortIcon:re,filterIcon:se,menuIcon:U,menuIconProps:ce,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},$=Y,X=$.renderBag.header,q=()=>{let H={...Y,renderBag:{...Y.renderBag}};if(e.renderSortIcon&&(H.renderBag.sortIcon=xe.createElement(wo,{render:e.renderSortIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderFilterIcon&&(H.renderBag.filterIcon=xe.createElement(wo,{render:e.renderFilterIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),typeof e.renderMenuIcon=="function"&&(H.renderBag.menuIcon=xe.createElement(wo,{render:_e=>{if(typeof e.renderMenuIcon!="function")return null;let $e=e.renderMenuIcon(_e);return $e?$e.type===ue||$e.type===dr?$e:xe.createElement(ue,{...ce},$e):null},renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){H.renderBag.selectionCheckBox=xe.createElement(wo,{render:GC,renderParam:{...H,renderBag:{...H.renderBag}}});let _e=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;_e&&_e!==!0&&(H.renderBag.selectionCheckBox=xe.createElement(wo,{render:_e,renderParam:{...H,renderBag:{...H.renderBag}}}))}L instanceof Function&&(H.renderBag.header=X=xe.createElement(wo,{render:L,renderParam:{...H,renderBag:{...H.renderBag}}}));let Ne=e.renderMenuIcon===!1?null:H.renderBag.menuIcon,pt=ae?xe.createElement("div",{className:_t},H.renderBag.header):H.renderBag.header,le=xe.createElement(xe.Fragment,null,k==="center"?us:null,H.renderBag.selectionCheckBox,pt,H.renderBag.sortIcon,H.renderBag.filterIcon,k==="center"?us:null,k!=="center"?us:null,Ne);return e.renderHeader?xe.createElement(wo,{render:e.renderHeader,renderParam:{...H,renderBag:{...H.renderBag,all:le}}}):le};kC(()=>{let H=null,Ne=z.current;return E&&Ne&&(H=an(Ne,E)),()=>{H?.()}},[z.current,o.onResize]);let fe={height:x};e.headerStyle&&(fe=typeof e.headerStyle=="function"?{...fe,...e.headerStyle($)||{}}:{...fe,...e.headerStyle});let me=typeof e.headerClassName=="function"?e.headerClassName($):e.headerClassName,{onPointerDown:ie,proxyPosition:G,dragColumnOutside:N}=Wd({columnId:e.id,domRef:z,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),ge=null,Ee=Ci.Provider,Ce={filtered:e.computedFiltered,verticalAlign:Q,align:k},Re=xe.useMemo(()=>{let H=Ne=>{m.setColumnFilter(e.id,Ne)};return u>0?Et(H,{wait:u}):H},[u,e.id]),Ae=e.computedFilterType,Ge=s[Ae],et=e.computedFilterable?e.computedFilterValue?.filter.operator??Ge?.defaultOperator:void 0,Xe=e.computedFilterable&&Ge?Ge.operators.find(H=>H.name===et):void 0,tt=Xe?.components?.FilterEditor||Ge?.components?.FilterEditor||e.components?.FilterEditor||gn,Ze=Ge?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,Ue=Gp(e,{horizontalLayoutPageIndex:r}),B=`var(${HC}-${e.computedVisibleIndex})`;fe.zIndex=B,fe.visibility=`var(${KC}-${e.computedVisibleIndex}, visible)`;let oe={"data-field":`${e.field||""}`,"data-column-id":e.id,[Ct]:e.id,[mr]:"header","data-header-align":k,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},he=e.computedFilterable?xe.createElement(td,{horizontalLayoutPageIndex:r,filterEditor:tt,filterOperatorSwitch:Ze??od,operator:Xe,filterTypes:s,onChange:Re,columnFilterType:Ae,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:C}):xe.createElement(nd,null);$.renderBag.filterEditor=he;let be=qf(H=>{ie(H),f(H)},[ie,f]),nt=q();return w&&G&&(ge=xe.createElement("div",{key:e.id,className:`${Bo}Proxy ${vc}`,style:{height:x,width:v,left:G.left??0,top:G.top??0}},xe.createElement("div",{className:Pc({visible:N})},xe.createElement(ef,{size:16})),X),ge=VC(ge,R.current)),xe.createElement(Ee,{value:$},xe.createElement(bi,{domRef:O,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...oe,"data-z-index":B,style:fe,width:v,onPointerDown:be,contentClassName:te(wc(Ce),ec[k]),contentStyle:T?{height:x/2}:void 0,className:te(Bo,ic.none,j?Qu.pointer:"",me,ii(e,[Bo,Zt],Dc,{dragging:w,insideDisabledDraggingPage:M,align:k,verticalAlign:Q,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Ic),cssEllipsis:ae,afterChildren:xe.createElement(xe.Fragment,null,T?he:null,Ue),renderChildren:nt}),ge)}var Uf=xe.memo(BC);function ni(){return LC(Ci)}import*as eo from"react";import{useEffect as WC}from"react";function Zf(o,e){let{separator:t}=e??{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Qf={padding:pe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},jC={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Jf=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Zf(t),n,"important")},em=eo.forwardRef(function(e,t){let{rootClassName:n}=Ur(),r=eo.useRef(null),i=eo.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return WC(()=>{let a=()=>{setTimeout(()=>{Jf(r.current,Qf),Jf(r.current?.firstElementChild,jC)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),eo.createElement("div",{ref:i,...e,className:te(`${n}-Footer`,pd,e.className),style:Qf},"Powered by"," ",eo.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});var ji=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new Z(n.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new Z(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Rt=class extends ji{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 Dt(){let o=De().performance?.now();return`${Date.now()}:${o}`}function Ui(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var tm=new WeakMap;function $i(o,e){if(!o||!o.length)return[];let t=tm.get(o);t||(t=new WeakMap,tm.set(o,t));let n=t.get(e);if(n)return n;let r=[],i=Ui(o,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 cs(o,e){if(!o.length)return!0;let{data:t}=e,n={data:t,index:e.index,dataArray:e.dataArray,primaryKey:e.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let r=0,i=o.length;r<i;r++){let a=o[r];if(n.field=a.field,n.filterValue=a.value,n.currentValue=a.valueGetter?a.valueGetter(n):a.field?t[a.field]:t,n.emptyValues=a.emptyValues,!a.fn(n))return!1}return!0}var UC=0;function om(o){return UC++,cs($i(o.filterValue,o.filterTypes),o)}function ds(o){return $i(o.filterValue,o.filterTypes).length?o.isLeafNode?om(o):o.filterTreeNode(o.data):!0}var $C="group-by",nm="group-by-";function rm(o){let e=o.map(t=>t.valueGetter?n=>t.valueGetter({data:n,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function Yi(o,e){if(!o?.length||!e?.length)return o;let t=!1,n=o.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===$C){let i=rm(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(nm)){let i=r.id.slice(nm.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=rm([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?n:o}var im=!0,YC={originalDataArray:!0,changes:!0},qC={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function Nt(o,e,t){let n=Yi(o.sortInfo,o.groupBy),r=o.multiSort?n:n?.[0]??null,i={append:!1,originalDataArray:o.originalDataArray,sortInfo:r,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(i.livePaginationCursor=o.livePaginationCursor,i.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=o.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],o.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=o.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=ps(i.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=o.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!YC[s]){let u=s,c=qC[u],d=i[u],p=l[u];(c?c(d,p):d===p)||(a[u]=!0)}return i.changes=a,i}function to(o,e,t,n,r){let i=Nt(e,n,r),a=i.append;if(e.lazyLoad){let c=e.originalLazyGroupData,d=[yt,...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:im,totalCount:0}),t.originalLazyGroupDataChangeDetect=Dt()}if(typeof o=="function")try{o=o(i)}catch(c){o=Promise.reject(c)}let s=typeof o=="object"&&typeof o.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([yt,...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=Dt();else{let m=e.lazyLoadCacheOfLoadedBatches,g=[...d,i.lazyLoadStartIndex??0];m.has(g)&&m.set(g,"failed"),p&&(p.childrenLoading=!1,p.error=f)}}s&&(t.loading=!1)};return Promise.resolve(o).then(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(y,S,T){let b=[yt,...y],R=S.data,C={cache:S.cache??im,childrenLoading:!1,childrenAvailable:!0,totalCount:S.totalCount??R.length,totalCountUnfiltered:S.totalCountUnfiltered,totalChildrenCount:S.totalChildrenCount,totalChildrenCountUnfiltered:S.totalChildrenCountUnfiltered,children:R,error:S.error},I=[];if(i.lazyLoadBatchSize&&!T){let D=g.get(b),w=!D,M=qc({children:!0},D||{},C);w&&(M.chidren=[]),M.children.length=M.totalCount;let E=i.lazyLoadStartIndex??0,x=Math.min(S.totalCount??R.length,E+i.lazyLoadBatchSize);for(let v=E;v<x;v++){let A=C.children[v-E];if(!A)throw`lazily loaded item not found at index ${v-E}`;M.children[v]=A,A.dataset&&I.push({keys:A.keys,dataset:A.dataset})}w&&g.set(b,M)}else C.children.forEach(D=>{D&&D.dataset&&I.push({keys:D.keys,dataset:D.dataset})}),C.children.length=C.totalCount,g.set(b,C);let P=!1;if(!y||!y.length){let D=g.get([yt]);t.originalDataArray=[...D.children],P=!0}if(P||(t.originalLazyGroupDataChangeDetect=Dt()),I.length){let D=y;I.forEach(({keys:w,dataset:M})=>{h(w,M,D)})}};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 ps(o,{filterTypes:e,filterMode:t}){return t==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(am):(Ui(o,e)||[]).map(am)}function am(o){if(!o.valueGetter)return o;let e={...o};return delete e.valueGetter,e}function lm(){let o;return(e,t,n)=>{if(o&&o.filterValue===e&&o.filterTypes===t&&o.filterMode===n)return o.result;let r=ps(e,{filterTypes:t,filterMode:n});return o&&o.filterValue===e&&JSON.stringify(o.result)===JSON.stringify(r)&&(r=o.result),o={filterValue:e,filterTypes:t,filterMode:n,result:r},r}}var XC=()=>new Promise(o=>{Ve(o)});function fs(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function sm(o){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:n}=o;if(!e||!t||t<=0)return!1;for(let r of n.keys())if(r.length===1)return!0;return!1}function um(o){for(let[e,t]of o.entries())t==="failed"&&o.delete(e)}function cm(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,u=l?()=>!1:g=>s[g].data!=null,c=!l,d=new Z,p=["_______xxx______"];for(let g=t;g<=n;g++){let h=s[g];if(!h)continue;let y=u(g),S=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&S.pop();let T=S.length?S:p,b=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let R={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:c},C=h.groupKeys,I=d.get(C);if(!I?.[h.id]){let P=!I;I=I||{},I[h.id]||(I[h.id]=R),P&&d.set(C,I)}}if(!y&&r!=null){let R=d.get(T),C=Math.floor(b/r)*r,I=b-C,P=s[h.indexInAll-I].indexInAll,D=u(P),w=s[P].id;if(D||R?.[w])continue;let M=!R;R=R||{};let E={lazyLoadStartIndex:C,lazyLoadBatchSize:r,groupKeys:S,append:c};R[w]||(R[w]=E),M&&d.set(T,R)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let y=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(y))return g;e?.set(y,!0);let S=[i.data,i,a,h];return g.then(()=>XC()).then(()=>to(...S))},f)}function ms(o,e){let{rowIndex:t,primaryKey:n}=e,{dataArray:r}=o.getDataSourceState();if(n!==void 0){let i=o.dataSourceApi.getIndexByPrimaryKey(n);if(i!==-1)return i;if(r[t]?.id!==n)return-1}return r[t]?t:-1}function Rr(o,e){let t=ms(o,e);return t===-1?null:Kt({...o,rowIndex:t,columnId:e.columnId})}function Ir(o,e){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function gs(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[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&&(n.columnMenuVisibleForColumnId=p),p}function qi(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function hs(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function dm(o,e,t){if(hs(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/n),p=Math.floor(u/n),f=l%n,m=u%n,g=Math.min(f,m),h=Math.max(f,m),y=[];for(let S=d;S<=p;S++)for(let T=g;T<=h;T++){let b=S*n+T;if(S===d)for(let R=s;R<r;R++)y.push({rowIndex:b,colIndex:R});else if(S===p)for(let R=0;R<=c;R++)y.push({rowIndex:b,colIndex:R});else for(let R=0;R<r;R++)y.push({rowIndex:b,colIndex:R})}return y}function ZC(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var ys=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Co(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new We(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=Co(l,this.getDataSourceState),h=Co(u,this.getDataSourceState);if(!g||!h)return;let y=g.indexInAll,S=h.indexInAll,[T,b]=qi({rowIndex:y,colIndex:f},{rowIndex:S,colIndex:m});for(let R=T.rowIndex;R<=b.rowIndex;R++)for(let C=T.colIndex;C<=b.colIndex;C++){let I={rowIndex:R,colIndex:C},[P,D]=this.getCellSelectionPosition(I);n?a.selectCell(P,D):a.deselectCell(P,D)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=di(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=ZC(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 n=new We(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new We(t);n.debugId=e.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new We:new We(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new We(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new We(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new We(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function pm(o){return new ys(o)}var _n=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var xt=class extends _n{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function fm(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new xt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new xt({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 xt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new xt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Eo(o,e,t){return Math.min(Math.max(o,e),t)}function Xi(o,e,t){let n=o().dataArray,r=0,i=n.length-1,a=e;do{a+=t;let l=n[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Eo(a,r,i)}function QC(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().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,y=0,S=u-1,T={ArrowDown:()=>{p=Xi(n,p,1)},ArrowUp:()=>{p=Xi(n,p,-1)},ArrowLeft:()=>{let R=s[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p-C>=y?p=p-C:T.ArrowUp();return}return R&&R.isGroupRow?i.collapseGroupRow(R.groupKeys):R&&i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.collapseRowDetail(R.id):!1},ArrowRight:()=>{let R=s[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p+C<=S?p=p+C:T.ArrowDown();return}return R&&R.isGroupRow?i.expandGroupRow(R.groupKeys):R&&i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.expandRowDetail(R.id):!1},Enter:()=>{let R=s[p];return R&&R.isGroupRow?i.toggleGroupRow(R.groupKeys):R&&R.isTreeNode&&R.isParentNode?a.treeApi.toggleNode(R.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.toggleRowDetail(R.id):!1},PageDown:()=>{p=Math.min(p+h,u-1)},PageUp:()=>{p=Math.max(p-h,y)},End:()=>{p=S},Home:()=>{p=y}},b=T[l];return b?(b(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Ss(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,u=i().dataArray,c=n(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[y,S]}=p.getRenderRange(),T=y-g-1,b=S-h-1,R=i().dataArray.length-1,C=r().computedVisibleColumns.length-1,I=0,P=0;f=Eo(f,0,R),m=Eo(m,0,C);let D={ArrowDown:()=>{f=Eo(f+1,I,R)},ArrowUp:()=>{f=Eo(f-1,I,R)},ArrowLeft:()=>{if(m===P)if(f!==I&&(m=C),p.isHorizontalLayoutBrain){let M=p.rowsPerPage;f-M>=I?f=f-M:D.ArrowUp()}else D.ArrowUp();else m=Eo(m-1,P,C)},ArrowRight:()=>{if(m===C)if(f!==R&&(m=P),p.isHorizontalLayoutBrain){let M=p.rowsPerPage;f+M<=R?f=f+M:D.ArrowDown()}else D.ArrowDown();else m=Eo(m+1,P,C)},Enter:()=>{let M=u[f];return M&&M.isGroupRow?t.toggleGroupRow(M.groupKeys):M&&M.isTreeNode&&M.isParentNode?a.treeApi.toggleNode(M.nodePath):M&&t.rowDetailApi.isRowDetailEnabledForRow(M.id)?t.rowDetailApi.toggleRowDetail(M.id):!1},PageDown:()=>{s?m=Math.min(m+b,C):f=Math.min(f+T,R)},PageUp:()=>{s?m=Math.max(m-b,P):f=Math.max(f-T,I)},End:()=>{s?m=C:f=R},Home:()=>{s?m=P:f=I}},w=D[l];return w?(w(),[f,m]):!1}function JC(o,e){let t=Ss(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var eR={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function mm(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!eR[t]?!1:i!=null&&l==="row"?QC(o,e):a!=null&&l==="cell"?JC(o,e):!1}var bs=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:n}=this.param,{activeRowIndex:r,keyboardNavigation:i}=n();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Xi(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,n=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Ss(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function gm(o){return new bs(o)}function hm(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var Ts=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(p=>requestAnimationFrame(p));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a=ms({...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={...Kt({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;n.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let 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:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...Kt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(Kt({...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,n=this.columnApiById.get(t);if(n)return n;let r=ut(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),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=wn({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 n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new Rt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),n=new Rt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[yt,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||to(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=Z.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Dt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let g=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let 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+(n.offset||0),m=u.scrollTop>p+(n.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=lp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=gm({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=fm({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=pm({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(gs(t),e?.()),setTimeout(()=>{this.isDestroyed()||(gs(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??gp({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(Kt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,n){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,n);return}let l=!!i.pivotColumn,s=i.groupByForColumn,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(go);d.length&&(u=d);let p=i.computedSortType;if(c.length&&p===qt){let m=this.getState().initialColumns;p=c.flatMap(h=>{let y=h.field??h.groupField,S=y?r.get(y):null;if(S)return S.computedSortType;let T=y?ko(m,y):void 0;return T?T.sortType||(typeof T.type=="string"?T.type:"string"):[qt]})}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,n)}setSortInfoForColumn(e,t,n){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!hm(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:hm(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 n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;n.computedFilterValue?(c={...n.computedFilterValue,filter:{...n.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:n.valueGetter},n.field&&(c.field=n.field)),c.id=n.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],u=n.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(go),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n={...this.getState().columnVisibility};t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollLeft=Math.max(e,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollTop=Math.max(e,0))}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=n.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),c&&(n.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),u=n.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function ym(o){return new Ts(o)}import{useEffect as bm,useRef as oR,useState as nR}from"react";var tR=10;function Sm(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${Zt} > .${ar}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${Bo}`);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(..._t.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let g=De().getComputedStyle(c);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+tR}if(m+=s[p],d){let g=0;c.childNodes.forEach(h=>{if(h!==u&&h.nodeType===1){let y=h,S=Math.max(y.offsetWidth,parseInt(y.style.width,10));if(isNaN(S)&&(S=0),g+=S,S>0){let T=De().getComputedStyle(y);g+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Tm(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=At(),[a,l]=nR(0),s=typeof r=="object"?r.key:r,u=Fe(s),c=oR(null);bm(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),bm(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let g=Sm(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let y=o().columnSizing,S={...y},T=!1;h.forEach(b=>{S[b]={width:g[b]},T=T||S[b].width!==y[b]?.width}),T&&(e.columnSizing=S)},[s,n,a])}import{useEffect as _I,useMemo as OI,useState as Gs}from"react";var Zi=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,n,r){if(r.horizontalLayout&&!hs(e,t,r)){dm(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=qi(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&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function rR(o,e){return o<e?[o,e]:[e,o]}var Qi=class{constructor(e){this.multiSelectStartIndex=0;this.getRowAt=e.getRowAt,this.isNodeSelectable=e.isNodeSelectable??(()=>!0)}set rowSelectionState(e){this._rowSelectionState=e,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(e){this._treeSelectionState=e}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(e){return e.isGroupRow||!!e.isParentNode}isExpanded(e){return e.isGroupRow?!e.collapsed:!!e.nodeExpanded}getPath(e){if(e)return this._treeSelectionState?e.nodePath:this.getGroupKeys(e)}getGroupKeys(e){return e.groupKeys&&e.groupKeys.length?e.groupKeys:void 0}setSelectedAt(e,t){let n=this.getRowAt(e);if(!n||n.rowDisabled||n.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){n.nodePath&&this.isNodeSelectable(n)&&r.setNodeSelection(n.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(n);if(n.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(n.id,a):i.deselectRow(n.id,a)}isSelectedAt(e){let t=this.getRowAt(e);if(!t)return!1;if(this._treeSelectionState)return t.nodePath?this._treeSelectionState.isNodeSelected(t.nodePath):!1;let n=this.getGroupKeys(t);return t.isGroupRow?n?this.rowSelectionState.isGroupRowSelected(n):!1:this.rowSelectionState.isRowSelected(t.id,n)}setRangeSelected(e,t,n){let[r,i]=rR(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,n))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let n=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!n||!r||r.length<n.length?!1:n.every((i,a)=>i===r[a])}resetClick(e){this.deselectAll(),this.setSelectedAt(e,!0),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){if(this.isSelectedAt(e))this.setSelectedAt(e,!1),this.isSelectedAt(e+1)&&(this.multiSelectStartIndex=e+1);else{this.setSelectedAt(e,!0),this.multiSelectStartIndex=e;let t;for(let n=e-1;n>=0&&this.isSelectedAt(n);n--)t=n;this.multiSelectEndIndex=t}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,e,!0),this.multiSelectEndIndex=e}};import{useMemo as mI}from"react";import*as pg from"react";var iR=()=>{};function aR(o,e){let t=new Z,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let 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[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function Cm(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(n),d=[...t,c],p=r(n),f=lt(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let y=m[g];Cm(o,e,d,y)}});p?(u?.(n),s?.(n,iR)):(l?.(n,f,i(n)),s?.(n,f))}function Rm(o,e,t){for(let n=0,r=t.length;n<r;n++)Cm(o,e,[],t[n])}var lR=function(o,e){return o-e},sR=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},uR=function(o,e){return o-e},cR={number:lR,string:sR,date:uR},Mo=cR;function Im(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var oo=(o,e,t)=>{let n=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(wm(Im(o),n)),r&&r.end(),e},Cs=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=wm(Im(o),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,u=d=>d[l],c=d=>d[l]===void 0;return Rm({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)),n&&n.end(),e};oo.knownTypes=Mo;var dR=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=oo.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(oo.knownTypes).join(", ")}`)}return r||(r=Mo.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:n*u}},pR=o=>o.map(dR).filter(e=>e instanceof Function),wm=(o,e)=>{let t=pR(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};import*as fR from"react";function Rs(o){return Oe(e=>o(e.dataSourceState))}var mR=qe("IT:InfiniteTable"),gR="#dc3545",hR="#eb9316";var Pm="Warn",Dm="Error",yR="Info",SR="Success",bR="Logs",Ji=mR.extend(bR),AV=Ji.extend(yR),TR=Ji.extend(Pm),CR=Ji.extend(Dm),_V=Ji.extend(SR);var RR=hR,IR=gR;var wR=(o,e)=>{e=e?e.extend?e.extend(Pm):e:TR,e(typeof e.color=="function"?e.color(RR,o):o)},vR=(o,e)=>{e=e?e.extend?e.extend(Dm):e:CR,e(typeof e.color=="function"?e.color(IR,o):o)};var vm=new Z,xm=(o,...e)=>{vm.has(e)||(vm.set(e,!0),o())};var Em=(o,e=o,t)=>{xm(()=>wR(o,t),e,"warn")},Mm=(o,e=o,t)=>{xm(()=>vR(o,t),e,"error")};var Is=new WeakMap,PR=o=>o;function Am(o,e=50,t){Is.set(o,{lastCallTime:0,lastCallArg:null});let n=t??PR;return r=>{let{lastCallTime:i,lastCallArg:a}=Is.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=mt(n(a),n(r));s<e&&u||(Is.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var ea=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new Z;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let u=n&&!n.isEmpty();if(u&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let c=[...n.getMutationsArray(),...n.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)}}n?.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),y=s?[...p,h]:void 0,S=s&&!!y,T=S?n?.getMutationsForNodePath(y):n?.getMutationsForPrimaryKey(h);if(T&&T.length){for(let b=0,R=T.length;b<R;b++){let C=T[b];if(C.type==="delete"&&!g&&(S?this.removeNodePath(y,t):this.remove(h),g=!0,d.splice(f,1),f--),C.type==="update"&&!g&&(m={...m,...C.data},d[f]=m),C.type==="update-children"&&!g){let I=C.children(m[l],m);m={...m},I!==void 0?m[l]=I:delete m[l],d[f]=m}C.type==="insert"&&(C.position==="before"?(d.splice(f,0,C.data),f--):d.splice(f+1,0,C.data))}S?n?.removeNodePathInfo(y):n?.removeInfo(h)}if(!g)if(S){this.addNodePath(y,m);let b=a(m),R=b?null:i(m);!b&&Array.isArray(R)&&(p.push(h),u&&(m[l]=R=R.concat()),c(R,p),p.pop())}else this.add(h,m)}}};c(e,[])}return e}}};var DR=Object.freeze([]),_m=(o,e)=>{let t=o??DR,n=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===n.length)return r}return e&&t&&e.set(t,n),n};var It=class extends _n{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function ta(o,e){if(o===e)return!0;if(o==null||e==null)return o===e;if(typeof o!=typeof e)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0,n=o.length;t<n;t++)if(!ta(o[t],e[t]))return!1;return!0}if(typeof o=="object"){let t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!ta(o[r],e[r]))return!1;return!0}return!1}function xR(o,e){return!(o===void 0||e===void 0||o.isGroupRow!==e.isGroupRow||o.dataSourceHasGrouping!==e.dataSourceHasGrouping||o.isTreeNode!==e.isTreeNode||o.isTreeNode&&o.isParentNode!==e.isParentNode)}var oa={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Om={...oa,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},ER={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},MR={...oa,...ER,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},Fm={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},AR={...oa,...Fm,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},_R={...oa,...Fm,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},OR=Object.entries(Om).map(([o,e])=>e?o:void 0).filter(Boolean),FR=Object.entries(Om).map(([o,e])=>e?o:void 0),NR=Object.entries(MR).map(([o,e])=>e?o:void 0),LR=Object.entries(AR).map(([o,e])=>e?o:void 0),kR=Object.entries(_R).map(([o,e])=>e?o:void 0);function zR(o,e){if(o===e)return!0;if(!o||!e||!xR(o,e)||o.id!==e.id||o.data!==e.data&&!ta(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?NR:FR:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?kR:LR:t=OR;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!ta(r,i))return!1}return!0}function Nm(){let o=[],e=new Map,t=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=o,g=f?.marker,y=p!==m&&t.size>0;y&&(n={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let S=[],T=l();for(let b of T){let R=m[b],C=p[b];if(C===void 0){S.push(b);continue}zR(R,C)||S.push(b)}o=p,(S.length>0||y)&&queueMicrotask(()=>{for(let b=0,R=S.length;b<R;b++){let C=S[b],I=e.get(C);if(I)for(let P of I)P()}if(y)for(let b of Array.from(t))b()}),g&&g.end({details:[{name:"updated row infos",value:S.length}]})},i=p=>o[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],e.clear(),t.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var no=new Map,ro=new Map,Ao=new Map,io=new Map,jt=new Map;var VR=Symbol("cursorId"),Lm=o=>o.totalLeafNodesCount===0,GR=o=>o.isParentNode?!Lm(o):!0;function km(o){let e=Date.now(),t=[],n=[],r=new Z;return{logger:Pt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Nm(),indexer:new ea,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new Z,waitForNodePathPromises:new Z,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new Z,dataParams:void 0,onCleanup:Se(),notifyScrollbarsChange:Se(),notifyScrollStop:Se(),notifyRenderRangeChange:Se(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:VR,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function HR(o){let e={...o};return delete e.originalDataArray,e}var KR=[],zm=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},Vm=(o,e)=>({onDataParamsChange:t=>t?Am(t,100,HR):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Lm,isNodeSelectable:t=>t??GR,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=>({...zo,...t}),sortTypes:t=>({...Mo,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,n)=>{let r={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(n.idToPathMap.set(s.id,s.nodePath),e.debugId&&n.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),n.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof It)return t;let n=o.propsCache.get("rowDisabledState"),r=n.get(t);return r||(r=new It(t),n.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>_m(t,o.propsCache.get("sortInfo")),groupBy:t=>t??KR});function BR(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}function WR(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let e={};return o.filterValue!=null&&(e.filterValue=o.filterValue),o.sortInfo!=null&&(e.sortInfo=o.sortInfo),o.groupBy!=null&&(e.groupBy=o.groupBy),o.pivotBy!=null&&(e.pivotBy=o.pivotBy),e}var jR={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Gm(o,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
2
2
 
3
3
 
4
4
  `);let n=Cn(t);if(o instanceof Qe)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??jR,i=t.propsCache.get("treeSelection"),a=i.get(r);return a&&a.setConfig(n),a=a??new Qe(r,n),i.set(r,a),a}function Hm(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=Yn(e.sortInfo),a=Yn(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((x,v)=>{let A=l[v].operators;x[v]=x[v]||{};let _=x[v];return A.forEach(F=>{_[F.name]=F}),x},{}),u=e,c=e.selectionMode;if(c===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)c="multi-cell";else{let x=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(x!==void 0&&(x&&typeof x=="object"?c="multi-row":c="single-row"),!c){let v=u.treeSelection??u.defaultTreeSelection;v!==void 0&&(c=typeof v=="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 Me({selectedRows:[],deselectedRows:[],defaultSelection:!1},it(t)):c==="single-row"||f instanceof Me?d=f:d=new Me(f,it(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new We;else if(m instanceof We)p=m;else{let x=t.propsCache.get("cellSelection"),v=x.get(m)??new We(m);x.set(m,v),p=v}let g=t.primaryKey,h=typeof g=="function"?x=>g(x):x=>x[g],y=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(y&&!(y instanceof ct)){let x=t.propsCache.get("treeExpandState"),v=x.get(y)??new ct(y);x.set(y,v),y=v}y=y||new ct({defaultExpanded:!0,collapsedPaths:[]});let S=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(S&&!(S instanceof Rt)){let x=t.propsCache.get("groupRowsState"),v=x.get(S)??new Rt(S);x.set(S,v),S=v}S=S||new Rt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let T=WR(e.shouldReloadData||{}),b=typeof e.data=="function"&&!!e.lazyLoad,R=!!e.livePagination,C={sortInfo:T.sortInfo??(b||R),filterValue:T.filterValue??(b||R),groupBy:T.groupBy??b,pivotBy:T.pivotBy??b},I=e.sortFunction?"local":C.sortInfo?"remote":"local",D=(typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function")&&!e.lazyLoad?"local":C.filterValue||e.lazyLoad?"remote":"local",w=t.rowDisabledState,M=e.isRowDisabled;if(!M&&w){let x=t.propsCache.get("isRowDisabled"),v=x.get(w);v?M=v:(M=A=>w.isRowDisabled(A.id),x.set(w,M))}let E={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:S,treeExpandState:y,treeExpandMode:y.mode,shouldReloadData:C,isRowDisabled:M,rowSelection:d,cellSelection:p,sortMode:I,filterMode:D,toPrimaryKey:h,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let x=!n||n.originalDataArray!==t.originalDataArray,v=typeof e.livePaginationCursor=="function"?x?BR(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;E.livePaginationCursor=v}if(t.devToolsDetected&&t.debugId){let x=ro.get(t.debugId);x&&(E={...E,...x})}return E}var UR=Pt("DataSource:fullLazyLoad");function Km(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&UR('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new Rt({collapsedRows:!0,expandedRows:[]})))}function Bm(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let t=e.__apiRef.current,n=t.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:n}]}},treeExpandState:(o,e)=>({callbackParams:[o.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof We?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function Wm(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Nt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Nt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Nt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Nt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Nt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Nt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>mt(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Pt(Do(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function jm(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function ws(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function vs(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e?.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function Ps(o){let{pivotByAtIndex:e}=o;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function Um({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=lt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=vs({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&c();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let y=e[m.length-1],T=m.slice(0,-1).join("/");if(!d){let b=T;T=m.join("/");let R=m[m.length-1];u[T]=Ps({header:`${R}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:R})}l.forEach((b,R)=>{let C=d?`${m[m.length-1]}`:b.name||b.id,I=vs({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:R,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,columnGroup:T,header:C,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),P=`${b.id}:${m.join("/")}`;s[P]=I})}else{let y=m.join("/"),S=m.slice(0,-1);if(u[y]=Ps({columnGroup:S.length?S.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let T=e[m.length-1],b=S.length?S.join("/"):void 0;if(!d){let R=b;b=`total:${m.join("/")}`,u[b]=Ps({header:`${m[m.length-1]} total`,columnGroup:R,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:T,pivotGroupKey:m[m.length-1]})}l.forEach((R,C)=>{let I=d?`${m[m.length-1]} total `:`${R.name||R.id} total`,P=vs({columnGroup:b,header:I,pivotAggregator:R,pivotAggregatorIndex:C,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:T,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[R.id]:null});s[`total:${R.id}:${m.join("/")}`]=P})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||n==="end")&&c(),{columns:s,columnGroups:u}}var $m=Symbol("CLEAR"),Zo=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new Z;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=$m,n=this.primaryKeyToData.get(t)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has($m);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>Z.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:Z.clone(e.nodePathToData),n}};var Ds=1e3;function Ym(o){return new xs(o)}var xs=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=()=>di(this.getState);this.getRowInfoByIndex=e=>Co(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),n=t.getDataForNodePath(e);return n||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let n=this.getState().isTree,r=n?void 0:e.map(l=>this.toPrimaryKey(l)),i=n?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,n)=>{let r=n?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Ds:r;return isNaN(a)||(a=Ds),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let 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=n?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let n=this.getState().rowDisabledState,r=n?new It(n):new It({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let n=this.getRowInfoByPrimaryKey(e);n&&this.setRowEnabledAt(n.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new It({enabledRows:!0,disabledRows:[]});return}let t=new It(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new It({disabledRows:!0,enabledRows:[]});return}let t=new It(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 pi({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:n,nodesKey:r}=this.getState(),i=t?Zo.clone(t,{light:!0}):new Zo({nodesKey:n?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 n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Ds,i=n.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,n.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===void 0&&l(!1)},r)});return n.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function qm(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,y)=>h||typeof y!="function"?l.has(y):!1,!1),t))break}if(u&&u.length){if(l===!0)n=!0;else for(let m of u)if(m.field&&l.has(m.field)){n=!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:n,filterValue:i,aggregationReducers:a,tree:r}}function na(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function ra(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function ia(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function Xm(o){return"groupNesting"in o?o.groupNesting??0:0}function Zm(o,e){if(!(!o.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?o.reducerResults?.[e.reducerId]:o.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function $R(o,e,t,n){if(o==null&&e==null)return 0;if(o==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&n[r]||n.string||Mo.string)(o,e);return a===0?0:t.dir*a}function YR(o,e){if(!o?.length||!e)return[];let t=[];for(let n of o){let r=n.id?e[n.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:n.dir,type:n.type,fn:n.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function qR(o){let e=[],t=[];for(let n of o){let r={row:n,children:[]},i=Xm(n);for(;t.length&&Xm(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 XR(o){let e=[],t=(n,r)=>{n.forEach((i,a)=>{let l=[...r,a],s=i.row;s.indexInGroup=a,s.indexInParentGroups=l,s.indexInAll=e.length,e.push(s),t(i.children,l)})};return t(o,[]),e}function Qm(o,e,t,n){let r=YR(e,t);if(!r.length||!o.length)return o;let i={...Mo,...n},a=qR(o),l=(u,c)=>{for(let d of r){let p=$R(Zm(u.row,d),Zm(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),XR(a)}var Ut=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function ZR(o){let e=o.get([yt]);if(!e)return;if(e.totalChildrenCount!=null)return e.totalChildrenCount;let t=0;for(let n=0;n<e.children.length;n++){let r=e.children[n]?.totalChildrenCount;if(r==null)return;t+=r}return t}function QR(o,e){let t=o.get([yt]);if(t)return e?t.totalChildrenCountUnfiltered:t.totalCountUnfiltered}function Es(){return!1}function JR(o,e,t,n,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Es,hasSelectedCells:Es};return n&&(a.rowSelected=n(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var eI=lt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
@@ -24,7 +24,7 @@ In most environments, you should be able to fix this by adding the following lin
24
24
  import '@infinite-table/infinite-react/index.css'
25
25
  `}),ig={...aI,...lI};var dt=new Map,ag=o=>{dt.delete(o),Ao.delete(o),no.delete(o),io.delete(o),ro.delete(o),jt.delete(o)};function Ms(o,e,t){let n=dt.get(o);if(!n)return;let r=Ao.get(o);(!r||!Object.hasOwn(r,e))&&Ao.set(o,{...r||{},[e]:n.getState()[e]}),no.set(o,{...no.get(o)||{},[e]:t}),n.actions[e]=t}function aa(o,e,t){let n=dt.get(o);if(!n)return;let r=io.get(o);(!r||!Object.hasOwn(r,e))&&io.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),ro.set(o,{...ro.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var sI=o=>{let e=o.type==="error"?fo(o.debugId):Pt(o.debugId),t=o.type==="error"?Mm:Em,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
26
26
 
27
- Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},wr=o=>{let{debugId:e,key:t}=o,n=ig[t];if(n&&(sI({...n,debugId:e}),e&&t)){let r=dt.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),_o(e))}};globalThis.logDevToolsWarning=wr;var _o=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=dt.get(o);t&&e(o,t)};function sg(o){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:n}=o,{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:y}=n,[S,T]=uI({vertical:!1,horizontal:!1}),b=vr(S);Qo(()=>(a.onChange(E=>{E&&(b.current=E,T(E))}),()=>a.destroy()),[a]),Qo(()=>{if(!m)return;let E=requestAnimationFrame(()=>{b.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(E)},[g]),Qo(()=>{if(!m||g!==void 0)return;let E=requestAnimationFrame(()=>{b.current?.vertical||y!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(E)},[i.length,g]),Qo(()=>{let E=e(),{livePaginationCursor:x,livePagination:v,dataArray:A}=E;!S.vertical&&v&&(x?t.cursorId=x:x===void 0&&A.length&&(t.cursorId=A.length))},[S.vertical]);let C=lg(()=>lm(),[])(p,h,f),I={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?C:null,cursorId:m?y:null},P=vr(!0),D=vr(!1);cI(o,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?y:null},D);let w=jr(),M=vr([]);Fn(()=>{let E=e(),x=w(),{isDetail:v,isDetailReady:A}=fs(x,e);if(v&&!A)return;let _=Date.now(),F=M.current;F.length>=10&&F.splice(0,1),F.push(_),_-F[0]<200&&F.length>=10&&wr({debugId:E.debugId,key:"DS001"}),typeof E.data!="function"&&to(E.data,E,t,void 0,x)},{data:r}),Fn(E=>{let x=Object.keys(E),v=!1;if(x.length===1){v=!!E.cursorId;let O=e().data;if(Array.isArray(O)&&E.refetchKey){t.originalDataArray=O;return}}let A=w(),{isDetail:_,isDetailReady:F}=fs(A,e);if(_&&!F)return;let L=e();if(typeof L.data=="function"){if(D.current&&!v&&sm(L))return;let O;L.debugId&&(O=ot(L.debugId).track.DataSource.label.RemoteDataLoad.start()),to(L.data,L,t,{append:v},A).then(()=>{O?.end()})}},{...I,data:r}),Qo(()=>{D.current=!1}),Fn(()=>{let E=e();if(P.current){P.current=!1;let x=Nt(E,void 0,w());t.dataParams=x}},I)}function cI(o,e,t){let{getDataSourceState:n,dataSourceActions:r,dataSourceState:i}=o;Qo(()=>{r.lazyLoadCacheOfLoadedBatches=new Z},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:u,dataArray:c,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=vr(null),m=(h,y,S=n().lazyLoadCacheOfLoadedBatches)=>{let T=n();if(h=h||f.current,!h)return;let{renderStartIndex:b,renderEndIndex:R}=h,{lazyLoadBatchSize:C,lazyLoad:I}=T;I&&((!C||C<=0)&&(!T.groupBy||T.groupBy.length===0)||cm({startIndex:b,endIndex:R,lazyLoadBatchSize:C,componentState:T,componentActions:r,dismissLoadedRows:y?.dismissLoadedRows??!1},S))},g=lg(()=>Et(m,{wait:p}),[p]);Fn(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(n().lazyLoadCacheOfLoadedBatches.clear(),n().originalLazyGroupData.clear(),m(u.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(u.get()),u.onChange(y=>{f.current=y,um(n().lazyLoadCacheOfLoadedBatches),m(y)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,groupRowsState:d}),Qo(()=>{a&&a>0&&g()},[c])}function Pr(o){let e=No(),t=jr(),n=!!e,r=n?e.id:"master",{contextValue:i,ContextComponent:a}=dg(o),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Fe(s),[d]=cg(()=>Ym({getState:c,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:c,assignState:u,dataSourceApi:d},f=Fe(i),m=Fe(p),g=ls(),h=dI(({children:y})=>{let S=Wi(),[T]=cg(()=>og());typeof y=="function"&&(y=y(c()));let b=m();return T.setSnapshot(b),_s(()=>{T.notify()}),As.createElement(a.Provider,{key:r,value:f()},As.createElement(g.Provider,{value:b},As.createElement(S.Provider,{value:T},y)))},[a,n,r]);return _s(()=>{let y=t();y&&y.registerDetail(p)},[]),_s(()=>()=>{let y=c();y.onCleanup(y)},[]),sg({dataSourceState:s,dataSourceActions:l,getDataSourceState:c}),ug(()=>{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]),ug(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.dataSourceState}}function pI(){return Oe(o=>o.dataSourceApi)}var sa=class sa{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??sa.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};sa.DEFAULT_SIZE=10;var la=sa;var Os=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},ua=class{constructor(e){this.storage=new la(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)}},Fs=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)}},Dr=class{constructor(e){this.cacheStorage=e===!1?new Os:e===!0?new Fs:typeof e=="number"?new ua(e):new ua(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 fI=(e=>(e.INIT="INIT",e))(fI||{});var{useManagedComponent:dg}=Mt({debugName:"DataSource",initSetupState:km,forwardProps:Vm,concludeReducer:tg,mapPropsToState:Hm,onPropChange:Km,cleanup:zm,interceptActions:Wm(),mappedCallbacks:Bm()});function TK(o){let{DataSource:e}=Pr(o);return pg.createElement(e,null,o.children??null)}function CK(){let{rowInfoReducerResults:o}=Oe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return o}function fg(o){let{getDataSourceState:e}=Oe(n=>({getDataSourceState:n.getDataSourceState}));return mI(()=>o.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=o[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}import{useCallback as gI}from"react";var MK=Pt("useColumnSizeFn");function mg(o){return gI(t=>{let n=o[t];return n?n.computedWidth:0},[o])}import{useEffect as Nn,useLayoutEffect as bI,useMemo as TI}from"react";var hI={scrollLeft:0,scrollTop:0},xr=class{constructor(){this.scrollPosition=hI;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let n=0,r=t.length;n<r;n++)t[n](e)}};function gg(o,e){let t=new Map;function n(r){return e[r]!==!1}return Object.keys(o).forEach(r=>{let a=o[r].columnGroup,l=0;for(n(r)||(l=-1);a;){let s=o[a];if(!s)break;n(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as hg from"react";function yg(o){return(e,t)=>hg.createElement(o,{key:e.id,rowInfo:e,cache:t})}var Er=class extends Yo{constructor(t,n){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,n,r,i){if(t==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(t,n,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=xi(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 n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,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 n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&h&&(this.initialCols=r,this.cols=r);let y=i!=null,S=a!=null,T=y&&i!==this.rowHeight,b=S&&a!==this.initialColWidth;y&&(this.rowHeight=i),S&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let R=g||T||p,C=h||b||d||R;(C||R)&&this.updateRenderCount({horizontal:C,vertical:R})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Jt){let n=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/n);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(n=>{Ve(()=>{this.destroyed||t.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(t,n){return this.initialCols*(n?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};function Jo(){return{current:null}}var Sg={};function Ns(o){return`.${Bt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Ls(o,e){let t=Do(o),n=e?new Er(t,{isHeader:!1}):new Yo(t),r=`${t}:header`,i=e?new Er(r,{isHeader:!0,masterBrain:n}):new Yo(r);n.onScroll(c=>{i.setScrollPosition({scrollLeft:c.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=yr(n),{renderer:s,onRenderUpdater:u}=yr(i);return n.onAvailableSizeChange(c=>{i.update({width:c.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:u}}function bg({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Ls(o,!!e),u=Jo(),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=Ns(d);return u.current.querySelector(p)||null},brain:n,headerBrain:r,domRef:u,columnMenuTargetRef:Jo(),editingValueRef:Jo(),scrollerDOMRef:Jo(),portalDOMRef:Jo(),focusDetectDOMRef:Jo(),activeCellIndicatorDOMRef:Jo(),onColumnMenuClick:Se(),cellContextMenu:Se(),contextMenu:Se(),onFilterOperatorMenuClick:Se(),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 xr,pinnedEndScrollListener:new xr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Tg=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new Dr(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:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Sg,columnGroupVisibility:e=>e??Sg,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 yI(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Cg=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Rg(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var ca=new WeakMap;function Ig(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var wg=o=>{let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=n?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=n?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=n?.pivotColumnGroups?gg(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=yI({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let h=ca.get(d);h||(h=yg(d),ca.set(d,h)),c=h}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof xt)&&(u=new xt(u)),u=u||new xt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=ca.get(u),f||(f=h=>u.isRowDetailsExpanded(h.id),typeof u=="object"&&ca.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||pe.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=no.get(t.debugId);h&&(g={...g,...h})}return g};function vg(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function Pg(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,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(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import*as ao from"react";var Dg=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import*as da from"react";var xg="_16lm1iwb _16lm1iw1d _16lm1iwk";var Eg="164.93361431346415 56.97787143782138",Mg={margin:"auto",display:"block",shapeRendering:"auto"},sB=Object.keys({size:1,style:1,className:1,viewBox:1});var Ag=o=>da.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...Mg,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:te(o.className,xg,"InfiniteIcon","InfiniteIcon-loading")},da.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Eg},da.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function _g(o,e,t,n){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=o,l=r.column?{...r.column}:{},s={header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:n.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})};return t&&(typeof t=="function"?s={...s,...t(o,e)}:s={...s,...t}),s}function Og(o,e,t,n){let r=typeof t=="function"?t(o,e):t,i={};return o.sortable!=null&&(i.sortable=o.sortable),{...i,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function ks({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=n,d=e==="multi-column"&&c.isGroupRow&&o+1!==c.groupNesting,p=te(cn.flex,i.align==="end"?qn.rowReverse:qn.row,Zu.center,`${Bt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||u||d&&i.field)?Sp({align:a}):null);return d?i.field?ao.createElement("div",{className:p},u,ao.createElement("div",{className:_t},l??null)):u?ao.createElement("div",{className:p},u):null:(e==="single-column"&&c.isGroupRow,ao.createElement("div",{className:p},s,u,ao.createElement("div",{className:_t},l??null)))}}function zs({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===o&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&o+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 Dg(c)?f=ao.createElement(Ag,null):m&&(f=ao.createElement(jo,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=ao.createElement(St,{render:n,renderParam:r})),f}}function Fg(){return{getGroupColumnRender:ks,getGroupColumnRenderGroupIcon:zs}}function Ng(o,e,t){return _g(o,e,t,Fg())}function Lg(o,e,t){return Og(o,e,t,Fg())}function kg(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=o;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,g,h)=>{let y=Ng({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:u,selectionMode:r},c,i),S=y.id||`group-by-${m.field||m.groupField}`;f.push(S),p[S]=y});else if(u==="single-column"&&t.length){let m=Lg({groupCount:t.length,groupBy:t,pivotBy:n,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,y=g.pivotTotalColumn&&!g.columnGroup;if(h&&a===!1||y&&l===!1)return;let S={...g};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:n,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?ko(d,S.pivotAggregator.field):void 0,...S}),!S.render&&S.renderValue&&(S.render=T=>S.renderValue(T)),p[m]=S}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}import{useCallback as SI}from"react";function Vs(){let{getDataSourceState:o,dataSourceActions:e,getDataSourceMasterContext:t}=Oe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return SI(r=>{let i=o(),a=new Rt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[yt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||to(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=Z.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Dt())}},[])}function CI(o){return TI(()=>Rg(o),[o])}function zg(o,e){let{groupBy:t,dataSourceActions:n}=Oe(u=>({groupBy:u.dataSourceState.groupBy,dataSourceActions:u.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=o;Nn(()=>{n.generateGroupRows=r!=="inline"},[r]),Nn(()=>{n.pivotTotalColumnPosition=i},[i]),Nn(()=>{a!=null&&(n.pivotGrandTotalColumnPosition=a)},[a]);let l=CI(t);RI(l,o,e);let{toggleGroupRow:s}=II();return wI(l,o,e),{toggleGroupRow:s}}function RI(o,e,t){let n=Vs(),{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={},y=c.get(g.field);if(y&&d==="inline"){let{groupIndex:T}=y;h={groupByForColumn:y.groupBy,field:y.groupBy?.field,valueGetter:y.groupBy?.valueGetter,valueFormatter:({rowInfo:b})=>b.isGroupRow?b.groupKeys?.[T]:b.value,rowspan:({rowInfo:b,dataArray:R})=>{if(b.isTreeNode||!b.isGroupRow)return 1;let C=R[b.indexInAll-1]||{indexInParentGroups:[]};if(!C||!C.dataSourceHasGrouping)return 1;let I=C.indexInParentGroups||[],P=b.indexInParentGroups||[],D=!1;for(let E=0;E<=T;E++){let x=I[E];if(P[E]!==x){D=!0;break}}if(!D)return 1;let w=b.parents[T];return w?w.groupCount-(w.collapsedChildrenCount||0)+(w.collapsedGroupsCount||0):1},renderGroupIcon:zs({groupIndexForColumn:T,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:ks({groupIndexForColumn:T,groupRenderStrategy:d})}}let S={...h,...g};f[m]=S}),Object.keys(f).length===0?void 0:f}Nn(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,o,i,n)})()},[r,o,i,n])}function II(){let{groupBy:o,pivotBy:e,selectionMode:t}=Oe(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=At(),f=Vs();return Nn(()=>{(()=>{let{columns:g,groupColumnIds:h}=kg({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let y=p().columnOrder;if(h.length&&Array.isArray(y)){let S=new Set(y),T=!1;h.forEach(b=>{S.has(b)||(T=!0,y=[b,...y])}),T&&(n.columnOrder=y)}})()},[r,o,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function wI(o,e,t){let{dataArray:n,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Oe(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=Fe(e);bI(()=>{if(f!=="multi-column")return;let h=g(),y=vg(c,o),S=Pg({computedGroupColumns:y,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:n,groupBy:i,groupByMap:o});mt(h.columnVisibility,S)||(m.columnVisibility=S)},[s,f,l,i,o,c,p?n:null,p?a:null,p?r:null,p]),Nn(()=>{let h=i.length>0,y=g(),{columnVisibility:S,columnVisibilityForGrouping:T,hideColumnWhenGrouped:b}=y,R={...S},C={...T},I=!1,P=new Set,D=new Set;Object.keys(c).forEach(w=>{let M=c[w];if(M.defaultHiddenWhenGroupedBy||b!=null)if(M.defaultHiddenWhenGroupedBy==="*"&&h||(M.defaultHiddenWhenGroupedBy===!0||b)&&M.field&&o.get(M.field)||typeof M.defaultHiddenWhenGroupedBy=="string"&&o.get(M.defaultHiddenWhenGroupedBy)||typeof M.defaultHiddenWhenGroupedBy=="object"&&Object.keys(M.defaultHiddenWhenGroupedBy).reduce((x,v)=>x||o.has(v),!1)){if(C[w]!==!1){if(S[w]===!1)return;C[w]=!1,I=!0,P.add(w)}}else C[w]===!1&&(delete C[w],I=!0,D.add(w))}),I&&(m.columnVisibilityForGrouping=C,D.forEach(w=>{delete R[w]}),P.forEach(w=>{R[w]=!1}),m.columnVisibility=R)},[c,u,i,o,d])}import{useMemo as vI}from"react";var Vg=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,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:y,editable:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnDefaultSortable:C,scrollbarWidth:I,columnTypes:P,pinnedEndMaxWidth:D,pinnedStartMaxWidth:w,viewportReservedWidth:M,resizableColumns:E,columnVisibility:x,columnVisibilityAssumeVisible:v,columnSizing:A,groupBy:_})=>{let{computedRemainingSpace:L,computedColumnOrder:O,computedVisibleColumns:K,computedVisibleColumnsMap:W,computedPinnedStartColumns:k,computedPinnedEndColumns:Q,computedUnpinnedColumns:V,computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:re,computedUnpinnedColumnsWidth:de,computedUnpinnedOffset:se,computedPinnedEndOffset:ae,computedPinnedEndWidth:ce,computedPinnedStartWidth:ue,renderSelectionCheckBox:U,computedColumnsMap:z,computedColumnsMapInInitialOrder:Y,fieldsToColumn:$}=vI(()=>Zc({columns:o,userColumns:e,scrollbarWidth:I,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:u,viewportReservedWidth:M,resizableColumns:E,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:D,pinnedStartMaxWidth:w,draggableColumns:c,columnDefaultDraggable:d,columnOrder:h,columnPinning:y,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnDefaultSortable:C,editable:S,columnSizing:A,columnTypes:P,columnVisibility:x,columnVisibilityAssumeVisible:v??!0,groupBy:_}),[o,e,t.width,n,r,i,M,I,l,p,f,m,g,h,x,v,d,c,E,D,w,A,P,y,T,b,R,S,_,1]);return{renderSelectionCheckBox:U,columns:o,computedColumnsMap:z,computedPinnedEndWidth:ce,computedPinnedStartWidth:ue,computedRemainingSpace:L,computedUnpinnedOffset:se,computedPinnedEndOffset:ae,computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:re,computedUnpinnedColumnsWidth:de,computedPinnedStartColumns:k,computedPinnedEndColumns:Q,computedUnpinnedColumns:V,computedVisibleColumns:K,computedVisibleColumnsMap:W,computedColumnOrder:O,computedColumnsMapInInitialOrder:Y,fieldsToColumn:$}};import{useMemo as DI}from"react";var pa=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function PI(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?n(d):0;return e&&e.rowHeight.set(c,p),p}:n;let l=typeof n=="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?n(d):n;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 Gg(o){let e=new pa;return{computedRowHeight:PI(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}}function Hg(o){return DI(()=>Gg(o),[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}import{useState as xI,useEffect as EI,useLayoutEffect as MI}from"react";var AI={vertical:!1,horizontal:!1};function Kg(o){let e=o().brain,{getDataSourceState:t}=Wt(),[n,r]=xI(AI);return EI(()=>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]),MI(()=>{let i=t(),{onScrollbarsChange:a}=o(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function Bg(o){let{state:e,actions:t,getState:n}=o,{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:y,editable:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnTypes:C,rowHeight:I,rowDetailHeight:P,isRowDetailExpanded:D,isRowDetailEnabled:w,bodySize:M,showSeparatePivotColumnForSingleAggregation:E,onRowHeightCSSVarChange:x,onFlashingDurationCSSVarChange:v,onRowDetailHeightCSSVarChange:A,onColumnHeaderHeightCSSVarChange:_,computedColumns:F,initialColumns:L,viewportReservedWidth:O,resizableColumns:K,sortable:W,draggableColumns:k}=e,Q=t,{multiSort:V,filterValue:j,filterTypes:re,groupBy:de,sortInfo:se,dataSourceActions:ae,getDataSourceState:ce,dataSourceApi:ue}=Oe(le=>({dataSourceActions:le.dataSourceActions,getDataSourceState:le.getDataSourceState,dataSourceApi:le.dataSourceApi,sortInfo:le.dataSourceState.sortInfo,multiSort:le.dataSourceState.multiSort,filterValue:le.dataSourceState.filterValue,filterTypes:le.dataSourceState.filterTypes,groupBy:le.dataSourceState.groupBy}));Gs(()=>{x.onChange(le=>{le&&(Q.rowHeight=le)}),v.onChange(le=>{let _e=le?le*1:null;_e!=null&&!isNaN(_e)&&(Q.flashingDurationCSSVarValue=_e)}),A.onChange(le=>{le&&(Q.rowDetailHeight=le)}),_.onChange(le=>{le&&(Q.columnHeaderHeight=le)})}),_I(()=>{ae.showSeparatePivotColumnForSingleAggregation=E},[E]);let{toggleGroupRow:U}=zg(e,t),z=F,{computedColumnOrder:Y,computedVisibleColumns:$,computedVisibleColumnsMap:X,computedPinnedStartColumns:q,computedPinnedEndColumns:fe,computedUnpinnedColumns:me,computedPinnedStartColumnsWidth:ie,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:ge,computedPinnedEndOffset:Ee,computedRemainingSpace:Ce,computedPinnedStartWidth:Re,computedPinnedEndWidth:Ae,renderSelectionCheckBox:Ge,computedColumnsMap:et,computedColumnsMapInInitialOrder:Xe,fieldsToColumn:tt}=Vg({columns:z,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:M,viewportReservedWidth:O,resizableColumns:K,sortable:W,draggableColumns:k,sortInfo:se??void 0,multiSort:V,groupBy:de,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,filterValue:j,filterTypes:re,columnSizing:y,columnTypes:C}),Ze=fg($),Ue=mg($),B=Kg(n),oe=Re?ie>Re:!1,he=Ae?G>Ae:!1,[be]=Gs(()=>new Qi({getRowAt:_e=>ce().dataArray[_e],isNodeSelectable:_e=>{let{isNodeSelectable:$e}=ce();return $e?$e(_e):!0}})),nt=Fe($),[H]=Gs(()=>new Zi({getPrimaryKeyByIndex:ue.getPrimaryKeyByIndex,getColumnIdByIndex:le=>nt()[le]?.id||""})),{computedRowHeight:Ne,computedRowSizeCacheForDetails:pt}=Hg({rowDetailHeight:P,rowHeight:I,isRowDetailsExpanded:D,isRowDetailsEnabled:w,getDataSourceState:ce});return OI(()=>({multiRowSelector:be,multiCellSelector:H,computedRowSizeCacheForDetails:pt,computedRowHeight:Ne,scrollbars:B,columnSize:Ue,rowspan:Ze,toggleGroupRow:U,computedColumnsMap:et,computedColumnsMapInInitialOrder:Xe,renderSelectionCheckBox:Ge,computedPinnedStartOverflow:oe,computedPinnedEndOverflow:he,computedPinnedStartWidth:Re,computedPinnedEndWidth:Ae,computedVisibleColumns:$,computedColumnOrder:Y,computedRemainingSpace:Ce,computedVisibleColumnsMap:X,computedPinnedStartColumns:q,computedPinnedEndColumns:fe,computedUnpinnedColumns:me,computedPinnedStartColumnsWidth:ie,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:ge,computedPinnedEndOffset:Ee,fieldsToColumn:tt}),[be,H,pt,Ne,B,Ue,Ze,U,et,Xe,Ge,oe,he,Re,Ae,$,Y,Ce,X,q,fe,me,ie,G,N,ge,Ee,tt])}import{useMemo as GI}from"react";function FI(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function NI(){return 4294967295}function LI(o,e,t){return e=e>>>8^o[t^e&255],e}function kI(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Hs(o,e=3988292384){var t=FI(e),n=0,r;for(n=NI(),r=0;r<o.length;r++)n=LI(t,n,o.charCodeAt(r));return n=kI(n),`${n}`}var zI=o=>{let e=o.reduce((n,r)=>(n.set(r.name,r.value),n),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Wg=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+8,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},jg=(o="",e,t)=>{let n;try{n=VI(o)}catch{return Wg(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(n.end);return i<r?(Wg([`
27
+ Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},wr=o=>{let{debugId:e,key:t}=o,n=ig[t];if(n&&(sI({...n,debugId:e}),e&&t)){let r=dt.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),_o(e))}};globalThis.logDevToolsWarning=wr;var _o=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=dt.get(o);t&&e(o,t)};function sg(o){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:n}=o,{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:y}=n,[S,T]=uI({vertical:!1,horizontal:!1}),b=vr(S);Qo(()=>(a.onChange(E=>{E&&(b.current=E,T(E))}),()=>a.destroy()),[a]),Qo(()=>{if(!m)return;let E=requestAnimationFrame(()=>{b.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(E)},[g]),Qo(()=>{if(!m||g!==void 0)return;let E=requestAnimationFrame(()=>{b.current?.vertical||y!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(E)},[i.length,g]),Qo(()=>{let E=e(),{livePaginationCursor:x,livePagination:v,dataArray:A}=E;!S.vertical&&v&&(x?t.cursorId=x:x===void 0&&A.length&&(t.cursorId=A.length))},[S.vertical]);let C=lg(()=>lm(),[])(p,h,f),I={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?C:null,cursorId:m?y:null},P=vr(!0),D=vr(!1);cI(o,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?y:null},D);let w=jr(),M=vr([]);Fn(()=>{let E=e(),x=w(),{isDetail:v,isDetailReady:A}=fs(x,e);if(v&&!A)return;let _=Date.now(),F=M.current;F.length>=10&&F.splice(0,1),F.push(_),_-F[0]<200&&F.length>=10&&wr({debugId:E.debugId,key:"DS001"}),typeof E.data!="function"&&to(E.data,E,t,void 0,x)},{data:r}),Fn(E=>{let x=Object.keys(E),v=!1;if(x.length===1){v=!!E.cursorId;let O=e().data;if(Array.isArray(O)&&E.refetchKey){t.originalDataArray=O;return}}let A=w(),{isDetail:_,isDetailReady:F}=fs(A,e);if(_&&!F)return;let L=e();if(typeof L.data=="function"){if(D.current&&!v&&sm(L))return;let O;L.debugId&&(O=ot(L.debugId).track.DataSource.label.RemoteDataLoad.start()),to(L.data,L,t,{append:v},A).then(()=>{O?.end()})}},{...I,data:r}),Qo(()=>{D.current=!1}),Fn(()=>{let E=e();if(P.current){P.current=!1;let x=Nt(E,void 0,w());t.dataParams=x}},I)}function cI(o,e,t){let{getDataSourceState:n,dataSourceActions:r,dataSourceState:i}=o;Qo(()=>{r.lazyLoadCacheOfLoadedBatches=new Z},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:u,dataArray:c,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=vr(null),m=(h,y,S=n().lazyLoadCacheOfLoadedBatches)=>{let T=n();if(h=h||f.current,!h)return;let{renderStartIndex:b,renderEndIndex:R}=h,{lazyLoadBatchSize:C,lazyLoad:I}=T;I&&((!C||C<=0)&&(!T.groupBy||T.groupBy.length===0)||cm({startIndex:b,endIndex:R,lazyLoadBatchSize:C,componentState:T,componentActions:r,dismissLoadedRows:y?.dismissLoadedRows??!1},S))},g=lg(()=>Et(m,{wait:p}),[p]);Fn(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(n().lazyLoadCacheOfLoadedBatches.clear(),n().originalLazyGroupData.clear(),m(u.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(u.get()),u.onChange(y=>{f.current=y,um(n().lazyLoadCacheOfLoadedBatches),m(y)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,groupRowsState:d}),Qo(()=>{a&&a>0&&g()},[c])}function Pr(o){let e=No(),t=jr(),n=!!e,r=n?e.id:"master",{contextValue:i,ContextComponent:a}=dg(o),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Fe(s),[d]=cg(()=>Ym({getState:c,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:c,assignState:u,dataSourceApi:d},f=Fe(i),m=Fe(p),g=ls(),h=dI(({children:y})=>{let S=Wi(),[T]=cg(()=>og());typeof y=="function"&&(y=y(c()));let b=m();return T.setSnapshot(b),_s(()=>{T.notify()}),As.createElement(a.Provider,{key:r,value:f()},As.createElement(g.Provider,{value:b},As.createElement(S.Provider,{value:T},y)))},[a,n,r]);return _s(()=>{let y=t();y&&y.registerDetail(p)},[]),_s(()=>()=>{let y=c();y.onCleanup(y)},[]),sg({dataSourceState:s,dataSourceActions:l,getDataSourceState:c}),ug(()=>{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]),ug(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.dataSourceState}}function pI(){return Oe(o=>o.dataSourceApi)}var sa=class sa{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??sa.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};sa.DEFAULT_SIZE=10;var la=sa;var Os=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},ua=class{constructor(e){this.storage=new la(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)}},Fs=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)}},Dr=class{constructor(e){this.cacheStorage=e===!1?new Os:e===!0?new Fs:typeof e=="number"?new ua(e):new ua(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 fI=(e=>(e.INIT="INIT",e))(fI||{});var{useManagedComponent:dg}=Mt({debugName:"DataSource",initSetupState:km,forwardProps:Vm,concludeReducer:tg,mapPropsToState:Hm,onPropChange:Km,cleanup:zm,interceptActions:Wm(),mappedCallbacks:Bm()});function TK(o){let{DataSource:e}=Pr(o);return pg.createElement(e,null,o.children??null)}function CK(){let{rowInfoReducerResults:o}=Oe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return o}function fg(o){let{getDataSourceState:e}=Oe(n=>({getDataSourceState:n.getDataSourceState}));return mI(()=>o.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=o[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}import{useCallback as gI}from"react";var MK=Pt("useColumnSizeFn");function mg(o){return gI(t=>{let n=o[t];return n?n.computedWidth:0},[o])}import{useEffect as Nn,useLayoutEffect as bI,useMemo as TI}from"react";var hI={scrollLeft:0,scrollTop:0},xr=class{constructor(){this.scrollPosition=hI;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let n=0,r=t.length;n<r;n++)t[n](e)}};function gg(o,e){let t=new Map;function n(r){return e[r]!==!1}return Object.keys(o).forEach(r=>{let a=o[r].columnGroup,l=0;for(n(r)||(l=-1);a;){let s=o[a];if(!s)break;n(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as hg from"react";function yg(o){return(e,t)=>hg.createElement(o,{key:e.id,rowInfo:e,cache:t})}var Er=class extends Yo{constructor(t,n){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,n,r,i){if(t==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(t,n,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=xi(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 n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,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 n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&h&&(this.initialCols=r,this.cols=r);let y=i!=null,S=a!=null,T=y&&i!==this.rowHeight,b=S&&a!==this.initialColWidth;y&&(this.rowHeight=i),S&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let R=g||T||p,C=h||b||d||R;(C||R)&&this.updateRenderCount({horizontal:C,vertical:R})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Jt){let n=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/n);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(n=>{Ve(()=>{this.destroyed||t.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(t,n){return this.initialCols*(n?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};function Jo(){return{current:null}}var Sg={};function Ns(o){return`.${Bt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Ls(o,e){let t=Do(o),n=e?new Er(t,{isHeader:!1}):new Yo(t),r=`${t}:header`,i=e?new Er(r,{isHeader:!0,masterBrain:n}):new Yo(r);n.onScroll(c=>{i.setScrollPosition({scrollLeft:c.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=yr(n),{renderer:s,onRenderUpdater:u}=yr(i);return n.onAvailableSizeChange(c=>{i.update({width:c.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:u}}function bg({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Ls(o,!!e),u=Jo(),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=Ns(d);return u.current.querySelector(p)||null},brain:n,headerBrain:r,domRef:u,columnMenuTargetRef:Jo(),editingValueRef:Jo(),scrollerDOMRef:Jo(),portalDOMRef:Jo(),focusDetectDOMRef:Jo(),activeCellIndicatorDOMRef:Jo(),onColumnMenuClick:Se(),cellContextMenu:Se(),contextMenu:Se(),onFilterOperatorMenuClick:Se(),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 xr,pinnedEndScrollListener:new xr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Tg=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new Dr(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:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Sg,columnGroupVisibility:e=>e??Sg,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 yI(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Cg=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Rg(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var ca=new WeakMap;function Ig(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var wg=o=>{let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=n?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=n?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=n?.pivotColumnGroups?gg(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=yI({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let h=ca.get(d);h||(h=yg(d),ca.set(d,h)),c=h}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof xt)&&(u=new xt(u)),u=u||new xt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=ca.get(u),f||(f=h=>u.isRowDetailsExpanded(h.id),typeof u=="object"&&ca.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||pe.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=no.get(t.debugId);h&&(g={...g,...h})}return g};function vg(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function Pg(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,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(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import*as ao from"react";var Dg=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import*as da from"react";var xg="_16lm1iwb _16lm1iw1d _16lm1iwk";var Eg="164.93361431346415 56.97787143782138",Mg={margin:"auto",display:"block",shapeRendering:"auto"},sB=Object.keys({size:1,style:1,className:1,viewBox:1});var Ag=o=>da.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...Mg,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:te(o.className,xg,"InfiniteIcon","InfiniteIcon-loading")},da.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Eg},da.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function _g(o,e,t,n){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=o,l=r.column?{...r.column}:{},s=typeof t=="function"?t(o,e):t;return{header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:n.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,...s,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:s?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})}}function Og(o,e,t,n){let r=typeof t=="function"?t(o,e):t,i={};return o.sortable!=null&&(i.sortable=o.sortable),{...i,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function ks({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=n,d=e==="multi-column"&&c.isGroupRow&&o+1!==c.groupNesting,p=te(cn.flex,i.align==="end"?qn.rowReverse:qn.row,Zu.center,`${Bt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||u||d&&i.field)?Sp({align:a}):null);return d?i.field?ao.createElement("div",{className:p},u,ao.createElement("div",{className:_t},l??null)):u?ao.createElement("div",{className:p},u):null:(e==="single-column"&&c.isGroupRow,ao.createElement("div",{className:p},s,u,ao.createElement("div",{className:_t},l??null)))}}function zs({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===o&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&o+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 Dg(c)?f=ao.createElement(Ag,null):m&&(f=ao.createElement(jo,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=ao.createElement(St,{render:n,renderParam:r})),f}}function Fg(){return{getGroupColumnRender:ks,getGroupColumnRenderGroupIcon:zs}}function Ng(o,e,t){return _g(o,e,t,Fg())}function Lg(o,e,t){return Og(o,e,t,Fg())}function kg(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=o;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,g,h)=>{let y=Ng({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:u,selectionMode:r},c,i),S=y.id||`group-by-${m.field||m.groupField}`;f.push(S),p[S]=y});else if(u==="single-column"&&t.length){let m=Lg({groupCount:t.length,groupBy:t,pivotBy:n,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,y=g.pivotTotalColumn&&!g.columnGroup;if(h&&a===!1||y&&l===!1)return;let S={...g};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:n,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?ko(d,S.pivotAggregator.field):void 0,...S}),!S.render&&S.renderValue&&(S.render=T=>S.renderValue(T)),p[m]=S}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}import{useCallback as SI}from"react";function Vs(){let{getDataSourceState:o,dataSourceActions:e,getDataSourceMasterContext:t}=Oe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return SI(r=>{let i=o(),a=new Rt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[yt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||to(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=Z.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Dt())}},[])}function CI(o){return TI(()=>Rg(o),[o])}function zg(o,e){let{groupBy:t,dataSourceActions:n}=Oe(u=>({groupBy:u.dataSourceState.groupBy,dataSourceActions:u.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=o;Nn(()=>{n.generateGroupRows=r!=="inline"},[r]),Nn(()=>{n.pivotTotalColumnPosition=i},[i]),Nn(()=>{a!=null&&(n.pivotGrandTotalColumnPosition=a)},[a]);let l=CI(t);RI(l,o,e);let{toggleGroupRow:s}=II();return wI(l,o,e),{toggleGroupRow:s}}function RI(o,e,t){let n=Vs(),{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={},y=c.get(g.field);if(y&&d==="inline"){let{groupIndex:T}=y;h={groupByForColumn:y.groupBy,field:y.groupBy?.field,valueGetter:y.groupBy?.valueGetter,valueFormatter:({rowInfo:b})=>b.isGroupRow?b.groupKeys?.[T]:b.value,rowspan:({rowInfo:b,dataArray:R})=>{if(b.isTreeNode||!b.isGroupRow)return 1;let C=R[b.indexInAll-1]||{indexInParentGroups:[]};if(!C||!C.dataSourceHasGrouping)return 1;let I=C.indexInParentGroups||[],P=b.indexInParentGroups||[],D=!1;for(let E=0;E<=T;E++){let x=I[E];if(P[E]!==x){D=!0;break}}if(!D)return 1;let w=b.parents[T];return w?w.groupCount-(w.collapsedChildrenCount||0)+(w.collapsedGroupsCount||0):1},renderGroupIcon:zs({groupIndexForColumn:T,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:ks({groupIndexForColumn:T,groupRenderStrategy:d})}}let S={...h,...g};f[m]=S}),Object.keys(f).length===0?void 0:f}Nn(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,o,i,n)})()},[r,o,i,n])}function II(){let{groupBy:o,pivotBy:e,selectionMode:t}=Oe(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=At(),f=Vs();return Nn(()=>{(()=>{let{columns:g,groupColumnIds:h}=kg({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let y=p().columnOrder;if(h.length&&Array.isArray(y)){let S=new Set(y),T=!1;h.forEach(b=>{S.has(b)||(T=!0,y=[b,...y])}),T&&(n.columnOrder=y)}})()},[r,o,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function wI(o,e,t){let{dataArray:n,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Oe(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=Fe(e);bI(()=>{if(f!=="multi-column")return;let h=g(),y=vg(c,o),S=Pg({computedGroupColumns:y,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:n,groupBy:i,groupByMap:o});mt(h.columnVisibility,S)||(m.columnVisibility=S)},[s,f,l,i,o,c,p?n:null,p?a:null,p?r:null,p]),Nn(()=>{let h=i.length>0,y=g(),{columnVisibility:S,columnVisibilityForGrouping:T,hideColumnWhenGrouped:b}=y,R={...S},C={...T},I=!1,P=new Set,D=new Set;Object.keys(c).forEach(w=>{let M=c[w];if(M.defaultHiddenWhenGroupedBy||b!=null)if(M.defaultHiddenWhenGroupedBy==="*"&&h||(M.defaultHiddenWhenGroupedBy===!0||b)&&M.field&&o.get(M.field)||typeof M.defaultHiddenWhenGroupedBy=="string"&&o.get(M.defaultHiddenWhenGroupedBy)||typeof M.defaultHiddenWhenGroupedBy=="object"&&Object.keys(M.defaultHiddenWhenGroupedBy).reduce((x,v)=>x||o.has(v),!1)){if(C[w]!==!1){if(S[w]===!1)return;C[w]=!1,I=!0,P.add(w)}}else C[w]===!1&&(delete C[w],I=!0,D.add(w))}),I&&(m.columnVisibilityForGrouping=C,D.forEach(w=>{delete R[w]}),P.forEach(w=>{R[w]=!1}),m.columnVisibility=R)},[c,u,i,o,d])}import{useMemo as vI}from"react";var Vg=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,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:y,editable:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnDefaultSortable:C,scrollbarWidth:I,columnTypes:P,pinnedEndMaxWidth:D,pinnedStartMaxWidth:w,viewportReservedWidth:M,resizableColumns:E,columnVisibility:x,columnVisibilityAssumeVisible:v,columnSizing:A,groupBy:_})=>{let{computedRemainingSpace:L,computedColumnOrder:O,computedVisibleColumns:K,computedVisibleColumnsMap:W,computedPinnedStartColumns:k,computedPinnedEndColumns:Q,computedUnpinnedColumns:V,computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:re,computedUnpinnedColumnsWidth:de,computedUnpinnedOffset:se,computedPinnedEndOffset:ae,computedPinnedEndWidth:ce,computedPinnedStartWidth:ue,renderSelectionCheckBox:U,computedColumnsMap:z,computedColumnsMapInInitialOrder:Y,fieldsToColumn:$}=vI(()=>Zc({columns:o,userColumns:e,scrollbarWidth:I,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:u,viewportReservedWidth:M,resizableColumns:E,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:D,pinnedStartMaxWidth:w,draggableColumns:c,columnDefaultDraggable:d,columnOrder:h,columnPinning:y,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnDefaultSortable:C,editable:S,columnSizing:A,columnTypes:P,columnVisibility:x,columnVisibilityAssumeVisible:v??!0,groupBy:_}),[o,e,t.width,n,r,i,M,I,l,p,f,m,g,h,x,v,d,c,E,D,w,A,P,y,T,b,R,S,_,1]);return{renderSelectionCheckBox:U,columns:o,computedColumnsMap:z,computedPinnedEndWidth:ce,computedPinnedStartWidth:ue,computedRemainingSpace:L,computedUnpinnedOffset:se,computedPinnedEndOffset:ae,computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:re,computedUnpinnedColumnsWidth:de,computedPinnedStartColumns:k,computedPinnedEndColumns:Q,computedUnpinnedColumns:V,computedVisibleColumns:K,computedVisibleColumnsMap:W,computedColumnOrder:O,computedColumnsMapInInitialOrder:Y,fieldsToColumn:$}};import{useMemo as DI}from"react";var pa=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function PI(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?n(d):0;return e&&e.rowHeight.set(c,p),p}:n;let l=typeof n=="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?n(d):n;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 Gg(o){let e=new pa;return{computedRowHeight:PI(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}}function Hg(o){return DI(()=>Gg(o),[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}import{useState as xI,useEffect as EI,useLayoutEffect as MI}from"react";var AI={vertical:!1,horizontal:!1};function Kg(o){let e=o().brain,{getDataSourceState:t}=Wt(),[n,r]=xI(AI);return EI(()=>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]),MI(()=>{let i=t(),{onScrollbarsChange:a}=o(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function Bg(o){let{state:e,actions:t,getState:n}=o,{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:y,editable:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnTypes:C,rowHeight:I,rowDetailHeight:P,isRowDetailExpanded:D,isRowDetailEnabled:w,bodySize:M,showSeparatePivotColumnForSingleAggregation:E,onRowHeightCSSVarChange:x,onFlashingDurationCSSVarChange:v,onRowDetailHeightCSSVarChange:A,onColumnHeaderHeightCSSVarChange:_,computedColumns:F,initialColumns:L,viewportReservedWidth:O,resizableColumns:K,sortable:W,draggableColumns:k}=e,Q=t,{multiSort:V,filterValue:j,filterTypes:re,groupBy:de,sortInfo:se,dataSourceActions:ae,getDataSourceState:ce,dataSourceApi:ue}=Oe(le=>({dataSourceActions:le.dataSourceActions,getDataSourceState:le.getDataSourceState,dataSourceApi:le.dataSourceApi,sortInfo:le.dataSourceState.sortInfo,multiSort:le.dataSourceState.multiSort,filterValue:le.dataSourceState.filterValue,filterTypes:le.dataSourceState.filterTypes,groupBy:le.dataSourceState.groupBy}));Gs(()=>{x.onChange(le=>{le&&(Q.rowHeight=le)}),v.onChange(le=>{let _e=le?le*1:null;_e!=null&&!isNaN(_e)&&(Q.flashingDurationCSSVarValue=_e)}),A.onChange(le=>{le&&(Q.rowDetailHeight=le)}),_.onChange(le=>{le&&(Q.columnHeaderHeight=le)})}),_I(()=>{ae.showSeparatePivotColumnForSingleAggregation=E},[E]);let{toggleGroupRow:U}=zg(e,t),z=F,{computedColumnOrder:Y,computedVisibleColumns:$,computedVisibleColumnsMap:X,computedPinnedStartColumns:q,computedPinnedEndColumns:fe,computedUnpinnedColumns:me,computedPinnedStartColumnsWidth:ie,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:ge,computedPinnedEndOffset:Ee,computedRemainingSpace:Ce,computedPinnedStartWidth:Re,computedPinnedEndWidth:Ae,renderSelectionCheckBox:Ge,computedColumnsMap:et,computedColumnsMapInInitialOrder:Xe,fieldsToColumn:tt}=Vg({columns:z,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:M,viewportReservedWidth:O,resizableColumns:K,sortable:W,draggableColumns:k,sortInfo:se??void 0,multiSort:V,groupBy:de,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,filterValue:j,filterTypes:re,columnSizing:y,columnTypes:C}),Ze=fg($),Ue=mg($),B=Kg(n),oe=Re?ie>Re:!1,he=Ae?G>Ae:!1,[be]=Gs(()=>new Qi({getRowAt:_e=>ce().dataArray[_e],isNodeSelectable:_e=>{let{isNodeSelectable:$e}=ce();return $e?$e(_e):!0}})),nt=Fe($),[H]=Gs(()=>new Zi({getPrimaryKeyByIndex:ue.getPrimaryKeyByIndex,getColumnIdByIndex:le=>nt()[le]?.id||""})),{computedRowHeight:Ne,computedRowSizeCacheForDetails:pt}=Hg({rowDetailHeight:P,rowHeight:I,isRowDetailsExpanded:D,isRowDetailsEnabled:w,getDataSourceState:ce});return OI(()=>({multiRowSelector:be,multiCellSelector:H,computedRowSizeCacheForDetails:pt,computedRowHeight:Ne,scrollbars:B,columnSize:Ue,rowspan:Ze,toggleGroupRow:U,computedColumnsMap:et,computedColumnsMapInInitialOrder:Xe,renderSelectionCheckBox:Ge,computedPinnedStartOverflow:oe,computedPinnedEndOverflow:he,computedPinnedStartWidth:Re,computedPinnedEndWidth:Ae,computedVisibleColumns:$,computedColumnOrder:Y,computedRemainingSpace:Ce,computedVisibleColumnsMap:X,computedPinnedStartColumns:q,computedPinnedEndColumns:fe,computedUnpinnedColumns:me,computedPinnedStartColumnsWidth:ie,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:ge,computedPinnedEndOffset:Ee,fieldsToColumn:tt}),[be,H,pt,Ne,B,Ue,Ze,U,et,Xe,Ge,oe,he,Re,Ae,$,Y,Ce,X,q,fe,me,ie,G,N,ge,Ee,tt])}import{useMemo as GI}from"react";function FI(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function NI(){return 4294967295}function LI(o,e,t){return e=e>>>8^o[t^e&255],e}function kI(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Hs(o,e=3988292384){var t=FI(e),n=0,r;for(n=NI(),r=0;r<o.length;r++)n=LI(t,n,o.charCodeAt(r));return n=kI(n),`${n}`}var zI=o=>{let e=o.reduce((n,r)=>(n.set(r.name,r.value),n),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Wg=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+8,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},jg=(o="",e,t)=>{let n;try{n=VI(o)}catch{return Wg(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(n.end);return i<r?(Wg([`
28
28
  Your Infinite Table license has expired on ${i.toDateString()}.
29
- `,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},VI=o=>{let e="",t=o.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let u=t[s];if(Hs(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Hs(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),zI(t)};var HI=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,KI=/(https):\/\/\S+(\.csb\.app)/g,Ug=typeof window<"u"?window.location.origin:"",BI=()=>{let[o,e,t]=Array.from(HI.exec(Ug)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},WI=()=>{let[o,e,t]=Array.from(KI.exec(Ug)||[]);return e==="https"&&t===".csb.app"},jI=WI()||BI(),$g=(o="")=>{let t=!!No();return GI(()=>{if(t)return!0;let r=jg(o,{publishedAt:1624970570587,version:"10.1.0"});return!o&&!r&&jI?!0:r},[o,t])};import{useRef as Yg,useEffect as qg}from"react";var UI=10;function Xg(o,e,t){let n=Yg(!1),r=Yg(null);qg(()=>{o!=null&&(n.current=!1,Ot(r.current))},[o]),qg(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,Ot(r.current),r.current=Ve(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<UI&&a(l)})};var i=a;a()}return()=>{Ot(r.current)}},[o,e])}import{useRef as Zg,useEffect as Qg}from"react";var $I=10;function Jg(o,e,t){let n=Zg(!1),r=Zg(null);Qg(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),Qg(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<$I&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}function eh(){return mo()}import{useCallback as tw,useMemo as ow,useEffect as nw}from"react";function th(o,e){o.getComputed().multiRowSelector.lastPointerDown={rowIndex:o.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var YI={Enter:!0," ":!0,a:!0};function oh(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=o,{key:l,ctrlKey:s,metaKey:u}=e;if(!YI[l])return!1;let c=t(),d=n(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=c,{selectionMode:h,rowSelection:y,treeSelectionState:S,isTree:T}=d;if(g===!1)return!1;let b=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null;if(!(b!=null?d.dataArray[b]:null)||b==null)return!1;if(l===" "&&(h==="single-row"||h==="multi-row")){let C={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return yi({...o,rowIndex:b},C,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||u)){if(T&&S){let I=a(S);return I.selectAll(),r.treeSelection=I,!0}let C=i(y);return C.selectAll(),r.rowSelection=C,!0}return!1}var nh=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),rh=o=>Array.from(o.querySelectorAll(nh)).filter(t=>!!t.offsetParent),fa=o=>o.querySelector(nh);var ah=rn(Go());async function ih(o,e=10,t=300){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})}var qI=10,XI=(o,e)=>o-e;function ma(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=n(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=ut(p.id,e);return p.contentFocusable({column:p,...wn({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Ks(o,e,t){let n=t.getState().editingCell;return ZI(o,e,t,{isCellFocusable:ma,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function lh(o,e,t){let n=(0,ah.default)(t,o+e,XI);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=lh;function ZI(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=o.rowIndex,c=o.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:lh(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 sh(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=ma(e,o)?e:Ks(e,-1,o);if(t){await Bs([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;fa(n)?.focus()}}async function Bs([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=qI,l=null,s=!1;function u(c=0){c++,Ot(l),l=Ve(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&c<a&&u(c),s){try{await ih(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var QI=`.${Bt}`;function uh(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:yo(n,QI),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}=o.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&ma({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:Ks({rowIndex:l,colIndex:s},t,o);if(!u){if(t===-1)r.focus();else{let c=rh(document.body),d=o.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return Bs([u.rowIndex,u.colIndex],o).then(()=>{let c=o.getState().getDOMNodeForCell(u);if(!c)return;fa(c)?.focus()}),!0}var ch={control:"ctrl"},dh={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},JI={esc:"escape"},fh={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},mh=Object.keys(fh),Ws=new Set(mh),ew=new Set(["shift","alt"]);function js(o,e){return Array.isArray(e)?e.some(t=>ph(o,t)):ph(o,e)}function ph(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>dh[p]),i=n.map(p=>ch[p]||dh[p]||JI[p]||p),a=i.filter(p=>Ws.has(p)),l=i.filter(p=>!Ws.has(p)),s=mh.reduce((p,f)=>(p[f]=fh[f](o),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=>!ew.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Ws.has(t)||t==="meta"||ch[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function gh(o,e){let t={...o,cloneRowSelection:a=>In(a,o.getDataSourceState),cloneTreeSelection:a=>Rn(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&oh(t,e)&&e.preventDefault(),(uh(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&mm(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,u=o.getComputed().computedVisibleColumns[s];u.computedEditable&&o.api.startEdit({rowIndex:l,columnId:u.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!js(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function rw(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=He(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=Wt();return ow(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>Rn(c,i),cloneRowSelection:c=>In(c,i)}),[o,e,i,a,t,l,n])}function iw(){let o=rw();nw(()=>{let e=o.getState().keyDown.onChange(a=>{gh(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],u=ut(s.id,o);sp({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=o.getComputed().computedVisibleColumns[u],d=ut(c.id,o);th({...o,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function aw(){let{getState:o}=ne(t=>({getState:t.getState}));return{onKeyDown:tw(t=>{o().keyDown(t)},[])}}function hh(){return iw(),aw()}import{useEffect as $h}from"react";import*as Ke from"react";import{useCallback as Ys,useEffect as sw,useLayoutEffect as uw,useState as ha}from"react";import{createPortal as cw}from"react-dom";var ga="__is_infinite_menu_component";function Us(o){return!!o.tagName}function bh(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=we.from(Us(e)?e.getBoundingClientRect():e),a=we.from(Us(t)?t.getBoundingClientRect():t),l=n?we.from(Us(n)?n.getBoundingClientRect():n):null;if(!l)return{...yh({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=yh({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 yh(o){let e=we.from(o.targetRect),t=we.from(o.anchorRect),n=o.constrainRect?we.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Sh(e,i),s=Sh(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function Sh(o,e){return e==="TopLeft"?Be.from({top:o.top,left:o.left}):e==="TopCenter"?Be.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Be.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Be.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Be.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Be.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Be.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Be.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Be.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function lw(o){return o&&typeof o.then=="function"||o instanceof Promise}function Ch(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Th(o){return typeof o=="function"&&(o=o()),lw(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&Ch(o)&&(o=o.getBoundingClientRect()),o?we.from(o):null}async function Rh(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),Ch(n)&&(r=n),r||null}return t(await e)}async function $s(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Th(t)||void 0,a=n?await Th(n):void 0,l=we.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=bh({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=o.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=o.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function dw(o){return Ke.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function pw(o){let e=Ke.useRef(null);return sw(()=>o.realign.onChange(t=>{e.current&&t&&$s(e.current,t)}),[o.realign]),Ke.createElement("div",{style:{position:"absolute",top:0,left:0},ref:Ys(t=>{t&&$s(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function fw(o,e){let[t,n]=ha(null);return uw(()=>{async function r(){let i=e?await Rh(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?cw(o,t):Ke.createElement(Ke.Fragment,null):e===null||e===!1?o:Ke.createElement(dw,null,o)}function mw(o){if(Ke.Children.count(o)===1){let e=Ke.Children.only(o);if(Ke.isValidElement(e))return e.props.id||e.key}return null}function gw(o,e,t){if(Ke.Children.count(o)===1){let n=Ke.Children.only(o);if(Ke.isValidElement(n)&&n.type[ga]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Ke.cloneElement(n,r)}}return o}function lo(o){let e=o,[t]=ha(()=>new Map),[n,r]=ha(null),[i,a]=ha(0),l=Ys(()=>{let m=[];for(let[g,h]of t)m.push(Ke.createElement(pw,{...h,key:h.key}));return m},[]),[s,u]=kt(),c=fw(l(),o.portalContainer),d=Ys((m,g)=>{let y=`${g.id||mw(m)||Dt()}`,S=t.get(y),T=C=>()=>{let I=typeof C=="function"?C():C;return gw(I,e.portalContainer,g.constrainTo??e.constrainTo)},b=T(m),R=(C,I)=>{if(!S)return;let P=T(C);Object.assign(S,{children:P}),u(),!!!I?.skipRealign&&(r(S.key),a(Date.now()))};return S?(Object.assign(S,g),R(m),R):(S={key:y,children:b,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Se()},t.set(S.key,S),u(),R)},[t,e.portalContainer,u]);Ke.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return Ke.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}import*as jh from"react";import*as kn from"react";import*as Nh from"react";import*as Oh from"react";function ya(o){return null}ya.defaultProps={__is_menu_item:!0};var Ih="submenu",hw="-";function wh(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Dt(),focused:!1,destroyed:!1,domRef:{current:null}}}function vh(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var qs=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===hw?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},yw=[{name:"label"}],Ph=(o,e)=>{let{props:t,state:n}=o,{activeItemKey:r,keyboardActiveItemKey:i}=n,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:u}=t,c=t.id||n.generatedId;u&&(c=`${u}-${c}`);let d=[...t.columns||yw],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:c},f=[];a?f=a.map(g=>qs(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==Ih)&&d.push({name:Ih,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:c}};import*as Ln from"react";var Dh="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",xh=ye({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"]]}),Eh="db3arf1",Mh="db3arfd";function Ah(){return Ln.createElement("hr",{className:Mh})}var Sa={renderSeparator:()=>Ln.createElement(Ah,null),renderSubmenuColumn:({domProps:o,item:e})=>e.menu?Ln.createElement("div",{...o},Ln.createElement(jo,{expanded:!1})):Ln.createElement("div",{...o})};var _h=(o,e)=>qs(o,e,Sa);function Fh(o,e){return Oh.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===ya)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),_h(o,n)}return _h(o,t)})||[]}function Lh(){return{...wh(),domRef:Nh.createRef()}}var kh=()=>vh(),zh=o=>Ph(o,{...Sa,childrenToRuntimeItems:Fh});import*as Lt from"react";import{useCallback as en,useLayoutEffect as Pw,useRef as Dw,useState as Qs}from"react";function Vh(o,e){let t=Gh(o,e);if(!t.length)return null;let n=we.from(t[0]?.getBoundingClientRect()),r=we.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function Gh(o,e){let t=yo(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function Hh(o,e){let t=Gh(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}var Mr=class extends Sn{constructor(e){super(e.slice(0,3))}};var Sw=250;function bw(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}Ve(i)};Ve(()=>{i()})})}var Tw=De(),ba=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||Sw;this.getPointerMoveTarget=()=>document.documentElement||Tw;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 Be({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 Mr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Mr([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,bw(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Be({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};import{createContext as Cw,useContext as Rw}from"react";var Xs=Cw(null);function Zs(){return Rw(Xs)}import{useCallback as Iw,useEffect as ww,useRef as vw}from"react";function Kh(){let o=vw(!0);return ww(()=>(o.current=!0,()=>{o.current=!1}),[]),Iw(()=>o.current,[])}function xw(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=o.menu;return c?(typeof c=="function"&&(c=c()),Lt.createElement($t,{key:u,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),n(p)},onHideIntent:d=>{c?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function Ew({onItemActivate:o}){let{getState:e}=Zs(),[{onItemEnter:t,onItemLeave:n}]=Qs(()=>new ba({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?we.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:en(t,[]),onItemLeave:en(n,[])}}function Bh(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:y}=Zs(),S=en(V=>{h.keyboardActiveItemKey=V},[]),T=en(V=>{h.activeItemKey=V},[]),b=Kh(),[R,C]=Qs(null),I=null;Pw(()=>{let{runtimeItems:V}=y(),j=V.filter(re=>re.type==="item"&&i===re.key)[0];if(!j||!j.menu){C(null),M();return}if(j){let re=Vh(r,j.key);re&&D(()=>xw(j,{constrainTo:l,setSubmenuApi:C,setActiveItemKey:T,setKeyboardActiveItemKey:S,parentMenuId:r,onHideIntent:K,api:W}),{id:`${r}-submenu`,alignTo:re,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let P=(V,j)=>{S(j.key),T(j.key),j.originalMenuItem.onClick&&j.originalMenuItem.onClick(V);let re={key:j.key,item:j.originalMenuItem,hideMenu:K};j.originalMenuItem.onAction&&j.originalMenuItem.onAction(re),u&&u(re),j.originalMenuItem.hideMenuOnAction&&K()},{showOverlay:D,portal:w,clearAll:M}=lo({portalContainer:!1}),{onItemEnter:E,onItemLeave:x}=Ew({onItemActivate:V=>{if(!b())return;let j=V?V.key:null;T(j)}});I=n.map((V,j)=>Lt.createElement(Mw,{key:V.type==="item"?V.key:j,onItemEnter:(re,de)=>{E(re.key,de)},onItemLeave:(re,de)=>{x(re.key,de)},columns:t,active:V.type==="item"&&V.key===i,keyboardActive:V.type==="item"&&V.key===a,item:V,index:j,onClick:P}));let v=t.map(V=>V.width||(typeof V.flex=="number"?`${V.flex}fr`:V.flex)||"auto").join(" "),A={...e.style,gridTemplateColumns:v,gridTemplateRows:n.map(()=>"auto").join(" ")};c||(A.whiteSpace="nowrap");function _(V){let{runtimeItems:j,runtimeSelectableItems:re}=y(),de=j.findIndex(U=>U.type==="item"&&U.key===a),se=a,ae=j[de],ce={ArrowUp:()=>{let U=j.slice(0,de).filter(z=>z.type==="item"&&!z.disabled).pop();U&&U.type==="item"&&U.key&&(se=U.key)},ArrowDown:()=>{let U=j.slice(de+1).filter(z=>z.type==="item"&&!z.disabled)[0];U&&U.type==="item"&&U.key&&(se=U.key)},Home:()=>{ce.PageUp()},End:()=>{ce.PageDown()},PageUp:()=>{se=re[0].key},PageDown:()=>{se=re[re.length-1].key},ArrowLeft:()=>{T(null),y().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{ae&&(T(ae.key),Ve(()=>{b()&&R&&R.getParentMenuId()===y().menuId&&R.focus()}))},Enter:()=>{if(ae)if(ae.originalMenuItem?.menu){if(ae&&ae.originalMenuItem.menu&&R){ce.ArrowLeft();return}ae&&T(ae.key)}else P(V,ae)}," ":()=>{if(!ae)return;ae.originalMenuItem.menu||P(V,ae);let U=Hh(r,ae.key);U&&U.click()},Escape:()=>{ce.ArrowLeft();let U=y();U.parentMenuId||U.onHideIntent?.(U)}},ue=ce[V.key];ue&&(ue(),V.preventDefault()),se!=a&&S(se)}function F(){h.focused=!1}let L=en(function(){h.focused=!0,setTimeout(()=>{O.current&&g.current&&g.current===document.activeElement&&y().keyboardActiveItemKey==null&&S(y().runtimeSelectableItems[0]?.key??null)})},[]),O=Dw(!0),K=en(()=>{let V=y();V.onHideIntent?.(V)},[y]),[W]=Qs(()=>({hideMenu:K,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),L())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),k=en(V=>{V?(g.current=V,d?.(y(),W),f&&W.focus()):(p?.(y()),g.current=V)},[]),Q=Lt.createElement("div",{className:cn.contents},Lt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:k,onKeyDown:V=>{e.onKeyDown?.(V),_(V)},onMouseDown:V=>{O.current=!1,e.onMouseDown?.(V)},onMouseUp:V=>{O.current=!0,e.onMouseUp?.(V)},onFocus:L,onBlur:F,className:te(Dh,e.className,"InfiniteMenu"),style:A},I),w);return s?null:Q}function Mw(o){let[e,t]=Lt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=Lt.createElement("div",{style:r.style},r.value);else{let c=0;u=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<c)return null;c=h;let S={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:h},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:te(xh({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:T=>{r.disabled||o.onItemEnter?.(r,T)},onPointerLeave:T=>{r.disabled||o.onItemLeave?.(r,T)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:T=>{r.disabled||o.onClick(T,r)}};return d.render?Lt.createElement(sr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:S}}):Lt.createElement("div",{key:`${s}-${m}`,...S},f[m])}).filter(Boolean)}return Lt.createElement("div",{className:Eh},u)}var{ManagedComponentContextProvider:Aw}=Mt({initSetupState:Lh,forwardProps:kh,mapPropsToState:zh,layoutEffect:!0});function _w(o){let{componentActions:e,componentState:t}=At(),n=Fe(t);return kn.createElement(Xs.Provider,{value:{componentActions:e,componentState:t,getState:n}},kn.createElement(Bh,{domProps:o.domProps}))}function $t(o){let{children:e,portalContainer:t,items:n,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:y,...S}=o;return kn.createElement(Aw,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...o},kn.createElement(_w,{domProps:S}))}$t[ga]=!0;import*as Js from"react";function Wh(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a,getState:l}=e,s=l().components?.CheckBox||To,c=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...c,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{let h=Vo(m,e,"column-menu");p.push({key:g,label:h,check:Js.createElement(s,{key:m.id,disabled:m.computedVisible&&i.getVisibleColumnsCount()===1,checked:m.computedVisible,onChange:y=>{let S=!!y;i.setVisibilityForColumn(m.id,S),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}},"-",{key:"group-by",label:"Group by",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{if(m.groupByForColumn)return;let h=Vo(m,e,"column-menu");p.push({key:g,label:h,check:Js.createElement(s,{key:m.id,disabled:!m.computedGroupable,checked:m.computedGroupedBy,onChange:()=>{a.toggleGroupByField(m.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}}].filter(p=>!!p)}function Uh(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??$t,s=n().computedColumnsMap.get(o);if(!s)return null;let u={column:s,columnApi:ut(s.id,e),...e},c=Wh([],u),d=a?a(c,u):c,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:jh.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var Ow=`[${ur["data-name"]}="${cr["data-name"]}"]`;function Fw(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){n(),a.columnMenuVisibleForColumnId=null}let c=o.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[${Xf["data-column-id"]}="${e}"] ${Ow}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Uh(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Yh(){let o=He(),{getState:e,actions:t,columnMenuVisibleForColumnId:n,columnMenuVisibleKey:r}=ne(u=>({getState:u.getState,actions:u.actions,columnMenuVisibleForColumnId:u.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:u.state.columnMenuVisibleKey})),{portalDOMRef:i}=Yt(u=>({portalDOMRef:u.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=lo({portalContainer:i?.current??!1});return $h(()=>{let u=e();return u.onColumnMenuClick.onChange(c=>{c&&(u.columnMenuTargetRef.current=c.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=c.column.id)})},[]),$h(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=e();if(u){let p=function(f){f.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),Fw({columnId:u,context:o,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,s();return()=>{}},[n,r]),{menuPortal:l}}import*as qh from"react";import{useCallback as Nw}from"react";var Lw={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function Xh(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=He(),{getDataSourceState:a,getDataSourceMasterContext:l}=Wt(),{focusDetectDOMRef:s}=o(),u=Nw(async()=>{sh({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return qh.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:Lw})}import{useEffect as Ar}from"react";function kw(){let o=He(),{getState:e,editingCell:t}=ne(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active?t.cancelled:void 0;Ar(()=>{if(n){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=Rr(o,i);if(!a){Ir("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[n])}function zw(){let o=He(),{getState:e,editingCell:t}=ne(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;Ar(()=>{if(n){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=Rr(o,i);if(!a){Ir("onEditRejected",i);return}r({...a,value:i.value,error:n,initialValue:i.initialValue})}},[n])}function Vw(){let o=He(),{editingCell:e}=ne(r=>({editingCell:r.state.editingCell})),t=e?.active,n=Lo(t);Ar(()=>{!t&&n&&o.api.focus()},[t,n])}function Gw(){let o=He(),{editingCell:e,getState:t}=ne(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e&&!e.active&&!e.cancelled&&e.accepted===!0;Ar(()=>{if(n){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=Rr(o,i);s?r({...s,value:a,initialValue:l}):Ir("onEditAccepted",i)}o.api.persistEdit({value:a})}},[n])}function Hw(){let o=He(),{editingCell:e,getState:t}=ne(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e?e.persisted:void 0;Ar(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=n instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=Rr(o,r);if(!s){Ir(l,r);return}let u={...s,value:r.value,initialValue:r.initialValue};n instanceof Error?i?.({...u,error:n}):a?.(u)}},[n])}function Zh(){kw(),zw(),Gw(),Hw(),Vw()}import{useEffect as ey}from"react";import*as Oo from"react";import*as eu from"react";var Ta=o=>eu.createElement(ke,{...o},eu.createElement("path",{d:ze.clear[0]}));import*as tu from"react";var Qh=o=>tu.createElement(ke,{...o},tu.createElement("path",{d:ze.done[0]}));function Jh(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=c?.Menu??$t,f=n().computedColumnsMap.get(o);if(!f)return null;let m=I=>{I.__insideMenu=!0},g=I=>{I.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),y=h[f.computedFilterType];if(!y)return null;let S=y.operators.map(I=>{let P=I.name,D=f.computedFilterValue?f.computedFilterValue.filter.operator===P:P===y.defaultOperator,w=I.components?.Icon??pn;return{key:P,icon:Oo.createElement(w,null),label:Oo.createElement(Oo.Fragment,null,I.label??I.name),onAction:()=>{u.setColumnFilterOperator(o,P)},checked:D?Oo.createElement(Qh,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Oo.createElement(Ta,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(o)}},"-"],...S],R={column:f,api:u,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},C=d?d(b,R):b;return Oo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,onShow:I=>{I.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:I=>{g(I),t?.()}})}var Ca=10;function ty(){let{portalDOMRef:o}=Yt(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=He(),{getState:t,actions:n}=e,{showOverlay:r,portal:i,clearAll:a}=lo({portalContainer:o?.current??!1});return ey(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:u,column:c}=s;function d(){a(),n.filterOperatorMenuVisibleForColumnId=null}let p=u?.parentElement||u,f=we.from(p.getBoundingClientRect());f.top-=Ca,f.left-=Ca,f.width+=2*Ca,f.height+=2*Ca,r(()=>Jh(c.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:f,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),n.contextMenuVisibleFor=null,n.cellContextMenuVisibleFor=null,n.columnMenuVisibleForColumnId=null,n.filterOperatorMenuVisibleForColumnId=c.id}),[]),ey(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as Ia}from"react";import*as ru from"react";import*as ou from"react";function _r(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function Ra(o){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),o.onHideIntent?.()}}}function nu(o,e,t){if(!o)return null;let n=Se();return o.then(r=>{let{items:i,columns:a}=_r(r);i&&i.length&&n(ou.createElement(t,{...e,items:i||[],columns:a}))}),ou.createElement(Po,{updater:n})}function oy(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=s?.Menu??$t,{computedColumnsMap:d}=a(),p=d.get(n),f={...Kt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=Ra({onHideIntent:t}),g=u(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:nu(g,m,c),preventDefault:h};let{items:y,columns:S}=_r(g);return!y||!y.length?{cellContext:f,menu:null,preventDefault:Array.isArray(y)}:{preventDefault:h,menu:ru.createElement(c,{...m,columns:S,items:y}),cellContext:f}}function ny(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??$t,{computedColumnsMap:s}=r(),u=o.columnId?s.get(o.columnId):void 0,c=u?{...o,...Kt({...e,rowIndex:o.rowIndex,columnId:u.id})}:o;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=Ra({onHideIntent:t}),p=a(c,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:c,menu:nu(p,d,l),preventDefault:f};let{items:m,columns:g}=_r(p);return!m||!m.length?{cellContext:c,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:ru.createElement(l,{...d,columns:g,items:m}),cellContext:c}}var wa=5,ry=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function iy(){let o=He(),{portalDOMRef:e}=Yt(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=lo({portalContainer:e?.current??!1});return Ia(()=>{let{actions:l,getState:s,getDataSourceState:u}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:h}=oy(d,o,f),y=we.fromPoint({top:p.clientY,left:p.clientX});y.width+=wa,y.height+=wa,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:ry}),h&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:S}=s();S&&S({...g,getState:s,getDataSourceState:u},p)})},[]),Ia(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function ay(){let o=He(),{portalDOMRef:e}=Yt(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=lo({portalContainer:e?.current??!1});return Ia(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=ny(c,o,p),h={top:d.clientY,left:d.clientX},y=we.fromPoint(h);y.width+=wa,y.height+=wa,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:ry}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:h,...c};let{onContextMenu:S}=s();S&&S({...o,...m},d)})},[]),Ia(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as Ww}from"react";import*as ly from"react";import{useCallback as Kw,useEffect as Bw}from"react";function iu(o,e){let{brain:t}=ne(r=>({brain:r.state.brain})),n=Kw(o,e);Bw(()=>t.onScroll(n),[t,n])}var au="yzx0vj0";function sy(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=Ww(null);iu(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),n==="column"?l.minWidth=pe.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=pe.runtime.bodyWidth),t==="column"?l.maxWidth=pe.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=pe.runtime.bodyWidth),ly.createElement("div",{ref:a,...i,className:i.className?te(i.className,au):au,style:l},i.children)}var jw=J(ee.columnWidthAtIndex),Uw=J(ee.columnOffsetAtIndex);function $w(){let{computedVisibleColumns:o}=ne(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return o.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${jw}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${Uw}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var va="InfiniteTable";import{useEffect as Yw}from"react";function uy(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=ne(c=>({getState:c.getState,actions:c.actions,dataSourceActions:c.dataSourceActions,getDataSourceState:c.getDataSourceState})),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),Yw(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,y=(r&&r.length>0||i)&&h>0?h:null;return f!=y&&(t.rowsPerPage=y,g=!0),m!=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])}import{useEffect as Pa,useRef as Xw}from"react";function qw(){let o=[],e=t=>{Object.keys(t).forEach(n=>{let r=t[n];if(typeof r=="string"){let i=J(r);if(i.includes("dont-override"))return;o.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...pe,loaded:void 0,runtime:void 0}),o}function cy(o){if(!o)return{};let e=qw(),t=getComputedStyle(o),n={};return e.forEach(r=>{n[r]=t.getPropertyValue(r).trim()}),n}var Or=ye({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),dy="_143ofgf5",py="_143ofgf3";var Zw=J(pe.loaded),lu={source:"infinite-table-page",target:"infinite-table-devtools-background"};function fy(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...lu,url:su(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...lu,url:su(),type:t,payload:{debugId:n,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:cy(l.domRef.current),themeVarOverrides:{...jt.get(n)||{}}}}}var su=lt(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function Qw(o){window.postMessage(o)}var Jw=lt(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){dt.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(fy({type:"update",debugId:e},t))}else ag(e),window.postMessage(fy({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,qe.onLogIntent("IT:*",e=>{Qw({...lu,url:su(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let n="";try{n=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return n}return String(t)}),timestamp:e.timestamp}})}),o});function my(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=ne(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(Zw)!==`${ad}`&&wr({debugId:i,key:"CSS001_CSS"}),Pa(()=>{e().debugId!==i&&(t.debugId=i)},[i]),ov()}var Da=Se(),ev={revertAll:o=>{let e=dt.get(o.debugId);if(e){let t=Ao.get(o.debugId);Ao.delete(o.debugId),no.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=io.get(o.debugId);io.delete(o.debugId),ro.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=dt.get(o.debugId);if(e){let t=o.property,n=no.get(o.debugId),r=Ao.get(o.debugId),i=ro.get(o.debugId),a=io.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=io.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:o=>{let e=dt.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),_o(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),_o(o.debugId))}}},discardAllWarnings:o=>{let e=dt.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),_o(o.debugId))},setColumnVisibility:o=>{Ms(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{aa(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{Ms(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{aa(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{aa(o.debugId,"multiSort",o.multiSort)},setCssVar:o=>{let e=dt.get(o.debugId),t=e?.getState().domRef.current;!e||!t||!o.name?.startsWith("--infinite-")||(t.style.setProperty(o.name,o.value),jt.set(o.debugId,{...jt.get(o.debugId)||{},[o.name]:o.value}),_o(o.debugId))},revertCssVar:o=>{let e=dt.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(o.name);let n={...jt.get(o.debugId)||{}};delete n[o.name],jt.set(o.debugId,n),_o(o.debugId)},revertAllCssVars:o=>{let e=dt.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let n=jt.get(o.debugId)||{};Object.keys(n).forEach(r=>{t.style.removeProperty(r)}),jt.delete(o.debugId),_o(o.debugId)},highlight:o=>{let e=dt.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${Or.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Or.classNames.base),r.innerHTML=[`<div class="${py}"></div>`,`<div class="${dy}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Or.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Or.classNames.variants.active.true)}}}}};function tv(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(Jw(),Da(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=ev[e];t&&t(o.data.payload)}})}tv();function ov(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=ne(c=>({getState:c.getState,getComputed:c.getComputed,getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions,actions:c.actions,dataSourceApi:c.dataSourceApi,api:c.api})),s=o().debugId,u=Xw(s);return u.current=s,Pa(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=Da.get();if(p){d(p);return}return Da.onChange(f=>{f&&d(f)})},[]),Pa(()=>{let c=u.current;if(!c)return;let d=Da.get();d&&d(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),Pa(()=>{if(s)return()=>{let c=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;c&&c(s,null)}},[s]),s}function nv(){let{masterPortalDOMRef:o}=Yt(n=>({masterPortalDOMRef:n.getMasterState().portalDOMRef}))??{},e=ne(n=>n.state.portalDOMRef);return o?.current??e?.current}import*as wt from"react";import{useCallback as rv}from"react";var gy="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",hy=ye({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),yy="hs68h81",Sy=ye({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"]]});import*as tn from"react";function by(o){return tn.createElement("div",{...o.domProps})}function Ty(o){let{active:e}=o;return tn.createElement("div",{className:yy},e?"Drop to group":"Drag columns to group")}function Cy(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return tn.createElement("div",{...o.domProps},o.label,tn.createElement("div",{className:$r[1]}),tn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:gy,onKeyDown:e,onMouseDown:o.onClear},tn.createElement(Ta,{size:20})))}var iv=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};De().addEventListener("mousemove",i,{once:!0}),De().addEventListener("mouseup",()=>{r||(De().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function av(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=xn(),u=l===zn,c=He(),d=(e?Vo(e.id,c,"grouping-toolbar"):r)??i,p=e?wt.createElement(Ri,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=wt.createElement(wt.Fragment,null,d,p),m=s===i&&l===zn,g=te(hy({draggingInProgress:u,active:m}),o.domProps?.className),h=iv(a,o.domProps?.onMouseDown),y={...o.domProps,className:g,onMouseDown:h},S=n?.ToolbarItem??Cy;return wt.createElement(S,{active:m,domProps:y,column:e,field:r,label:f,onClear:t})}var zn="grouping-toolbar";function Ry(o){let{groupBy:e}=Oe(T=>({groupBy:T.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:n,api:r}=ne(T=>({getComputed:T.getComputed,dataSourceApi:T.dataSourceApi,api:T.api})),{dropTargetListId:i,dragSourceListId:a}=bo(),{fieldsToColumn:l,computedColumnsMap:s}=t(),u=i===zn,c=a===zn,d=o.components?.Placeholder??Ty,p=o.components?.Host??by,f=e.length?wt.createElement(wt.Fragment,null,e.map((T,b)=>{let R=T.field?l.get(T.field):void 0,C=`${T.field??`idx-${b}`}`;return wt.createElement($o.DraggableItem,{key:C,id:C},I=>wt.createElement(av,{id:C,components:o.components,domProps:I,field:T.field,column:R,toggleSorting:()=>{R&&r.toggleSortingForColumn(R.id)},onClear:()=>{let P=e.filter(D=>D!==T).filter(Boolean);n.setGroupBy(P)}}))})):wt.createElement(d,{draggingInProgress:c,active:u,groupBy:e}),m=T=>{let b=T.map(R=>e[R]);n.setGroupBy(b)},g=T=>{let{dragItemId:b}=T,R=b,C=s.get(R);if(!C||!C.field||!C.computedGroupable)return;let I=[...e];I.splice(T.dropIndex,0,{field:C.field}),n.setGroupBy(I)},h=rv(T=>{let{computedColumnsMap:b}=t(),R=T.dragItem.id,C=b.get(R);return!(!C||!C.computedGroupable||e.some(I=>I.field===C.field))},[e]),y=o.orientation??"horizontal",{domProps:S}=o;return wt.createElement($o,{orientation:y,dragListId:zn,acceptDropsFrom:["header",zn],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:h},(T,{draggingInProgress:b,status:R})=>{let C=te(Sy({active:u,orientation:y,draggingInProgress:b,dropRejected:R==="rejected"}),T.className,S?.className),I={...T,...S,className:C,children:f};return wt.createElement(p,{active:u,rejectDrop:R==="rejected",domProps:I,orientation:y})})}import*as Gn from"react";import{useMemo as uu}from"react";import{useCallback as pv,useEffect as Fr,useRef as fv}from"react";import*as xa from"react";function Iy(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return Bi(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}import*as so from"react";var wy=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as Dy}from"react";function lv(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function sv(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=jm(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(o,l),r.detailDataSourcesStateToRestore=a}function vy(o,e){let t={current:!1};return{currentRowCache:{getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)},cacheCalledByRowDetailRenderer:t}}function Py(o){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=o,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),u={registerDetail:lt(c=>{if(n.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)});return}lv(e.id,{masterState:r(),detailContext:c}),requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)}),c.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&sv(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 xy(o){let{rowDetailsCache:e,rowInfo:t}=o,{getDataSourceState:n,dataSourceActions:r}=Oe(u=>({getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions})),{getMasterState:i}=ne(u=>({getMasterState:u.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=Dy(()=>vy(t.id,e),[e,t.id]),s=Dy(()=>Py({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:n,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Ey(){return mo()}var{rootClassName:uv}=Le,cv=`${uv}RowDetail`;function dv(o){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:n,rowInfo:r,detailOffset:i,rowDetailsCache:a}=o,{masterDetailContextValue:l,currentRowCache:s}=xy({rowDetailsCache:a,rowInfo:r}),u=sn(),[c]=so.useState(()=>Ey());return c.setSnapshot(l),so.useLayoutEffect(()=>{c.notify()},[l]),so.createElement(u.Provider,{value:c},so.createElement("div",{ref:e,className:te(cv,wy({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${ee.bodyWidth} - ${ee.scrollbarWidthVertical})`,height:n}},t(r,s)))}var My=so.memo(dv);var mv=1;function Ay(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{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:y,cellClassName:S,cellStyle:T,repaintCellsKey:b,rowStyle:R,rowDetailCache:C,rowClassName:I,onScrollToTop:P,onScrollToBottom:D,onScrollStop:w,scrollToBottomOffset:M,wrapRowsHorizontally:E,updatedAt:x,ready:v,editingCell:A}=ne(G=>({actions:G.actions,getState:G.getState,getComputed:G.getComputed,getDataSourceMasterContext:G.getDataSourceMasterContext,rowHeight:G.state.rowHeight,rowDetailHeight:G.state.rowDetailHeight,onRowMouseEnter:G.state.onRowMouseEnter,onRowMouseLeave:G.state.onRowMouseLeave,groupRenderStrategy:G.state.groupRenderStrategy,brain:G.state.brain,showZebraRows:G.state.showZebraRows,rowDetailRenderer:G.state.rowDetailRenderer,isRowDetailsExpanded:G.state.isRowDetailExpanded,isRowDetailsEnabled:G.state.isRowDetailEnabled,cellClassName:G.state.cellClassName,cellStyle:G.state.cellStyle,repaintCellsKey:G.state.repaintCellsKey,rowStyle:G.state.rowStyle,rowDetailCache:G.state.rowDetailCache,rowClassName:G.state.rowClassName,onScrollToTop:G.state.onScrollToTop,onScrollToBottom:G.state.onScrollToBottom,onScrollStop:G.state.onScrollStop,scrollToBottomOffset:G.state.scrollToBottomOffset,wrapRowsHorizontally:G.state.wrapRowsHorizontally,updatedAt:G.state.updatedAt,ready:G.state.ready,editingCell:G.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:F,computedVisibleColumns:L,computedColumnsMap:O,computedColumnOrder:K,computedRowHeight:W,computedRowSizeCacheForDetails:k,fieldsToColumn:Q,rowspan:V,toggleGroupRow:j,columnSize:re}=e,de=uu(()=>L.map(G=>G.id),[L]),{dataArray:se,rowInfoStore:ae,selectionMode:ce,cellSelection:ue,isNodeReadOnly:U,getDataSourceState:z,dataSourceApi:Y,dataSourceActions:$}=Oe(G=>({dataSourceApi:G.dataSourceApi,dataSourceActions:G.dataSourceActions,getDataSourceState:G.getDataSourceState,dataArray:G.dataSourceState.dataArray,rowInfoStore:G.dataSourceState.rowInfoStore,selectionMode:G.dataSourceState.selectionMode,cellSelection:G.dataSourceState.cellSelection,isNodeReadOnly:G.dataSourceState.isNodeReadOnly})),X=Fe(se);Iy({columnSize:re,brain:f,computedPinnedStartColumns:_,computedPinnedEndColumns:F,computedVisibleColumns:L,computedRowHeight:W,dataArray:se,bodySize:t,rowspan:V});let q=fv(0);Fr(()=>f.onRenderCountChange(()=>{q.current=f.scrollTopMax}),[f]),Fr(()=>f.onRenderRangeChange(G=>{i().onRenderRangeChange?.(G)}),[f]),Fr(()=>f.onScrollStop(G=>{let{scrollTop:N,scrollLeft:ge}=G;if(N===0&&P?.(),N+(M??mv)>=q.current){D?.();let{livePagination:Re,livePaginationCursor:Ae,dataArray:Ge}=z();Re&&($.cursorId=Ae!==void 0?Date.now():Ge.length)}if(w){let Re=f.getRenderRange();w({scrollTop:N,scrollLeft:ge,renderRange:Re,viewportSize:i().bodySize,firstVisibleRowIndex:Re.start[0],lastVisibleRowIndex:Re.end[0],firstVisibleColIndex:Re.start[1],lastVisibleColIndex:Re.end[1]})}}),[f,P,D,w]),Fr(()=>{t.height&&(r.ready=!0)},[!!t.height]),Fr(()=>{let{onReady:G}=i();G&&G({api:n,dataSourceApi:Y})},[v]);let fe=uu(()=>({isNodeReadOnly:U,selectionMode:ce,cellSelection:ue}),[U,ce,ue]),me=pv(G=>{let{rowIndex:N,colIndex:ge,heightWithRowspan:Ee,domRef:Ce,hidden:Re,width:Ae,onMouseLeave:Ge,onMouseEnter:et}=G,tt=X()[N],Ze=L[ge];if(!tt||!Ze)return null;let Ue=k?k.getRowHeight(N):Ee,B=!1;!y||typeof y=="function"&&!y(tt)?B=!1:h&&(B=h(tt)?"expanded":"collapsed");let oe=E?f.getRowIndexInPage(N):null,he=E?f.getPageIndexForRow(N):null,be=n.isEditorVisibleForCell({rowIndex:N,columnId:Ze.id}),nt={getData:X,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:oe,horizontalLayoutPageIndex:he,rowIndex:N,rowInfoStore:ae,hidden:Re,toggleGroupRow:j,rowHeight:Ue,rowDetailState:B,onMouseEnter:et,onMouseLeave:Ge,onRowMouseEnter:c,onRowMouseLeave:d,domRef:Ce,width:Ae,column:Ze,columnsMap:O,fieldsToColumn:Q,rowStyle:R,rowClassName:I,cellStyle:T,cellClassName:S,repaintCellsKey:Ze.repaintCellsKey!==void 0?Ze.repaintCellsKey:b,visibleColumnIds:de,computedColumnOrder:K,inEditMode:be,getDataSourceState:z,dataSourceApi:Y,dataSourceActions:$,getState:i,imperativeApi:n,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:fe};return xa.createElement(xp,{...nt})},[s,u,c,d,k,W,h,X,L,O,Q,p,E,j,m,f,ae,R,I,S,T,b,z,Y,$,i,n,r,a,l,de,K,x,A,fe]),ie=uu(()=>{if(h)return G=>{let{rowIndex:N,domRef:ge}=G,Ce=X()[N];if(!Ce||!h(Ce)||!k)return xa.createElement("div",{ref:ge,className:ac.hidden});let{rowDetailHeight:Re,rowHeight:Ae}=k.getSize(N);return xa.createElement(My,{rowInfo:Ce,rowDetailsCache:C,rowIndex:N,domRef:ge,detailOffset:Ae,rowDetailHeight:Re,rowDetailRenderer:g})}},[v,me,g,u,h,C]);return{renderCell:me,renderDetailRow:ie}}import{useEffect as gv}from"react";function _y(){let{state:o,getState:e,actions:t}=ne(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:n}=o,r=Lo(n);gv(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=Ls(va,!!n);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,n])}import*as Ny from"react";var Oy="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Fy=te(Oy,Dl);function Ly(o){return Ny.createElement("div",{...o,className:o.className?te(Fy,o.className):Fy})}import*as Vn from"react";var ky={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},zy="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Vy="qy58ya4";var{rootClassName:hv}=Le,cu=`${hv}-LoadMask`;function yv(o){let{visible:e,children:t="Loading"}=o;return Vn.createElement("div",{className:`${ky[e?"visible":"hidden"]} ${cu}`},Vn.createElement("div",{className:`${zy} ${cu}-Overlay`}),Vn.createElement("div",{className:`${Vy} ${cu}-Text`},t))}var Ea=Vn.memo(yv);import{useMemo as Sv}from"react";var bv=[bp,`${Bt}--hovered`];function Tv(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function on(o){let e=He(),t=No(),{getComputed:n,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:y,rowDetailRenderer:S,showHoverRows:T,wrapRowsHorizontally:b,domProps:R,domRef:C,forceBodyRerenderTimestamp:I,rowHoverClassName:P,ready:D}=ne(k=>({ready:k.state.ready,columnReorderDragColumnId:k.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:k.state.forceBodyRerenderTimestamp,renderer:k.state.renderer,onRenderUpdater:k.state.onRenderUpdater,debugId:k.state.debugId,keyboardNavigation:k.state.keyboardNavigation,activeRowIndex:k.state.activeRowIndex,loadingText:k.state.loadingText,scrollStopDelay:k.state.scrollStopDelay,brain:k.state.brain,scrollerDOMRef:k.state.scrollerDOMRef,components:k.state.components,bodySize:k.state.bodySize,activeCellIndex:k.state.activeCellIndex,rowDetailRenderer:k.state.rowDetailRenderer,showHoverRows:k.state.showHoverRows,wrapRowsHorizontally:k.state.wrapRowsHorizontally,domProps:k.state.domProps,domRef:k.state.domRef,rowHoverClassName:k.state.rowHoverClassName})),w=g?.LoadMask??Ea,M=n(),{computedRowHeight:E,computedRowSizeCacheForDetails:x}=M,v=x?.getRowHeight||E,{loading:A}=Oe(k=>({loading:k.dataSourceState.loading})),_=Gn.useCallback(k=>{let Q=e.getState(),V=k.target;if(!t&&k._from_row_detail)return;t&&(k._from_row_detail=!0);let j=id(V,Ns(),Q.domRef.current),re,de,se,ae;j&&(de=Number(j.dataset.colIndex),ae=Number(j.dataset.rowIndex),re=e.getComputed().computedVisibleColumns[de].id,se=e.dataSourceApi.getRowInfoArray()[ae].id);let ce={columnId:re,colIndex:de,rowId:se,rowIndex:ae,event:k,target:j??k.target};j&&Q.cellContextMenu(ce),Q.contextMenu(ce)},[]),{renderCell:F,renderDetailRow:L}=Ay({imperativeApi:r,getComputed:n,domRef:C,bodySize:h,computed:M}),{autoFocus:O,tabIndex:K}=R??{};_y();let W=Sv(()=>{if(!T)return;let k=[];return P&&(k=k.concat(P)),o.rowHoverClassName&&(k=k.concat(o.rowHoverClassName)),on.rowHoverClassName&&(k=k.concat(on.rowHoverClassName)),Tv(k)},[T,P,o.rowHoverClassName,on.rowHoverClassName]);return Gn.createElement(Ly,{onContextMenu:_},Gn.createElement(Af,{forceRerenderTimestamp:I,debugId:l,tabIndex:K??0,autoFocus:O??void 0,activeRowIndex:D&&s==="row"?u:null,activeCellIndex:D&&s==="cell"&&!d?y:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:b,onRenderUpdater:a,brain:f,activeCellRowHeight:v,renderCell:F,renderDetailRow:S?L:void 0,cellHoverClassNames:W,scrollerDOMRef:m,scrollVarHostRef:C}),Gn.createElement(w,{visible:A},c))}on.rowHoverClassName=bv;function Cv(){return ne(o=>o.api)}function Rv(o){return ne(e=>e.api.getColumnApi(o))}var Gy=o=>`--infinite-${o}`;var Hy=40,Ky=Gy(ld);var Xt=Le.rootClassName,{ManagedComponentContextProvider:Iv}=Mt({initSetupState:bg,forwardProps:Tg,mapPropsToState:wg,cleanup:Cg,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Ig(),getParentState:()=>Rs(o=>o),debugName:o=>Do(o.debugId,va)}),wv=Pe.memo(function(){let e=Wr(),{componentState:t,api:n,initialChildren:r}=ne(O=>({componentState:O.state,api:O.api,initialChildren:O.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Oe(O=>({dataArrayLength:O.dataSourceState.dataArray.length,getDataSourceState:O.getDataSourceState,dataSourceActions:O.dataSourceActions,dataSourceApi:O.dataSourceApi})),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:y,scrollStopDelay:S,brain:T,activeRowIndex:b,activeCellIndex:R}=t,{licenseKey:C}=t;!C&&uo.licenseKey&&(C=uo.licenseKey),Jg(b,i,n),Xg(R,i,n);let{onKeyDown:I}=hh();Pe.useEffect(()=>{let O=a(),K=Et(W=>{O.notifyRenderRangeChange({renderStartIndex:W[0],renderEndIndex:W[1]})},{wait:S});return T.onVerticalRenderRangeChange(K)},[T,S]);let P=$g(C),{autoFocus:D,tabIndex:w,...M}=t.domProps??{},E=vd(M);Pe.useEffect(()=>{T.setScrollStopDelay(S),l.scrollStopDelayUpdatedByTable=S},[S]),Tm(),uy(),Zh();let{menuPortal:x}=Yh(),{menuPortal:v}=iy(),{menuPortal:A}=ay(),{menuPortal:_}=ty();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,n,{dataSourceApi:s})},[t.ready,n,s]);let F=my();Pe.useEffect(()=>{if(e){let O=e.getSnapshot();c.current=O.getMasterState().portalDOMRef.current}},[]);let L=r??Pe.createElement(Pe.Fragment,null,Pe.createElement(ss,null),Pe.createElement(on,null));return Pe.createElement("div",{"data-debug-id":F,onKeyDown:I,ref:u,...E},L,Pe.createElement("div",{ref:c,className:te(`${st}Portal`,lc[1e7],Yr.absolute,rc[0],tc[0])},x,v,A,_),g?Pe.createElement(Un,{key:"row-height",varName:g,onChange:d}):null,Pe.createElement(Un,{key:"flashing-duration",allowInts:!0,varName:pe.components.Cell.flashingDuration,onChange:p}),h?Pe.createElement(Un,{key:"row-detail-height",varName:h,onChange:f}):null,y?Pe.createElement(Un,{key:"column-header-height",varName:y,onChange:m}):null,P?null:Pe.createElement(em,null),Pe.createElement(Xh,null))});function vv({children:o,store:e}){let{componentActions:t,componentState:n}=At(),{scrollerDOMRef:r,scrollTopKey:i}=n,a=Fe(n),l=Bg({state:n,actions:t,getState:a}),s=Fe(l),u=Wr(),{getDataSourceState:c,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=Wt(),[m]=Pe.useState(()=>ym({getComputed:s,getState:a,getDataSourceState:c,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:n,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:c,getComputed:s,getState:a,api:m,dataSourceApi:f,children:o};return e.setSnapshot(g),Pe.useLayoutEffect(()=>{e.notify()}),zr(r,h=>{let y={width:h.width,height:h.height};t.bodySize=y},{earlyAttach:!0,debounce:50}),Pe.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),Pe.createElement(wv,null)}var uo=function(o){let[e]=Pe.useState(()=>eh()),t=ti();return Pe.createElement(Iv,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:Hy,columnHeaderHeight:Ky,...o},Pe.createElement(Pl,null,Pe.createElement(t.Provider,{value:e},Pe.createElement(vv,{children:o.children,store:e}))))};uo.Header=ss;uo.Body=on;uo.HScrollSyncContent=sy;uo.Footer=()=>Pe.createElement(uc,null);uo.GroupingToolbar=Ry;import*as By from"react";function V5(o){let{DataSource:e}=Pr({nodesKey:"children",...o});return By.createElement(e,null,o.children??null)}import*as jy from"react";var Wy=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Qe(i,{treePaths:n});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()};o(u)};function Pv(o){return jy.createElement(uo,{...o})}var Ma=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,n(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=qe(`IT:${e}:DataQuery`)}};function Hn(o){if(Array.isArray(o))return o.map(Hn);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=Hn(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var co=class co{constructor(e){this.queryCache=new Z;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Hn(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new Ma(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Hn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Hn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Hn(e);this.queryCache.delete(t)};if(this.options=e,co.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)}co.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=co.clients.get(e);t&&t.destroy()}static destroyAll(){co.clients.forEach(e=>{co.destroy(e.name)})}destroy(){co.clients.delete(this.options.name)}};co.clients=new Map;var Uy=co;var Dv={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},xv={instantEdit:Dv};import{useEffect as cY}from"react";function Ev(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var Aa=class Aa{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Aa.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Aa.DEFAULT_SIZE=10;var du=Aa;var _a=class _a{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??_a.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};_a.DEFAULT_SIZE=10;var pu=_a;import{useEffect as Mv,useRef as Oa}from"react";var Av=(o,e)=>o.every((t,n)=>t===e[n]),_v=(o,e)=>{let t=Oa(e),n=Av(e,t.current),r=Oa(!0);t.current=e;let i=Oa(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=Oa(o);l.current=o,Mv(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as Ov,useRef as Nr}from"react";var $y=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),fu=(o,e)=>{let{same:t,different:n,compare:r}=e,i=Nr(t),a=Nr(n),l=$y(t,i.current,r),s=!$y(n,a.current,r),u=Nr(!0);i.current=t,a.current=n;let c=Nr(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=Nr(o);p.current=o,l&&s&&(u.current=!1),Ov(()=>{if(!u.current)return p.current()},d)};import*as vt from"react";var Yy=J(ee.currentFlashingDuration),Fv=({children:o})=>vt.createElement(vt.Fragment,null,o),qy=1e3,Xy={up:ui({direction:"up"}).split(" "),down:ui({direction:"down"}).split(" "),neutral:ui({direction:"neutral"}).split(" ")},Zy=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=Fv}=o;return vt.forwardRef((i,a)=>{let l=Ti(),{flashingDurationCSSVarValue:s}=ne(I=>({flashingDurationCSSVarValue:I.state.flashingDurationCSSVarValue})),u=typeof s=="number"?s??e??qy:e??qy,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,y=vt.useRef(!0),S=vt.useRef(d),T=y.current?null:S.current;y.current=!1;let b=vt.useRef(void 0),R=vt.useRef(void 0),C=vt.useRef(void 0);return fu(()=>{if(d===S.current)return;let I=()=>{let M=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),C.current&&(clearTimeout(C.current),C.current=void 0),R.current&&M){let E=R.current,x=Xy[E];M.classList.remove(...t?[t,...x]:x),M.style.removeProperty(Yy),R.current=void 0}};S.current=d;let P=m.current;if(!P)return;I();let D=typeof d=="number"?d>T?"up":"down":"neutral",w=Xy[D];return P.style.setProperty(Yy,`${u}`),P.classList.add(...t?[t,...w]:w),R.current=D,b.current=setTimeout(I,u),I},{same:[h,g],different:[d]}),vt.createElement("div",{ref:c,...i,className:te(i.className)},n({children:i.children,oldValue:T}))})},Nv=Zy();import*as Je from"react";import{useEffect as Jy,useRef as Qy}from"react";import{createPortal as Lv}from"react-dom";function kv(o){let[e,t]=Je.useState(null);return Jy(()=>{let{debugTarget:n}=o,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[n]){let i=globalThis.INFINITE[n].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[o.debugTarget]),typeof e=="function"?Je.createElement(eS.Provider,{value:{getState:e}},Je.createElement(zv,null)):null}var eS=Je.createContext({getState:()=>null});function zv(){let o=Je.useContext(eS),{getState:e}=o,[,t]=kt(),n=e().renderer.cellManager;Jy(()=>{let s=Et(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=Qy(null),l=Qy(null);return Je.createElement("div",{style:{overflow:"auto"}},Lv(Je.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),Je.createElement("table",{style:{borderCollapse:"collapse"}},Je.createElement("thead",null,Je.createElement("tr",null,i.map(s=>Je.createElement("th",{key:s,"data-col-index":s},s)))),Je.createElement("tbody",null,r.map(s=>Je.createElement("tr",{key:s,"data-row-index":s},i.map(u=>Je.createElement("td",{key:u,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,u])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":u},Je.createElement("button",{onClick:()=>{let c=n.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 VY={CheckBox:To,LoadMask:Ea,MenuIcon:dr,StringFilterEditor:gn,NumberFilterEditor:ri};export{Dn as AutoScroller,We as CellSelectionState,Ct as DRAG_ITEM_ATTRIBUTE,Uy as DataClient,TK as DataSource,fI as DataSourceActionType,Z as DeepMap,Pl as DragDropProvider,fr as DragInteractionTarget,$o as DragList,du as FixedSizeSet,Nv as FlashingColumnCell,Rt as GroupRowsState,kv as INTERNAL_MatrixDebugger,uo as InfiniteTable,Xt as InfiniteTableClassName,wv as InfiniteTableComponent,$t as Menu,Dr as RowDetailCache,xt as RowDetailState,It as RowDisabledState,Me as RowSelectionState,V5 as TreeDataSource,ct as TreeExpandState,Pv as TreeGrid,Qe as TreeSelectionState,pu as WeakFixedSizeSet,$s as alignNode,VY as components,Zp as createDefaultProxy,Zy as createFlashingColumnCellComponent,Et as debounce,qe as debug,Qp as defaultDragProxyMove,om as defaultFilterFunction,zo as defaultFilterTypes,ds as defaultTreeFilterFunction,js as eventMatchesKeyboardShortcut,eg as filterDataArray,zo as filterTypes,qb as flatten,Mt as getComponentStateRoot,Fl as group,Ev as interceptMap,xv as keyboardShortcuts,oo as multisort,Cs as multisortNested,Hn as queryKeyToCacheKey,aR as toTreeDataArray,At as useComponentState,pI as useDataSourceApi,Pr as useDataSourceInternal,Oe as useDataSourceSelector,Rs as useDataSourceState,bo as useDragDropProvider,xn as useDragListContext,fu as useEffectWhen,_v as useEffectWhenSameDeps,Fn as useEffectWithChanges,mH as useEffectWithObject,iu as useGridScroll,Rv as useInfiniteColumnApi,Ti as useInfiniteColumnCell,zl as useInfiniteColumnEditor,Zn as useInfiniteColumnFilterEditor,ni as useInfiniteHeaderCell,nv as useInfinitePortalContainer,Cv as useInfiniteTableApi,fH as useLayoutEffectWithChanges,dg as useManagedDataSource,No as useMasterRowInfo,lo as useOverlay,fw as useOverlayPortal,Lo as usePrevious,CK as useRowInfoReducers,$w as useVisibleColumnSizes,Wy as withSelectedLeafNodesOnly};
29
+ `,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},VI=o=>{let e="",t=o.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let u=t[s];if(Hs(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Hs(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),zI(t)};var HI=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,KI=/(https):\/\/\S+(\.csb\.app)/g,Ug=typeof window<"u"?window.location.origin:"",BI=()=>{let[o,e,t]=Array.from(HI.exec(Ug)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},WI=()=>{let[o,e,t]=Array.from(KI.exec(Ug)||[]);return e==="https"&&t===".csb.app"},jI=WI()||BI(),$g=(o="")=>{let t=!!No();return GI(()=>{if(t)return!0;let r=jg(o,{publishedAt:1624970570587,version:"10.1.2"});return!o&&!r&&jI?!0:r},[o,t])};import{useRef as Yg,useEffect as qg}from"react";var UI=10;function Xg(o,e,t){let n=Yg(!1),r=Yg(null);qg(()=>{o!=null&&(n.current=!1,Ot(r.current))},[o]),qg(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,Ot(r.current),r.current=Ve(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<UI&&a(l)})};var i=a;a()}return()=>{Ot(r.current)}},[o,e])}import{useRef as Zg,useEffect as Qg}from"react";var $I=10;function Jg(o,e,t){let n=Zg(!1),r=Zg(null);Qg(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),Qg(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<$I&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}function eh(){return mo()}import{useCallback as tw,useMemo as ow,useEffect as nw}from"react";function th(o,e){o.getComputed().multiRowSelector.lastPointerDown={rowIndex:o.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var YI={Enter:!0," ":!0,a:!0};function oh(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=o,{key:l,ctrlKey:s,metaKey:u}=e;if(!YI[l])return!1;let c=t(),d=n(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=c,{selectionMode:h,rowSelection:y,treeSelectionState:S,isTree:T}=d;if(g===!1)return!1;let b=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null;if(!(b!=null?d.dataArray[b]:null)||b==null)return!1;if(l===" "&&(h==="single-row"||h==="multi-row")){let C={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return yi({...o,rowIndex:b},C,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||u)){if(T&&S){let I=a(S);return I.selectAll(),r.treeSelection=I,!0}let C=i(y);return C.selectAll(),r.rowSelection=C,!0}return!1}var nh=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),rh=o=>Array.from(o.querySelectorAll(nh)).filter(t=>!!t.offsetParent),fa=o=>o.querySelector(nh);var ah=rn(Go());async function ih(o,e=10,t=300){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})}var qI=10,XI=(o,e)=>o-e;function ma(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=n(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=ut(p.id,e);return p.contentFocusable({column:p,...wn({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Ks(o,e,t){let n=t.getState().editingCell;return ZI(o,e,t,{isCellFocusable:ma,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function lh(o,e,t){let n=(0,ah.default)(t,o+e,XI);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=lh;function ZI(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=o.rowIndex,c=o.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:lh(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 sh(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=ma(e,o)?e:Ks(e,-1,o);if(t){await Bs([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;fa(n)?.focus()}}async function Bs([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=qI,l=null,s=!1;function u(c=0){c++,Ot(l),l=Ve(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&c<a&&u(c),s){try{await ih(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var QI=`.${Bt}`;function uh(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:yo(n,QI),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}=o.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&ma({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:Ks({rowIndex:l,colIndex:s},t,o);if(!u){if(t===-1)r.focus();else{let c=rh(document.body),d=o.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return Bs([u.rowIndex,u.colIndex],o).then(()=>{let c=o.getState().getDOMNodeForCell(u);if(!c)return;fa(c)?.focus()}),!0}var ch={control:"ctrl"},dh={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},JI={esc:"escape"},fh={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},mh=Object.keys(fh),Ws=new Set(mh),ew=new Set(["shift","alt"]);function js(o,e){return Array.isArray(e)?e.some(t=>ph(o,t)):ph(o,e)}function ph(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>dh[p]),i=n.map(p=>ch[p]||dh[p]||JI[p]||p),a=i.filter(p=>Ws.has(p)),l=i.filter(p=>!Ws.has(p)),s=mh.reduce((p,f)=>(p[f]=fh[f](o),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=>!ew.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Ws.has(t)||t==="meta"||ch[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function gh(o,e){let t={...o,cloneRowSelection:a=>In(a,o.getDataSourceState),cloneTreeSelection:a=>Rn(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&oh(t,e)&&e.preventDefault(),(uh(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&mm(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,u=o.getComputed().computedVisibleColumns[s];u.computedEditable&&o.api.startEdit({rowIndex:l,columnId:u.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!js(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function rw(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=He(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=Wt();return ow(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>Rn(c,i),cloneRowSelection:c=>In(c,i)}),[o,e,i,a,t,l,n])}function iw(){let o=rw();nw(()=>{let e=o.getState().keyDown.onChange(a=>{gh(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],u=ut(s.id,o);sp({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=o.getComputed().computedVisibleColumns[u],d=ut(c.id,o);th({...o,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function aw(){let{getState:o}=ne(t=>({getState:t.getState}));return{onKeyDown:tw(t=>{o().keyDown(t)},[])}}function hh(){return iw(),aw()}import{useEffect as $h}from"react";import*as Ke from"react";import{useCallback as Ys,useEffect as sw,useLayoutEffect as uw,useState as ha}from"react";import{createPortal as cw}from"react-dom";var ga="__is_infinite_menu_component";function Us(o){return!!o.tagName}function bh(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=we.from(Us(e)?e.getBoundingClientRect():e),a=we.from(Us(t)?t.getBoundingClientRect():t),l=n?we.from(Us(n)?n.getBoundingClientRect():n):null;if(!l)return{...yh({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=yh({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 yh(o){let e=we.from(o.targetRect),t=we.from(o.anchorRect),n=o.constrainRect?we.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Sh(e,i),s=Sh(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function Sh(o,e){return e==="TopLeft"?Be.from({top:o.top,left:o.left}):e==="TopCenter"?Be.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Be.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Be.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Be.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Be.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Be.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Be.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Be.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function lw(o){return o&&typeof o.then=="function"||o instanceof Promise}function Ch(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Th(o){return typeof o=="function"&&(o=o()),lw(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&Ch(o)&&(o=o.getBoundingClientRect()),o?we.from(o):null}async function Rh(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),Ch(n)&&(r=n),r||null}return t(await e)}async function $s(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Th(t)||void 0,a=n?await Th(n):void 0,l=we.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=bh({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=o.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=o.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function dw(o){return Ke.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function pw(o){let e=Ke.useRef(null);return sw(()=>o.realign.onChange(t=>{e.current&&t&&$s(e.current,t)}),[o.realign]),Ke.createElement("div",{style:{position:"absolute",top:0,left:0},ref:Ys(t=>{t&&$s(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function fw(o,e){let[t,n]=ha(null);return uw(()=>{async function r(){let i=e?await Rh(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?cw(o,t):Ke.createElement(Ke.Fragment,null):e===null||e===!1?o:Ke.createElement(dw,null,o)}function mw(o){if(Ke.Children.count(o)===1){let e=Ke.Children.only(o);if(Ke.isValidElement(e))return e.props.id||e.key}return null}function gw(o,e,t){if(Ke.Children.count(o)===1){let n=Ke.Children.only(o);if(Ke.isValidElement(n)&&n.type[ga]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Ke.cloneElement(n,r)}}return o}function lo(o){let e=o,[t]=ha(()=>new Map),[n,r]=ha(null),[i,a]=ha(0),l=Ys(()=>{let m=[];for(let[g,h]of t)m.push(Ke.createElement(pw,{...h,key:h.key}));return m},[]),[s,u]=kt(),c=fw(l(),o.portalContainer),d=Ys((m,g)=>{let y=`${g.id||mw(m)||Dt()}`,S=t.get(y),T=C=>()=>{let I=typeof C=="function"?C():C;return gw(I,e.portalContainer,g.constrainTo??e.constrainTo)},b=T(m),R=(C,I)=>{if(!S)return;let P=T(C);Object.assign(S,{children:P}),u(),!!!I?.skipRealign&&(r(S.key),a(Date.now()))};return S?(Object.assign(S,g),R(m),R):(S={key:y,children:b,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Se()},t.set(S.key,S),u(),R)},[t,e.portalContainer,u]);Ke.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return Ke.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}import*as jh from"react";import*as kn from"react";import*as Nh from"react";import*as Oh from"react";function ya(o){return null}ya.defaultProps={__is_menu_item:!0};var Ih="submenu",hw="-";function wh(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Dt(),focused:!1,destroyed:!1,domRef:{current:null}}}function vh(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var qs=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===hw?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},yw=[{name:"label"}],Ph=(o,e)=>{let{props:t,state:n}=o,{activeItemKey:r,keyboardActiveItemKey:i}=n,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:u}=t,c=t.id||n.generatedId;u&&(c=`${u}-${c}`);let d=[...t.columns||yw],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:c},f=[];a?f=a.map(g=>qs(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==Ih)&&d.push({name:Ih,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:c}};import*as Ln from"react";var Dh="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",xh=ye({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"]]}),Eh="db3arf1",Mh="db3arfd";function Ah(){return Ln.createElement("hr",{className:Mh})}var Sa={renderSeparator:()=>Ln.createElement(Ah,null),renderSubmenuColumn:({domProps:o,item:e})=>e.menu?Ln.createElement("div",{...o},Ln.createElement(jo,{expanded:!1})):Ln.createElement("div",{...o})};var _h=(o,e)=>qs(o,e,Sa);function Fh(o,e){return Oh.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===ya)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),_h(o,n)}return _h(o,t)})||[]}function Lh(){return{...wh(),domRef:Nh.createRef()}}var kh=()=>vh(),zh=o=>Ph(o,{...Sa,childrenToRuntimeItems:Fh});import*as Lt from"react";import{useCallback as en,useLayoutEffect as Pw,useRef as Dw,useState as Qs}from"react";function Vh(o,e){let t=Gh(o,e);if(!t.length)return null;let n=we.from(t[0]?.getBoundingClientRect()),r=we.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function Gh(o,e){let t=yo(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function Hh(o,e){let t=Gh(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}var Mr=class extends Sn{constructor(e){super(e.slice(0,3))}};var Sw=250;function bw(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}Ve(i)};Ve(()=>{i()})})}var Tw=De(),ba=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||Sw;this.getPointerMoveTarget=()=>document.documentElement||Tw;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 Be({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 Mr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Mr([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,bw(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Be({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};import{createContext as Cw,useContext as Rw}from"react";var Xs=Cw(null);function Zs(){return Rw(Xs)}import{useCallback as Iw,useEffect as ww,useRef as vw}from"react";function Kh(){let o=vw(!0);return ww(()=>(o.current=!0,()=>{o.current=!1}),[]),Iw(()=>o.current,[])}function xw(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=o.menu;return c?(typeof c=="function"&&(c=c()),Lt.createElement($t,{key:u,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),n(p)},onHideIntent:d=>{c?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function Ew({onItemActivate:o}){let{getState:e}=Zs(),[{onItemEnter:t,onItemLeave:n}]=Qs(()=>new ba({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?we.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:en(t,[]),onItemLeave:en(n,[])}}function Bh(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:y}=Zs(),S=en(V=>{h.keyboardActiveItemKey=V},[]),T=en(V=>{h.activeItemKey=V},[]),b=Kh(),[R,C]=Qs(null),I=null;Pw(()=>{let{runtimeItems:V}=y(),j=V.filter(re=>re.type==="item"&&i===re.key)[0];if(!j||!j.menu){C(null),M();return}if(j){let re=Vh(r,j.key);re&&D(()=>xw(j,{constrainTo:l,setSubmenuApi:C,setActiveItemKey:T,setKeyboardActiveItemKey:S,parentMenuId:r,onHideIntent:K,api:W}),{id:`${r}-submenu`,alignTo:re,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let P=(V,j)=>{S(j.key),T(j.key),j.originalMenuItem.onClick&&j.originalMenuItem.onClick(V);let re={key:j.key,item:j.originalMenuItem,hideMenu:K};j.originalMenuItem.onAction&&j.originalMenuItem.onAction(re),u&&u(re),j.originalMenuItem.hideMenuOnAction&&K()},{showOverlay:D,portal:w,clearAll:M}=lo({portalContainer:!1}),{onItemEnter:E,onItemLeave:x}=Ew({onItemActivate:V=>{if(!b())return;let j=V?V.key:null;T(j)}});I=n.map((V,j)=>Lt.createElement(Mw,{key:V.type==="item"?V.key:j,onItemEnter:(re,de)=>{E(re.key,de)},onItemLeave:(re,de)=>{x(re.key,de)},columns:t,active:V.type==="item"&&V.key===i,keyboardActive:V.type==="item"&&V.key===a,item:V,index:j,onClick:P}));let v=t.map(V=>V.width||(typeof V.flex=="number"?`${V.flex}fr`:V.flex)||"auto").join(" "),A={...e.style,gridTemplateColumns:v,gridTemplateRows:n.map(()=>"auto").join(" ")};c||(A.whiteSpace="nowrap");function _(V){let{runtimeItems:j,runtimeSelectableItems:re}=y(),de=j.findIndex(U=>U.type==="item"&&U.key===a),se=a,ae=j[de],ce={ArrowUp:()=>{let U=j.slice(0,de).filter(z=>z.type==="item"&&!z.disabled).pop();U&&U.type==="item"&&U.key&&(se=U.key)},ArrowDown:()=>{let U=j.slice(de+1).filter(z=>z.type==="item"&&!z.disabled)[0];U&&U.type==="item"&&U.key&&(se=U.key)},Home:()=>{ce.PageUp()},End:()=>{ce.PageDown()},PageUp:()=>{se=re[0].key},PageDown:()=>{se=re[re.length-1].key},ArrowLeft:()=>{T(null),y().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{ae&&(T(ae.key),Ve(()=>{b()&&R&&R.getParentMenuId()===y().menuId&&R.focus()}))},Enter:()=>{if(ae)if(ae.originalMenuItem?.menu){if(ae&&ae.originalMenuItem.menu&&R){ce.ArrowLeft();return}ae&&T(ae.key)}else P(V,ae)}," ":()=>{if(!ae)return;ae.originalMenuItem.menu||P(V,ae);let U=Hh(r,ae.key);U&&U.click()},Escape:()=>{ce.ArrowLeft();let U=y();U.parentMenuId||U.onHideIntent?.(U)}},ue=ce[V.key];ue&&(ue(),V.preventDefault()),se!=a&&S(se)}function F(){h.focused=!1}let L=en(function(){h.focused=!0,setTimeout(()=>{O.current&&g.current&&g.current===document.activeElement&&y().keyboardActiveItemKey==null&&S(y().runtimeSelectableItems[0]?.key??null)})},[]),O=Dw(!0),K=en(()=>{let V=y();V.onHideIntent?.(V)},[y]),[W]=Qs(()=>({hideMenu:K,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),L())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),k=en(V=>{V?(g.current=V,d?.(y(),W),f&&W.focus()):(p?.(y()),g.current=V)},[]),Q=Lt.createElement("div",{className:cn.contents},Lt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:k,onKeyDown:V=>{e.onKeyDown?.(V),_(V)},onMouseDown:V=>{O.current=!1,e.onMouseDown?.(V)},onMouseUp:V=>{O.current=!0,e.onMouseUp?.(V)},onFocus:L,onBlur:F,className:te(Dh,e.className,"InfiniteMenu"),style:A},I),w);return s?null:Q}function Mw(o){let[e,t]=Lt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=Lt.createElement("div",{style:r.style},r.value);else{let c=0;u=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<c)return null;c=h;let S={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:h},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:te(xh({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:T=>{r.disabled||o.onItemEnter?.(r,T)},onPointerLeave:T=>{r.disabled||o.onItemLeave?.(r,T)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:T=>{r.disabled||o.onClick(T,r)}};return d.render?Lt.createElement(sr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:S}}):Lt.createElement("div",{key:`${s}-${m}`,...S},f[m])}).filter(Boolean)}return Lt.createElement("div",{className:Eh},u)}var{ManagedComponentContextProvider:Aw}=Mt({initSetupState:Lh,forwardProps:kh,mapPropsToState:zh,layoutEffect:!0});function _w(o){let{componentActions:e,componentState:t}=At(),n=Fe(t);return kn.createElement(Xs.Provider,{value:{componentActions:e,componentState:t,getState:n}},kn.createElement(Bh,{domProps:o.domProps}))}function $t(o){let{children:e,portalContainer:t,items:n,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:y,...S}=o;return kn.createElement(Aw,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...o},kn.createElement(_w,{domProps:S}))}$t[ga]=!0;import*as Js from"react";function Wh(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a,getState:l}=e,s=l().components?.CheckBox||To,c=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...c,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{let h=Vo(m,e,"column-menu");p.push({key:g,label:h,check:Js.createElement(s,{key:m.id,disabled:m.computedVisible&&i.getVisibleColumnsCount()===1,checked:m.computedVisible,onChange:y=>{let S=!!y;i.setVisibilityForColumn(m.id,S),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}},"-",{key:"group-by",label:"Group by",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{if(m.groupByForColumn)return;let h=Vo(m,e,"column-menu");p.push({key:g,label:h,check:Js.createElement(s,{key:m.id,disabled:!m.computedGroupable,checked:m.computedGroupedBy,onChange:()=>{a.toggleGroupByField(m.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}}].filter(p=>!!p)}function Uh(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??$t,s=n().computedColumnsMap.get(o);if(!s)return null;let u={column:s,columnApi:ut(s.id,e),...e},c=Wh([],u),d=a?a(c,u):c,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:jh.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var Ow=`[${ur["data-name"]}="${cr["data-name"]}"]`;function Fw(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){n(),a.columnMenuVisibleForColumnId=null}let c=o.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[${Xf["data-column-id"]}="${e}"] ${Ow}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Uh(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Yh(){let o=He(),{getState:e,actions:t,columnMenuVisibleForColumnId:n,columnMenuVisibleKey:r}=ne(u=>({getState:u.getState,actions:u.actions,columnMenuVisibleForColumnId:u.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:u.state.columnMenuVisibleKey})),{portalDOMRef:i}=Yt(u=>({portalDOMRef:u.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=lo({portalContainer:i?.current??!1});return $h(()=>{let u=e();return u.onColumnMenuClick.onChange(c=>{c&&(u.columnMenuTargetRef.current=c.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=c.column.id)})},[]),$h(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=e();if(u){let p=function(f){f.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),Fw({columnId:u,context:o,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,s();return()=>{}},[n,r]),{menuPortal:l}}import*as qh from"react";import{useCallback as Nw}from"react";var Lw={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function Xh(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=He(),{getDataSourceState:a,getDataSourceMasterContext:l}=Wt(),{focusDetectDOMRef:s}=o(),u=Nw(async()=>{sh({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return qh.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:Lw})}import{useEffect as Ar}from"react";function kw(){let o=He(),{getState:e,editingCell:t}=ne(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active?t.cancelled:void 0;Ar(()=>{if(n){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=Rr(o,i);if(!a){Ir("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[n])}function zw(){let o=He(),{getState:e,editingCell:t}=ne(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;Ar(()=>{if(n){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=Rr(o,i);if(!a){Ir("onEditRejected",i);return}r({...a,value:i.value,error:n,initialValue:i.initialValue})}},[n])}function Vw(){let o=He(),{editingCell:e}=ne(r=>({editingCell:r.state.editingCell})),t=e?.active,n=Lo(t);Ar(()=>{!t&&n&&o.api.focus()},[t,n])}function Gw(){let o=He(),{editingCell:e,getState:t}=ne(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e&&!e.active&&!e.cancelled&&e.accepted===!0;Ar(()=>{if(n){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=Rr(o,i);s?r({...s,value:a,initialValue:l}):Ir("onEditAccepted",i)}o.api.persistEdit({value:a})}},[n])}function Hw(){let o=He(),{editingCell:e,getState:t}=ne(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e?e.persisted:void 0;Ar(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=n instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=Rr(o,r);if(!s){Ir(l,r);return}let u={...s,value:r.value,initialValue:r.initialValue};n instanceof Error?i?.({...u,error:n}):a?.(u)}},[n])}function Zh(){kw(),zw(),Gw(),Hw(),Vw()}import{useEffect as ey}from"react";import*as Oo from"react";import*as eu from"react";var Ta=o=>eu.createElement(ke,{...o},eu.createElement("path",{d:ze.clear[0]}));import*as tu from"react";var Qh=o=>tu.createElement(ke,{...o},tu.createElement("path",{d:ze.done[0]}));function Jh(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=c?.Menu??$t,f=n().computedColumnsMap.get(o);if(!f)return null;let m=I=>{I.__insideMenu=!0},g=I=>{I.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),y=h[f.computedFilterType];if(!y)return null;let S=y.operators.map(I=>{let P=I.name,D=f.computedFilterValue?f.computedFilterValue.filter.operator===P:P===y.defaultOperator,w=I.components?.Icon??pn;return{key:P,icon:Oo.createElement(w,null),label:Oo.createElement(Oo.Fragment,null,I.label??I.name),onAction:()=>{u.setColumnFilterOperator(o,P)},checked:D?Oo.createElement(Qh,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Oo.createElement(Ta,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(o)}},"-"],...S],R={column:f,api:u,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},C=d?d(b,R):b;return Oo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,onShow:I=>{I.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:I=>{g(I),t?.()}})}var Ca=10;function ty(){let{portalDOMRef:o}=Yt(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=He(),{getState:t,actions:n}=e,{showOverlay:r,portal:i,clearAll:a}=lo({portalContainer:o?.current??!1});return ey(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:u,column:c}=s;function d(){a(),n.filterOperatorMenuVisibleForColumnId=null}let p=u?.parentElement||u,f=we.from(p.getBoundingClientRect());f.top-=Ca,f.left-=Ca,f.width+=2*Ca,f.height+=2*Ca,r(()=>Jh(c.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:f,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),n.contextMenuVisibleFor=null,n.cellContextMenuVisibleFor=null,n.columnMenuVisibleForColumnId=null,n.filterOperatorMenuVisibleForColumnId=c.id}),[]),ey(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as Ia}from"react";import*as ru from"react";import*as ou from"react";function _r(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function Ra(o){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),o.onHideIntent?.()}}}function nu(o,e,t){if(!o)return null;let n=Se();return o.then(r=>{let{items:i,columns:a}=_r(r);i&&i.length&&n(ou.createElement(t,{...e,items:i||[],columns:a}))}),ou.createElement(Po,{updater:n})}function oy(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=s?.Menu??$t,{computedColumnsMap:d}=a(),p=d.get(n),f={...Kt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=Ra({onHideIntent:t}),g=u(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:nu(g,m,c),preventDefault:h};let{items:y,columns:S}=_r(g);return!y||!y.length?{cellContext:f,menu:null,preventDefault:Array.isArray(y)}:{preventDefault:h,menu:ru.createElement(c,{...m,columns:S,items:y}),cellContext:f}}function ny(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??$t,{computedColumnsMap:s}=r(),u=o.columnId?s.get(o.columnId):void 0,c=u?{...o,...Kt({...e,rowIndex:o.rowIndex,columnId:u.id})}:o;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=Ra({onHideIntent:t}),p=a(c,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:c,menu:nu(p,d,l),preventDefault:f};let{items:m,columns:g}=_r(p);return!m||!m.length?{cellContext:c,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:ru.createElement(l,{...d,columns:g,items:m}),cellContext:c}}var wa=5,ry=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function iy(){let o=He(),{portalDOMRef:e}=Yt(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=lo({portalContainer:e?.current??!1});return Ia(()=>{let{actions:l,getState:s,getDataSourceState:u}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:h}=oy(d,o,f),y=we.fromPoint({top:p.clientY,left:p.clientX});y.width+=wa,y.height+=wa,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:ry}),h&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:S}=s();S&&S({...g,getState:s,getDataSourceState:u},p)})},[]),Ia(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function ay(){let o=He(),{portalDOMRef:e}=Yt(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=lo({portalContainer:e?.current??!1});return Ia(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=ny(c,o,p),h={top:d.clientY,left:d.clientX},y=we.fromPoint(h);y.width+=wa,y.height+=wa,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:ry}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:h,...c};let{onContextMenu:S}=s();S&&S({...o,...m},d)})},[]),Ia(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as Ww}from"react";import*as ly from"react";import{useCallback as Kw,useEffect as Bw}from"react";function iu(o,e){let{brain:t}=ne(r=>({brain:r.state.brain})),n=Kw(o,e);Bw(()=>t.onScroll(n),[t,n])}var au="yzx0vj0";function sy(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=Ww(null);iu(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),n==="column"?l.minWidth=pe.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=pe.runtime.bodyWidth),t==="column"?l.maxWidth=pe.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=pe.runtime.bodyWidth),ly.createElement("div",{ref:a,...i,className:i.className?te(i.className,au):au,style:l},i.children)}var jw=J(ee.columnWidthAtIndex),Uw=J(ee.columnOffsetAtIndex);function $w(){let{computedVisibleColumns:o}=ne(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return o.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${jw}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${Uw}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var va="InfiniteTable";import{useEffect as Yw}from"react";function uy(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=ne(c=>({getState:c.getState,actions:c.actions,dataSourceActions:c.dataSourceActions,getDataSourceState:c.getDataSourceState})),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),Yw(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,y=(r&&r.length>0||i)&&h>0?h:null;return f!=y&&(t.rowsPerPage=y,g=!0),m!=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])}import{useEffect as Pa,useRef as Xw}from"react";function qw(){let o=[],e=t=>{Object.keys(t).forEach(n=>{let r=t[n];if(typeof r=="string"){let i=J(r);if(i.includes("dont-override"))return;o.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...pe,loaded:void 0,runtime:void 0}),o}function cy(o){if(!o)return{};let e=qw(),t=getComputedStyle(o),n={};return e.forEach(r=>{n[r]=t.getPropertyValue(r).trim()}),n}var Or=ye({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),dy="_143ofgf5",py="_143ofgf3";var Zw=J(pe.loaded),lu={source:"infinite-table-page",target:"infinite-table-devtools-background"};function fy(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...lu,url:su(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...lu,url:su(),type:t,payload:{debugId:n,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:cy(l.domRef.current),themeVarOverrides:{...jt.get(n)||{}}}}}var su=lt(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function Qw(o){window.postMessage(o)}var Jw=lt(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){dt.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(fy({type:"update",debugId:e},t))}else ag(e),window.postMessage(fy({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,qe.onLogIntent("IT:*",e=>{Qw({...lu,url:su(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let n="";try{n=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return n}return String(t)}),timestamp:e.timestamp}})}),o});function my(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=ne(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(Zw)!==`${ad}`&&wr({debugId:i,key:"CSS001_CSS"}),Pa(()=>{e().debugId!==i&&(t.debugId=i)},[i]),ov()}var Da=Se(),ev={revertAll:o=>{let e=dt.get(o.debugId);if(e){let t=Ao.get(o.debugId);Ao.delete(o.debugId),no.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=io.get(o.debugId);io.delete(o.debugId),ro.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=dt.get(o.debugId);if(e){let t=o.property,n=no.get(o.debugId),r=Ao.get(o.debugId),i=ro.get(o.debugId),a=io.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=io.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:o=>{let e=dt.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),_o(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),_o(o.debugId))}}},discardAllWarnings:o=>{let e=dt.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),_o(o.debugId))},setColumnVisibility:o=>{Ms(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{aa(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{Ms(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{aa(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{aa(o.debugId,"multiSort",o.multiSort)},setCssVar:o=>{let e=dt.get(o.debugId),t=e?.getState().domRef.current;!e||!t||!o.name?.startsWith("--infinite-")||(t.style.setProperty(o.name,o.value),jt.set(o.debugId,{...jt.get(o.debugId)||{},[o.name]:o.value}),_o(o.debugId))},revertCssVar:o=>{let e=dt.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(o.name);let n={...jt.get(o.debugId)||{}};delete n[o.name],jt.set(o.debugId,n),_o(o.debugId)},revertAllCssVars:o=>{let e=dt.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let n=jt.get(o.debugId)||{};Object.keys(n).forEach(r=>{t.style.removeProperty(r)}),jt.delete(o.debugId),_o(o.debugId)},highlight:o=>{let e=dt.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${Or.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Or.classNames.base),r.innerHTML=[`<div class="${py}"></div>`,`<div class="${dy}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Or.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Or.classNames.variants.active.true)}}}}};function tv(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(Jw(),Da(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=ev[e];t&&t(o.data.payload)}})}tv();function ov(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=ne(c=>({getState:c.getState,getComputed:c.getComputed,getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions,actions:c.actions,dataSourceApi:c.dataSourceApi,api:c.api})),s=o().debugId,u=Xw(s);return u.current=s,Pa(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=Da.get();if(p){d(p);return}return Da.onChange(f=>{f&&d(f)})},[]),Pa(()=>{let c=u.current;if(!c)return;let d=Da.get();d&&d(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),Pa(()=>{if(s)return()=>{let c=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;c&&c(s,null)}},[s]),s}function nv(){let{masterPortalDOMRef:o}=Yt(n=>({masterPortalDOMRef:n.getMasterState().portalDOMRef}))??{},e=ne(n=>n.state.portalDOMRef);return o?.current??e?.current}import*as wt from"react";import{useCallback as rv}from"react";var gy="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",hy=ye({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),yy="hs68h81",Sy=ye({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"]]});import*as tn from"react";function by(o){return tn.createElement("div",{...o.domProps})}function Ty(o){let{active:e}=o;return tn.createElement("div",{className:yy},e?"Drop to group":"Drag columns to group")}function Cy(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return tn.createElement("div",{...o.domProps},o.label,tn.createElement("div",{className:$r[1]}),tn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:gy,onKeyDown:e,onMouseDown:o.onClear},tn.createElement(Ta,{size:20})))}var iv=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};De().addEventListener("mousemove",i,{once:!0}),De().addEventListener("mouseup",()=>{r||(De().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function av(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=xn(),u=l===zn,c=He(),d=(e?Vo(e.id,c,"grouping-toolbar"):r)??i,p=e?wt.createElement(Ri,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=wt.createElement(wt.Fragment,null,d,p),m=s===i&&l===zn,g=te(hy({draggingInProgress:u,active:m}),o.domProps?.className),h=iv(a,o.domProps?.onMouseDown),y={...o.domProps,className:g,onMouseDown:h},S=n?.ToolbarItem??Cy;return wt.createElement(S,{active:m,domProps:y,column:e,field:r,label:f,onClear:t})}var zn="grouping-toolbar";function Ry(o){let{groupBy:e}=Oe(T=>({groupBy:T.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:n,api:r}=ne(T=>({getComputed:T.getComputed,dataSourceApi:T.dataSourceApi,api:T.api})),{dropTargetListId:i,dragSourceListId:a}=bo(),{fieldsToColumn:l,computedColumnsMap:s}=t(),u=i===zn,c=a===zn,d=o.components?.Placeholder??Ty,p=o.components?.Host??by,f=e.length?wt.createElement(wt.Fragment,null,e.map((T,b)=>{let R=T.field?l.get(T.field):void 0,C=`${T.field??`idx-${b}`}`;return wt.createElement($o.DraggableItem,{key:C,id:C},I=>wt.createElement(av,{id:C,components:o.components,domProps:I,field:T.field,column:R,toggleSorting:()=>{R&&r.toggleSortingForColumn(R.id)},onClear:()=>{let P=e.filter(D=>D!==T).filter(Boolean);n.setGroupBy(P)}}))})):wt.createElement(d,{draggingInProgress:c,active:u,groupBy:e}),m=T=>{let b=T.map(R=>e[R]);n.setGroupBy(b)},g=T=>{let{dragItemId:b}=T,R=b,C=s.get(R);if(!C||!C.field||!C.computedGroupable)return;let I=[...e];I.splice(T.dropIndex,0,{field:C.field}),n.setGroupBy(I)},h=rv(T=>{let{computedColumnsMap:b}=t(),R=T.dragItem.id,C=b.get(R);return!(!C||!C.computedGroupable||e.some(I=>I.field===C.field))},[e]),y=o.orientation??"horizontal",{domProps:S}=o;return wt.createElement($o,{orientation:y,dragListId:zn,acceptDropsFrom:["header",zn],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:h},(T,{draggingInProgress:b,status:R})=>{let C=te(Sy({active:u,orientation:y,draggingInProgress:b,dropRejected:R==="rejected"}),T.className,S?.className),I={...T,...S,className:C,children:f};return wt.createElement(p,{active:u,rejectDrop:R==="rejected",domProps:I,orientation:y})})}import*as Gn from"react";import{useMemo as uu}from"react";import{useCallback as pv,useEffect as Fr,useRef as fv}from"react";import*as xa from"react";function Iy(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return Bi(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}import*as so from"react";var wy=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as Dy}from"react";function lv(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function sv(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=jm(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(o,l),r.detailDataSourcesStateToRestore=a}function vy(o,e){let t={current:!1};return{currentRowCache:{getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)},cacheCalledByRowDetailRenderer:t}}function Py(o){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=o,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),u={registerDetail:lt(c=>{if(n.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)});return}lv(e.id,{masterState:r(),detailContext:c}),requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)}),c.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&sv(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 xy(o){let{rowDetailsCache:e,rowInfo:t}=o,{getDataSourceState:n,dataSourceActions:r}=Oe(u=>({getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions})),{getMasterState:i}=ne(u=>({getMasterState:u.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=Dy(()=>vy(t.id,e),[e,t.id]),s=Dy(()=>Py({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:n,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Ey(){return mo()}var{rootClassName:uv}=Le,cv=`${uv}RowDetail`;function dv(o){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:n,rowInfo:r,detailOffset:i,rowDetailsCache:a}=o,{masterDetailContextValue:l,currentRowCache:s}=xy({rowDetailsCache:a,rowInfo:r}),u=sn(),[c]=so.useState(()=>Ey());return c.setSnapshot(l),so.useLayoutEffect(()=>{c.notify()},[l]),so.createElement(u.Provider,{value:c},so.createElement("div",{ref:e,className:te(cv,wy({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${ee.bodyWidth} - ${ee.scrollbarWidthVertical})`,height:n}},t(r,s)))}var My=so.memo(dv);var mv=1;function Ay(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{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:y,cellClassName:S,cellStyle:T,repaintCellsKey:b,rowStyle:R,rowDetailCache:C,rowClassName:I,onScrollToTop:P,onScrollToBottom:D,onScrollStop:w,scrollToBottomOffset:M,wrapRowsHorizontally:E,updatedAt:x,ready:v,editingCell:A}=ne(G=>({actions:G.actions,getState:G.getState,getComputed:G.getComputed,getDataSourceMasterContext:G.getDataSourceMasterContext,rowHeight:G.state.rowHeight,rowDetailHeight:G.state.rowDetailHeight,onRowMouseEnter:G.state.onRowMouseEnter,onRowMouseLeave:G.state.onRowMouseLeave,groupRenderStrategy:G.state.groupRenderStrategy,brain:G.state.brain,showZebraRows:G.state.showZebraRows,rowDetailRenderer:G.state.rowDetailRenderer,isRowDetailsExpanded:G.state.isRowDetailExpanded,isRowDetailsEnabled:G.state.isRowDetailEnabled,cellClassName:G.state.cellClassName,cellStyle:G.state.cellStyle,repaintCellsKey:G.state.repaintCellsKey,rowStyle:G.state.rowStyle,rowDetailCache:G.state.rowDetailCache,rowClassName:G.state.rowClassName,onScrollToTop:G.state.onScrollToTop,onScrollToBottom:G.state.onScrollToBottom,onScrollStop:G.state.onScrollStop,scrollToBottomOffset:G.state.scrollToBottomOffset,wrapRowsHorizontally:G.state.wrapRowsHorizontally,updatedAt:G.state.updatedAt,ready:G.state.ready,editingCell:G.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:F,computedVisibleColumns:L,computedColumnsMap:O,computedColumnOrder:K,computedRowHeight:W,computedRowSizeCacheForDetails:k,fieldsToColumn:Q,rowspan:V,toggleGroupRow:j,columnSize:re}=e,de=uu(()=>L.map(G=>G.id),[L]),{dataArray:se,rowInfoStore:ae,selectionMode:ce,cellSelection:ue,isNodeReadOnly:U,getDataSourceState:z,dataSourceApi:Y,dataSourceActions:$}=Oe(G=>({dataSourceApi:G.dataSourceApi,dataSourceActions:G.dataSourceActions,getDataSourceState:G.getDataSourceState,dataArray:G.dataSourceState.dataArray,rowInfoStore:G.dataSourceState.rowInfoStore,selectionMode:G.dataSourceState.selectionMode,cellSelection:G.dataSourceState.cellSelection,isNodeReadOnly:G.dataSourceState.isNodeReadOnly})),X=Fe(se);Iy({columnSize:re,brain:f,computedPinnedStartColumns:_,computedPinnedEndColumns:F,computedVisibleColumns:L,computedRowHeight:W,dataArray:se,bodySize:t,rowspan:V});let q=fv(0);Fr(()=>f.onRenderCountChange(()=>{q.current=f.scrollTopMax}),[f]),Fr(()=>f.onRenderRangeChange(G=>{i().onRenderRangeChange?.(G)}),[f]),Fr(()=>f.onScrollStop(G=>{let{scrollTop:N,scrollLeft:ge}=G;if(N===0&&P?.(),N+(M??mv)>=q.current){D?.();let{livePagination:Re,livePaginationCursor:Ae,dataArray:Ge}=z();Re&&($.cursorId=Ae!==void 0?Date.now():Ge.length)}if(w){let Re=f.getRenderRange();w({scrollTop:N,scrollLeft:ge,renderRange:Re,viewportSize:i().bodySize,firstVisibleRowIndex:Re.start[0],lastVisibleRowIndex:Re.end[0],firstVisibleColIndex:Re.start[1],lastVisibleColIndex:Re.end[1]})}}),[f,P,D,w]),Fr(()=>{t.height&&(r.ready=!0)},[!!t.height]),Fr(()=>{let{onReady:G}=i();G&&G({api:n,dataSourceApi:Y})},[v]);let fe=uu(()=>({isNodeReadOnly:U,selectionMode:ce,cellSelection:ue}),[U,ce,ue]),me=pv(G=>{let{rowIndex:N,colIndex:ge,heightWithRowspan:Ee,domRef:Ce,hidden:Re,width:Ae,onMouseLeave:Ge,onMouseEnter:et}=G,tt=X()[N],Ze=L[ge];if(!tt||!Ze)return null;let Ue=k?k.getRowHeight(N):Ee,B=!1;!y||typeof y=="function"&&!y(tt)?B=!1:h&&(B=h(tt)?"expanded":"collapsed");let oe=E?f.getRowIndexInPage(N):null,he=E?f.getPageIndexForRow(N):null,be=n.isEditorVisibleForCell({rowIndex:N,columnId:Ze.id}),nt={getData:X,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:oe,horizontalLayoutPageIndex:he,rowIndex:N,rowInfoStore:ae,hidden:Re,toggleGroupRow:j,rowHeight:Ue,rowDetailState:B,onMouseEnter:et,onMouseLeave:Ge,onRowMouseEnter:c,onRowMouseLeave:d,domRef:Ce,width:Ae,column:Ze,columnsMap:O,fieldsToColumn:Q,rowStyle:R,rowClassName:I,cellStyle:T,cellClassName:S,repaintCellsKey:Ze.repaintCellsKey!==void 0?Ze.repaintCellsKey:b,visibleColumnIds:de,computedColumnOrder:K,inEditMode:be,getDataSourceState:z,dataSourceApi:Y,dataSourceActions:$,getState:i,imperativeApi:n,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:fe};return xa.createElement(xp,{...nt})},[s,u,c,d,k,W,h,X,L,O,Q,p,E,j,m,f,ae,R,I,S,T,b,z,Y,$,i,n,r,a,l,de,K,x,A,fe]),ie=uu(()=>{if(h)return G=>{let{rowIndex:N,domRef:ge}=G,Ce=X()[N];if(!Ce||!h(Ce)||!k)return xa.createElement("div",{ref:ge,className:ac.hidden});let{rowDetailHeight:Re,rowHeight:Ae}=k.getSize(N);return xa.createElement(My,{rowInfo:Ce,rowDetailsCache:C,rowIndex:N,domRef:ge,detailOffset:Ae,rowDetailHeight:Re,rowDetailRenderer:g})}},[v,me,g,u,h,C]);return{renderCell:me,renderDetailRow:ie}}import{useEffect as gv}from"react";function _y(){let{state:o,getState:e,actions:t}=ne(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:n}=o,r=Lo(n);gv(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=Ls(va,!!n);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,n])}import*as Ny from"react";var Oy="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Fy=te(Oy,Dl);function Ly(o){return Ny.createElement("div",{...o,className:o.className?te(Fy,o.className):Fy})}import*as Vn from"react";var ky={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},zy="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Vy="qy58ya4";var{rootClassName:hv}=Le,cu=`${hv}-LoadMask`;function yv(o){let{visible:e,children:t="Loading"}=o;return Vn.createElement("div",{className:`${ky[e?"visible":"hidden"]} ${cu}`},Vn.createElement("div",{className:`${zy} ${cu}-Overlay`}),Vn.createElement("div",{className:`${Vy} ${cu}-Text`},t))}var Ea=Vn.memo(yv);import{useMemo as Sv}from"react";var bv=[bp,`${Bt}--hovered`];function Tv(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function on(o){let e=He(),t=No(),{getComputed:n,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:y,rowDetailRenderer:S,showHoverRows:T,wrapRowsHorizontally:b,domProps:R,domRef:C,forceBodyRerenderTimestamp:I,rowHoverClassName:P,ready:D}=ne(k=>({ready:k.state.ready,columnReorderDragColumnId:k.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:k.state.forceBodyRerenderTimestamp,renderer:k.state.renderer,onRenderUpdater:k.state.onRenderUpdater,debugId:k.state.debugId,keyboardNavigation:k.state.keyboardNavigation,activeRowIndex:k.state.activeRowIndex,loadingText:k.state.loadingText,scrollStopDelay:k.state.scrollStopDelay,brain:k.state.brain,scrollerDOMRef:k.state.scrollerDOMRef,components:k.state.components,bodySize:k.state.bodySize,activeCellIndex:k.state.activeCellIndex,rowDetailRenderer:k.state.rowDetailRenderer,showHoverRows:k.state.showHoverRows,wrapRowsHorizontally:k.state.wrapRowsHorizontally,domProps:k.state.domProps,domRef:k.state.domRef,rowHoverClassName:k.state.rowHoverClassName})),w=g?.LoadMask??Ea,M=n(),{computedRowHeight:E,computedRowSizeCacheForDetails:x}=M,v=x?.getRowHeight||E,{loading:A}=Oe(k=>({loading:k.dataSourceState.loading})),_=Gn.useCallback(k=>{let Q=e.getState(),V=k.target;if(!t&&k._from_row_detail)return;t&&(k._from_row_detail=!0);let j=id(V,Ns(),Q.domRef.current),re,de,se,ae;j&&(de=Number(j.dataset.colIndex),ae=Number(j.dataset.rowIndex),re=e.getComputed().computedVisibleColumns[de].id,se=e.dataSourceApi.getRowInfoArray()[ae].id);let ce={columnId:re,colIndex:de,rowId:se,rowIndex:ae,event:k,target:j??k.target};j&&Q.cellContextMenu(ce),Q.contextMenu(ce)},[]),{renderCell:F,renderDetailRow:L}=Ay({imperativeApi:r,getComputed:n,domRef:C,bodySize:h,computed:M}),{autoFocus:O,tabIndex:K}=R??{};_y();let W=Sv(()=>{if(!T)return;let k=[];return P&&(k=k.concat(P)),o.rowHoverClassName&&(k=k.concat(o.rowHoverClassName)),on.rowHoverClassName&&(k=k.concat(on.rowHoverClassName)),Tv(k)},[T,P,o.rowHoverClassName,on.rowHoverClassName]);return Gn.createElement(Ly,{onContextMenu:_},Gn.createElement(Af,{forceRerenderTimestamp:I,debugId:l,tabIndex:K??0,autoFocus:O??void 0,activeRowIndex:D&&s==="row"?u:null,activeCellIndex:D&&s==="cell"&&!d?y:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:b,onRenderUpdater:a,brain:f,activeCellRowHeight:v,renderCell:F,renderDetailRow:S?L:void 0,cellHoverClassNames:W,scrollerDOMRef:m,scrollVarHostRef:C}),Gn.createElement(w,{visible:A},c))}on.rowHoverClassName=bv;function Cv(){return ne(o=>o.api)}function Rv(o){return ne(e=>e.api.getColumnApi(o))}var Gy=o=>`--infinite-${o}`;var Hy=40,Ky=Gy(ld);var Xt=Le.rootClassName,{ManagedComponentContextProvider:Iv}=Mt({initSetupState:bg,forwardProps:Tg,mapPropsToState:wg,cleanup:Cg,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Ig(),getParentState:()=>Rs(o=>o),debugName:o=>Do(o.debugId,va)}),wv=Pe.memo(function(){let e=Wr(),{componentState:t,api:n,initialChildren:r}=ne(O=>({componentState:O.state,api:O.api,initialChildren:O.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Oe(O=>({dataArrayLength:O.dataSourceState.dataArray.length,getDataSourceState:O.getDataSourceState,dataSourceActions:O.dataSourceActions,dataSourceApi:O.dataSourceApi})),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:y,scrollStopDelay:S,brain:T,activeRowIndex:b,activeCellIndex:R}=t,{licenseKey:C}=t;!C&&uo.licenseKey&&(C=uo.licenseKey),Jg(b,i,n),Xg(R,i,n);let{onKeyDown:I}=hh();Pe.useEffect(()=>{let O=a(),K=Et(W=>{O.notifyRenderRangeChange({renderStartIndex:W[0],renderEndIndex:W[1]})},{wait:S});return T.onVerticalRenderRangeChange(K)},[T,S]);let P=$g(C),{autoFocus:D,tabIndex:w,...M}=t.domProps??{},E=vd(M);Pe.useEffect(()=>{T.setScrollStopDelay(S),l.scrollStopDelayUpdatedByTable=S},[S]),Tm(),uy(),Zh();let{menuPortal:x}=Yh(),{menuPortal:v}=iy(),{menuPortal:A}=ay(),{menuPortal:_}=ty();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,n,{dataSourceApi:s})},[t.ready,n,s]);let F=my();Pe.useEffect(()=>{if(e){let O=e.getSnapshot();c.current=O.getMasterState().portalDOMRef.current}},[]);let L=r??Pe.createElement(Pe.Fragment,null,Pe.createElement(ss,null),Pe.createElement(on,null));return Pe.createElement("div",{"data-debug-id":F,onKeyDown:I,ref:u,...E},L,Pe.createElement("div",{ref:c,className:te(`${st}Portal`,lc[1e7],Yr.absolute,rc[0],tc[0])},x,v,A,_),g?Pe.createElement(Un,{key:"row-height",varName:g,onChange:d}):null,Pe.createElement(Un,{key:"flashing-duration",allowInts:!0,varName:pe.components.Cell.flashingDuration,onChange:p}),h?Pe.createElement(Un,{key:"row-detail-height",varName:h,onChange:f}):null,y?Pe.createElement(Un,{key:"column-header-height",varName:y,onChange:m}):null,P?null:Pe.createElement(em,null),Pe.createElement(Xh,null))});function vv({children:o,store:e}){let{componentActions:t,componentState:n}=At(),{scrollerDOMRef:r,scrollTopKey:i}=n,a=Fe(n),l=Bg({state:n,actions:t,getState:a}),s=Fe(l),u=Wr(),{getDataSourceState:c,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=Wt(),[m]=Pe.useState(()=>ym({getComputed:s,getState:a,getDataSourceState:c,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:n,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:c,getComputed:s,getState:a,api:m,dataSourceApi:f,children:o};return e.setSnapshot(g),Pe.useLayoutEffect(()=>{e.notify()}),zr(r,h=>{let y={width:h.width,height:h.height};t.bodySize=y},{earlyAttach:!0,debounce:50}),Pe.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),Pe.createElement(wv,null)}var uo=function(o){let[e]=Pe.useState(()=>eh()),t=ti();return Pe.createElement(Iv,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:Hy,columnHeaderHeight:Ky,...o},Pe.createElement(Pl,null,Pe.createElement(t.Provider,{value:e},Pe.createElement(vv,{children:o.children,store:e}))))};uo.Header=ss;uo.Body=on;uo.HScrollSyncContent=sy;uo.Footer=()=>Pe.createElement(uc,null);uo.GroupingToolbar=Ry;import*as By from"react";function V5(o){let{DataSource:e}=Pr({nodesKey:"children",...o});return By.createElement(e,null,o.children??null)}import*as jy from"react";var Wy=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Qe(i,{treePaths:n});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()};o(u)};function Pv(o){return jy.createElement(uo,{...o})}var Ma=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,n(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=qe(`IT:${e}:DataQuery`)}};function Hn(o){if(Array.isArray(o))return o.map(Hn);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=Hn(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var co=class co{constructor(e){this.queryCache=new Z;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Hn(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new Ma(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Hn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Hn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Hn(e);this.queryCache.delete(t)};if(this.options=e,co.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)}co.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=co.clients.get(e);t&&t.destroy()}static destroyAll(){co.clients.forEach(e=>{co.destroy(e.name)})}destroy(){co.clients.delete(this.options.name)}};co.clients=new Map;var Uy=co;var Dv={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},xv={instantEdit:Dv};import{useEffect as cY}from"react";function Ev(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var Aa=class Aa{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Aa.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Aa.DEFAULT_SIZE=10;var du=Aa;var _a=class _a{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??_a.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};_a.DEFAULT_SIZE=10;var pu=_a;import{useEffect as Mv,useRef as Oa}from"react";var Av=(o,e)=>o.every((t,n)=>t===e[n]),_v=(o,e)=>{let t=Oa(e),n=Av(e,t.current),r=Oa(!0);t.current=e;let i=Oa(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=Oa(o);l.current=o,Mv(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as Ov,useRef as Nr}from"react";var $y=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),fu=(o,e)=>{let{same:t,different:n,compare:r}=e,i=Nr(t),a=Nr(n),l=$y(t,i.current,r),s=!$y(n,a.current,r),u=Nr(!0);i.current=t,a.current=n;let c=Nr(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=Nr(o);p.current=o,l&&s&&(u.current=!1),Ov(()=>{if(!u.current)return p.current()},d)};import*as vt from"react";var Yy=J(ee.currentFlashingDuration),Fv=({children:o})=>vt.createElement(vt.Fragment,null,o),qy=1e3,Xy={up:ui({direction:"up"}).split(" "),down:ui({direction:"down"}).split(" "),neutral:ui({direction:"neutral"}).split(" ")},Zy=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=Fv}=o;return vt.forwardRef((i,a)=>{let l=Ti(),{flashingDurationCSSVarValue:s}=ne(I=>({flashingDurationCSSVarValue:I.state.flashingDurationCSSVarValue})),u=typeof s=="number"?s??e??qy:e??qy,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,y=vt.useRef(!0),S=vt.useRef(d),T=y.current?null:S.current;y.current=!1;let b=vt.useRef(void 0),R=vt.useRef(void 0),C=vt.useRef(void 0);return fu(()=>{if(d===S.current)return;let I=()=>{let M=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),C.current&&(clearTimeout(C.current),C.current=void 0),R.current&&M){let E=R.current,x=Xy[E];M.classList.remove(...t?[t,...x]:x),M.style.removeProperty(Yy),R.current=void 0}};S.current=d;let P=m.current;if(!P)return;I();let D=typeof d=="number"?d>T?"up":"down":"neutral",w=Xy[D];return P.style.setProperty(Yy,`${u}`),P.classList.add(...t?[t,...w]:w),R.current=D,b.current=setTimeout(I,u),I},{same:[h,g],different:[d]}),vt.createElement("div",{ref:c,...i,className:te(i.className)},n({children:i.children,oldValue:T}))})},Nv=Zy();import*as Je from"react";import{useEffect as Jy,useRef as Qy}from"react";import{createPortal as Lv}from"react-dom";function kv(o){let[e,t]=Je.useState(null);return Jy(()=>{let{debugTarget:n}=o,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[n]){let i=globalThis.INFINITE[n].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[o.debugTarget]),typeof e=="function"?Je.createElement(eS.Provider,{value:{getState:e}},Je.createElement(zv,null)):null}var eS=Je.createContext({getState:()=>null});function zv(){let o=Je.useContext(eS),{getState:e}=o,[,t]=kt(),n=e().renderer.cellManager;Jy(()=>{let s=Et(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=Qy(null),l=Qy(null);return Je.createElement("div",{style:{overflow:"auto"}},Lv(Je.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),Je.createElement("table",{style:{borderCollapse:"collapse"}},Je.createElement("thead",null,Je.createElement("tr",null,i.map(s=>Je.createElement("th",{key:s,"data-col-index":s},s)))),Je.createElement("tbody",null,r.map(s=>Je.createElement("tr",{key:s,"data-row-index":s},i.map(u=>Je.createElement("td",{key:u,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,u])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":u},Je.createElement("button",{onClick:()=>{let c=n.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 VY={CheckBox:To,LoadMask:Ea,MenuIcon:dr,StringFilterEditor:gn,NumberFilterEditor:ri};export{Dn as AutoScroller,We as CellSelectionState,Ct as DRAG_ITEM_ATTRIBUTE,Uy as DataClient,TK as DataSource,fI as DataSourceActionType,Z as DeepMap,Pl as DragDropProvider,fr as DragInteractionTarget,$o as DragList,du as FixedSizeSet,Nv as FlashingColumnCell,Rt as GroupRowsState,kv as INTERNAL_MatrixDebugger,uo as InfiniteTable,Xt as InfiniteTableClassName,wv as InfiniteTableComponent,$t as Menu,Dr as RowDetailCache,xt as RowDetailState,It as RowDisabledState,Me as RowSelectionState,V5 as TreeDataSource,ct as TreeExpandState,Pv as TreeGrid,Qe as TreeSelectionState,pu as WeakFixedSizeSet,$s as alignNode,VY as components,Zp as createDefaultProxy,Zy as createFlashingColumnCellComponent,Et as debounce,qe as debug,Qp as defaultDragProxyMove,om as defaultFilterFunction,zo as defaultFilterTypes,ds as defaultTreeFilterFunction,js as eventMatchesKeyboardShortcut,eg as filterDataArray,zo as filterTypes,qb as flatten,Mt as getComponentStateRoot,Fl as group,Ev as interceptMap,xv as keyboardShortcuts,oo as multisort,Cs as multisortNested,Hn as queryKeyToCacheKey,aR as toTreeDataArray,At as useComponentState,pI as useDataSourceApi,Pr as useDataSourceInternal,Oe as useDataSourceSelector,Rs as useDataSourceState,bo as useDragDropProvider,xn as useDragListContext,fu as useEffectWhen,_v as useEffectWhenSameDeps,Fn as useEffectWithChanges,mH as useEffectWithObject,iu as useGridScroll,Rv as useInfiniteColumnApi,Ti as useInfiniteColumnCell,zl as useInfiniteColumnEditor,Zn as useInfiniteColumnFilterEditor,ni as useInfiniteHeaderCell,nv as useInfinitePortalContainer,Cv as useInfiniteTableApi,fH as useLayoutEffectWithChanges,dg as useManagedDataSource,No as useMasterRowInfo,lo as useOverlay,fw as useOverlayPortal,Lo as usePrevious,CK as useRowInfoReducers,$w as useVisibleColumnSizes,Wy as withSelectedLeafNodesOnly};
30
30
  //!collapsed || lazyLoad;