@infinite-table/infinite-react 7.0.1 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var $m=Object.create;var Jl=Object.defineProperty;var Um=Object.getOwnPropertyDescriptor;var Ym=Object.getOwnPropertyNames;var qm=Object.getPrototypeOf,Xm=Object.prototype.hasOwnProperty;var Zm=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Qm=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ym(e))!Xm.call(n,r)&&r!==t&&Jl(n,r,{get:()=>e[r],enumerable:!(o=Um(e,r))||o.enumerable});return n};var tn=(n,e,t)=>(t=n!=null?$m(qm(n)):{},Qm(e||!n||!n.__esModule?Jl(t,"default",{value:n,enumerable:!0}):t,n));var vo=Zm((WR,As)=>{As.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});function Dt(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}import*as me from"react";var J=(...n)=>n.filter(e=>!!`${e}`).join(" ");import*as ao from"react";import{useRef as ss}from"react";function pe(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function Ye(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var es=(n,e)=>n-e;var zi=(n,e)=>es(n.revision,e.revision),q=class{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),u=!a;if(i!==void 0){if(i<0)return;i--}let c=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,h=p===this.emptyKey;if(h&&!u)return;let g=h?[]:[...e,p],y=m?()=>this.visitWithNext(g,t,o,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let C=t(f.value,g,l,y,f);if(o&&C===!0)return!0;l++}else y?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(o&&f===!0)return f}};this.fill(e)}static clone(e){let t=new q;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t,o){let r=[];return this.getStartingWith(e,(i,a)=>{r.push(a)},t,o),r}getEntriesStartingWith(e,t,o){let r=[];return this.getStartingWith(e,(i,a)=>{r.push([i,a])},t,o),r}getUnnestedKeysStartingWith(e,t,o){let r=[],i=u=>{r.push(u)},a=this.map,l,s=!1;if(e.length)for(let u=0,c=e.length;u<c;u++){let d=e[u];if(l=a.get(d),!l||!l.map)if(s=!0,u===c-1){s=!0;break}else return[];a=l.map}else if(!t&&a.has(this.emptyKey))return[[]];return l&&l.value!==void 0&&(t||(i({...l,keys:e}),s=!0)),s?r.sort(zi).map(u=>u.keys):(this.visitWithNext(e,(u,c,d,p,f)=>{i({...f,keys:c})},!1,a,o,t),r.sort(zi).map(u=>u.keys))}getKeysStartingWith(e,t,o){let r=[];return this.getStartingWith(e,i=>{r.push(i)},t,o),r}getStartingWith(e,t,o,r){let i=this.map,a,l=!1;if(e.length)for(let s=0,u=e.length;s<u;s++){let c=e[s];if(a=i.get(c),!a||!a.map)if(l=!0,s===u-1){l=!0;break}else return;i=a.map}a&&a.value!==void 0&&(o||t(e,a.value)),!l&&this.visitWithNext(e,(s,u,c,d)=>{t(u,s),d?.()},!1,i,r,o)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.map,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],u=e[e.length-1],c=s?.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],u=Ye(()=>{if(l)for(let[c]of l){let d=this.visitKey(c,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let c=r(a,s,u);if(i&&c===!0)return!0}u()}getArray(e){let t=[];return this.visit((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(zi);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};function Ee(){return globalThis}var Jn=["#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"],ts=Symbol("color"),Qn=new WeakMap,Gi=pe();function Ki(n=Jn){Qn.set(n,n.map(e=>0))}Ki();var Jm=(n=Jn)=>{let e=[];Qn.has(n)?e=Qn.get(n):(e=n.map(o=>0),Qn.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??Jn[0]},nn=":",Hi="*",os="-",eh=",",th="debug",oh="diffdebug",rs=!1,on=new q,rn=new Map;function Bi(n,e){let t=n.split(nn),o=new q;o.set(t,!0);let r=e.split(nn),i=new Set(r).has(Hi),a=r.indexOf(Hi),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,i).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(nn)):!0}}function nh(n,e){let t=`channel=${n}_permissions=${e}`;if(rn.has(t))return rn.get(t);let o=e.split(eh);function r(l){return rn.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(Hi)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(os);if(u&&(s=s.substring(os.length)),Bi(n,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),Bi(n,s))return r(!u)}return r(!1)}var ki=()=>Ge.enable??(Ee()&&Ee().localStorage?.getItem(th))??"",rh=()=>Ge.diffenable??(Ee()&&Ee().localStorage?.getItem(oh))??`${rs}`,Wi="",is=rs;function ji(n){is=`${rh()}`=="true",Wi!==n&&(Wi=n,rn.clear())}function as(n){ji(ki()),typeof Ee()<"u"&&Ee().addEventListener&&Ee().addEventListener("storage",function(){ji(ki())});function e(t,o){let r=o?`${o}${nn}${t}`:t,i=r.split(nn),a=on.get(i);if(a)return a;let l=on.get(i.slice(0,-1)),s=(l?l.logFn:Ge.logFn)??ls,u=s,c,d=0,p=()=>c??nh(r,Wi),f=Jm(Ge.colors),m=Object.defineProperties((...h)=>{let g=Gi.getListenersCount(),y;if(g>0&&(y=y??Date.now(),Gi({color:f,channel:r,args:h,timestamp:y})),p()){if(y=y??Date.now(),d&&is){let b=y-d;u(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=y;let C=[],S;if(h.forEach(b=>{if(b[ts])S===void 0&&(S=!0),C.push(...b);else{if(typeof b!="string"&&typeof b!="number"){S=!1;return}C.push(`${b}%s`)}}),S){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...C,""];u(...b)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...h)}},{channel:{value:r},color:{value:(h,...g)=>{let y=[`%c${g.join(" ")}%c%s`,`color: ${h}`,""];return y.toString=()=>g.join(" "),y[ts]=!0,y}},extend:{value:h=>e(h,r)},enabled:{get:()=>p(),set:h=>{c=h}},logFn:{configurable:!1,get:()=>u,set:h=>{u=h??s}},destroy:{value:()=>{on.delete(i)}}});return on.set(i,m),m}return e(n)}var ls=console.log.bind(console),ns;Object.defineProperty(as,"enable",{get:()=>ns,set:n=>{ns=n,ji(ki())}});var Ge=as;Ge.colors=Jn;Ge.logFn=ls;var ih=(n,e)=>Gi.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;Bi(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Ge.onLogIntent=ih;Ge.destroyAll=()=>{Ki(),Ki(Ge.colors),on.clear(),rn.clear()};var rt=n=>{let e=Ge(n?`${n}:TYPE=debug`:"TYPE=debug");return e.logFn=console.log.bind(console),e},Ht=n=>{let e=Ge(n?`${n}:TYPE=error`:"TYPE=error");return e.logFn=console.error.bind(console),e},an=()=>an;an.extend=()=>an;var Je=class{constructor(e){this.debug=an,this.error=an}};import*as ah from"react";import{useMemo as Hb,useRef as lh,useEffect as sh,useLayoutEffect as uh,useCallback as Bb}from"react";var ln=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Dt(e,{wait:o}):e,a=new r(l=>{let s=l[0],{width:u,height:c}=s.contentRect;if(s.borderBoxSize?.[0])c=s.borderBoxSize[0].blockSize,u=s.borderBoxSize[0].inlineSize;else{let d=n.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(n),()=>{a.disconnect()}},er=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=lh({width:0,height:0}),r=i=>{let a;return n.current&&(a=ln(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};sh(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),uh(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};var ch=Ht("CSSVariableWatch"),dh=rt("CSSVariableWatch"),ph={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},fh=n=>{let e=ss(0),t=ao.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);er(n.ref,t,{earlyAttach:!0}),ao.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o)return e.current=o,dh(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);ch(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},sn=n=>{let e=ss(null);fh({...n,ref:e});let t=n.varName.startsWith("var(")?n.varName:`var(${n.varName})`,{allowInts:o=!1}=n;return ao.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:ph},ao.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};import*as or from"react";import*as us from"react";var $i;function un(){return $i||($i=us.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}import*as cs from"react";var Ui;function tr(){return Ui||(Ui=cs.createContext(void 0))}function Po(){let n=un();return or.useContext(n).componentState}function Ie(){let n=un();return or.useContext(n)}function Le(){let n=tr();return or.useContext(n)}import*as uo from"react";import{useCallback as Qs,useEffect as sa,useRef as tg,useState as og}from"react";import*as nr from"react";function mh(n){let{height:e,width:t,count:o}=n;return nr.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var ds=nr.memo(mh);var ps="mlx2t3";import*as rr from"react";import{useRef as gh}from"react";import{useEffect as hh}from"react";var fs=(n,e)=>{hh(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var ms={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},hs={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},gs={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Yi="_1ueijco1",ys="_1ueijco0 _16lm1iw0";var Cs=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=ms[`${n}`]:e=J(hs[`${n.horizontal}`],gs[`${n.vertical}`]),e};var yh="InfiniteVirtualScrollContainer";var Ts=rr.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??gh(null);return fs(c,i),rr.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:J(a,yh,ys,Cs(r))},o)});import*as fr from"react";import{useEffect as la,useLayoutEffect as Eh,useMemo as Mh}from"react";import*as Ss from"react";import{useEffect as Ch,useRef as Th,useState as Sh}from"react";function bh(n){let[e,t]=Sh(n.updater.get),o=Th(null);return Ch(()=>{function r(a){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=n.updater.onChange(r);return()=>{o.current!=null&&cancelAnimationFrame(o.current),i()}},[n.updater,n.useraf]),e??null}var Bt=Ss.memo(bh);function xo(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function bs(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}function Y(n){return n.slice(4,-1)}var et="Infinite",De={rootClassName:et};var U={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnZIndexAtIndex:"var(--_16hkbkch)",pinnedStartWidth:"var(--_16hkbkci)",pinnedEndWidth:"var(--_16hkbkcj)",pinnedEndOffset:"var(--_16hkbkck)",computedVisibleColumnsCount:"var(--_16hkbkcl)",baseZIndexForCells:"var(--_16hkbkcm)",bodyWidth:"var(--_16hkbkcn)",bodyHeight:"var(--_16hkbkco)",scrollbarWidthHorizontal:"var(--_16hkbkcp)",scrollbarWidthVertical:"var(--_16hkbkcq)",scrollLeft:"var(--_16hkbkcr)",scrollTop:"var(--_16hkbkcs)"};var Rs="true",le={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},Is="column-header-height";var ws=`.${De.rootClassName}`;function qi(n){return xo(n,ws)}var Ps=Y(U.scrollLeft),Rh=Y(U.scrollTop),Ih=Y(U.columnWidthAtIndex),Xi=Y(U.columnOffsetAtIndex),xs=Y(U.columnReorderEffectDurationAtIndex),wh=Y(U.columnOffsetAtIndexWhileReordering),Ph=Y(U.columnZIndexAtIndex);function vt(n,e,t){let o=t?qi(t):document.querySelector(ws);xh(n,e,o)}function xh(n,e,t){if(t){let o=n,r=U[o]?Y(U[o]):n;t.style.setProperty(r,`${e}`)}}function Do(n,e){if(e)for(var t in n){let o=U[t]?Y(U[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function Zi(n,e,t){vt(`${Xi}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${Ps}))`:`${n.computedAbsoluteOffset+e}px`,t)}function Qi(n,e,t){vt(`${Ph}-${n}`,`${e}`,t)}function cn(n,e,t){vt(`${wh}-${n}`,typeof e=="number"?`calc( var(${Xi}-${n}) + ${e}px )`:e,t)}function ir(n,e,t){vt(`${xs}-${n}`,t??"",e)}function Ds(n,e){let t=`${xs}-${n}`;vt(t,le.components.Cell.reorderEffectDuration,e)}var Ce={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Ih}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,vt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Xi}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,vt(this.varName.get(n),e,t)}}};function vs(n,e){Do({[Ps]:`${n.scrollLeft}px`,[Rh]:`${n.scrollTop}px`},e)}var ve=Ee().requestAnimationFrame||(n=>setTimeout(n,16)),gt=Ee().cancelAnimationFrame||(n=>clearTimeout(n));var Es=tn(vo());var Ji=(n,e)=>n-e,At={horizontal:!0,vertical:!0};function ar(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var ea="DebugID=";function kt(n,e){return e&&e.startsWith(ea)?e:e?`${ea}${n}:${e}`:`${ea}${n}`}var lr={start:0,end:0},ta=n=>{n()},oa=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},Ms=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},dn=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function Dh(n){return n.horizontalChange||n.verticalChange}var lo=class extends Je{constructor(t){let o=kt(t,`${t}:MatrixBrain`);super(o);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=lr;this.verticalExtendRangeBy=lr;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{dn(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?ta:dn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?ta:dn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:o}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=At)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=At)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=o.startIndex,u=o.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=At)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",u=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,c=this.getItemAt(l,t),d=u.start||0,p=u.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(c=Math.max(0,c-d),r+=d),p&&(r+=p);let f=c+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,c=Math.max(a,f-r)),{startIndex:c,endIndex:f}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,o),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,Es.default)(a,t,Ji);return p>=0?p:~p-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,h={rowIndex:t,colIndex:o};for(;f<=m;f++)if(d[f]===void 0){h[r==="horizontal"?"colIndex":"rowIndex"]=f;let g=s(h);d[f]=f,p[f]=g;let y=f;for(;g>1;)y+=1,d[y]=f,p[y]=0,g-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=oa;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=At){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0}getVirtualColIndex(t,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:u}=t,c=typeof s=="number",d=typeof u=="number",p=c&&s!==this.availableWidth,f=d&&u!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=u,this.availableRenderHeight=u),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",h=typeof i=="number",g=m&&r!==this.rows,y=h&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),h&&(this.cols=i);let C=a!=null,S=l!=null,b=C&&a!==this.rowHeight,T=S&&l!==this.colWidth;C&&(this.rowHeight=a),S&&(this.colWidth=l);let I=t.rowspan!=null,R=t.colspan!=null,w=I&&t.rowspan!=this.rowspan,P=R&&t.colspan!=this.colspan;w&&(this.rowspan=t.rowspan),P&&(this.colspan=t.colspan);let x=y||T||p||P,D=g||b||f||w;(o||Dh)({horizontalChange:x,verticalChange:D,colsChanged:y,colWidthChanged:T,widthChanged:p,colspanChanged:P,rowsChanged:g,rowHeightChanged:b,heightChanged:f,rowspanChanged:w})&&this.updateRenderCount({horizontal:x,vertical:D})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=At){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=At){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?ta:dn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="function"){let c=[],d=0,p=r;d+=s,p-=u;for(let f=d;f<p;f++)c.push(this.getItemSize(f,t));a=ar(l,c)}else a=(o?Math.ceil(l/o):0)+1;return a+=s+u,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{dn(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=lr,this.verticalExtendRangeBy=lr,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var ra=tn(vo());function _s(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function Fs(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function pn(n,e){for(let t of n)if(e(t))return t}import*as Ns from"react";var Os=new Map,vh=()=>{},na=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=pe();let o=Os.get(e)??0,r=`${e}:GridCellReact:${o}`;Os.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=pe(),this.node=Ns.createElement(Bt,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=vh,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}},mn=class extends Je{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=pe();this.cellAttachmentChangeSubscription=pe();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=new na(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,o=t.values().next().value;return o||(this.poolSize+=mn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/mn.POOL_SIZE_INCREMENT)*mn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}},fn=mn;fn.POOL_SIZE_INCREMENT=1;var sr=(n,e)=>n-e,ur=class extends Je{constructor(t){super(`${t}:GridCellManager`);this.matrix=new q;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,h=p>=l,g=f<a,y=f>=s;(m||h||g||y)&&u.add(c)}),u};this.debugId=t,this.pool=new fn(t),this.offRemoveCell=this.pool.onRemoveCell(o=>this.onRemoveCell(o))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=pn(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=pn(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,u)=>{let c=[a,u],d=this.getCellAt(c);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(sr)}getColumnsWithCells(){let t=this.matrix.getUnnestedKeysStartingWith([],!0);return[...new Set(t.map(r=>r[1])).values()].sort(sr)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,ra.default)(o,t,sr);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,ra.default)(o,t,sr);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;(l>=o||s>=r)&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return pn(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return pn(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var zs=tn(vo());import*as Vs from"react";var Ls=new Map,Ah=()=>{},ia=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=pe();let t=Ls.get(e)??0,o=`${e}:ListRowReact:${t}`;Ls.set(e,t+1),this.debugId=o,this.updater=pe(),this.node=Vs.createElement(Bt,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Ah,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},gn=class extends Je{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=pe();this.rowAttachmentChangeSubscription=pe();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=new ia(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,o=t.values().next().value;return o||(this.poolSize+=gn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/gn.POOL_SIZE_INCREMENT)*gn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}},hn=gn;hn.POOL_SIZE_INCREMENT=1;var cr=class extends Je{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new hn(t),this.offRemoveRow=this.pool.onRemoveRow(o=>this.onRemoveRow(o))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,zs.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Gs=!0,so=Y(U.y),Ks=Y(U.scrollTop),EI=Y(U.columnOffsetAtIndex),aa=Y(U.columnOffsetAtIndexWhileReordering),Ao=class extends Je{constructor(t,o){o=o||"ReactHeadlessTableRenderer";super(o);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(so,i?`calc( ${r}px + var(${Ks}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${so}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Ce.columnOffsets.get(r),d=`${aa}-${r}`,p=s?`calc( ${a}px + var(${Ks}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(so,p));let f=`translate3d(var(${d}, ${c}), var(${so}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),u!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let u=r.getItemOffsetFor(t,"vertical"),c=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let h=f+m.height;l||(l=u>h-p?"end":u<f+d?"start":"end");let g=i.scrollTop;if(l==="center"?g=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,g+=u-f+s-d):(s+=c,g+=u-h+s+p),this.brain.isHorizontalLayoutBrain){let y=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),C=this.getScrollPositionForScrollColumnIntoView(y,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});C&&(a=C.scrollLeft)}return{scrollLeft:a,scrollTop:g}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let u=r.getItemOffsetFor(t,"horizontal"),c=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let h=f+m.width;l||(l=u>h-p?"end":u<f+d?"start":"end");let g=i.scrollLeft;return l==="center"?g=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,g+=u-f+s-d):(s+=c,g+=u-h+s+p),{...i,scrollLeft:g}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,u]}=i.getRenderRange();if(t<l||t>=u)return!1;let c=Math.floor((l+u)/2);if(t>=c){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,h=[];if(i&&(o&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,i]}),r&&h.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),h.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(o&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,l]}),r&&h.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),h.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),o){let g={start:[0,p],end:[o,m],rowFixed:"start",colFixed:!1};h.push(g)}if(r){let g={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};h.push(g)}return h};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(o<a&&(d=!0,p="start"),l&&!d){let f=s-l;o>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};ve(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:u,y:c}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,Gs){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let f=(o?o.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==f&&(r.__zIndex=f,r.style.zIndex=f)}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,Gs&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(E=>{let F=i.getRowIndex(E);if(F!=null){let v=this.brain.getItemOffsetFor(F,"vertical");if(v==null)return;let M=E.getElement();if(!M)return;this.setDetailTransform(M,F,{y:v,scrollLeft:t.scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&vs(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:g}=this.brain.getRenderRange(),[y,C]=h,[S,b]=g;function T(E,F,v){let M=r.getCellAt([E,F]);if(M==null)return;let N=o.getCellOffset(E,F),G=M.getElement();G&&N&&v(E,F,G,N)}let I=(E,F,v,{x:M,y:N})=>{this.setTransform(v,E,F,{x:M,y:N,scrollLeft:!0},s-F)},R=(E,F,v,M)=>{this.setTransform(v,E,F,{x:M.x,y:M.y,scrollTop:!0},c-E)},w=(E,F,v,{y:M})=>{let N=f[F];this.setTransform(v,E,F,{x:N,y:M,scrollLeft:!0},a-F)},P=(E,F,v,M)=>{this.setTransform(v,E,F,{x:M.x,y:m[E],scrollTop:!0},l-E)},x=(E,F,v,{x:M,y:N})=>{this.setTransform(v,E,F,{x:M,scrollLeft:!0,y:N,scrollTop:!0},1e5)},D=(E,F,v,{x:M})=>{this.setTransform(v,E,F,{x:M,scrollLeft:!0,y:m[E],scrollTop:!0},2e5)},A=(E,F,v,M)=>{this.setTransform(v,E,F,{x:f[F],y:M.y,scrollLeft:!0,scrollTop:!0},3e5)},_=(E,F,v)=>{this.setTransform(v,E,F,{x:f[F],y:m[E],scrollLeft:!0,scrollTop:!0},4e5)};if(s||u)for(let E=y;E<S;E++){for(let F=0;F<s;F++)T(E,F,I);if(u){let F=a-u;for(let v=F;v<a;v++)T(E,v,w)}}if(c||d)for(let E=C;E<b;E++){for(let F=0;F<c;F++)T(F,E,R);if(d){let F=l-d;for(let v=F;v<l;v++)T(v,E,P)}}if(s&&c)for(let E=0;E<c;E++)for(let F=0;F<s;F++)T(E,F,x);if(s&&d){let E=l-d;for(let F=E;F<l;F++)for(let v=0;v<s;v++)T(F,v,D)}if(u&&c){let E=a-u;for(let F=0;F<c;F++)for(let v=E;v<a;v++)T(F,v,A)}if(u&&d){let E=l-d,F=a-u;for(let v=E;v<l;v++)for(let M=F;M<a;M++)T(v,M,_)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=o,this.cellManager=new ur(o),this.cellManager.onCellAttachmentChange((s,u)=>{u?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new cr(o),this.rowManager.onRowAttachmentChange((s,u)=>{u?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),ve(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=qi(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,u=this.brain.isHorizontalLayoutBrain,{rowManager:c,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],D=t.end[1];m.forEach(A=>{x<=A&&A<D||f.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let h=new Map,g=f.map(this.getExtraSpanCellsForRange).flat();g&&g.forEach(([x,D])=>{h.set(`${x}:${D}`,!0)});let y=f.reduce((x,D)=>x+oa(D),0),C=r?f.reduce((x,D)=>x+Ms(D),0):0,S=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([S,b]);let T=Math.min(S*b,y);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>C&&(c.poolSize=C));let I=_s(...f.map(x=>d.getCellsOutsideRenderRange(x)));I=Fs(I,x=>{let D=d.getCellPosition(x);return!(D&&h.has(`${D[0]}:${D[1]}`))}),d.detachCells(I),d.poolSize=T;let R=new Map,w=new Map;f.forEach(x=>{let{start:D,end:A}=x,[_,E]=D,[F,v]=A;for(let M=_;M<F;M++){for(let G=E;G<v;G++){let $=`${M}:${G}`;if(R.has($))continue;R.set($,!0);let{rendered:te,mapped:he}=this.isCellRenderedAndMappedCorrectly(M,G);if(M===_||G===E){let z=this.isCellCovered(M,G);if(z&&h.has(`${z[0]}:${z[1]}`)){let k=d.getCellAt([M,G]);k!=null&&d.detachCell(k);continue}}if(te&&!i&&he)continue;let ue;te?ue=d.getCellAt([M,G]):ue=d.getCellFor([M,G],u?"row":"column"),ue==null&&(ue=d.getDetachedCell()),this.renderCellAt(M,G,ue,o)}!r||w.has(M)||(w.set(M,!0),c.isRowAttachedAt(M)&&!i)||this.renderDetailRowAtElement(M,this.rowManager.getRowFor(M),r)}}),g.forEach(([x,D])=>{let{rendered:A,mapped:_}=this.isCellRenderedAndMappedCorrectly(x,D);if(A){if(i||!_){let F=[x,D],v=d.getCellAt(F);this.renderCellAt(x,D,v,o)}return}let E=d.getCellFor([x,D],u?"row":"column");E!=null&&this.renderCellAt(x,D,E,o)});let P=d.getAllCells().map(x=>x.getNode());return r&&c.getAllRows().forEach(x=>{P.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(P),P}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(u,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),u=this.brain.getRowspan(t,o),c=this.brain.getColspan(t,o),d=u===1?l:this.brain.getRowHeightWithSpan(t,o,u),p=c===1?s:this.brain.getColWidthWithSpan(t,o,c),{row:f,col:m}=this.isCellFixed(t,o),h=!!a,{rowIndex:g,colIndex:y}=this.getCellRealCoordinates(t,o),C=i({rowIndex:g,colIndex:y,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:h,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:r.ref});r.isMounted()||r.onMount(b=>{let T=b.getElement();T&&(T.style.position="absolute",T.style.left="0px",T.style.top="0px"),this.updateElementPosition(b)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:g,renderColIndex:y}:void 0;if(!C){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(C,r,[t,o],S),this.updateElementPosition(r,{hidden:h,rowspan:u,colspan:c})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var dr=class extends Ao{constructor(t,o){super(t,o);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage),c=le.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Ce.columnOffsets.get(l.colIndex),f=`${aa}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(so,m));let h=`calc(var(${f}, ${p}) + ${d})`,g=`var(${so})`,y=`translate3d(${h}, ${g}, 0px)`;t.__transformValue!==y&&(t.__transformValue=y,t.style.transform=y)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function pr(n){let e=n.isHorizontalLayoutBrain?new dr(n,`${n.name}:HorizontalLayoutTableRenderer`):new Ao(n,`${n.name}:ReactHeadlessTableRenderer`),t=pe();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function _h(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=Mh(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:pr(e),[e,n.onRenderUpdater,n.renderer]);return la(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),la(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),Eh(()=>{let l=e.getRenderRange();i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o})},[i,e,t,o,a,r]),la(()=>e.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:u=>{let c=a.get();c&&u&&c.length===u.length||a(u)},renderCell:t,renderDetailRow:o})}),[t,o,e,a]),fr.createElement(Bt,{updater:a})}var mr=fr.memo(_h);import*as yn from"react";import{useEffect as Gh,useLayoutEffect as Kh,useRef as Hh}from"react";import{useCallback as Fh,useState as Oh}from"react";var Rt=()=>{let[n,e]=Oh(0);return[n,Fh(()=>{e(t=>t+1)},[e])]};function Nh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Lh(n){var e=Nh(n,"string");return typeof e=="symbol"?e:String(e)}function Vh(n,e,t){return e=Lh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Bs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hs(Object(t),!0).forEach(function(o){Vh(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function ks(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var zh=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},ye=n=>{var e=t=>{var o=n.defaultClassName,r=Bs(Bs({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=n.variantClassNames[i][s];u&&(o+=" "+u)}}for(var[c,d]of n.compoundVariants)zh(c,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return ks(n.variantClassNames,t=>ks(t,o=>o.split(" ")[0]))}},e};var Ws=ye({defaultClassName:"nxbq1c1 _16lm1iwl _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),hr="nxbq1c0 _16lm1iwl _16lm1iw4 _16lm1iw1f _16lm1iw1d _16lm1iw18 _16lm1iwu";var js=ye({defaultClassName:"j26lrx0 _16lm1iwl _16lm1iw2 _16lm1iw1d _16lm1iw1f",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Bh}=De,kh=`${Bh}-ActiveRowIndicator`,Wh=`calc(${U.activeCellRowOffsetX} + var(${Y(U.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,jh={[Y(U.activeCellOffsetY)]:U.activeCellRowOffset,transform:`translate3d(${Wh}, calc( ${U.activeCellOffsetY} + var(${Y(U.scrollTopForActiveRow)}, 0px)), 0px)`,height:U.activeCellRowHeight,maxWidth:le.runtime.totalVisibleColumnsWidthVar},$h=n=>{let{brain:e}=n,t=Hh(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=Rt();return Kh(()=>{if(n.activeRowIndex==null)return;let a="0px",l=n.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${le.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),u=e.getItemOffsetFor(l,"vertical"),c=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${u}px`,activeCellRowOffsetX:a};Do(d,c)},[n.activeRowIndex,e]),Gh(()=>{let a=u=>{Do({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]),yn.createElement("div",{className:hr,"data-name":"active-row"},yn.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${kh} ${js({active:o})}`,style:o?jh:void 0}))},$s=yn.memo($h);import*as Cn from"react";import{useEffect as Uh,useLayoutEffect as Yh,useRef as qh}from"react";var{rootClassName:Xh}=De,Zh=`${Xh}-ActiveCellIndicator`,Qh=Y(U.columnZIndexAtIndex),Jh=(n,e,t,o)=>{if(e==null)return;let[r]=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(r=r%n.rowsPerPage);let i=typeof t=="function"?t(r):t??n.getRowHeight(r),a=n.getItemOffsetFor(r,"vertical"),l=o.current;Do({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},eg=n=>{let{brain:e}=n,[t,o]=Rt(),r=qh(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];return Yh(()=>{Jh(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]),Uh(()=>{let a=e.onRenderCountChange(()=>{o()});return()=>{a()}},[e]),Cn.createElement("div",{className:hr,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${Qh}-${n.activeCellIndex[1]})`}:void 0},Cn.createElement("div",{"data-name":"active-cell-indicator",className:`${Zh} ${Ws({visible:i})}`}))},Us=Cn.memo(eg);var Ys="_1eexc2a7 _1eexc2a6",qs=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"]]}),Xs=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 Zs="_1eexc2a5",gr=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),yr="_1eexc2a8";var Cr=[Zs,`${et}DetachedCell`];function Tr(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var ng=J(ps,Yi);function Js(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...h}=n,{autoFocus:g}=h,y=tg(null),[C,S]=og({width:0,height:0});sa(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),sa(()=>{let I=y.current?.parentNode;return I?(g&&document.activeElement!==I&&I.focus(),ln(I,()=>{let P={height:I.clientHeight,width:I.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let b=Qs(I=>{requestAnimationFrame(()=>{y.current&&y.current.style.setProperty("transform",`translate3d(${-I.scrollLeft}px, ${-I.scrollTop}px, 0px)`)})},[]),T=Qs(I=>{e.setScrollPosition(I,b)},[e,b]);return sa(()=>{let I=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]),uo.createElement(Ts,{onContainerScroll:T,...h,ref:t},uo.createElement("div",{ref:y,className:ng,"data-name":"scroll-transform-target"},uo.createElement(mr,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Cr}),c!=null?uo.createElement(Us,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?uo.createElement($s,{brain:e,activeRowIndex:u}):null,uo.createElement(ds,{width:C.width,height:C.height}))}import*as Eo from"react";import{useReducer as cg,createContext as dg,useMemo as pa,useEffect as pg,useState as tu,useRef as ou,useLayoutEffect as fg}from"react";function ua(n,e){let t=new Set;function o(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return n.apply(this,s)}return{fn:o,propertyReads:t}}var ca=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function Tn(n){return n!==void 0}function Wt(n,e){let t=e[n];return Tn(t)}import{useCallback as rg,useEffect as ig,useRef as da}from"react";var eu=n=>{let e=rg(n,[]),t=da(!1),o=da(!1),r=da(),[i,a]=Rt();t.current&&(o.current=!0),ig(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};import{useCallback as ag,useRef as lg}from"react";function _e(n){let e=lg(n);return e.current=n,ag(()=>e.current,[])}import{useRef as sg,useLayoutEffect as ug}from"react";var co=(n,e)=>{let t=sg(e===void 0?n:e);return ug(()=>{t.current=n}),t.current};var mg=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)},fa;function nu(){return fa||(fa=dg(null))}function hg(n,e,t,o,r,i,a){let l=e();return Object.keys(l).reduce((s,u)=>{let c=u;return Object.defineProperty(s,u,{set:p=>{let f=t(),m=e(),h=m[c],g=!0;if(i&&typeof i[c]=="function"&&i[c](p,{actions:s,state:m})===!1&&(g=!1),g){let S=[p],b=`on${ca(u)}Change`;if(a&&a[c]){let T=a[c](p,m);b=T.callbackName||b,S=T.callbackParams}mg(f,b,S)}let y=o[c];typeof y=="function"&&(p=y(p));let C=!!r?.[c];Wt(u,f)&&!C||n({payload:{updatedProps:null,mappedState:{[u]:p}}})}}),s},{})}function gg(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=Wt(r,e)?e[r]:e[`default${ca(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function Et(n){let e=n.getParentState||(()=>null);function t(r){let[i]=tu(()=>n.initSetupState?n.initSetupState(r):{}),a=ou(new Set),l=pa(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),u=_e(s);function c(){let w={};l&&(w=gg(l,r,i));let P={...i,...w};if(n.mapPropsToState){let{fn:x,propertyReads:D}=ua(n.mapPropsToState,{getProxyTargetFromArgs:_=>_.props,putProxyToArgs:(_,E)=>[{...E,props:_}]}),A=x({props:r,state:P,oldState:null,parentState:s});return a.current=new Set([...a.current,...D]),{...P,...A}}return P}let[d]=tu(c),p=_e(r),f=(w,P)=>{if(P.type==="REPLACE_STATE")return P.payload;let x=u?.()??null,D=P.payload.mappedState,A=P.payload.updatedPropsToState,_={...w};if(D&&Object.assign(_,D),n.mapPropsToState){let{fn:F,propertyReads:v}=ua(n.mapPropsToState,{getProxyTargetFromArgs:N=>N.props,putProxyToArgs:(N,G)=>[{...G,props:N}]}),M=F({props:p(),state:_,oldState:w,parentState:x});a.current=new Set([...a.current,...v]),Object.assign(_,M)}return P.type==="ASSIGN_STATE"&&Object.assign(_,P.payload),n.concludeReducer?n.concludeReducer({previousState:w,state:_,updatedProps:A,parentState:x}):_},[m,h]=cg(f,d),g=_e(m),{allowedControlledPropOverrides:y}=n,C=pa(()=>hg(h,g,p,l,y,n.interceptActions,n.mappedCallbacks),[h,l,y]),S=nu(),b=pa(()=>({componentState:m,componentActions:C,getComponentState:g,replaceState:w=>{h({type:"REPLACE_STATE",payload:w})},assignState:w=>{h({type:"ASSIGN_STATE",payload:w})}}),[m,C,g]),T=co(r),I=ou(!1);I.current=!1;let R=n.layoutEffect?fg:pg;return R(()=>{let w=r,P={},x=0,D={},A=0,_={},E=0;if(new Set([...Object.keys(w),...Object.keys(T)]).forEach(M=>{let N=M,G=T[N],$=w[N];if(N!=="children"&&G!==$&&(_[N]={newValue:$,oldValue:G},E++,Wt(N,r)||Wt(N,T)))if(l.hasOwnProperty(M)){let te=$,he=l[M];typeof he=="function"&&(te=he($)),m[N]!==te&&(P[N]=te,x++)}else a.current.has(M)&&(D[N]=w[N],A++)}),A>0||x>0){(n.debugName?rt(typeof n.debugName=="function"?`${n.debugName(w)}:rerender`:`${n.debugName}:rerender`):rt("rerender"))("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(D??{}));let N={payload:{mappedState:x?P:null,updatedPropsToState:A?D:null}};if(I.current=!0,h(N),n.onPropChange){for(var v in _)if(_.hasOwnProperty(v)){let{newValue:G,oldValue:$}=_[v];n.onPropChange({name:v,newValue:G,oldValue:$},r,C,m)}}n.onPropsChange&&E&&n.onPropsChange(_,r,C,m)}}),R(()=>{s!=null&&!I.current&&h({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),eu(()=>()=>{n.cleanup?.(g())}),{contextValue:b,ContextComponent:S}}return{ManagedComponentContextProvider:Eo.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Eo.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Ke(){let n=nu();return Eo.useContext(n)}import*as yu from"react";var Sr=()=>De;var ru="_16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",iu={center:"_16lm1iw1r",stretch:"_16lm1iw1s"};var It="_16lm1iw24 _16lm1iw25 _16lm1iw1y",au={pointer:"_16lm1iwi",default:"_16lm1iwj",colResize:"_16lm1iwk"},Mo={flex:"_16lm1iwz",contents:"_16lm1iw10",none:"_16lm1iw11",block:"_16lm1iw12",grid:"_16lm1iw13",inlineBlock:"_16lm1iw14",inlineFlex:"_16lm1iw15",inlineGrid:"_16lm1iw16"};var br={1:"_16lm1iwm",none:"_16lm1iwn"},Sn={column:"_16lm1iw1n",columnReverse:"_16lm1iw1o",row:"_16lm1iw1p",rowReverse:"_16lm1iw1q"},lu={0:"_16lm1iw18","100%":"_16lm1iw19","50%":"_16lm1iw1a"},su={center:"_16lm1iw1t",spaceBetween:"_16lm1iw1u",spaceAround:"_16lm1iw1v",start:"_16lm1iw1w",end:"_16lm1iw1x"},uu={0:"_16lm1iw1f","100%":"_16lm1iw1g",auto:"_16lm1iw1h"};var cu={none:"_16lm1iwd"},du={hidden:"_16lm1iw1y",auto:"_16lm1iw1z",visible:"_16lm1iw20"};var bn={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var pu={0:"_16lm1iw1d","100%":"_16lm1iw1e"};var fu="_16lm1iwe",mu={none:"_16lm1iw17"};var hu={visible:"_16lm1iw21",hidden:"_16lm1iw22"};var gu={1:"_16lm1iwo",10:"_16lm1iwp",100:"_16lm1iwq",1e3:"_16lm1iwr",1e4:"_16lm1iws",1e5:"_16lm1iwt",1e6:"_16lm1iwu",1e7:"_16lm1iwv","1k":"_16lm1iww","10k":"_16lm1iwx","100k":"_16lm1iwy"};function Cu(n){let{rootClassName:e}=Sr();return yu.createElement("div",{...n,className:J(`${e}Footer`,bn.relative,Mo.flex,Sn.row,n.className)})}import*as Re from"react";import{useCallback as Iy,useContext as wy,useEffect as Py,useRef as xy}from"react";import{createPortal as Dy}from"react-dom";function Rr(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}import*as Tu from"react";var Fe=n=>{let e=n.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...n.style};return Tu.createElement("svg",{viewBox:"0 0 24 24",...n,style:t},n.children)};import*as Rn from"react";var Su=n=>Rn.createElement(Fe,{...n},Rn.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Rn.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Rn.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));import*as ma from"react";var bu=n=>ma.createElement(Fe,{...n},ma.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));import*as ha from"react";var ga=n=>ha.createElement(Fe,{...n},ha.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as ya from"react";var Ru=n=>ya.createElement(Fe,{...n},ya.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));import*as Ca from"react";var Iu=n=>Ca.createElement(Fe,{...n},Ca.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as Ta from"react";var wu=n=>Ta.createElement(Fe,{...n},Ta.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));import*as Sa from"react";var Pu=n=>Sa.createElement(Fe,{...n},Sa.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as ba from"react";var xu=n=>ba.createElement(Fe,{...n},ba.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as Ra from"react";var Du=n=>Ra.createElement(Fe,{...n},Ra.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));import*as _a from"react";import*as $e from"react";import{useEffect as Eg,useState as oc}from"react";import{useContext as Cg}from"react";import{createContext as yg}from"react";var Ia;function _o(){return Ia||(Ia=yg(null))}var X=()=>{let n=_o();return Cg(n)};import{useContext as Tg}from"react";var vu=()=>{let n=_o(),{state:e}=Tg(n);return e};import*as Fo from"react";import{useEffect as Sg,useLayoutEffect as bg,useState as $u}from"react";var Au="_1eexc2a6";var Eu=ye({defaultClassName:"_12zfob129 _16lm1iw19 _16lm1iw1c _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1w",variantClassNames:{filtered:{false:"_12zfob12a",true:"_12zfob12b"},verticalAlign:{start:"_12zfob12c",end:"_12zfob12d",center:"_12zfob12e"},align:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"}},defaultVariants:{},compoundVariants:[]}),Mu="_12zfob1n _16lm1iw24 _16lm1iw25 _16lm1iw1y",_u=ye({defaultClassName:"_12zfob1o",variantClassNames:{rowActive:{false:"_12zfob1p",true:"_12zfob1q"},cellSelected:{false:"_12zfob1r",true:"_12zfob1s"},rowSelected:{false:"_12zfob1t",true:"_12zfob1u",null:"_12zfob1v"},rowDisabled:{false:"_12zfob1w",true:"_12zfob1x"},firstRow:{false:"_12zfob1y",true:"_12zfob1z"},treeNode:{parent:"_12zfob110",leaf:"_12zfob111",false:"_12zfob112"},firstRowInHorizontalLayoutPage:{false:"_12zfob113",true:"_12zfob114"},groupRow:{false:"_12zfob115",true:"_12zfob116"},groupCell:{false:"_12zfob117",true:"_12zfob118"},align:{start:"_12zfob119",end:"_12zfob11a",center:"_12zfob11b"},verticalAlign:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},zebra:{false:"_12zfob11f",even:"_12zfob11g",odd:"_12zfob11h"},dragging:{true:"_12zfob11i",false:"_12zfob11j"},insideDisabledDraggingPage:{true:"_12zfob11k",false:"_12zfob11l"},first:{true:"_12zfob11m",false:"_12zfob11n"},last:{true:"_12zfob11o",false:"_12zfob11p"},groupByField:{true:"_12zfob11q",false:"_12zfob11r"},firstInCategory:{true:"_12zfob11s",false:"_12zfob11t"},lastInCategory:{true:"_12zfob11u",false:"_12zfob11v"},pinned:{start:"_12zfob11w",end:"_12zfob11x",false:"_12zfob11y"},filtered:{true:"_12zfob11z",false:"_12zfob120"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob121"],[{pinned:"end",firstInCategory:!0},"_12zfob122"],[{pinned:!1,lastInCategory:!0},"_12zfob123"]]}),Fu=ye({defaultClassName:"_12zfob19 _16lm1iw12 _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1a",end:"_12zfob1b",false:"_12zfob1c"},firstInCategory:{true:"_12zfob1d",false:"_12zfob1e"},lastInCategory:{true:"_12zfob1f",false:"_12zfob1g"},overflow:{true:"_12zfob1h",false:"_12zfob1i"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1j"],[{pinned:"start",firstInCategory:!0},"_12zfob1k"],[{overflow:!0,pinned:"end"},"_12zfob1l"],[{pinned:"end",lastInCategory:!0},"_12zfob1m"]]}),Ou="_12zfob12r _16lm1iw1c _16lm1iw19";var Nu="_12zfob17",Lu="_12zfob12n _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1",Vu=ye({defaultClassName:"_12zfob12o _16lm1iw1 _16lm1iw1d",variantClassNames:{disabled:{true:"_12zfob12p",false:"_12zfob12q"}},defaultVariants:{},compoundVariants:[]}),wa=ye({defaultClassName:"_12zfob12k _16lm1iwz _16lm1iw1p _16lm1iw1s _16lm1iw1",variantClassNames:{active:{true:"_12zfob12l",false:"_12zfob12m"}},defaultVariants:{},compoundVariants:[]}),zu="_12zfob12j _16lm1iwz _16lm1iw1p _16lm1iw1r",Gu=ye({defaultClassName:"_12zfob124 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw1v _16lm1iw22",variantClassNames:{menuVisible:{true:"_12zfob125"},reserveSpaceWhenHidden:{true:"_12zfob126",false:"_12zfob127"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob128"]]}),Ku="_12zfob18 _16lm1iw2",Hu="_16lm1iw1",Bu="_12zfob16",ku=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Wu="_12zfob12i _16lm1iw1y _16lm1iw1 _16lm1iwz _16lm1iw1p";var it="InfiniteIcon";var ju="_6aunoi0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v _16lm1iw1r";var Rg={transition:"width 0.25s, opacity 0.25s"};function Oo(n){let[e,t]=$u(!0),[o,r]=$u(0),{lineWidth:i=1,style:a,className:l,index:s}=n,u=s!=null&&s>0,c=n.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...Rg,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if(Sg(()=>{if(!e)return;let h=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(h)}},[e]),bg(()=>{t(!0)},[]),!e)return null;let m={};return Fo.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:J(l,it,ju,`${it}-filter`)},u?Fo.createElement("div",{"data-name":"index",style:m,className:Nu},s):null,Fo.createElement("div",{style:{width:p[0],...f}}),Fo.createElement("div",{style:{width:p[1],...f}}),Fo.createElement("div",{style:{width:p[2],...f}}))}var Pa=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((R,w)=>{let P=R.maxSize??r??void 0,x=R.minSize??o??void 0;s.push(x),u.push(P),R.size!=null&&(P!=null&&R.size>P&&(R.size=P),x!=null&&R.size<x&&(R.size=x));let D=R.flex==0?null:R.flex;if(R.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${w} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,i+=R.size??0});let c=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,w)=>{if(R.flex!=null){let P=d*R.flex,x=R.maxSize??r??void 0,D=R.minSize??o??void 0,A=!1,_=0;x!=null&&P>x&&(p[w]=!0,A=!0,_=x),D!=null&&P<D&&(f[w]=!0,A=!0,_=D),A&&(m+=1,l-=1,a-=R.flex,c-=_)}}),m&&(d=c/a);let h=[],g=0,y=c,C=a,S=0,b=0,T=[];return{items:t.map((R,w)=>{let P={...R},x=R.maxSize??r??void 0,D=R.minSize??o??void 0,A=0,_=p[w],E=f[w],F=_||E,v=R.size??0;if(R.flex!=null){if(F)E&&(A=D),_&&(A=x);else{g+=1;let M=N=>(x!=null&&N>x&&(N=x),D!=null&&N<D&&(N=D),N);g===l?A=M(y):(A=M(Math.round(R.flex*d)),b+=A,y=c-b,C-=R.flex,d=y/C)}v=A,P.flexSize=A}return h.push(A),T.push(v),P.computedSize=v,S+=v,P}),flexSizes:h,minSizes:s,maxSizes:u,computedSizes:T,remainingSize:Math.round(e-S)}};function Ir(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}var xa=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((x,D)=>(x[D]={...n.columnSizing[D]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],u=l.id,c=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",h=s?.computedWidth,g=s?.computedMinWidth,y=s?.computedMaxWidth,C=s?.computedFlex?"flex":"width",S=!1,b=!1,T=r>0?1:-1,{value:I,clamped:R,diff:w}=Ir(d+r,p,f,T);if(n.shareSpaceOnResize){if(s==null)return o[u]={...o[u],[m]:I},b=R==="min",S=R==="max",{adjustedDiff:I-d,reservedWidth:t,columnSizing:o,minReached:b,maxReached:S,constrained:b||S};let{value:x,clamped:D,diff:A}=Ir(h-r,g,y,T);if(R&&D&&(Math.abs(w)>Math.abs(A)?D=!1:R=!1),!(!R&&!D)){if(R){let _=Ir(h-r-w,g,y,T);x=_.value,D=_.clamped,A=_.diff}else if(D){let _=Ir(d+r+A,p,f,T);I=_.value,R=_.clamped,w=_.diff}}o[u]={...o[u],[m]:I},o[c]={...o[c],[C]:x},b=R==="min"||D==="min",S=R==="max"||D==="max"}else o[u]={...o[u],[m]:I},b=R==="min",S=R==="max";let P=I-d;return{adjustedDiff:P,reservedWidth:n.shareSpaceOnResize?t:t-P,columnSizing:o,minReached:b,maxReached:S,constrained:b||S}};function Uu(n,e){return n+e}function Ig(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var Yu=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((y,C)=>(y[C]={...n.columnSizing[C]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((y,C)=>n.dragHandlePositionAfter-C).reverse(),a=i.map(y=>n.items[y]),l=a.map(y=>y.computedWidth),s=a.map(y=>y.computedFlex?"flex":"width"),u=0,{computedSizes:c}=Pa({items:a.map(y=>(y.resizable===!1&&(u+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Uu,0)+r-u,0)}),d=a.map((y,C)=>c[C]-y.computedWidth),p=!0,f=!0,m=!0,h=[];d.forEach((y,C)=>{let S=a[C];if(!S.resizable){h.push(0);return}let b=s[C],T=l[C],I=Ig(o),{maxReached:R,minReached:w,constrained:P,adjustedDiff:x}=xa({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[C],shareSpaceOnResize:!1,items:n.items,columnSizing:I});o[S.id]={...I[S.id],[b]:T+x},h.push(x),R||(f=!1),w||(p=!1),P||(m=!1)});let g=h.reduce(Uu,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:h,adjustedDiff:g,columnSizing:o,reservedWidth:t-g}};var wr;function jt(){if(wr!=null)return wr;let n=Ee().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),wr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),wr}var qu=["start",void 0,"end"],Xu=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:qu.indexOf(r)-qu.indexOf(i)}),n);function Zu(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function Da(n,...e){return Zu(t=>t!=null,n,...e)}function Qu(n,e,...t){return Zu((o,r)=>!(r in n),e,...t)}var Pr=Object.freeze({}),wg={string:Pr,number:{}};function va(n,e){let t=e.default||Pr;return n.type===void 0?t:n.type===null?Pr:typeof n.type=="string"?e[n.type]||wg[n.type]||Pr:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var xr=!0,Pg=!0,xg=!0,Dg="string",No="unknown",vg=Ht("getComputedVisibleColumns"),Ag=(n,e,t)=>n[t]!==!1,Aa=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1},Ju=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:u,pinnedEndMaxWidth:c,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:h=po,viewportReservedWidth:g,resizableColumns:y,draggableColumns:C,columnDefaultDraggable:S,columnOrder:b,columnPinning:T,editable:I,columnDefaultEditable:R,columnDefaultFilterable:w,columnDefaultSortable:P,columnSizing:x,columnTypes:D,columnVisibility:A,columnVisibilityAssumeVisible:_})=>{let E=0,F=(d||[]).reduce((H,ne)=>{let{id:K,field:re}=ne;return re&&(H[re]=ne),K&&(H[K]=ne),H},{}),v=Xu(b===!0?Object.keys(n):b,T),M=v.filter(H=>n[H]?Ag(A,_,H):(vg(`Column with id "${H}" specified in columnOrder array cannot be found in the columns map.`),!1)),N=new Map,G=M.map((H,ne)=>{let K=n[H];return N.set(H,ne),K}),$=(f??[]).reduce((H,ne,K)=>(ne.id?H[ne.id]={sortInfo:ne,index:K}:ne.field&&(H[ne.field]={sortInfo:ne,index:K}),H),{});function te(H){let ne=n[H],K=va(ne,D),re={minWidth:K?.minWidth,maxWidth:K?.maxWidth,width:K?.defaultWidth,flex:K?.defaultFlex},ge=Da({width:ne?.defaultWidth,flex:ne?.defaultFlex,minWidth:ne?.minWidth,maxWidth:ne?.maxWidth},x[H]);ge.width!=null&&delete re.flex,ge.flex!=null&&delete re.width,ge=Da(re,ge);let ie=ge.flex??void 0,We=ge.minWidth??ne?.minWidth??t,dt=ge.maxWidth??ne?.maxWidth??o,bt=ie!=null?void 0:ge.width??(i?void 0:r);return!bt&&ie==null&&(i?ie=i:bt=We),{size:bt,flex:ie,minSize:We,maxSize:dt}}let he=Pa({availableSize:Math.max(e.width-(g??0)-(a??jt()),0),maxSize:o,minSize:t,items:M.map(te)}),{computedSizes:ue,flexSizes:z,minSizes:k,maxSizes:ae}=he,oe=[],W=[],V=[],L=[];L.length=M.length;let Z=new Map,j=new Map,se=0,Q=0,O=0,be=null,Te=[],B=0,ee=0,ce=0;G.forEach((H,ne)=>{let K=M[ne],re=ue[ne],ge=Te[ne]=Aa(K,T);ge==="start"?B+=re:ge==="end"?ce+=re:ee+=re});let xe=e.width-ce,we=[],Ne=new Map;M.forEach((H,ne)=>{let K=G[ne];Ne.set(H,K)});let Ae=[];Object.keys(n).forEach(H=>{let ne=n[H];Ae.push(H),Ne.has(H)||Ne.set(H,ne)});let He=new Map;Ne.forEach((H,ne)=>{let K=N.get(ne);K==null&&(K=-1);let re=K!=-1,ge=M[K+1],ie=va(H,D),We=K,dt=$[ne]?$[ne]:H.field?$[H.field]??null:null,bt=dt?.sortInfo??null,io=!!bt,wo=io&&bt.dir===1,Yn=io&&!wo,qn=dt?.index??-1,Jo=re?{}:te(ne),Xn=re?ue[K]:Jo.size||0,_i=re&&z[K]||null,Fi=re?k[K]||0:Jo.minSize||0,Oi=re?ae[K]||1e4:Jo.maxSize||1e4,de=re?Aa(ne,T):!1,je=re?K===M.length-1:!1,pt=We,ht=re?de==="start"?Q:de==="end"?O:E-Q:0;de=="start"?pt=re?We:-1:de==="end"?pt=re?We-(oe.length+V.length):-1:pt=re?We-oe.length:-1;let en=re?de==="start"||de===!1?E:xe+O:-1,zm=re?de!==be:!1,Gm=re?je||de!==Aa(ge,T):!1,Yl=H.cssEllipsis??ie.cssEllipsis??l,Km=H.headerCssEllipsis??ie.cssEllipsis??H.cssEllipsis??ie.headerCssEllipsis??s??Yl,Zn=re&&(F[ne]||H.field||H.groupByForColumn)&&(F[ne]||F[H.field||H.groupByForColumn])||null,Hm=H.defaultFilterable??ie.defaultFilterable??w??!0,Bm=I??H.defaultEditable??ie.defaultEditable??R??!1,Ni=H.dataType||ie.dataType||(Array.isArray(H.type)?H.type[0]:H.type)||Dg,km=H.sortType||ie.sortType||Ni,ql=H.filterType||ie.filterType||Ni,Xl=!1;if(Zn!=null&&!Zn.disabled){let Vi=h[ql];Vi&&(!Vi.emptyValues||!Vi.emptyValues.includes(Zn.filter.value))&&(Xl=!0)}let Zl=H.field??ie.field,Ql=H.valueGetter??ie.valueGetter,Li=H.defaultSortable??ie.defaultSortable;Li==null&&!H.groupByForColumn&&Zl==null&&Ql==null&&(Li=!1);let Wm=p??Li??P??xr,jm=H.resizable??ie.resizable??y??Pg,ze={colType:ie,align:ie.align,headerAlign:ie.headerAlign,computedVisible:re,verticalAlign:ie.verticalAlign,defaultHiddenWhenGroupedBy:ie.defaultHiddenWhenGroupedBy,valueGetter:Ql,valueFormatter:ie.valueFormatter,renderValue:ie.renderValue,render:ie.render,style:ie.style,contentFocusable:ie.contentFocusable,renderMenuIcon:ie.renderMenuIcon,renderSortIcon:ie.renderSortIcon,renderRowDetailIcon:ie.renderRowDetailIcon,renderSelectionCheckBox:ie.renderSelectionCheckBox,renderHeaderSelectionCheckBox:ie.renderHeaderSelectionCheckBox,headerStyle:ie.headerStyle,headerClassName:ie.headerClassName,columnGroup:ie.columnGroup,getValueToEdit:ie.getValueToEdit,getValueToPersist:ie.getValueToPersist,shouldAcceptEdit:ie.shouldAcceptEdit,field:Zl,...H,components:{...ie.components,...H.components},computedResizable:jm,computedMinWidth:Fi,computedMaxWidth:Oi,computedFlex:_i,computedDataType:Ni,computedEditable:Bm,computedSortType:km,computedFilterType:ql,cssEllipsis:Yl,headerCssEllipsis:Km,computedFilterValue:Zn,computedFiltered:Xl,computedFilterable:Hm,computedWidth:Xn,computedAbsoluteOffset:en,computedPinningOffset:ht,computedVisibleIndexInCategory:pt,computedOffset:E,computedSortable:Wm,computedSortInfo:bt,computedSortIndex:qn,computedMultiSort:m,computedSorted:io,computedSortedAsc:wo,computedSortedDesc:Yn,computedVisibleIndex:We,computedPinned:de,computedDraggable:C??H.defaultDraggable??S??xg,computedFirstInCategory:zm,computedLastInCategory:Gm,computedFirst:K===0,computedLast:je,id:ne,header:H.header??ie.header??H.name??H.field};re&&(E+=Xn,Z.set(ze.id,ze),L[K]=ze,de==="start"&&(oe.push(ze),Q+=ze.computedWidth),de==="end"&&(W.push(ze),O+=ze.computedWidth),de||(V.push(ze),se+=ze.computedWidth),be=de),ze.groupByForColumn&&(ze.computedSortType=H.sortType||ie.sortType||No,we.push(ze)),j.set(ze.id,ze),ze.field&&!ze.groupByForColumn&&!He.has(ze.field)&&He.set(ze.field,ze)}),we.forEach(H=>{H.computedSortable=ec(H,{fieldsToColumn:He,sortable:p,columnDefaultSortable:P})});let Ue=new Map;Ae.forEach(H=>{let ne=j.get(H);ne&&Ue.set(H,ne)}),j.forEach(H=>{Ue.has(H.id)||Ue.set(H.id,H)});let ke=u!=null?Math.min(u,Q):Q,nt=c!=null?Math.min(c,O):O;return{computedRemainingSpace:e.width-(B+ce+ee),computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:se,computedColumnOrder:v,computedPinnedStartColumns:oe,computedPinnedEndColumns:W,computedUnpinnedOffset:Q,computedPinnedEndOffset:Q+se,computedUnpinnedColumns:V,computedVisibleColumns:L,computedColumnsMap:j,computedColumnsMapInInitialOrder:Ue,computedVisibleColumnsMap:Z,computedPinnedEndWidth:nt,computedPinnedStartWidth:ke,renderSelectionCheckBox:L.reduce((H,ne)=>H||!!ne.renderSelectionCheckBox,!1),fieldsToColumn:He}};function ec(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r}=e;if(t)return t;let i=n.defaultSortable??n.colType.defaultSortable;if(i!=null)return i;let a=r??xr;return n.computedSortType!==No&&a?!0:s=>{let{column:u,api:c}=s,d=u.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.groupField,h;if(m){let g=o.get(m),y=g?c.getColumnApi(g.id):void 0;g&&y?h=y.isSortable():h=!1}return h===void 0&&f.valueGetter&&(h=!0),h??r??xr},!0)}}function qe(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function Dr(n,e){let t=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,{api:o,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,u=i(),{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=u,f=r(),m=t.header&&typeof t.header!="function"?t.header:t.name||t.id||"";if(typeof t.header=="function"){let h=qe(t.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});m=t.header({horizontalLayoutPageIndex:null,column:t,columnApi:h,dataSourceApi:s,insideColumnMenu:!0,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:t.computedSortInfo,columnFilterValue:t.computedFilterValue,filtered:t.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:o,renderBag:{header:m}})??null}return m}import*as tc from"react";var vr=`${et}HeaderCell__filter`,Ea=`${et}HeaderCell__filterOperator`,Ma=tc.createContext(null);var Mg=`${vr}__input`,Ar=n=>n.stopPropagation();function nc(n){let{filterOperatorMenuVisibleForColumnId:e}=vu(),{column:t}=Er(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=oc(!1),l=$e.useCallback(()=>{a(!0)},[]),s=$e.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return $e.createElement("div",{onPointerUp:Ar,onPointerDown:Ar,onFocus:l,onBlur:s,className:`${vr} ${wa({active:u})}`,style:{height:n.columnHeaderHeight}},$e.createElement(Ma.Provider,{value:n},$e.createElement(r,null),$e.createElement(o,null)))}function rc(){let{columnApi:n,disabled:e,operator:t}=In(),o=t?.components?.Icon??Oo;return $e.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:J(Ea,Lu,e?`${Ea}--disabled`:"")},$e.createElement(o,{size:20,className:`${Vu({disabled:e})}`}))}function ic(){return $e.createElement("div",{onPointerUp:Ar,onPointerDown:Ar,className:`${vr} ${wa({active:!1})} ${lu["50%"]}`})}function In(){let n=X(),{column:e,columnApi:t}=Er(),o=Dr(e,n),r=$e.useContext(Ma),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=oc(l?.filter.value??""),d=$e.useCallback(g=>{c(g),r.onChange(g)},[r.onChange]),p=$e.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),f=$e.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);Eg(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let g=[...s.emptyValues][0];g!==u&&c(g)}},[l?.filter.value]);let m=r.operator,h=m?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:h,operator:m,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${o}`,className:`${Ou} ${Mg}`}}function Lo(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=In();return _a.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function Mr(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=In();return _a.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}function _g(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:Lo},operators:[{name:"includes",components:{Icon:Su},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:ga},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:Du},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:bu},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Mr},operators:[{label:"Equals",components:{Icon:ga},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:xu},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:Iu},fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>t},{name:"gte",components:{Icon:Ru},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>=t},{name:"lt",components:{Icon:Pu},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<t},{name:"lte",components:{Icon:wu},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<=t}]}}}var po=_g();function _r(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as wc,useState as jg}from"react";var ac="_16lm1iw1",lc="_1yeub2v0 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw0",sc="_1yeub2vs",uc="_1yeub2vr",cc=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 Fa="_1yeub2vp";var zD=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Oa=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};var wn={bodyWidth:{name:Y(le.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Y(le.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Y(le.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Y(le.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Y(le.runtime.browserScrollbarWidth),value:""}},Fg=Y(U.scrollbarWidthHorizontal),dc=Y(U.scrollbarWidthVertical),Og=Y(U.columnWidthAtIndex),Ng=Y(U.columnZIndexAtIndex),pc=Y(U.scrollLeft),Lg=Y(U.activeCellColWidth),fc=Y(U.activeCellColOffset),yc=Y(U.baseZIndexForCells),Vg=Y(U.pinnedStartWidth),mc=Y(U.bodyWidth),zg=Y(U.bodyHeight),hc=Y(U.pinnedEndOffset),gc=Y(U.pinnedEndWidth),Gg=Y(U.computedVisibleColumnsCount);function Na(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${yc}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Cc(n){let e=jt(),{computed:t,state:o,actions:r,getState:i}=X(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:u,onBlurWithin:c,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:h,wrapRowsHorizontally:g}=o,{computedPinnedStartColumnsWidth:y,computedPinnedEndColumnsWidth:C,computedPinnedStartColumns:S,computedPinnedEndColumns:b,computedVisibleColumns:T,computedUnpinnedColumnsWidth:I,scrollbars:R}=t,w=[],P=T.reduce((v,M)=>{let N=M.computedVisibleIndex;v[Ce.columnWidths.varName.get(N)]=M.computedWidth+"px",v[Ce.columnOffsets.varName.get(N)]=M.computedPinned==="start"?`calc( ${M.computedOffset}px + var(${pc}) )`:M.computedPinned==="end"?`calc( var(${hc}) ${w.length?"+":""} ${w.map($=>Ce.columnWidths.get($.computedVisibleIndex)).join(" + ")} + var(${pc}) )`:`${M.computedOffset}px`;let G=Na(M,{pinnedStartColsCount:S.length,visibleColsCount:T.length});return v[`${Ng}-${N}`]=`${G}`,M.computedPinned==="end"&&w.push(M),v},{});if(m.width&&(P[wn.browserScrollbarWidth.name]=`${jt()}px`),P[wn.bodyWidth.name]=`calc(${U.bodyWidth} - ${U.scrollbarWidthVertical})`,P[wn.totalVisibleColumnsWidthValue.name]=`${y+C+I}px`,P[wn.totalVisibleColumnsWidthVar.name]=`calc(${T.map((v,M)=>`var(${Og}-${M})`).join(" + ")})`,P[wn.visibleColumnsCount.name]=T.length,h!=null){P[Lg]=Ce.columnWidths.get(h[1]);let v=Ce.columnOffsets.get(h[1]);if(o.brain.isHorizontalLayoutBrain){let M=o.brain.getPageIndexForRow(h[0]);P[fc]=M?`calc( ${le.runtime.totalVisibleColumnsWidthVar} * ${M} + ${v})`:v}else P[fc]=v}P[Gg]=T.length,P[Fg]=R.horizontal?`${e}px`:"0px",P[dc]=R.vertical?`${e}px`:"0px",P[Vg]="calc( "+S.map(v=>Ce.columnWidths.get(v.computedVisibleIndex)).join(" + ")+")",P[gc]="calc( "+b.map(v=>Ce.columnWidths.get(v.computedVisibleIndex)).join(" + ")+")",P[yc]=T.length*10,P[hc]=`calc( var(${mc}) - var(${gc}) - var(${dc}) )`,P[mc]=`${m.width}px`,P[zg]=`${m.height}px`;let x=Oa(v=>{r.focused=v}),D=Oa(v=>{r.focusedWithin=v}),E={...n,onFocus:v=>{if(n?.onFocus?.(v),v.target===s.current||v.target===u.current){if(i().focused)return;x(!0),p?.(v),l&&(D(!1),c?.(v));return}l||(D(!0),d?.(v))},onBlur:v=>{if(n?.onBlur?.(v),v.target===s.current||v.target===u.current){if(!i().focused)return;x(!1),f?.(v),l&&(D(!1),c?.(v));return}s.current?.contains(v.relatedTarget)||(D(!1),c?.(v))}},F=J(Mt,lc,g?`${Mt}--horizontal-layout`:null,E?.className,y?`${Mt}--has-pinned-start ${uc}`:null,C?`${Mt}--has-pinned-end ${sc}`:null,a?`${Mt}--focused`:null,l?`${Mt}--focused-within`:null,a&&o.focusedClassName?o.focusedClassName:null,l&&o.focusedWithinClassName?o.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Mt}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Mt}--has-pinned-end-overflow`:null,cc({horizontalLayout:!!g,hasPinnedStart:!!y,hasPinnedEnd:!!C,focused:a,focusedWithin:l}));return E.className=F,E.style={...n?.style,...P},a&&o.focusedStyle&&Object.assign(E.style,o.focusedStyle),l&&o.focusedWithinStyle&&Object.assign(E.style,o.focusedWithinStyle),E}var Rc=tn(vo());function Fr(n){return n.map(e=>e instanceof at?e:new at(null,[e]))}var at=class{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new at("+",[this,...e])}subtract(...e){return new at("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new at("*",[this,...e])}divide(...e){return new at("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>Kg(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function Kg(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var Hg=(...n)=>new at("+",Fr(n)),Tc=(...n)=>new at("-",Fr(n)),Bg=(...n)=>new at("*",Fr(n)),kg=(...n)=>new at("/",Fr(n)),Or={add:Hg,subtract:Tc,minus:Tc,multiply:Bg,divide:kg};var Pn=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var Sc=n=>{let e=null,t=null;return{stop(){e!==null&&gt(e),t!=null&&gt(t)},scroll(o){e!==null&&gt(e),t!=null&&gt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft-p,e=ve(()=>{i.scroll(o)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft+p,t=ve(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var bc=10,Wg=Y(U.pinnedStartWidth);function Ic(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,setProxyPosition:d,api:p,horizontalLayoutPageIndex:f,pageWidth:m}=n;function h(W){let V=W==="start"?E:F;return D===_?V:_===W?V+P.computedWidth:D===W?V-P.computedWidth:V}function g(W){if(W.columnIndex===x||f!=null)return!0;let V=e[W.columnIndex];if(V.computedPinned)return!0;let L=l.getScrollPosition().scrollLeft,Z=V.computedOffset+(f!=null&&m!=null?m*f:0);return Z>=L+h("start")&&Z+V.computedWidth<=L+c.width-h("end")}let y=(W,V)=>{let{restrictToParentGroup:L,dragColumn:Z}=V,j=[];if(W.forEach(Q=>{if(Q.computedVisibleIndex===x)return;let O={columnId:Q.id,columnIndex:Q.computedVisibleIndex,offsetX:Q.computedOffset+Math.round(Q.computedWidth/2)};g(O)&&j.push(O)}),L){let O=function(Te,B,ee){let ce=W[Te];ce&&(ce.columnGroup!==Z.columnGroup&&ee.add(ce.id),O(Te+B,B,ee))};var se=O;let Q=Z.computedVisibleIndex,be=new Set;O(Q-1,-1,be),O(Q+1,1,be),j=j.filter(Te=>!be.has(Te.columnId))}return j},S=r.length,b={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},T={left:b.clientX-c.left-(b.clientX-s.left)+bc,top:b.clientY-c.top-(b.clientY-s.top)+bc},I=l.getScrollPosition(),R=e.map(W=>W.computedVisibleIndex),w=R,P=t.get(i),x=P.computedVisibleIndex,D=P?.computedPinned,A=x,_=D,E=l.getFixedStartColsWidth(),F=l.getFixedEndColsWidth(),v=b,M={x:0,y:0},N=1,G=0;function $(W){let V=Math.round(W.clientX),L=Math.round(W.clientY);if(V===v.clientX&&L===v.clientY)return;v={clientX:V,clientY:L};let j=l.getScrollPosition().scrollLeft-I.scrollLeft;M.x=v.clientX-b.clientX,M.y=v.clientY-b.clientY,G=M.x+j,N=G<0?-1:1,d({left:T.left+M.x,top:T.top+M.y})}function te(W){let V=0;D?D==="start"&&W.forEach((L,Z)=>{V||e[L]?.computedPinned!=="start"&&(V=Z)}):W.forEach((L,Z)=>{e[L]?.computedPinned==="start"&&(V=Z+1)}),S=V,he("start",W,V)}function he(W,V,L){if(W==="start"){let Z=0;for(let j=0;j<L;j++){let se=V[j],Q=e[se];Z+=Q.computedWidth}vt(Wg,`${Z}px`,a)}}function ue(W){if(W==null||W===A)return;A=W;let V=Pn(R,x,A>x?A-1:A);S=0;let Z=new Set;return V.forEach((j,se)=>{let Q=w[se];j!==Q&&Z.add(j),te(V)}),w=V,z(Z),{newColumnIndexes:V,indexesWithTransition:Z,pinnedStartCount:S}}function z(W){e.forEach(V=>{let L=V.computedVisibleIndex;W.has(L)?Ds(L,a):ir(L,a);let Z=L===x,j=N===-1?L<A||L>x:L<x||L>=A,se="";N===-1?se=Z?Ce.columnOffsets.get(A):j?Ce.columnOffsets.get(L):Or.add(Ce.columnOffsets.get(L),Ce.columnWidths.get(x)).done():se=j?Ce.columnOffsets.get(L):Z?Or.add(Ce.columnOffsets.get(A-1),Ce.columnWidths.get(A-1)).minus(Ce.columnWidths.get(x)).done():Or.minus(Ce.columnOffsets.get(L),Ce.columnWidths.get(x)).done(),cn(L,se,a)})}let k=c.left+h("start"),ae=c.right-h("end"),oe=Sc({scrollOffsetStart:k,scrollOffsetEnd:ae});return $(b),{speedScroller:oe,stop(){oe.stop()},onMove(W){$(W),oe.scroll({mousePosition:v,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(Q){p.scrollLeft=Q}});let V=y(e,{dragColumn:P,restrictToParentGroup:u==="group"}),L=N===-1?P.computedOffset+G:P.computedOffset+P.computedWidth+G,Z=(0,Rc.default)(V,L,({offsetX:Q},O)=>Q<O?-1:Q>O?1:0);Z<0&&(Z=~Z),V.length?Z=V[Z]?V[Z].columnIndex:V[V.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),Z=0),Z===x+1&&(Z=x),ue(Z);let j={};o.forEach(Q=>{j[Q.id]="end"});for(let Q=0;Q<S;Q++){let O=w[Q],be=e[O];j[be.id]="start"}let se=w.map(Q=>e[Q].id);return{columnPinning:j,columnOrder:se}}}}function $t(n,e,t){if(n===e)return!0;if(!n||!e)return!1;var o=Object.keys(n),r=Object.keys(e);t&&(o=o.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=o.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=o[a];if(!(t&&t.has(l))&&(n[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function La(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],u=o.indexOf(s),c=o.indexOf(r);return Pn(o,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=o.indexOf(s),c=o.indexOf(r);return Pn(o,c,u)}return e}var $g=Y(U.baseZIndexForCells),Ug=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:$t(n,e)},Pc=({columnId:n,domRef:e,horizontalLayoutPageIndex:t})=>{let[o,r]=jg(null),{actions:i,computed:a,getComputed:l,getState:s,api:u,state:{domRef:c}}=X(),d=wc(f=>{let m=l().computedVisibleColumnsMap.get(n);if(!m||!m.computedSortable)return;let{multiSortBehavior:h}=s();u.toggleSortingForColumn(n,{multiSortBehavior:h==="replace"&&(f.ctrlKey||f.metaKey)?"append":h})},[]),p=wc(f=>{let m=f.target?.tagName;if(m==="INPUT"||m==="BUTTON")return;let{brain:h,draggableColumnsRestrictTo:g}=s(),{computedVisibleColumns:y,computedVisibleColumnsMap:C,computedPinnedStartColumns:S,computedUnpinnedColumns:b,computedPinnedEndColumns:T}=l(),I=C.get(n);if(!I.computedDraggable){d(f);return}let R=e.current,w=R.getBoundingClientRect(),P=c.current.getBoundingClientRect(),x=h.getAvailableSize(),D=I.computedVisibleIndex,A=h.getVirtualColIndex(I.computedVisibleIndex,{pageIndex:t||0}),_=h.isHorizontalLayoutBrain?h.getPageWidth():null,E=R.style.cursor??"auto",F=!1,v=Ic({brain:h,horizontalLayoutPageIndex:t,pageWidth:_,draggableColumnsRestrictTo:g,computedPinnedEndColumns:T,computedPinnedStartColumns:S,computedUnpinnedColumns:b,computedVisibleColumns:y,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:w,dragColumnId:n,api:u,infiniteDOMNode:c.current,setProxyPosition:r,tableRect:P,initialMousePosition:{clientX:f.clientX,clientY:f.clientY}}),M=null,N,G;function $(ue){let{columnPinning:z,columnOrder:k}=ue;Ug(s().columnPinning,z)||(i.columnPinning=z);let ae=l().computedColumnOrder;JSON.stringify(k,ae)&&(y.forEach(oe=>{cn(oe.computedVisibleIndex,"",c.current)}),i.columnOrder=La({newColumnOrder:k,visibleColumnOrder:l().computedVisibleColumns.map(oe=>oe.id),existingColumnOrder:ae,dragColumnId:n}))}let te=ue=>{let{headerBrain:z,brain:k}=s();if(!F){F=!0;let ae=k.keepColumnRendered(A),oe=z.keepColumnRendered(A);if(k.isHorizontalLayoutBrain){let V=k.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),L=z.extendRenderRange({start:!0,end:!0,direction:"horizontal"});G=()=>{V(),L()}}N=()=>{ae(),oe()},i.columnReorderDragColumnId=I.id,t!=null&&(i.columnReorderInPageIndex=t),Qi(D,`calc( var(${$g}) + 10000 )`,c.current),c.current?.classList.add(Fa),R.style.cursor="grabbing"}M=v.onMove(ue)},he=ue=>{let{multiSortBehavior:z}=s(),k=e.current;c.current?.classList.remove(Fa),v.stop(),h.update({...x}),N?.(),G?.(),y.forEach(oe=>{ir(oe.computedVisibleIndex,c.current),cn(oe.computedVisibleIndex,"",c.current)}),Qi(D,Na(I,{pinnedStartColsCount:S.length,visibleColsCount:y.length}),c.current),k.style.cursor=E,k.releasePointerCapture(ue.pointerId),k.removeEventListener("pointermove",te),k.removeEventListener("pointerup",he),r(null);let ae=u.getColumnApi(I.id)?.isSortable()??!1;!F&&ae&&u.toggleSortingForColumn(I.id,{multiSortBehavior:z==="replace"&&(ue.ctrlKey||ue.metaKey)?"append":z}),M&&$(M),i.columnReorderDragColumnId=!1,t!=null&&(i.columnReorderInPageIndex=null)};R.addEventListener("pointermove",te),R.addEventListener("pointerup",he),R.setPointerCapture(f.pointerId)},[n,t]);return{onPointerDown:a.computedVisibleColumnsMap.get(n)?.computedDraggable?p:d,proxyPosition:o}};import*as zo from"react";import*as fe from"react";import{useCallback as ot,useContext as ly,useMemo as sy}from"react";import*as mo from"react";var xc=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;import*as xn from"react";import{useState as Yg}from"react";var Dc="_6rdmyg0 _16lm1iwn _16lm1iwi _16lm1iw9",vc=ye({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwg",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwh"]]});var Nr=`${it}-expand-collapse`;function fo(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=Yg(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),Wt("expanded",n)||i(!r)};xn.useEffect(()=>{Wt("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return xn.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:J(n.className,Dc,vc({direction:t||"start",expanded:r,disabled:o}),`${it}`,`${Nr}`,`${Nr}--${l}`,`${Nr}--${t==="end"?"end":"start"}`,o?`${Nr}--disabled`:"")},xn.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as Lr from"react";var Ac="_16lm1iwb _16lm1iwn _16lm1iwi";var Ec=n=>Lr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:J(n.className,Ac,"InfiniteIcon","InfiniteIcon-loading")},Lr.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},Lr.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Mc=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),_c="_7pupv00",Fc=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Oc({rowInfo:n}){return{[Y(le.components.Row.groupNesting)]:n.dataSourceHasGrouping?n.isGroupRow?n.groupNesting-1:n.groupNesting:0}}function Vr({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=o,d=J(Mo.flex,i.align==="end"?Sn.rowReverse:Sn.row,iu.center,`${ho}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||u)?Mc({align:a}):null);if(e==="multi-column"){if(n+1!==c.groupNesting&&c.isGroupRow)return u?mo.createElement("div",{className:d},u):null}else e==="single-column"&&c.isGroupRow;return mo.createElement("div",{className:d},s,u,mo.createElement("div",{className:It},l??null))}}function zr({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===n&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&n+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(c.groupKeys?.length||0)<l?.length:(c.groupKeys?.length||0)<=l?.length;return xc(c)?f=mo.createElement(Ec,null):m&&(f=mo.createElement(fo,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),o&&(r.renderBag.groupIcon=f,f=mo.createElement(tt,{render:o,renderParam:r})),f}}function Nc(n,e,t){let{groupByForColumn:o,groupIndexForColumn:r,groupRenderStrategy:i}=n,a=o.column?{...o.column}:{},l={header:`Group by ${o.field||o.groupField}`,groupByForColumn:o,render:Vr({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:zr({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(n,e)}:l={...l,...t}),l}function Lc(n,e,t){let o=typeof t=="function"?t(n,e):t,r={};return n.sortable!=null&&(r.sortable=n.sortable),{...r,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:Vr({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...o,renderGroupIcon:zr({initialRenderGroupIcon:o?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Vc(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}import*as Gr from"react";import{useEffect as qg,useRef as Xg}from"react";var zc="qz8ht90 _16lm1iwi";function Zg(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:Qg}=Et({forwardProps:Zg,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function Jg(){let{componentState:n,componentActions:e}=Ke(),{checked:t,domProps:o,disabled:r}=n,i=Xg(null);return qg(()=>{i.current.indeterminate=t==null},[t]),Gr.createElement("input",{...o,className:J("InfiniteCheckBox",zc,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function Ut(n){return Gr.createElement(Qg,{...n},Gr.createElement(Jg,null))}function ey(n){return typeof n.field=="string"}function Gc(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?o.get(i.field||i.groupField):void 0}!r&&e.field&&(r=o.get(e.field))}return r}function lt(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:h}=o(),g=r===f&&m==="row",y=!h||typeof h=="function"&&!h(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:C,formattedValueContext:{rawValue:S}}=Vo({column:p,rowInfo:u,rowDetailState:y,columnsMap:e().computedColumnsMap,context:n}),b=qe(p.id,n);return c?{api:a,dataSourceApi:l,column:p,columnApi:b,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}}function Kc(n){return Bc(n.column,n.rowInfo)}function Hc(n){let{column:e,context:t,rowInfo:o,visibleColumnsIds:r}=n,i=Gc({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Vo(n),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:c,stylingParam:d,formattedValueContext:u,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:ty({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnsIds:n.visibleColumnsIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function ty(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=n,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:h}=f(),{indexInAll:g}=o,y=p(),{selectionMode:C,cellSelection:S}=y,b=Gc({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),T=d.toggleGroupRow,I=S?.isCellSelected(o.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:I,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...u,editError:h&&h.primaryKey===o.id&&h.columnId===e.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:b,selectionMode:C,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:g,toggleGroupRow:T,toggleCurrentGroupRow:()=>{o.isGroupRow&&T(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:y.groupBy,pivotBy:y.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),R}function Bc(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:ey(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function oy(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}}function Vo(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=Bc(e,t),a=oy(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as _t from"react";var{rootClassName:kc}=De,go=`${kc}Cell`,Va=`${kc}Cell_content`,ny=Y(U.columnWidthAtIndex),ry=Y(U.columnReorderEffectDurationAtIndex);function iy(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:h,...g}=n,y=m(),C={width:`var(${ny}-${i.computedVisibleIndex})`,transition:`transform var(${ry}-${i.computedVisibleIndex}, 0s)`,...g.style},S={...g,style:C,"data-column-id":i.id,"data-z-index":C.zIndex,className:J(g.className,go,Ys),children:_t.createElement(_t.Fragment,null,d,_t.createElement("div",{className:J(Va,e?It:du.hidden,s),style:r},y),c)};u!=null&&(S["data-row-id"]=`${u}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?_t.createElement(b,{...S,ref:a}):_t.createElement("div",{...S,ref:a})}var Kr=_t.memo(iy);import*as yo from"react";import{useCallback as Wc,useRef as ay}from"react";function jc(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=za(),i=ay(),a=yo.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=Wc(s=>{let{key:u}=s;u==="Enter"||u==="Tab"?t():u==="Escape"?o():s.stopPropagation()},[]);return yo.createElement(yo.Fragment,null,yo.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:J(ru,cu.none),type:"text",defaultValue:n,onChange:Wc(s=>{e(s.target.value)},[])}))}var{rootClassName:uy}=De,cy=Y(U.columnZIndexAtIndex);function dy({rowInfo:n}){return{[Y(le.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}var Dn=fe.createContext(null),ho=`${uy}ColumnCell`,py=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return fe.createElement(fo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},fy={display:"inline-block",visibility:"visible"},Ga=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return fe.createElement(fo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:fy,expanded:o,onChange:t})},my=n=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:o,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=n;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),u=l.getDataSourceState().isNodeSelectable,c=s?.CheckBox||Ut;return fe.createElement(c,{domProps:{className:yr},disabled:e.isTreeNode?!u(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():o()},checked:e.rowSelected})};function Ka(n,e){return n?typeof n=="function"?n(e):n:void 0}function Ha(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function hy(n){let{rowInfo:e,rowStyle:t,rowClassName:o,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:u,width:c,column:d,onMouseLeave:p,onMouseEnter:f,onRowMouseEnter:m,onRowMouseLeave:h,rowIndex:g,rowHeight:y,columnsMap:C,fieldsToColumn:S,domRef:b,hidden:T,showZebraRows:I}=n,R=fe.useRef(null),w=ot(de=>{R.current=de,b&&b(de)},[b]);if(!d)return fe.createElement("div",{ref:w},"no column");let{rowSelected:P}=e,{getState:x,actions:D,computed:A,api:_,getDataSourceMasterContext:E}=X(),{componentState:F,getState:v,api:M,componentActions:N}=Ie(),{activeRowIndex:G,keyboardNavigation:$,columnReorderInPageIndex:te}=x(),he=g===G&&$==="row",ue={getState:x,getDataSourceState:v,getDataSourceMasterContext:E,actions:D,dataSourceActions:N,api:_,dataSourceApi:M},z=e.rowDisabled,k=A.computedVisibleColumns.map(de=>de.id),ae=Hc({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:u,columnsMap:C,visibleColumnsIds:k,fieldsToColumn:S,context:ue}),{stylingParam:oe,renderParams:W,formattedValueContext:V,renderFunctions:L,groupByColumnReference:Z,inEdit:j}=ae,{align:se,verticalAlign:Q}=W,O=W,be=fe.useRef(O),Te=m&&f?de=>{let pt={...V,rowIndex:g};m(pt,de),f(de)}:f,B=h&&p?de=>{let je={...V,rowIndex:g,rowInfo:e};h(je,de),p(de)}:p,ee=ot(de=>{let je=d.computedVisibleIndex;x().cellClick({rowIndex:g,colIndex:je,event:de})},[g,d.computedVisibleIndex,$]),ce=ot(de=>{let je=d.computedVisibleIndex;if(x().cellMouseDown({rowIndex:g,colIndex:je,event:de}),$==="row"){z||(D.activeRowIndex=g);return}$==="cell"&&(D.activeCellIndex=[g,je])},[g,z,d.computedVisibleIndex,$]),{selectionMode:xe,cellSelection:we,isNodeReadOnly:Ne}=F,Ae=O.cellSelected;O.domRef=w,O.htmlElementRef=R,O.toggleCurrentTreeNode=ot(O.toggleCurrentTreeNode,[e]),O.selectCell=ot(O.selectCell,[e]),O.deselectCell=ot(O.deselectCell,[e]),O.selectCurrentRow=ot(O.selectCurrentRow,[e]),O.deselectCurrentRow=ot(O.deselectCurrentRow,[e]),O.toggleCurrentGroupRow=ot(O.toggleCurrentGroupRow,[e]),O.toggleCurrentRowSelection=ot(O.toggleCurrentRowSelection,[e]),O.toggleCurrentGroupRowSelection=ot(O.toggleCurrentGroupRowSelection,[e]),O.toggleCurrentTreeNodeSelection=ot(O.toggleCurrentTreeNodeSelection,[e]);let He=d.components?.Editor??jc,Ue=j?fe.createElement(Uc,{contextValue:O},fe.createElement(He,null)):null,ke=ot(Ye(()=>{if(T||j)return null;if(be.current=O,L.renderGroupIcon&&(O.renderBag.groupIcon=fe.createElement(tt,{render:L.renderGroupIcon,renderParam:{...O,renderBag:{...O.renderBag}}})),L.renderSelectionCheckBox&&xe=="multi-row"&&(O.renderBag.selectionCheckBox=fe.createElement(tt,{render:my,renderParam:O}),L.renderSelectionCheckBox!==!0&&(O.renderBag.selectionCheckBox=fe.createElement(tt,{render:L.renderSelectionCheckBox,renderParam:{...O,renderBag:{...O.renderBag}}}))),e.isTreeNode){let{isParentNode:pt}=e,ht;ht=(pt?L.renderTreeIconForParentNode:L.renderTreeIconForLeafNode)||typeof L.renderTreeIcon=="function"?L.renderTreeIcon:pt&&L.renderTreeIcon===!0?Ga:void 0,ht===!0?ht=Ga:ht&&(O.renderBag.treeIcon=fe.createElement(tt,{render:Ga,renderParam:O})),ht&&(O.renderBag.treeIcon=fe.createElement(tt,{render:ht,renderParam:{...O,renderBag:{...O.renderBag}}}))}L.renderRowDetailIcon&&(O.renderBag.rowDetailsIcon=fe.createElement(tt,{render:py,renderParam:{...O,renderBag:{...O.renderBag}}}),typeof L.renderRowDetailIcon=="function"&&(O.renderBag.rowDetailsIcon=fe.createElement(tt,{render:L.renderRowDetailIcon,renderParam:{...O,renderBag:{...O.renderBag}}}))),L.renderValue&&(O.renderBag.value=fe.createElement(tt,{render:L.renderValue,renderParam:{...O,renderBag:{...O.renderBag}}})),e.isGroupRow&&L.renderGroupValue&&(O.renderBag.value=fe.createElement(tt,{render:L.renderGroupValue,renderParam:{...O,renderBag:{...O.renderBag}}})),!e.isGroupRow&&L.renderLeafValue&&(O.renderBag.value=fe.createElement(tt,{render:L.renderLeafValue,renderParam:{...O,renderBag:{...O.renderBag}}})),be.current=O;let de=O.renderBag.value;de instanceof Date&&(de=de.toLocaleDateString());let je=fe.createElement(fe.Fragment,null,se!=="end"?O.renderBag.treeIcon:null,se!=="end"?O.renderBag.groupIcon:null,se!=="end"?O.renderBag.rowDetailsIcon:null,se!=="end"?O.renderBag.selectionCheckBox:null,de,se==="end"?O.renderBag.selectionCheckBox:null,se==="end"?O.renderBag.rowDetailsIcon:null,se==="end"?O.renderBag.groupIcon:null,se==="end"?O.renderBag.treeIcon:null);return d.render?fe.createElement(tt,{render:d.render,renderParam:{...O,renderBag:{...O.renderBag,all:je}}}):je}),[d,T,j,u,d.renderTreeIcon||d.renderTreeIconForParentNode?Ne:!1,...Vc(O,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),nt=A.computedVisibleColumns.map(de=>de.id),Qe=A.computedColumnOrder,H={...V,visibleColumnIds:nt,allColumnIds:Qe,rowIndex:g,rowHasSelectedCells:!1};Object.defineProperty(H,"rowHasSelectedCells",{get(){return e.hasSelectedCells(nt)}});let ne=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),K=typeof o=="function"?o(H):o,re;Z?.className&&(re=Ka(Z.className,oe)),s&&(re=J(re,Ka(s,oe))),d.className&&(re=J(re,Ka(d.className,oe))),ne&&(re=J(re,Fc({align:se})));let ge;e.dataSourceHasGrouping&&d.groupByForColumn&&(ge=Oc({rowInfo:e})),ne&&(ge=dy({rowInfo:e})),t&&(ge=typeof t=="function"?{...ge,...t(H)}:{...ge,...t}),l&&(ge=Ha(ge,l,oe)),Z?.style&&(ge=Ha(ge,Z.style,oe)),d.style&&(ge=Ha(ge,d.style,oe)),ge=ge||{},ge.height=y,ge.zIndex=`var(${cy}-${d.computedVisibleIndex})`;let ie=sy(()=>ge,[ge?JSON.stringify(ge):null]),We=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:g)%2===1,dt=I?We?"odd":"even":!1,bt=!1,io=!1,wo=!1,Yn=!1;if(we&&Ae){let de=a(),je=de[e.indexInAll-1],pt=de[e.indexInAll+1],ht=A.computedVisibleColumns[d.computedVisibleIndex+1],en=A.computedVisibleColumns[d.computedVisibleIndex-1];bt=je?!we.isCellSelected(je.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?io=!0:io=en?!we.isCellSelected(e.id,en.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?wo=!0:wo=ht?!we.isCellSelected(e.id,ht.id):!0,Yn=pt?!we.isCellSelected(pt.id,d.id):!0}let qn=we&&Ae?{top:bt,left:io,right:wo,bottom:Yn}:null,Jo=te!=null?i!==te:!1,Xn=Ue,_i=ke(),Fi={domRef:w,cellType:"body",column:d,width:c,rowId:e.id,horizontalLayoutPageIndex:i,style:ie,onMouseLeave:B,onMouseEnter:Te,onClick:ee,afterChildren:Xn,onMouseDown:ce,cssEllipsis:d.cssEllipsis??!0,className:J(qn?Xs(qn):"",_r(d,[ho,go],qs,{dragging:!1,insideDisabledDraggingPage:Jo,zebra:dt,align:se,verticalAlign:Q,rowDisabled:z,rowActive:he,cellSelected:Ae,rowSelected:P,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),re,K),renderChildren:ot(()=>_i,[ke])},Oi=Dn.Provider;return fe.createElement(Oi,{value:be.current},fe.createElement(Kr,{...Fi}))}var $c=fe.memo(hy);function Hr(){return ly(Dn)}function za(){let{api:n,state:{editingValueRef:e,editingCell:t}}=X(),{column:o,rowInfo:r}=Hr(),[i]=fe.useState(()=>t?.value),[a,l]=fe.useState(i),s=t?!t.active&&!!t.waiting:!1,u=fe.useCallback(f=>{e.current=f,l(f)},[]);fe.useLayoutEffect(()=>{e.current=i},[]);let c=n.confirmEdit,d=n.cancelEdit,p=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function vn(n){return n.render(n.renderParam)??null}function tt(n){let e=Dn.Provider;return zo.createElement(e,{value:n.renderParam},zo.createElement(vn,{render:n.render,renderParam:n.renderParam}))}function Uc(n){let e=Dn.Provider;return zo.createElement(e,{value:n.contextValue},n.children)}function Yt(n){let e=Br.Provider;return zo.createElement(e,{value:n.renderParam},zo.createElement(vn,{render:n.render,renderParam:n.renderParam}))}import*as qt from"react";var gy={width:"100%",pointerEvents:"none"},Ba=`${it}-menu`,ka=Rr({"data-name":""}),Wa={[ka["data-name"]]:"menu-icon"};function An(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...gy,borderTop:`${le.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return qt.createElement("div",{...o,style:e,...Wa,onPointerDown:s=>s.stopPropagation(),className:J(t,Gu({menuVisible:i,reserveSpaceWhenHidden:r}),it,`${it}-menu`)},a??qt.createElement(qt.Fragment,null,qt.createElement("div",{className:Ba,style:l}),qt.createElement("div",{className:Ba,style:l}),qt.createElement("div",{className:Ba,style:l})))}import*as Go from"react";import{useEffect as yy,useState as qc}from"react";var Yc="_1ek6mqy0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v";var Cy={transition:"width 0.25s, opacity 0.25s"};function Xc(n){let[e,t]=qc(!0),[o,r]=qc(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=n,c=u!=null&&u>0,d=n.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Cy,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};yy(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==o){let C=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(C)}}return()=>{}},[i,e]);let h=()=>{let C=!(o===0&&i===0);C!==e&&t(C)};if(!e)return null;let g={};return i===-1&&(g.top="100%"),Go.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:J(s,it,Yc,`${it}-sort`)},c?Go.createElement("div",{"data-name":"index",style:g,className:Bu},u):null,Go.createElement("div",{style:{width:f[0],...m},onTransitionEnd:h}),Go.createElement("div",{style:{width:f[1],...m}}),Go.createElement("div",{style:{width:f[2],...m}}))}import*as od from"react";import{useCallback as td}from"react";import{useRef as Jc,useState as Ty}from"react";import*as En from"react";function Zc(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){Ce.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;Ce.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?Zi(l,i,o.current):Ce.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){Zi(u,i,o.current);continue}u.computedPinned!=="end"&&Ce.columnOffsets.set(l,u.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Ce.columnOffsets.set(l,u.computedOffset+i,o.current)}}}}}function Qc(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,u=i.current;if(o.forEach((c,d)=>{s+=c;let p=n[d],f=r[p],m=f.computedWidth+c;Ce.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Ce.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"&&Ce.columnOffsets.set(c,d.computedOffset+s,u)}}}}var kr="zneyzh0 _16lm1iw2 _16lm1iw1d _16lm1iw1k _16lm1iw1i _16lm1iwk _16lm1iw1y",Wr=ye({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw1d _16lm1iw1i",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0},"zneyzhn"]]}),jr=ye({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw1f _16lm1iw1m",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:Sy}=De,by=`${Sy}HeaderCell_ResizeHandle`;function Ry(n){let{state:{brain:e,headerBrain:t}}=X(),o=Jc(null),[r,i]=Ty(!1),a=Jc(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=h=>{h.stopPropagation();let g=!!h.shiftKey,y=h.pointerId,C=h.clientX,S=h.target;if(e.isHorizontalLayoutBrain){let w=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),P=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{w(),P()}}S.setPointerCapture(y);let b=Zc(n.columnIndex,{columns:n.columns,shareSpaceOnResize:g,domRef:o}),T=(w,{done:P}={})=>{s&&(w=w/(s+1),P&&(w=Math.round(w))),u==="end"&&(w*=-1);let{adjustedDiff:x,constrained:D}=n.computeResize({diff:w,shareSpaceOnResize:g});return a.current!==D&&i(D),b.resize(x),x},I=w=>{T(Math.round(w.clientX-C))},R=w=>{S.releasePointerCapture(y),S.removeEventListener("pointermove",I),S.removeEventListener("pointerup",R);let P=Math.round(w.clientX-C),x=T(P,{done:!0});p(),n.onResize({diff:x,shareSpaceOnResize:g})};S.addEventListener("pointermove",I),S.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return En.createElement("div",{ref:o,className:`${by} ${kr} ${jr({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},En.createElement("div",{style:m,className:Wr({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var ed=En.memo(Ry);function nd(n,e){let{computed:{computedVisibleColumns:t},getState:o,getComputed:r,actions:i}=X(),a=td(({diff:u,shareSpaceOnResize:c})=>{let d=o(),{columnSizing:p,viewportReservedWidth:f,bodySize:m}=d,h=r().computedVisibleColumns,g=!1,y=h.reduce((b,T)=>(T.computedFlex&&(b[T.id]={...p[T.id],flex:T.computedWidth},g=!0),b),{}),C=g?{...p,...y}:p;return xa({shareSpaceOnResize:c,availableSize:m.width,reservedWidth:f||0,dragHandleOffset:u,dragHandlePositionAfter:n.computedVisibleIndex,columnSizing:C,items:h.map(b=>({id:b.id,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},[n]),l=td(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a]);return n.computedResizable?od.createElement(ed,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}var Co=`${et}HeaderCell`,rd=`${et}HeaderWrapper`;var vy=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||Ut;return Re.createElement(s,{domProps:{className:yr},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},Br=Re.createContext(null);var Ay=Y(U.columnZIndexAtIndex),ja=Re.createElement("div",{className:br[1]}),id=Rr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":""});function ad(n){let e=n.column,{api:t,getComputed:o,getState:r,actions:i,state:{showColumnFilters:a,components:l,portalDOMRef:s,columnHeaderHeight:u,columnReorderDragColumnId:c,columnMenuVisibleForColumnId:d,columnReorderInPageIndex:p},getDataSourceMasterContext:f}=X(),{api:m,componentActions:h,getState:g,componentState:{filterDelay:y,filterTypes:C}}=Ie(),{allRowsSelected:S,someRowsSelected:b,selectionMode:T}=Po(),I=n.horizontalLayoutPageIndex,R=c===e.id,w=p!=null?I!==p:!1,{onResize:P,height:x,width:D,headerOptions:A,columnsMap:_}=n,E=e.computedSortInfo,F=e.header,v=Iy(K=>{L.current=K,n.domRef?.(K)},[n.domRef]),M=A.alwaysReserveSpaceForSortIcon,N=e.headerAlign??e.align,G=(typeof N=="function"?N({isHeader:!0,column:e}):N)??"start",$=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",te=qe(e,{actions:i,api:t,dataSourceActions:h,dataSourceApi:m,getComputed:o,getDataSourceState:g,getDataSourceMasterContext:f,getState:r}),he=te.isSortable(),ue=he&&(e.computedSorted||M)?Re.createElement(Xc,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:le.spacing[2],marginInlineEnd:le.spacing[2]},className:`${Co}__sort-icon ${Hu} ${ku({align:G})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,k=e.computedFilterable&&e.computedFiltered?Re.createElement(Oo,null):null,ae=e.headerCssEllipsis??e.cssEllipsis??!0,oe={reserveSpaceWhenHidden:G==="center",menuVisible:d===e.id,style:G==="end"?{marginInlineStart:`calc(${le.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:le.spacing[2]}:{marginInlineEnd:`calc(${le.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:le.spacing[2]},domProps:{onMouseDown:K=>{K.stopPropagation(),te.toggleContextMenu(K.target)}}},W=e.components?.MenuIcon||l?.MenuIcon||An,V=Re.createElement(W,{...oe}),L=xy(null),Z={horizontalLayoutPageIndex:I,dragging:R,domRef:v,htmlElementRef:L,insideColumnMenu:!1,column:e,columnsMap:_,columnSortInfo:E,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:b,allRowsSelected:S,selectionMode:T,api:t,dataSourceApi:m,columnApi:te,renderBag:{sortIcon:ue,filterIcon:k,menuIcon:V,menuIconProps:oe,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},j=Z,se=()=>{let K={...Z,renderBag:{...Z.renderBag}};if(e.renderSortIcon&&(K.renderBag.sortIcon=Re.createElement(Yt,{render:e.renderSortIcon,renderParam:{...K,renderBag:{...K.renderBag}}})),e.renderFilterIcon&&(K.renderBag.filterIcon=Re.createElement(Yt,{render:e.renderFilterIcon,renderParam:{...K,renderBag:{...K.renderBag}}})),typeof e.renderMenuIcon=="function"&&(K.renderBag.menuIcon=Re.createElement(Yt,{render:We=>{if(typeof e.renderMenuIcon!="function")return null;let dt=e.renderMenuIcon(We);return dt?dt.type===W||dt.type===An?dt:Re.createElement(W,{...oe},dt):null},renderParam:{...K,renderBag:{...K.renderBag}}})),e.renderSelectionCheckBox&&T==="multi-row"){K.renderBag.selectionCheckBox=Re.createElement(Yt,{render:vy,renderParam:{...K,renderBag:{...K.renderBag}}});let We=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;We&&We!==!0&&(K.renderBag.selectionCheckBox=Re.createElement(Yt,{render:We,renderParam:{...K,renderBag:{...K.renderBag}}}))}F instanceof Function&&(K.renderBag.header=Re.createElement(Yt,{render:F,renderParam:{...K,renderBag:{...K.renderBag}}}));let re=e.renderMenuIcon===!1?null:K.renderBag.menuIcon,ge=ae?Re.createElement("div",{className:It},K.renderBag.header):K.renderBag.header,ie=Re.createElement(Re.Fragment,null,G==="center"?ja:null,K.renderBag.selectionCheckBox,ge,K.renderBag.sortIcon,K.renderBag.filterIcon,G==="center"?ja:null,G!=="center"?ja:null,re);return e.renderHeader?Re.createElement(Yt,{render:e.renderHeader,renderParam:{...K,renderBag:{...K.renderBag,all:ie}}}):ie};Py(()=>{let K=null,re=L.current;return P&&re&&(K=ln(re,P)),()=>{K?.()}},[L.current,n.onResize]);let Q={height:x};e.headerStyle&&(Q=typeof e.headerStyle=="function"?{...Q,...e.headerStyle(j)||{}}:{...Q,...e.headerStyle});let O=typeof e.headerClassName=="function"?e.headerClassName(j):e.headerClassName,{onPointerDown:be,proxyPosition:Te}=Pc({columnId:e.id,domRef:L,horizontalLayoutPageIndex:I}),B=null;R&&Te&&(B=Re.createElement("div",{key:e.id,className:`${Co}Proxy ${Mu}`,style:{position:"absolute",height:x,width:D,left:Te.left??0,top:Te.top??0,zIndex:1e9}},j.renderBag.header),B=Dy(B,s.current));let ee=Br.Provider,ce={filtered:e.computedFiltered,verticalAlign:$,align:G},xe=Re.useMemo(()=>{let K=re=>{t.setColumnFilter(e.id,re)};return y>0?Dt(K,{wait:y}):K},[y,e.id]),we=e.computedFilterType,Ne=C[we],Ae=e.computedFilterable?e.computedFilterValue?.filter.operator??Ne?.defaultOperator:void 0,He=e.computedFilterable&&Ne?Ne.operators.find(K=>K.name===Ae):void 0,Ue=He?.components?.FilterEditor||Ne?.components?.FilterEditor||e.components?.FilterEditor||Lo,ke=Ne?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,nt=nd(e,{horizontalLayoutPageIndex:I}),Qe=`var(${Ay}-${e.computedVisibleIndex})`;Q.zIndex=Qe;let H={"data-field":`${e.field||""}`,"data-column-id":e.id,"data-header-align":G,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ne=e.computedFilterable?Re.createElement(nc,{horizontalLayoutPageIndex:I,filterEditor:Ue,filterOperatorSwitch:ke??rc,operator:He,filterTypes:C,onChange:xe,columnFilterType:we,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:u}):Re.createElement(ic,null);return j.renderBag.filterEditor=ne,Re.createElement(ee,{value:j},Re.createElement(Kr,{domRef:v,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...H,"data-z-index":Qe,style:Q,width:D,onPointerDown:be,contentClassName:J(Eu(ce),su[G]),contentStyle:a?{height:x/2}:void 0,className:J(Co,mu.none,he?au.pointer:"",O,_r(e,[Co,go],_u,{dragging:R,insideDisabledDraggingPage:w,align:G,verticalAlign:$,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Au),cssEllipsis:ae,afterChildren:Re.createElement(Re.Fragment,null,a?ne:null,nt),renderChildren:se}),B)}function Er(){return wy(Br)}import*as yt from"react";function ld(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((c,d)=>{let p=c.id,f=n[d-1],m=f?.id??"",h=new Set,g=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,h);let y={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],y);let C=c.columnGroup,S,b=y;for(;C;){let T=e[C];if(T){h.add(C);let I=[p,...h];S=g.has(C)?i.get(C):void 0,S||(S={id:C,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[C],computedWidth:0,computedPinned:y.computedPinned,depth:t.get(C)??0},r.set(I,S),i.set(C,S)),S.columnItems.push(y),S.uniqueGroupId.push(y.id),b&&!g.has(b.id)&&S.children.push(b),b=S,C=T.columnGroup}else break}});let l=[],s=new q,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&sd(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=o+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function sd(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&sd(t.children),e+=o})}import*as To from"react";import{useCallback as yd,useEffect as Ny,useRef as Ly}from"react";import*as $a from"react";import*as pd from"react";import{useCallback as dd}from"react";import{useRef as ud,useState as Ey}from"react";import*as Mn from"react";var{rootClassName:My}=De,_y=`${My}HeaderCell_ResizeHandle`;function Fy(n){let e=ud(null),[t,o]=Ey(!1),r=ud(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let h=!0,g=Qc(n.groupColumns.map(b=>b.computedVisibleIndex),{columns:n.columns,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{constrained:T,adjustedDiffs:I,adjustedDiff:R}=n.computeResize(b);return r.current!==T&&o(T),g.resize(I),R},C=b=>{if(h){let T=n.groupColumns.reduce((w,P)=>w+P.computedWidth-P.computedMinWidth,0),I=n.brain.getAvailableSize(),R={width:I.width+T,height:I.height};n.brain.update(R),h=!1}y(Math.round(b.clientX-f))},S=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",C),m.removeEventListener("pointerup",S);let T=Math.round(b.clientX-f),I=y(T);n.onResize(I)};m.addEventListener("pointermove",C),m.addEventListener("pointerup",S)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:le.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Mn.createElement("div",{ref:e,className:`${_y} ${kr} ${jr({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},Mn.createElement("div",{style:{...c,...n.style},className:Wr({constrained:t})}))}var cd=Mn.memo(Fy);function fd(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:u}=X(),c=n[n.length-1],d=dd(h=>{let g=l(),{columnSizing:y,viewportReservedWidth:C,bodySize:S}=g,b=s().computedVisibleColumns,T=!1,I=b.reduce((P,x)=>(x.computedFlex&&(P[x.id]={...y[x.id],flex:x.computedWidth},T=!0),P),{}),R=T?{...y,...I}:y;return Yu({availableSize:S.width,reservedWidth:C||0,dragHandleOffset:h,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:n.length,items:b.map(P=>({id:P.id,resizable:P.computedResizable,computedFlex:P.computedFlex,computedWidth:P.computedWidth,computedMinWidth:P.computedMinWidth,computedMaxWidth:P.computedMaxWidth}))})},[c]),p=dd(h=>{let{columnSizing:g,reservedWidth:y}=d(h);u.viewportReservedWidth=y,u.columnSizing=g},[d]);return n.some(h=>h.computedResizable)?pd.createElement(cd,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:p}):null}var md=`${et}HeaderGroup`,hd=Y(U.columnWidthAtIndex),Oy=Y(U.columnZIndexAtIndex);function gd(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=fd(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=o[0],c=o.length>1?"calc( "+o.map(f=>`var(${hd}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${hd}-${u.computedVisibleIndex})`,d=`calc(var(${Oy}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,$a.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:J(zu,md),style:p,"data-z-index":d},$a.createElement("div",{className:J(`${md}__header-content`,It)},a),s)}var{rootClassName:Vy}=De,zy=[],Cd=`${Vy}Header`,Gy=Fu({overflow:!1});function Ky(n){let{bodyBrain:e,columns:t,style:o,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=n,{computed:s,getState:u,state:{headerBrain:c,headerOptions:d,showColumnFilters:p}}=X(),{computedColumnsMap:f}=s,m=Ly(null),h=yd(C=>{m.current&&(m.current.style.transform=`translate3d(-${C.scrollLeft}px, 0px, 0px)`)},[]);Ny(()=>{let C=c.onScroll(h);return h(c.getScrollPosition()||{scrollLeft:0,scrollTop:0}),C},[c]);let g={ref:m,className:J(Cd,`${Cd}--virtualized`,r,Gy),style:{...o,height:i}},y=yd(C=>{let{rowIndex:S,colIndex:b,domRef:T,height:I,widthWithColspan:R,heightWithRowspan:w,hidden:P}=C,x=t[b];if(!x||P)return null;let D=c.isHorizontalLayoutBrain?c.getPageIndexForRow(S):null,A=a?a.pathsToCells.get([S,b]):null;if(A&&A.type==="group"){let _=A.columnItems.map(v=>v.ref),E={...A.ref,id:A.id,uniqueGroupId:A.uniqueGroupId,depth:A.depth,columns:_.map(v=>v.id),computedWidth:A.computedWidth,groupOffset:A.groupOffset};return u().columnGroupVisibility[A.id]!==!1?To.createElement(gd,{horizontalLayoutPageIndex:D,bodyBrain:e,columnGroupsMaxDepth:l,domRef:T,columns:_,width:R,height:I,columnGroup:E}):null}return To.createElement(ad,{domRef:T,column:x,horizontalLayoutPageIndex:D,headerOptions:d,width:R,height:w,columnsMap:f})},[d,t,i,a,l,p,c]);return To.createElement("div",{...g},To.createElement(mr,{name:"header",renderCell:y,brain:c,cellHoverClassNames:zy,cellDetachedClassNames:Cr}))}var Td=To.memo(Ky);function Sd(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,r=X(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:u,columnGroupsDepthsMap:c,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,h=m*u+(f?u:0),g=yt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return ld(l,p,c,d)},[l,p,c]),y=yt.useCallback(({rowIndex:R,colIndex:w})=>{let P=l[w],x=1,D=1;if(!P||!g)return{rowspan:x,colspan:D};let A=g.pathsToCells.get([R,w]);if(!A)return{rowspan:x,colspan:D};if(A.type==="column")return{colspan:D,rowspan:m-A.depth};let _=A.columnItems.findIndex(E=>E.id===P.id);return{rowspan:x,colspan:_===0?A.columnItems.length:1}},[p,d,l,g,m,c]),C=yt.useCallback(({rowIndex:R,colIndex:w})=>y({rowIndex:R,colIndex:w}).rowspan,[y]),S=yt.useCallback(({rowIndex:R,colIndex:w})=>y({rowIndex:R,colIndex:w}).colspan,[y]),b=yt.useCallback(R=>f?R<m-1?u:2*u:u,[m,f,u]);Tr(e,{colWidth:s,rowHeight:b,rows:m,cols:l.length,height:h,rowspan:C,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let T=yt.createElement(Td,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:h,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:g}),I=o.vertical&&jt()?yt.createElement("div",{className:Ku,style:{zIndex:1e3,width:jt()}}):null;return yt.createElement("div",{className:`${rd} ${Wu}`,style:{height:h}},T,I)}import*as Ft from"react";import{useEffect as Hy}from"react";function bd(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Rd={padding:le.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},By={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Id=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(bd(t),o,"important")},wd=Ft.forwardRef(function(e,t){let{rootClassName:o}=Sr(),r=Ft.useRef(null),i=Ft.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return Hy(()=>{let a=()=>{setTimeout(()=>{Id(r.current,Rd),Id(r.current?.firstElementChild,By)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),Ft.createElement("div",{ref:i,...e,className:J(`${o}-Footer`,ac,e.className),style:Rd},"Powered by"," ",Ft.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});import*as Ko from"react";var Pd={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i"},xd="qy58ya3 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",Dd="qy58ya4";var{rootClassName:ky}=De,Ua=`${ky}-LoadMask`;function Wy(n){let{visible:e,children:t="Loading"}=n;return Ko.createElement("div",{className:`${Pd[e?"visible":"hidden"]} ${Ua}`},Ko.createElement("div",{className:`${xd} ${Ua}-Overlay`}),Ko.createElement("div",{className:`${Dd} ${Ua}-Text`},t))}var $r=Ko.memo(Wy);function Ya(n){return n.map(wt)}function wt(n){if(Ee().structuredClone)return Ee().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return Ya(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(Ya(Array.from(n)));if(n instanceof Map)return new Map(Ya(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=wt(n[t]));return e}function _n(n){return n}var So=Object.seal({data:null,field:null});var Zt="____root____",Ad="____not_loaded_yet____";function Xt(){return!1}function qa(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function Ur(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function Ed(n,e){let{reducers:t={},pivot:o,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=n,u=new q;function c(g,y,C,S=0,b=[]){let T=!C.length||S===C.length-1,I=y[s?.values||"values"]||{};for(let R in I)if(I.hasOwnProperty(R)){let w=R;b.push(w),d.set(b,!0),g.set(b,{reducerResults:I[R][s?.totals||"totals"]||{},items:[]}),T||c(g,I[R],C,S+1,b),b.pop()}}let d=o?new q:void 0,p=[],f=qa(t),m=wt(f);e.visitDepthFirst((g,y,C,S)=>{let[b,...T]=y,I=g.children,R=u.get(T);if(R&&(R.cache=g.cache,R.childrenLoading=g.childrenLoading,R.childrenAvailable=g.childrenAvailable,R.error=g.error),T.length==r.length&&r.length){if(R){R.items=I;for(let P=0,x=T.length;P<x;P++){let D=T.slice(0,P),A=u.get(D);A&&(A.items=A.items||[],A.items=A.items.concat(I))}I=i.indexArray(I,{toPrimaryKey:a,cache:l,nodesKey:void 0})}return S?.()}for(let w=0,P=I.length;w<P;w++){if(!I[w]){let _={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...T,`${Ad}${w}`],_);continue}let x=I[w].data,D=I[w].keys||[];if(D.length){let _=D[D.length-1];T.push(_)}let A={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:I[w].totalChildrenCount,reducerResults:I[w].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(T,A),o){let _=A.pivotDeepMap=new q,E=I[w].pivot;c(_,E,o,0,p)}D.length&&T.pop()}S?.()});let h={deepMap:u,groupParams:n,initialData:e,reducerResults:m};return o&&(h.topLevelPivotColumns=d,h.pivot=o),h}function vd(n,e,t,o,r,i,a,l,s,u=_n){let{items:c,reducerResults:d,pivotDeepMap:p}=n.get(e);if(c.push(o),a&&Ur(o,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:h,valueGetter:g,toKey:y}=i[f],C=h?o[h]:null;g&&(So.data=o,So.field=h,C=g(So));let S=(y||u)(C,o);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:wt(s),items:[]}));let{reducerResults:b,items:T}=p.get(t);T.push(o),a&&Ur(o,r,a,b,e)}t.length=0}}function Md(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=n,d=c(r),p=[...o,d],f=s(r);if(t.set(p,!0),f){for(let y=0,C=o.length;y<=C;y++){let S=o.slice(0,y),b=e.get(S),{reducerResults:T,items:I}=b;I.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&Ur(r,i,a,T,S)}return}let m=wt(l),h=[];e.set(p,{items:h,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let g=u(r);if(!(!g||!Array.isArray(g))){for(let y=0,C=g.length;y<C;y++){let S=g[y];Md(n,e,t,p,S,y,a,l)}a&&Fn(a,m,h)}}function _d(n,e){let{reducers:t}=n,o=qa(t),r=wt(o),i=new q,a=new q;i.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,u=e.length;s<u;s++)Md(n,i,a,[],e[s],s,t,o);return t&&Fn(t,r,e),{deepMap:i,treeParams:n,treePaths:a,initialData:e,reducerResults:r}}function Xa(n,e){let{groupBy:t,defaultToKey:o=_n,pivot:r,reducers:i}=n,a=t.length,l=r?new q:void 0,s=new q,u=[],c=[],d=qa(i),p=wt(d);if(!a){let m={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:wt(d)};r&&(m.pivotDeepMap=new q),s.set(u,m)}for(let m=0,h=e.length;m<h;m++){let g=e[m],y={};for(let C=0;C<a;C++){let{field:S,groupField:b,valueGetter:T,toKey:I}=t[C],R=S?g[S]:null;T&&(So.data=g,So.field=S,R=T(So));let w=(I||o)(R,g);if(y[S||b]=w,u.push(w),!s.has(u)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:wt(d)};r&&(P.pivotDeepMap=new q),s.set(u,P)}vd(s,u,c,g,m,r,i,l,d,o)}a||vd(s,u,c,g,m,r,i,l,d,o),i&&Ur(g,m,i,p,u),u.length=0}i&&(s.visitDepthFirst((m,h,g,y)=>{Fn(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:C,reducerResults:S},b,T,I)=>{Fn(i,S,C),I?.()}),y?.()}),Fn(i,p,e));let f={deepMap:s,groupParams:n,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function jy(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function $y(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d??null,f;if(Object.keys(u).length>0){p={...d},f={};for(let C in i)if(i.hasOwnProperty(C)){let b=i[C].field;b&&(f[b]=u[C]),b&&p[b]==null&&(p[b]=u[C])}}let m=!0,h=o[o.length-1],g=h;if(p!=null){let C=t[o.length-1];C&&C.field&&(g=p[C.field]),C&&C.toKey&&(g=C.toKey(g,p)),g=g??h}return typeof g=="string"&&g.startsWith(Ad)&&(m=!1,g=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Xt,hasSelectedCells:Xt,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:g,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function Yr(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function Fn(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function Fd(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:u,treeResult:c,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:h,repeatWrappedGroupRows:g,rowsPerPage:y}=r,{deepMap:C}=c,S=n.length,b=t[t.length-1],T=b?b.nodeExpanded:!0;for(let I=0;I<S;I++){let R=n[I],w=u(R,I),P=[...e,w];if(l(R)){let v={id:w,nodePath:P,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Xt,hasSelectedCells:Xt,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,I],indexInParent:I,indexInAll:T?i.length:-1};p&&(v.rowSelected=p(v)),d&&(v.rowDisabled=d(v)),f&&f(v);let M=g&&y!=null&&y>0&&v.indexInAll%y===0?v.indexInAll/y:null;for(let N=0,G=t.length;N<G;N++){let $=t[N];if(T||($.collapsedLeafNodesCount+=1),$.deepRowInfoArray.push(v),M!=null&&T){if(typeof g=="function"&&g($)!==!0)continue;let te=Yr($,v.indexInAll,M);i[te.indexInAll]=te,v.indexInAll++}}T&&(i[v.indexInAll]=v);continue}let A=C.get(P)?.totalLeafNodesCount??0,_={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:P,id:w,data:R,indexInAll:i.length,indexInParent:I,indexInParentNodes:[...o,I],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Xt,hasSelectedCells:Xt,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(_.rowSelected=p(_),h)){let v=h.getSelectionCountFor(_.nodePath);_.selectedLeafNodesCount=v.selectedCount,_.deselectedLeafNodesCount=v.deselectedCount}d&&(_.rowDisabled=d(_)),f&&f(_);let E=!0;if(m&&(_.selfExpanded=E=m(_)),T||(E=!1),_.nodeExpanded=E,T&&g&&y!=null&&y>0){let v=_.indexInAll,M=_.parentNodes;if(M.length>0&&v%y===0){let N=v/y,G=0;M.forEach($=>{typeof g=="function"&&g($)!==!0||(i.push(Yr($,v+G,N)),G++,_.indexInAll++)})}}T&&(i[_.indexInAll]=_);let F=s(R);Array.isArray(F)&&Fd(F,P,[...t,_],_.indexInParentNodes,r,i)}return i}function Od(n){let{dataArray:e}=n,t=[];return Fd(e,[],[],[],n,t),{data:t}}function Nd(n){let{lazyLoad:e,groupResult:t,rowsPerPage:o,repeatWrappedGroupRows:r,withRowInfo:i,toPrimaryKey:a,groupRowsState:l,isRowDisabled:s,isRowSelected:u,rowSelectionState:c,generateGroupRows:d,reducers:p={}}=n,{groupParams:f,deepMap:m,pivot:h}=t,{groupBy:g}=f,y=[],C=[],S=[],b=[];return m.visitDepthFirst((T,I,R,w)=>{let P=T.items,x=I.length,D=l?.isGroupRowCollapsed(I)??!1;b.push(R);let A=$y({lazyLoad:e,groupBy:g,parents:Array.from(S),reducers:p,indexInGroup:R,indexInParentGroups:Array.from(b),indexInAll:y.length,groupKeys:I,error:T.error,totalChildrenCount:T.totalChildrenCount,childrenLoading:(T.childrenLoading||!D&&!T.childrenAvailable)&&e,childrenAvailable:T.childrenAvailable,directChildrenCount:I.length===g.length?T.items.length:m.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},T);if(u&&(A.rowSelected=u(A),c)){let M=c.getSelectionCountFor(A.groupKeys);A.selectedChildredCount=M.selectedCount,A.deselectedChildredCount=M.deselectedCount}s&&(A.rowDisabled=s(A));let _=S[S.length-1],E=_?.collapsed??!1;E&&(D=!0),A.collapsed=D;let F=d||D;if(E&&(F=!1),F){if(r&&o!=null&&o>0){let M=A.indexInAll,N=A.parents;if(N.length>0&&M%o===0){let G=M/o,$=0;N.forEach(te=>{typeof r=="function"&&r(te)!==!0||(y.push(Yr(te,M+$,G)),$++,A.indexInAll++)})}}y.push(A),C.push(y.length-1)}A.collapsedChildrenCount=0,S.forEach(M=>{M.deepRowInfoArray.push(A),M.collapsedGroupsCount+=D?1:0}),_&&A.selfLoaded&&e&&(_.directChildrenLoadedCount+=1),i&&i(A),S.push(A);let v=!0;if(v){if(w)w();else if(!h){let M=y.length;D||(y.length+=P.length);let N=0;for(let G=0,$=P.length;G<$;G++){let te=P[G];if(!D&&r&&o!=null&&o>0){let k=M+G+N;if(k%o===0){let ae=k/o;S.forEach(oe=>{if(typeof r=="function"&&r(oe)!==!0)return;let W=M+G+N;y[W]=Yr(oe,W,ae),N++,y.length++})}}let he=M+G+N,z={id:te?a(te,he):`${I}-${G}`,data:te,isCellSelected:Xt,hasSelectedCells:Xt,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!te,rowSelected:!1,rowDisabled:!1,rootGroupBy:g,collapsed:D,groupKeys:I,parents:Array.from(S),indexInParentGroups:[...b,G],indexInGroup:G,indexInAll:he,groupBy:g,groupNesting:x+1,groupCount:A.groupCount};u&&(z.rowSelected=u(z)),s&&(z.rowDisabled=s(z)),i&&i(z),S.forEach((k,ae)=>{ae===S.length-1&&te&&(k.directChildrenLoadedCount+=1),D&&(k.collapsedChildrenCount+=1),k.deepRowInfoArray.push(z)}),D||(y[M+G+N]=z)}}}S.pop(),b.pop()}),{data:y,groupRowsIndexes:C}}import*as Ip from"react";var Uy=()=>{};function Yy(n,e){let t=new q,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let u=0;u<s.length;u++){let c=s.slice(0,u);t.has(c)||t.set(c,void 0)}t.set(s,l)}function a(l,s){let u=t.getKeysStartingWith(l,!0,1);for(let c of u){let d=[...l,c[c.length-1]],p=t.get(d),f=p?p[o]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[o]=f),s.push(p)}return s}return a([],[])}function Ld(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(o),d=[...t,c],p=r(o),f=Ye(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let h=0,g=m.length;h<g;h++){let y=m[h];Ld(n,e,d,y)}});p?(u?.(o),s?.(o,Uy)):(l?.(o,f,i(o)),s?.(o,f))}function Vd(n,e,t){for(let o=0,r=t.length;o<r;o++)Ld(n,e,[],t[o])}var qy=function(n,e){return n-e},Xy=function(n,e){return n=`${n}`,e=`${e}`,n.localeCompare(e)},Zy=function(n,e){return n-e},Qy={number:qy,string:Xy,date:Zy},On=Qy;function zd(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var Ot=(n,e,t)=>{let o=typeof t=="function"?t:t?.get;return e.sort(Gd(zd(n),o)),e},Za=(n,e,t)=>{let o=Gd(zd(n),t.get),r=t.depthFirst??!1,i=t.inplace??!1;r||(i?e.sort(o):e=[...e].sort(o));let{nodesKey:a,toKey:l}=t,s=c=>c[a],u=c=>c[a]===void 0;return Vd({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??s,toKey:l},{onParentNode:(c,d,p)=>{if(r&&d(),Array.isArray(p)){let f=i?p.sort(o):[...p].sort(o);c[a]=f}r||d()}},e),r&&(i?e.sort(o):e=[...e].sort(o)),e};Ot.knownTypes=On;var Jy=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=Ot.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(Ot.knownTypes).join(", ")}`)}return r||(r=On.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:o*u}},eC=n=>n.map(Jy).filter(e=>e instanceof Function),Gd=(n,e)=>{let t=eC(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var qr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new q(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new q(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var st=class extends qr{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 Ho(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||_n)(l,n);return t.push(s),t},[])}var Se=class{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new q;this.deselectedMap=new q;this.onlyUsePrimaryKeys=!1;this.selectionCache=new q;this.selectionCountCache=new q;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Ho(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let o=this.getGroupDeepMap()?.get(e);return o?o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,!0,1)||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],!0,1)||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let o=t?.get(e);return o?o.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new Se(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,!0).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,!0).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(r&&this.onlyUsePrimaryKeys){let u=this.getAllPrimaryKeysInsideGroup(e),c=0,d=0;u.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}c++}else{if(this.selectedMap.has([f])){c++;return}d++}});let p={selectedCount:c,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let u=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,c=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,!0,1).length,p=this.deselectedMap.getKeysStartingWith(e,!0,1).length,f=c-(d+p),m={selectedCount:d+(u?f:0),deselectedCount:p+(u?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let u=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=u,l=this.deselectedMap.getAllChildrenSizeFor(e),l===u&&(a=0)):(l=u,a=this.selectedMap.getAllChildrenSizeFor(e),a===u&&(l=0))}i.forEach(u=>{let c=this.selectedMap.get(u),d=this.deselectedMap.get(u),p=c?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(u,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var tC="*",Ve=class{constructor(e){this.wildcard=tC;this.cache=new q;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(u=>{this.cache.delete(u)}),this.cache.delete(s),o)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){Ht(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),u=this.deselectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||u?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var oC=Ge("InfiniteTable"),nC="#dc3545",rC="#eb9316";var Hd="Warn",Bd="Error",iC="Info",aC="Success",lC="Logs",Xr=oC.extend(lC),eF=Xr.extend(iC),sC=Xr.extend(Hd),uC=Xr.extend(Bd),tF=Xr.extend(aC);var cC=rC,dC=nC;var pC=(n,e)=>{e=e?e.extend?e.extend(Hd):e:sC,e(typeof e.color=="function"?e.color(cC,n):n)},fC=(n,e)=>{e=e?e.extend?e.extend(Bd):e:uC,e(typeof e.color=="function"?e.color(dC,n):n)};var Kd=new q,kd=(n,...e)=>{Kd.has(e)||(Kd.set(e,!0),n())};var Bo=(n,e=n,t)=>{kd(()=>pC(n,t),e,"warn")},Wd=(n,e=n,t)=>{kd(()=>fC(n,t),e,"error")};function Zr(n,e){return new Se(n,Xe(e))}function Xe(n){return()=>{let e=typeof n=="function"?n():n;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function jd(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Se))throw"Invalid row selection";let a=new Se(r,Xe(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Se))throw"Invalid row selection";let a=new Se(r,Xe(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Se))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?Ho(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Se))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,u):[]}let c=new Se(a,Xe(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Se))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,u):[]}let c=new Se(l,Xe(e));c.deselectRow(r,i),t.rowSelection=c}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Se))throw"Invalid row selection";let s=new Se(a,Xe(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Se))throw"Invalid row selection";let s=new Se(a,Xe(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Se))throw"Invalid row selection";let s=new Se(a,Xe(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Se(i,Xe(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Se))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Se(r,Xe(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}var Qa=new WeakMap,mC=n=>n;function $d(n,e=50,t){Qa.set(n,{lastCallTime:0,lastCallArg:null});let o=t??mC;return r=>{let{lastCallTime:i,lastCallArg:a}=Qa.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=$t(o(a),o(r));s<e&&u||(Qa.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var Qr=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new q;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let u=o&&!o.isEmpty();if(u&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let c=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,p=c.length;d<p;d++){let f=c[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}o?.removeInfo(void 0)}}else{let c=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];u&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let h=!1;if(m!=null){let g=r(m),y=s?[...p,g]:void 0,C=s&&!!y,S=C?o?.getMutationsForNodePath(y):o?.getMutationsForPrimaryKey(g);if(S&&S.length){for(let b=0,T=S.length;b<T;b++){let I=S[b];if(I.type==="delete"&&!h&&(C?this.removeNodePath(y,t):this.remove(g),h=!0,d.splice(f,1),f--),I.type==="update"&&!h&&(m={...m,...I.data},d[f]=m),I.type==="update-children"&&!h){let R=I.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}I.type==="insert"&&(I.position==="before"?(d.splice(f,0,I.data),f--):d.splice(f+1,0,I.data))}C?o?.removeNodePathInfo(y):o?.removeInfo(g)}if(!h)if(C){this.addNodePath(y,m);let b=a(m),T=b?null:i(m);!b&&Array.isArray(T)&&(p.push(g),u&&(m[l]=T=T.concat()),c(T,p),p.pop())}else this.add(g,m)}}};c(e,[])}return e}}};import{useEffect as $o,useMemo as ap,useRef as ai,useState as PC}from"react";import{useEffect as Ud,useRef as Ja}from"react";function ko(n,e){let t=Ja({}),o=Ja({}),r=o.current,i=Ja({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,Ud(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function mF(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);Ud(n,t)}function el(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function tl(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function ol(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function Yd({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=Ye(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=tl({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[f.id]:null})})});(!a&&t==="start"||o==="start")&&c();let d=!i&&l.length===1;return n.visitDepthFirst((f,m,h,g)=>{if(m=[...m],t==="end"&&g?.(),m.length===a){let y=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let b=S;S=m.join("/");let T=m[m.length-1];u[S]=ol({header:`${T}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:T})}l.forEach((b,T)=>{let I=d?`${m[m.length-1]}`:b.name||b.id,R=tl({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:T,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,defaultSortable:!1,columnGroup:S,header:I,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),w=`${b.id}:${m.join("/")}`;s[w]=R})}else{let y=m.join("/"),C=m.slice(0,-1);if(u[y]=ol({columnGroup:C.length?C.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let S=e[m.length-1],b=C.length?C.join("/"):void 0;if(!d){let T=b;b=`total:${m.join("/")}`,u[b]=ol({header:`${m[m.length-1]} total`,columnGroup:T,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((T,I)=>{let R=d?`${m[m.length-1]} total `:`${T.name||T.id} total`,w=tl({columnGroup:b,header:R,pivotAggregator:T,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[T.id]:null});s[`total:${T.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&g?.()}),(!a&&t==="end"||o==="end")&&c(),{columns:s,columnGroups:u}}var qd=Symbol("CLEAR"),Nt=class{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new q;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=qd,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(qd);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>q.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new Nt({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:q.clone(e.nodePathToData),o}};function Qt(n,e){return e().dataArray[n]}function Jr(n){return n().dataArray}var Ze=class{constructor(e){this.collapsedPathsMap=new q;this.expandedPathsMap=new q;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var hC=(n,e)=>n.length-e.length,Be=class{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new q;this.cache=new q;let o=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.setConfigFn(t),this.update(o)}getTreeDeepMap(){return this.getConfig().treeDeepMap}isLeafNode(e){return!this.getTreeDeepMap().has(e)}getLeafNodesCount(e){let o=this.getTreeDeepMap().get(e);return o?o.items.length:1}static from(e,t){return new Be(e,t)}setConfigFn(e){this.getConfig=e,this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getUnnestedKeysStartingWith(e,!0).sort(hC);if(!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,u=0,c=this.getNodeBooleanSelectionStateFromParent(e);c?s+=r:u+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:h}=this.getSelectionStateForNode(f);if(c?(s-=h,u+=h):(u-=m,s+=m),t&&m>0&&h>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:u})}if(!s&&!u)return this.cacheIt(e,{selected:c,selectedCount:c?r:0,deselectedCount:c?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:u,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.getSelectionStateForNode(e,!0).selected}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.getConfig=null,this.xcache(),this.selectionMap.clear()}};function ti(n,e){return new Be(n,Wo(e))}function Wo(n){return()=>({treeDeepMap:(typeof n=="function"?n():n).treeDeepMap})}var ei=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Be))throw"Invalid tree selection";let a=new Be(r,Wo(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current=e,this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new Ze({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new Ze({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new Ze(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new Ze(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new Ze(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){let{treeDeepMap:t}=this.getState();if(!t||!e.length)return null;let o=this.getRowInfoByPath(e);return o?o.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?Qt(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Be))throw"Invalid node selection";let o=new Be(e,Wo(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Be))throw"Invalid node selection";let o=new Be(e,Wo(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Be))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var jo=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var ut=class extends jo{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var nl=1e3;function Xd(n){return new rl(n)}var rl=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=()=>Jr(this.getState);this.getRowInfoByIndex=e=>Qt(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?nl:r;return isNaN(a)||(a=nl),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let u=c=>t.position==="start"?[...e,...c||[]]:[...c||[],...e];return this.updateChildrenByNodePath(u,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let o=this.getState().rowDisabledState,r=o?new ut(o):new ut({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new ut({enabledRows:!0,disabledRows:[]});return}let t=new ut(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new ut({disabledRows:!0,enabledRows:[]});return}let t=new ut(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 ei({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?Nt.clone(t,{light:!0}):new Nt({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((c,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],c,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof c=="function"?i.updateChildren(a.nodePaths[d],c,p,a.metadata):i.updateNodePath(a.nodePaths[d],c,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(c=>{let d=this.getDataByPrimaryKey(c);d&&i.delete(c,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(c=>{let d=this.getDataByNodePath(c);d&&i.deleteNodePath(c,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,u=a.nodePath;u?a.array.forEach(c=>{i.insertNodePath([...u],c,s,a.metadata),l=this.toPrimaryKey(c),u.pop(),u.push(l),s="after"}):a.array.forEach(c=>{i.insert(l,c,s,a.metadata),l=this.toPrimaryKey(c),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??nl,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(u=>{let c,d;l=p=>{clearTimeout(d),c=p,o.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Zd(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let h=m.field;if(h&&(h=Array.isArray(h)?h:[h],t=h.reduce((g,y)=>g||typeof y!="function"?l.has(y):!1,!1),t))break}if(u&&u.length){if(l===!0)o=!0;else for(let m of u)if(m.field&&l.has(m.field)){o=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),c&&c.length)if(l===!0)i=!0;else for(let m of c){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let h=d[m];if(h.field){if(l.has(h.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:o,filterValue:i,aggregationReducers:a,tree:r}}function oi(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function ni(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function ri(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function al(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var Pt=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function il(){return!1}function gC(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:il,hasSelectedCells:il};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var yC=Ye(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
1
+ var Um=Object.create;var Ql=Object.defineProperty;var Ym=Object.getOwnPropertyDescriptor;var qm=Object.getOwnPropertyNames;var Xm=Object.getPrototypeOf,Zm=Object.prototype.hasOwnProperty;var Qm=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Jm=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qm(e))!Zm.call(o,r)&&r!==t&&Ql(o,r,{get:()=>e[r],enumerable:!(n=Ym(e,r))||n.enumerable});return o};var ro=(o,e,t)=>(t=o!=null?Um(Xm(o)):{},Jm(e||!o||!o.__esModule?Ql(t,"default",{value:o,enumerable:!0}):t,o));var Pn=Qm((Ww,Ds)=>{"use strict";Ds.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 xt(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 me from"react";var J=(...o)=>o.filter(e=>!!`${e}`).join(" ");import*as rn from"react";import{useRef as ls}from"react";function fe(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function Ue(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Jl=(o,e)=>o-e;var Gi=(o,e)=>Jl(o.revision,e.revision),q=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,f)=>{let p=r.get(f);if(!p)return;let{map:m}=p,h=f===this.emptyKey;if(h&&!c)return;let g=h?[]:[...e,f],y=m?()=>this.visitWithNext(g,t,n,m,i!==void 0?i-1:void 0):void 0;if(p.hasOwnProperty("value")){let b=t(p.value,g,l,y,p);if(n&&b===!0)return!0;l++}else y?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,f]of r){let p=u(f,d);if(n&&p===!0)return p}};this.fill(e)}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,n){let r=[];return this.getStartingWith(e,(i,a)=>{r.push(a)},t,n),r}getEntriesStartingWith(e,t,n){let r=[];return this.getStartingWith(e,(i,a)=>{r.push([i,a])},t,n),r}getUnnestedKeysStartingWith(e,t,n){let r=[],i=c=>{r.push(c)},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return[];a=l.map}else if(!t&&a.has(this.emptyKey))return[[]];return l&&l.value!==void 0&&(t||(i({...l,keys:e}),s=!0)),s?r.sort(Gi).map(c=>c.keys):(this.visitWithNext(e,(c,u,d,f,p)=>{i({...p,keys:u})},!1,a,n,t),r.sort(Gi).map(c=>c.keys))}getKeysStartingWith(e,t,n){let r=[];return this.getStartingWith(e,i=>{r.push(i)},t,n),r}getStartingWith(e,t,n,r){let i=this.map,a,l=!1;if(e.length)for(let s=0,c=e.length;s<c;s++){let u=e[s];if(a=i.get(u),!a||!a.map)if(l=!0,s===c-1){l=!0;break}else return;i=a.map}a&&a.value!==void 0&&(n||t(e,a.value)),!l&&this.visitWithNext(e,(s,c,u,d)=>{t(c,s),d?.()},!1,i,r,n)}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;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}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],c=Ue(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e({...n,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Gi);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};function Ae(){return globalThis}var Qo=["#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"],es=Symbol("color"),Zo=new WeakMap,Ki=fe();function Hi(o=Qo){Zo.set(o,o.map(e=>0))}Hi();var eh=(o=Qo)=>{let e=[];Zo.has(o)?e=Zo.get(o):(e=o.map(n=>0),Zo.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]??Qo[0]},ao=":",Bi="*",ts="-",th=",",nh="debug",oh="diffdebug",os=!1,io=new q,lo=new Map;function Wi(o,e){let t=o.split(ao),n=new q;n.set(t,!0);let r=e.split(ao),i=new Set(r).has(Bi),a=r.indexOf(Bi),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,i).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(ao)):!0}}function rh(o,e){let t=`channel=${o}_permissions=${e}`;if(lo.has(t))return lo.get(t);let n=e.split(th);function r(l){return lo.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(Bi)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(ts);if(c&&(s=s.substring(ts.length)),Wi(o,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),Wi(o,s))return r(!c)}return r(!1)}var ji=()=>ke.enable??(Ae()&&Ae().localStorage?.getItem(nh))??"",ih=()=>ke.diffenable??(Ae()&&Ae().localStorage?.getItem(oh))??`${os}`,$i="",rs=os;function Ui(o){rs=`${ih()}`=="true",$i!==o&&($i=o,lo.clear())}function is(o){Ui(ji()),typeof Ae()<"u"&&Ae().addEventListener&&Ae().addEventListener("storage",function(){Ui(ji())});function e(t,n){let r=n?`${n}${ao}${t}`:t,i=r.split(ao),a=io.get(i);if(a)return a;let l=io.get(i.slice(0,-1)),s=(l?l.logFn:ke.logFn)??as,c=s,u,d=0,f=()=>u??rh(r,$i),p=eh(ke.colors),m=Object.defineProperties((...h)=>{let g=Ki.getListenersCount(),y;if(g>0&&(y=y??Date.now(),Ki({color:p,channel:r,args:h,timestamp:y})),f()){if(y=y??Date.now(),d&&rs){let S=y-d;c(`%c[${r}]`,`color: ${p}`,`+${S}ms:`)}d=y;let b=[],T;if(h.forEach(S=>{if(S[es])T===void 0&&(T=!0),b.push(...S);else{if(typeof S!="string"&&typeof S!="number"){T=!1;return}b.push(`${S}%s`)}}),T){let S=[`%c[${r}]%c %s`,`color: ${p}`,"",...b,""];c(...S)}else c(`%c[${r}]%c %s`,`color: ${p}`,"",...h)}},{channel:{value:r},color:{value:(h,...g)=>{let y=[`%c${g.join(" ")}%c%s`,`color: ${h}`,""];return y.toString=()=>g.join(" "),y[es]=!0,y}},extend:{value:h=>e(h,r)},enabled:{get:()=>f(),set:h=>{u=h}},logFn:{configurable:!1,get:()=>c,set:h=>{c=h??s}},destroy:{value:()=>{io.delete(i)}}});return io.set(i,m),m}return e(o)}var as=console.log.bind(console),ns;Object.defineProperty(is,"enable",{get:()=>ns,set:o=>{ns=o,Ui(ji())}});var ke=is;ke.colors=Qo;ke.logFn=as;var ah=(o,e)=>Ki.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;Wi(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});ke.onLogIntent=ah;ke.destroyAll=()=>{Hi(),Hi(ke.colors),io.clear(),lo.clear()};var rt=o=>{let e=ke(o?`${o}:TYPE=debug`:"TYPE=debug");return e.logFn=console.log.bind(console),e},Gt=o=>{let e=ke(o?`${o}:TYPE=error`:"TYPE=error");return e.logFn=console.error.bind(console),e},so=()=>so;so.extend=()=>so;var Je=class{constructor(e){this.debug=so,this.error=so}};import*as lh from"react";import{useMemo as KS,useRef as sh,useEffect as ch,useLayoutEffect as uh,useCallback as HS}from"react";var co=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?xt(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}},Jo=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=sh({width:0,height:0}),r=i=>{let a;return o.current&&(a=co(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()}};ch(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),uh(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};var dh=Gt("CSSVariableWatch"),fh=rt("CSSVariableWatch"),ph={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},mh=o=>{let e=ls(0),t=rn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);Jo(o.ref,t,{earlyAttach:!0}),rn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n)return e.current=n,fh(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);dh(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},uo=o=>{let e=ls(null);mh({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return rn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:ph},rn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};import*as tr from"react";import*as ss from"react";var Yi;function fo(){return Yi||(Yi=ss.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}import*as cs from"react";var qi;function er(){return qi||(qi=cs.createContext(void 0))}function vn(){let o=fo();return tr.useContext(o).componentState}function Re(){let o=fo();return tr.useContext(o)}function Oe(){let o=er();return tr.useContext(o)}import*as sn from"react";import{useCallback as Zs,useEffect as ua,useRef as tg,useState as ng}from"react";import*as nr from"react";function hh(o){let{height:e,width:t,count:n}=o;return nr.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 us=nr.memo(hh);var ds="mlx2t3";import*as or from"react";import{useRef as yh}from"react";import{useEffect as gh}from"react";var fs=(o,e)=>{gh(()=>{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 ps={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},ms={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},hs={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Xi="_1ueijco1",gs="_1ueijco0 _16lm1iw0";var ys=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=ps[`${o}`]:e=J(ms[`${o.horizontal}`],hs[`${o.vertical}`]),e};var bh="InfiniteVirtualScrollContainer";var bs=or.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??yh(null);return fs(u,i),or.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:J(a,bh,gs,ys(r))},n)});import*as pr from"react";import{useLayoutEffect as ca,useMemo as Mh}from"react";import*as Cs from"react";import{useLayoutEffect as Ch,useRef as Th,useState as Sh}from"react";function wh(o){let[e,t]=Sh(o.updater.get),n=Th(null);return Ch(()=>{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 Kt=Cs.memo(wh);function In(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 Ts(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}function Y(o){return o.slice(4,-1)}var et="Infinite",xe={rootClassName:et};var U={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnZIndexAtIndex:"var(--_16hkbkch)",pinnedStartWidth:"var(--_16hkbkci)",pinnedEndWidth:"var(--_16hkbkcj)",pinnedEndOffset:"var(--_16hkbkck)",computedVisibleColumnsCount:"var(--_16hkbkcl)",baseZIndexForCells:"var(--_16hkbkcm)",bodyWidth:"var(--_16hkbkcn)",bodyHeight:"var(--_16hkbkco)",scrollbarWidthHorizontal:"var(--_16hkbkcp)",scrollbarWidthVertical:"var(--_16hkbkcq)",scrollLeft:"var(--_16hkbkcr)",scrollTop:"var(--_16hkbkcs)"};var Ss="true",se={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},ws="column-header-height";var Rs=`.${xe.rootClassName}`;function Zi(o){return In(o,Rs)}var vs=Y(U.scrollLeft),Rh=Y(U.scrollTop),vh=Y(U.columnWidthAtIndex),Qi=Y(U.columnOffsetAtIndex),Is=Y(U.columnReorderEffectDurationAtIndex),Ih=Y(U.columnOffsetAtIndexWhileReordering),xh=Y(U.columnZIndexAtIndex);function Pt(o,e,t){let n=t?Zi(t):document.querySelector(Rs);Ph(o,e,n)}function Ph(o,e,t){if(t){let n=o,r=U[n]?Y(U[n]):o;t.style.setProperty(r,`${e}`)}}function xn(o,e){if(e)for(var t in o){let n=U[t]?Y(U[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function Ji(o,e,t){Pt(`${Qi}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${vs}))`:`${o.computedAbsoluteOffset+e}px`,t)}function ea(o,e,t){Pt(`${xh}-${o}`,`${e}`,t)}function po(o,e,t){Pt(`${Ih}-${o}`,typeof e=="number"?`calc( var(${Qi}-${o}) + ${e}px )`:e,t)}function rr(o,e,t){Pt(`${Is}-${o}`,t??"",e)}function xs(o,e){let t=`${Is}-${o}`;Pt(t,se.components.Cell.reorderEffectDuration,e)}var be={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${vh}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Pt(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`${Qi}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Pt(this.varName.get(o),e,t)}}};function Ps(o,e){xn({[vs]:`${o.scrollLeft}px`,[Rh]:`${o.scrollTop}px`},e)}var Pe=Ae().requestAnimationFrame||(o=>setTimeout(o,16)),ht=Ae().cancelAnimationFrame||(o=>clearTimeout(o));var As=ro(Pn());var ta=(o,e)=>o-e,Dt={horizontal:!0,vertical:!0};function ir(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 na="DebugID=";function Ht(o,e){return e&&e.startsWith(na)?e:e?`${na}${o}:${e}`:`${na}${o}`}var ar={start:0,end:0},oa=o=>{o()},ra=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},Es=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},mo=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function Dh(o){return o.horizontalChange||o.verticalChange}var an=class extends Je{constructor(t){let n=Ht(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=ar;this.verticalExtendRangeBy=ar;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=>{mo(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?oa:mo;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?oa:mo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=Dt)=>{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=Dt)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let f=l;for(;d[f]!=f;)f--;a.push([f,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let f=l;for(;d[f]!=f;)f--;a.push([u,f])}}}return a};this.computeRenderRange=(t=Dt)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,f=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),f&&(r+=f);let p=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return p>m&&(p=m,u=Math.max(a,p-r)),{startIndex:u,endIndex:p}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let f=(0,As.default)(a,t,ta);return f>=0?f:~f-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),f=u.get(a);if(d[i]===void 0){let p=d.length,m=l?Math.min(i,l-1):0,h={rowIndex:t,colIndex:n};for(;p<=m;p++)if(d[p]===void 0){h[r==="horizontal"?"colIndex":"rowIndex"]=p;let g=s(h);d[p]=p,f[p]=g;let y=p;for(;g>1;)y+=1,d[y]=p,f[y]=0,g-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ra;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=Dt){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",f=u&&s!==this.availableWidth,p=d&&c!==this.availableHeight;f&&(this.availableWidth=s,this.availableRenderWidth=s),p&&(this.availableHeight=c,this.availableRenderHeight=c),(f||p)&&this.notifyAvailableSizeChange();let m=typeof r=="number",h=typeof i=="number",g=m&&r!==this.rows,y=h&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),h&&(this.cols=i);let b=a!=null,T=l!=null,S=b&&a!==this.rowHeight,C=T&&l!==this.colWidth;b&&(this.rowHeight=a),T&&(this.colWidth=l);let R=t.rowspan!=null,w=t.colspan!=null,v=R&&t.rowspan!=this.rowspan,I=w&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),I&&(this.colspan=t.colspan);let x=y||C||f||I,P=g||S||p||v;(n||Dh)({horizontalChange:x,verticalChange:P,colsChanged:y,colWidthChanged:C,widthChanged:f,colspanChanged:I,rowsChanged:g,rowHeightChanged:S,heightChanged:p,rowspanChanged:v})&&this.updateRenderCount({horizontal:x,vertical:P})}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=Dt){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Dt){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?oa:mo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,f=r;d+=s,f-=c;for(let p=d;p<f;p++)u.push(this.getItemSize(p,t));a=ir(l,u)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{mo(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let n=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=ar,this.verticalExtendRangeBy=ar,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var aa=ro(Pn());function Ms(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function _s(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function ho(o,e){for(let t of o)if(e(t))return t}import*as Os from"react";var Fs=new Map,Ah=()=>{},ia=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=fe();let n=Fs.get(e)??0,r=`${e}:GridCellReact:${n}`;Fs.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=fe(),this.node=Os.createElement(Kt,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Ah,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}},Dn=class Dn extends Je{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=fe();this.cellAttachmentChangeSubscription=fe();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=new ia(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,n=t.values().next().value;return n||(this.poolSize+=Dn.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}set poolSize(t){t=Math.ceil(t/Dn.POOL_SIZE_INCREMENT)*Dn.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--}};Dn.POOL_SIZE_INCREMENT=1;var lr=Dn;var sr=(o,e)=>o-e,cr=class extends Je{constructor(t){super(`${t}:GridCellManager`);this.matrix=new q;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[f,p]=d,m=f<i,h=f>=l,g=p<a,y=p>=s;(m||h||g||y)&&c.add(u)}),c};this.debugId=t,this.pool=new lr(t),this.offRemoveCell=this.pool.onRemoveCell(n=>this.onRemoveCell(n))}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=ho(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=ho(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(sr)}getColumnsWithCells(){let t=this.matrix.getUnnestedKeysStartingWith([],!0);return[...new Set(t.map(r=>r[1])).values()].sort(sr)}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,aa.default)(n,t,sr);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,aa.default)(n,t,sr);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 ho(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return ho(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var zs=ro(Pn());import*as Ls from"react";var Ns=new Map,Eh=()=>{},la=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=fe();let t=Ns.get(e)??0,n=`${e}:ListRowReact:${t}`;Ns.set(e,t+1),this.debugId=n,this.updater=fe(),this.node=Ls.createElement(Kt,{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=Eh,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},An=class An extends Je{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=fe();this.rowAttachmentChangeSubscription=fe();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=new la(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,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 ur=An;var dr=class extends Je{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new ur(t),this.offRemoveRow=this.pool.onRemoveRow(n=>this.onRemoveRow(n))}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,zs.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 ks=!0,ln=Y(U.y),Vs=Y(U.scrollTop),ER=Y(U.columnOffsetAtIndex),sa=Y(U.columnOffsetAtIndexWhileReordering),En=class extends Je{constructor(t,n){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(ln,i?`calc( ${r}px + var(${Vs}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${ln}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=be.columnOffsets.get(r),d=`${sa}-${r}`,f=s?`calc( ${a}px + var(${Vs}) )`:`${a}px`;t.__currentTransformY!==f&&(t.__currentTransformY=f,t.style.setProperty(ln,f));let p=`translate3d(var(${d}, ${u}), var(${ln}), 0)`;t.__transformValue!==p&&(t.__transformValue=p,t.style.transform=p),c!=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 c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),f=r.getFixedEndRowsHeight(),p=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let h=p+m.height;l||(l=c>h-f?"end":c<p+d?"start":"end");let g=i.scrollTop;if(l==="center"?g=c-Math.floor((r.getAvailableSize().height-d-f)/2):l==="start"?(s=-s,g+=c-p+s-d):(s+=u,g+=c-h+s+f),this.brain.isHorizontalLayoutBrain){let y=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(y,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:g}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),f=r.getFixedStartColsWidth(),p=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let h=p+m.width;l||(l=c>h-f?"end":c<p+d?"start":"end");let g=i.scrollLeft;return l==="center"?g=c-Math.floor((r.getAvailableSize().width-d-f)/2):l==="start"?(s=-s,g+=c-p+s-d):(s+=u,g+=c-h+s+f),{...i,scrollLeft:g}};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,f]=c,[p,m]=u,h=[];if(i&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&h.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),h.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[p,i]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&h.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),h.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[p,l]})),n){let g={start:[0,f],end:[n,m],rowFixed:"start",colFixed:!1};h.push(g)}if(r){let g={rowFixed:"end",colFixed:!1,start:[s-r,f],end:[s,m]};h.push(g)}return h};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,f=!1;if(t<r&&(u=!0,f="start"),i&&!u){let p=c-i;t>=p&&(u=!0,f="end")}if(n<a&&(d=!0,f="start"),l&&!d){let p=s-l;n>=p&&(d=!0,f="end")}return{row:u?f:!1,col:d?f:!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.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))};Pe(()=>{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:c,y:u}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,ks){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==p&&(r.__zIndex=p,r.style.zIndex=p)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`}};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,ks&&(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:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(A=>{let F=i.getRowIndex(A);if(F!=null){let D=this.brain.getItemOffsetFor(F,"vertical");if(D==null)return;let M=A.getElement();if(!M)return;this.setDetailTransform(M,F,{y:D,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let f=this.cellManager.getOneAttachedCell();f&&Ps(t,this.getInfiniteNode(f.getElement()));let p=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:g}=this.brain.getRenderRange(),[y,b]=h,[T,S]=g;function C(A,F,D){let M=r.getCellAt([A,F]);if(M==null)return;let N=n.getCellOffset(A,F),V=M.getElement();V&&N&&D(A,F,V,N)}let R=(A,F,D,{x:M,y:N})=>{this.setTransform(D,A,F,{x:M,y:N,scrollLeft:!0},s-F)},w=(A,F,D,M)=>{this.setTransform(D,A,F,{x:M.x,y:M.y,scrollTop:!0},u-A)},v=(A,F,D,{y:M})=>{let N=p[F];this.setTransform(D,A,F,{x:N,y:M,scrollLeft:!0},a-F)},I=(A,F,D,M)=>{this.setTransform(D,A,F,{x:M.x,y:m[A],scrollTop:!0},l-A)},x=(A,F,D,{x:M,y:N})=>{this.setTransform(D,A,F,{x:M,scrollLeft:!0,y:N,scrollTop:!0},1e5)},P=(A,F,D,{x:M})=>{this.setTransform(D,A,F,{x:M,scrollLeft:!0,y:m[A],scrollTop:!0},2e5)},E=(A,F,D,M)=>{this.setTransform(D,A,F,{x:p[F],y:M.y,scrollLeft:!0,scrollTop:!0},3e5)},_=(A,F,D)=>{this.setTransform(D,A,F,{x:p[F],y:m[A],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let A=y;A<T;A++){for(let F=0;F<s;F++)C(A,F,R);if(c){let F=a-c;for(let D=F;D<a;D++)C(A,D,v)}}if(u||d)for(let A=b;A<S;A++){for(let F=0;F<u;F++)C(F,A,w);if(d){let F=l-d;for(let D=F;D<l;D++)C(D,A,I)}}if(s&&u)for(let A=0;A<u;A++)for(let F=0;F<s;F++)C(A,F,x);if(s&&d){let A=l-d;for(let F=A;F<l;F++)for(let D=0;D<s;D++)C(F,D,P)}if(c&&u){let A=a-c;for(let F=0;F<u;F++)for(let D=A;D<a;D++)C(F,D,E)}if(c&&d){let A=l-d,F=a-c;for(let D=A;D<l;D++)for(let M=F;M<a;M++)C(D,M,_)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new cr(n),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new dr(n),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Pe(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Zi(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,f=this.getFixedRanges(t),p=[t,...f],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],P=t.end[1];m.forEach(E=>{x<=E&&E<P||p.push({start:[t.start[0],E],end:[t.end[0],E+1]})})}let h=new Map,g=p.map(this.getExtraSpanCellsForRange).flat();g&&g.forEach(([x,P])=>{h.set(`${x}:${P}`,!0)});let y=p.reduce((x,P)=>x+ra(P),0),b=r?p.reduce((x,P)=>x+Es(P),0):0,T=this.brain.getRowCount(),S=this.brain.getColCount();d.detachCellsStartingAt([T,S]);let C=Math.min(T*S,y);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>b&&(u.poolSize=b));let R=Ms(...p.map(x=>d.getCellsOutsideRenderRange(x)));R=_s(R,x=>{let P=d.getCellPosition(x);return!(P&&h.has(`${P[0]}:${P[1]}`))}),d.detachCells(R),d.poolSize=C;let w=new Map,v=new Map;p.forEach(x=>{let{start:P,end:E}=x,[_,A]=P,[F,D]=E;for(let M=_;M<F;M++){for(let V=A;V<D;V++){let $=`${M}:${V}`;if(w.has($))continue;w.set($,!0);let{rendered:te,mapped:he}=this.isCellRenderedAndMappedCorrectly(M,V);if(M===_||V===A){let k=this.isCellCovered(M,V);if(k&&h.has(`${k[0]}:${k[1]}`)){let B=d.getCellAt([M,V]);B!=null&&d.detachCell(B);continue}}if(te&&!i&&he)continue;let ce;te?ce=d.getCellAt([M,V]):ce=d.getCellFor([M,V],c?"row":"column"),ce==null&&(ce=d.getDetachedCell()),this.renderCellAt(M,V,ce,n)}!r||v.has(M)||(v.set(M,!0),u.isRowAttachedAt(M)&&!i)||this.renderDetailRowAtElement(M,this.rowManager.getRowFor(M),r)}}),g.forEach(([x,P])=>{let{rendered:E,mapped:_}=this.isCellRenderedAndMappedCorrectly(x,P);if(E){if(i||!_){let F=[x,P],D=d.getCellAt(F);this.renderCellAt(x,P,D,n)}return}let A=d.getCellFor([x,P],c?"row":"column");A!=null&&this.renderCellAt(x,P,A,n)});let I=d.getAllCells().map(x=>x.getNode());return r&&u.getAllRows().forEach(x=>{I.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(I),I}renderDetailRowAtElement(t,n,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),f=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:p,col:m}=this.isCellFixed(t,n),h=!!a,{rowIndex:g,colIndex:y}=this.getCellRealCoordinates(t,n),b=i({rowIndex:g,colIndex:y,height:l,width:s,rowspan:c,colspan:u,rowFixed:p,colFixed:m,hidden:h,heightWithRowspan:d,widthWithColspan:f,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:r.ref});r.isMounted()||r.onMount(S=>{let C=S.getElement();C&&(C.style.position="absolute",C.style.left="0px",C.style.top="0px"),this.updateElementPosition(S)});let T=this.brain.isHorizontalLayoutBrain?{renderRowIndex:g,renderColIndex:y}:void 0;if(!b){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(b,r,[t,n],T),this.updateElementPosition(r,{hidden:h,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var fr=class extends En{constructor(t,n){super(t,n);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=se.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",f=be.columnOffsets.get(l.colIndex),p=`${sa}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(ln,m));let h=`calc(var(${p}, ${f}) + ${d})`,g=`var(${ln})`,y=`translate3d(${h}, ${g}, 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}}};function go(o){let e=o.isHorizontalLayoutBrain?new fr(o,`${o.name}:HorizontalLayoutTableRenderer`):new En(o,`${o.name}:ReactHeadlessTableRenderer`),t=fe();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function _h(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=Mh(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:go(e),[e,o.onRenderUpdater,o.renderer]);return ca(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),ca(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),ca(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),pr.createElement(Kt,{updater:a})}var mr=pr.memo(_h);import*as yo from"react";import{useEffect as Vh,useLayoutEffect as Gh,useRef as Kh}from"react";import{useCallback as Fh,useState as Oh}from"react";var St=()=>{let[o,e]=Oh(0);return[o,Fh(()=>{e(t=>t+1)},[e])]};function Nh(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 Lh(o){var e=Nh(o,"string");return typeof e=="symbol"?e:String(e)}function zh(o,e,t){return e=Lh(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Gs(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 Ks(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gs(Object(t),!0).forEach(function(n){zh(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Gs(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Hs(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var kh=(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=Ks(Ks({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=o.variantClassNames[i][s];c&&(n+=" "+c)}}for(var[u,d]of o.compoundVariants)kh(u,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Hs(o.variantClassNames,t=>Hs(t,n=>n.split(" ")[0]))}},e};var Bs=ye({defaultClassName:"nxbq1c1 _16lm1iwl _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),hr="nxbq1c0 _16lm1iwl _16lm1iw4 _16lm1iw1f _16lm1iw1d _16lm1iw18 _16lm1iwu";var Ws=ye({defaultClassName:"j26lrx0 _16lm1iwl _16lm1iw2 _16lm1iw1d _16lm1iw1f",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Hh}=xe,Bh=`${Hh}-ActiveRowIndicator`,Wh=`calc(${U.activeCellRowOffsetX} + var(${Y(U.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,jh={[Y(U.activeCellOffsetY)]:U.activeCellRowOffset,transform:`translate3d(${Wh}, calc( ${U.activeCellOffsetY} + var(${Y(U.scrollTopForActiveRow)}, 0px)), 0px)`,height:U.activeCellRowHeight,maxWidth:se.runtime.totalVisibleColumnsWidthVar},$h=o=>{let{brain:e}=o,t=Kh(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=St();return Gh(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let f=e.getPageIndexForRow(l);f>0&&(a=`calc(${se.runtime.totalVisibleColumnsWidthVar} * ${f})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};xn(d,u)},[o.activeRowIndex,e]),Vh(()=>{let a=c=>{xn({scrollTopForActiveRow:`${-c.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-c.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),yo.createElement("div",{className:hr,"data-name":"active-row"},yo.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${Bh} ${Ws({active:n})}`,style:n?jh:void 0}))},js=yo.memo($h);import*as bo from"react";import{useEffect as Uh,useLayoutEffect as Yh,useRef as qh}from"react";var{rootClassName:Xh}=xe,Zh=`${Xh}-ActiveCellIndicator`,Qh=Y(U.columnZIndexAtIndex),Jh=(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;xn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},eg=o=>{let{brain:e}=o,[t,n]=St(),r=qh(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return Yh(()=>{Jh(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),Uh(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),bo.createElement("div",{className:hr,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${Qh}-${o.activeCellIndex[1]})`}:void 0},bo.createElement("div",{"data-name":"active-cell-indicator",className:`${Zh} ${Bs({visible:i})}`}))},$s=bo.memo(eg);var Us="_1eexc2a7 _1eexc2a6",Ys=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"]]}),qs=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 Xs="_1eexc2a5",gr=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),yr="_1eexc2a8";var br=[Xs,`${et}DetachedCell`];function Cr(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 og=J(ds,Xi);function Qs(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:f,forceRerenderTimestamp:p,scrollVarHostRef:m,...h}=o,{autoFocus:g}=h,y=tg(null),[b,T]=ng({width:0,height:0});ua(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),ua(()=>{let R=y.current?.parentNode;return R?(g&&document.activeElement!==R&&R.focus(),co(R,()=>{let I={height:R.clientHeight,width:R.clientWidth};e.update(I)},{debounce:50})):void 0},[f,e]);let S=Zs(R=>{requestAnimationFrame(()=>{y.current&&y.current.style.setProperty("transform",`translate3d(${-R.scrollLeft}px, ${-R.scrollTop}px, 0px)`)})},[]),C=Zs(R=>{e.setScrollPosition(R,S)},[e,S]);return ua(()=>{let R=e.onRenderCountChange(()=>{T(e.getVirtualizedContentSize())});return T(e.getVirtualizedContentSize()),S(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),R},[e]),sn.createElement(bs,{onContainerScroll:C,...h,ref:t},sn.createElement("div",{ref:y,className:og,"data-name":"scroll-transform-target"},sn.createElement(mr,{forceRerenderTimestamp:p,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:br}),u!=null?sn.createElement($s,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?sn.createElement(js,{brain:e,activeRowIndex:c}):null,sn.createElement(us,{width:b.width,height:b.height}))}import*as Mn from"react";import{useReducer as ug,createContext as dg,useMemo as ma,useEffect as fg,useState as ec,useRef as tc,useLayoutEffect as pg}from"react";function da(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var fa=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Co(o){return o!==void 0}function Bt(o,e){let t=e[o];return Co(t)}import{useCallback as rg,useEffect as ig,useRef as pa}from"react";var Js=o=>{let e=rg(o,[]),t=pa(!1),n=pa(!1),r=pa(void 0),[i,a]=St();t.current&&(n.current=!0),ig(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};import{useCallback as ag,useRef as lg}from"react";function Me(o){let e=lg(o);return e.current=o,ag(()=>e.current,[])}import{useRef as sg,useLayoutEffect as cg}from"react";var cn=(o,e)=>{let t=sg(e===void 0?o:e);return cg(()=>{t.current=o}),t.current};var mg=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)},ha;function nc(){return ha||(ha=dg(null))}function hg(o,e,t,n,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:f=>{let p=t(),m=e(),h=m[u],g=!0;if(i&&typeof i[u]=="function"&&i[u](f,{actions:s,state:m})===!1&&(g=!1),g){let T=[f],S=`on${fa(c)}Change`;if(a&&a[u]){let C=a[u](f,m);S=C.callbackName||S,T=C.callbackParams}mg(p,S,T)}let y=n[u];typeof y=="function"&&(f=y(f));let b=!!r?.[u];Bt(c,p)&&!b||o({payload:{updatedProps:null,mappedState:{[c]:f}}})}}),s},{})}function gg(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=Bt(r,e)?e[r]:e[`default${fa(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function At(o){let e=o.getParentState||(()=>null);function t(r){let[i]=ec(()=>o.initSetupState?o.initSetupState(r):{}),a=tc(new Set),l=ma(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=Me(s);function u(){let v={};l&&(v=gg(l,r,i));let I={...i,...v};if(o.mapPropsToState){let{fn:x,propertyReads:P}=da(o.mapPropsToState,{getProxyTargetFromArgs:_=>_.props,putProxyToArgs:(_,A)=>[{...A,props:_}]}),E=x({props:r,state:I,oldState:null,parentState:s});return a.current=new Set([...a.current,...P]),{...I,...E}}return I}let[d]=ec(u),f=Me(r),p=(v,I)=>{if(I.type==="REPLACE_STATE")return I.payload;let x=c?.()??null,P=I.payload.mappedState,E=I.payload.updatedPropsToState,_={...v};if(P&&Object.assign(_,P),o.mapPropsToState){let{fn:F,propertyReads:D}=da(o.mapPropsToState,{getProxyTargetFromArgs:N=>N.props,putProxyToArgs:(N,V)=>[{...V,props:N}]}),M=F({props:f(),state:_,oldState:v,parentState:x});a.current=new Set([...a.current,...D]),Object.assign(_,M)}return I.type==="ASSIGN_STATE"&&Object.assign(_,I.payload),o.concludeReducer?o.concludeReducer({previousState:v,state:_,updatedProps:E,parentState:x}):_},[m,h]=ug(p,d),g=Me(m),{allowedControlledPropOverrides:y}=o,b=ma(()=>hg(h,g,f,l,y,o.interceptActions,o.mappedCallbacks),[h,l,y]),T=nc(),S=ma(()=>({componentState:m,componentActions:b,getComponentState:g,replaceState:v=>{h({type:"REPLACE_STATE",payload:v})},assignState:v=>{h({type:"ASSIGN_STATE",payload:v})}}),[m,b,g]),C=cn(r),R=tc(!1);R.current=!1;let w=o.layoutEffect?pg:fg;return w(()=>{let v=r,I={},x=0,P={},E=0,_={},A=0;if(new Set([...Object.keys(v),...Object.keys(C)]).forEach(M=>{let N=M,V=C[N],$=v[N];if(N!=="children"&&V!==$&&(_[N]={newValue:$,oldValue:V},A++,Bt(N,r)||Bt(N,C)))if(l.hasOwnProperty(M)){let te=$,he=l[M];typeof he=="function"&&(te=he($)),m[N]!==te&&(I[N]=te,x++)}else a.current.has(M)&&(P[N]=v[N],E++)}),E>0||x>0){(o.debugName?rt(typeof o.debugName=="function"?`${o.debugName(v)}:rerender`:`${o.debugName}:rerender`):rt("rerender"))("Triggered by new values for the following props",...Object.keys(I??{}),...Object.keys(P??{}));let N={payload:{mappedState:x?I:null,updatedPropsToState:E?P:null}};if(R.current=!0,h(N),o.onPropChange){for(var D in _)if(_.hasOwnProperty(D)){let{newValue:V,oldValue:$}=_[D];o.onPropChange({name:D,newValue:V,oldValue:$},r,b,m)}}o.onPropsChange&&A&&o.onPropsChange(_,r,b,m)}}),w(()=>{s!=null&&!R.current&&h({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Js(()=>()=>{o.cleanup?.(g())}),{contextValue:S,ContextComponent:T}}return{ManagedComponentContextProvider:Mn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Mn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Ge(){let o=nc();return Mn.useContext(o)}import*as gc from"react";var Tr=()=>xe;var oc="_16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",rc={center:"_16lm1iw1r",stretch:"_16lm1iw1s"};var wt="_16lm1iw24 _16lm1iw25 _16lm1iw1y",ic={pointer:"_16lm1iwi",default:"_16lm1iwj",colResize:"_16lm1iwk"},_n={flex:"_16lm1iwz",contents:"_16lm1iw10",none:"_16lm1iw11",block:"_16lm1iw12",grid:"_16lm1iw13",inlineBlock:"_16lm1iw14",inlineFlex:"_16lm1iw15",inlineGrid:"_16lm1iw16"};var Sr={1:"_16lm1iwm",none:"_16lm1iwn"},To={column:"_16lm1iw1n",columnReverse:"_16lm1iw1o",row:"_16lm1iw1p",rowReverse:"_16lm1iw1q"},ac={0:"_16lm1iw18","100%":"_16lm1iw19","50%":"_16lm1iw1a"},lc={center:"_16lm1iw1t",spaceBetween:"_16lm1iw1u",spaceAround:"_16lm1iw1v",start:"_16lm1iw1w",end:"_16lm1iw1x"},sc={0:"_16lm1iw1f","100%":"_16lm1iw1g",auto:"_16lm1iw1h"};var cc={none:"_16lm1iwd"},uc={hidden:"_16lm1iw1y",auto:"_16lm1iw1z",visible:"_16lm1iw20"};var So={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var dc={0:"_16lm1iw1d","100%":"_16lm1iw1e"};var fc="_16lm1iwe",pc={none:"_16lm1iw17"};var mc={visible:"_16lm1iw21",hidden:"_16lm1iw22"};var hc={1:"_16lm1iwo",10:"_16lm1iwp",100:"_16lm1iwq",1e3:"_16lm1iwr",1e4:"_16lm1iws",1e5:"_16lm1iwt",1e6:"_16lm1iwu",1e7:"_16lm1iwv","1k":"_16lm1iww","10k":"_16lm1iwx","100k":"_16lm1iwy"};function yc(o){let{rootClassName:e}=Tr();return gc.createElement("div",{...o,className:J(`${e}Footer`,So.relative,_n.flex,To.row,o.className)})}import*as Se from"react";import{useCallback as Ry,useContext as vy,useEffect as Iy,useRef as xy}from"react";import{createPortal as Py}from"react-dom";function wr(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}import*as bc from"react";var _e=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return bc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};import*as wo from"react";var Cc=o=>wo.createElement(_e,{...o},wo.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),wo.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),wo.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));import*as ga from"react";var Tc=o=>ga.createElement(_e,{...o},ga.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));import*as ya from"react";var ba=o=>ya.createElement(_e,{...o},ya.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as Ca from"react";var Sc=o=>Ca.createElement(_e,{...o},Ca.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));import*as Ta from"react";var wc=o=>Ta.createElement(_e,{...o},Ta.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as Sa from"react";var Rc=o=>Sa.createElement(_e,{...o},Sa.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));import*as wa from"react";var vc=o=>wa.createElement(_e,{...o},wa.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as Ra from"react";var Ic=o=>Ra.createElement(_e,{...o},Ra.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as va from"react";var xc=o=>va.createElement(_e,{...o},va.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));import*as Oa from"react";import*as je from"react";import{useEffect as Eg,useState as tu}from"react";import{useContext as bg}from"react";import{createContext as yg}from"react";var Ia;function Fn(){return Ia||(Ia=yg(null))}var X=()=>{let o=Fn();return bg(o)};import{useContext as Cg}from"react";var Pc=()=>{let o=Fn(),{state:e}=Cg(o);return e};import*as On from"react";import{useEffect as Tg,useLayoutEffect as Sg,useState as jc}from"react";var Dc="_1eexc2a6";var Ac=ye({defaultClassName:"_12zfob129 _16lm1iw19 _16lm1iw1c _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1w",variantClassNames:{filtered:{false:"_12zfob12a",true:"_12zfob12b"},verticalAlign:{start:"_12zfob12c",end:"_12zfob12d",center:"_12zfob12e"},align:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"}},defaultVariants:{},compoundVariants:[]}),Ec="_12zfob1n _16lm1iw24 _16lm1iw25 _16lm1iw1y",Mc=ye({defaultClassName:"_12zfob1o",variantClassNames:{rowActive:{false:"_12zfob1p",true:"_12zfob1q"},cellSelected:{false:"_12zfob1r",true:"_12zfob1s"},rowSelected:{false:"_12zfob1t",true:"_12zfob1u",null:"_12zfob1v"},rowDisabled:{false:"_12zfob1w",true:"_12zfob1x"},firstRow:{false:"_12zfob1y",true:"_12zfob1z"},treeNode:{parent:"_12zfob110",leaf:"_12zfob111",false:"_12zfob112"},firstRowInHorizontalLayoutPage:{false:"_12zfob113",true:"_12zfob114"},groupRow:{false:"_12zfob115",true:"_12zfob116"},groupCell:{false:"_12zfob117",true:"_12zfob118"},align:{start:"_12zfob119",end:"_12zfob11a",center:"_12zfob11b"},verticalAlign:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},zebra:{false:"_12zfob11f",even:"_12zfob11g",odd:"_12zfob11h"},dragging:{true:"_12zfob11i",false:"_12zfob11j"},insideDisabledDraggingPage:{true:"_12zfob11k",false:"_12zfob11l"},first:{true:"_12zfob11m",false:"_12zfob11n"},last:{true:"_12zfob11o",false:"_12zfob11p"},groupByField:{true:"_12zfob11q",false:"_12zfob11r"},firstInCategory:{true:"_12zfob11s",false:"_12zfob11t"},lastInCategory:{true:"_12zfob11u",false:"_12zfob11v"},pinned:{start:"_12zfob11w",end:"_12zfob11x",false:"_12zfob11y"},filtered:{true:"_12zfob11z",false:"_12zfob120"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob121"],[{pinned:"end",firstInCategory:!0},"_12zfob122"],[{pinned:!1,lastInCategory:!0},"_12zfob123"]]}),_c=ye({defaultClassName:"_12zfob19 _16lm1iw12 _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1a",end:"_12zfob1b",false:"_12zfob1c"},firstInCategory:{true:"_12zfob1d",false:"_12zfob1e"},lastInCategory:{true:"_12zfob1f",false:"_12zfob1g"},overflow:{true:"_12zfob1h",false:"_12zfob1i"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1j"],[{pinned:"start",firstInCategory:!0},"_12zfob1k"],[{overflow:!0,pinned:"end"},"_12zfob1l"],[{pinned:"end",lastInCategory:!0},"_12zfob1m"]]}),Fc="_12zfob12r _16lm1iw1c _16lm1iw19";var Oc="_12zfob17",Nc="_12zfob12n _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1",Lc=ye({defaultClassName:"_12zfob12o _16lm1iw1 _16lm1iw1d",variantClassNames:{disabled:{true:"_12zfob12p",false:"_12zfob12q"}},defaultVariants:{},compoundVariants:[]}),xa=ye({defaultClassName:"_12zfob12k _16lm1iwz _16lm1iw1p _16lm1iw1s _16lm1iw1",variantClassNames:{active:{true:"_12zfob12l",false:"_12zfob12m"}},defaultVariants:{},compoundVariants:[]}),zc="_12zfob12j _16lm1iwz _16lm1iw1p _16lm1iw1r",kc=ye({defaultClassName:"_12zfob124 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw1v _16lm1iw22",variantClassNames:{menuVisible:{true:"_12zfob125"},reserveSpaceWhenHidden:{true:"_12zfob126",false:"_12zfob127"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob128"]]}),Vc="_12zfob18 _16lm1iw2",Gc="_16lm1iw1",Kc="_12zfob16",Hc=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Bc="_12zfob12i _16lm1iw1y _16lm1iw1 _16lm1iwz _16lm1iw1p";var it="InfiniteIcon";var Wc="_6aunoi0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v _16lm1iw1r";var wg={transition:"width 0.25s, opacity 0.25s"};function Nn(o){let[e,t]=jc(!0),[n,r]=jc(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),f=[u-1*d,u-2*d,u-3*d],p={...wg,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if(Tg(()=>{if(!e)return;let h=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(h)}},[e]),Sg(()=>{t(!0)},[]),!e)return null;let m={};return On.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:J(l,it,Wc,`${it}-filter`)},c?On.createElement("div",{"data-name":"index",style:m,className:Oc},s):null,On.createElement("div",{style:{width:f[0],...p}}),On.createElement("div",{style:{width:f[1],...p}}),On.createElement("div",{style:{width:f[2],...p}}))}var Pa=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((w,v)=>{let I=w.maxSize??r??void 0,x=w.minSize??n??void 0;s.push(x),c.push(I),w.size!=null&&(I!=null&&w.size>I&&(w.size=I),x!=null&&w.size<x&&(w.size=x));let P=w.flex==0?null:w.flex;if(w.size==null&&P==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;P!=null&&(l+=1),a+=P??0,i+=w.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,f={},p={},m=0;t.forEach((w,v)=>{if(w.flex!=null){let I=d*w.flex,x=w.maxSize??r??void 0,P=w.minSize??n??void 0,E=!1,_=0;x!=null&&I>x&&(f[v]=!0,E=!0,_=x),P!=null&&I<P&&(p[v]=!0,E=!0,_=P),E&&(m+=1,l-=1,a-=w.flex,u-=_)}}),m&&(d=u/a);let h=[],g=0,y=u,b=a,T=0,S=0,C=[];return{items:t.map((w,v)=>{let I={...w},x=w.maxSize??r??void 0,P=w.minSize??n??void 0,E=0,_=f[v],A=p[v],F=_||A,D=w.size??0;if(w.flex!=null){if(F)A&&(E=P),_&&(E=x);else{g+=1;let M=N=>(x!=null&&N>x&&(N=x),P!=null&&N<P&&(N=P),N);g===l?E=M(y):(E=M(Math.round(w.flex*d)),S+=E,y=u-S,b-=w.flex,d=y/b)}D=E,I.flexSize=E}return h.push(E),C.push(D),I.computedSize=D,T+=D,I}),flexSizes:h,minSizes:s,maxSizes:c,computedSizes:C,remainingSize:Math.round(e-T)}};function Rr(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}}var Da=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((x,P)=>(x[P]={...o.columnSizing[P]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],c=l.id,u=s?.id,d=l.computedWidth,f=l.computedMinWidth,p=l.computedMaxWidth,m=l.computedFlex?"flex":"width",h=s?.computedWidth,g=s?.computedMinWidth,y=s?.computedMaxWidth,b=s?.computedFlex?"flex":"width",T=!1,S=!1,C=r>0?1:-1,{value:R,clamped:w,diff:v}=Rr(d+r,f,p,C);if(o.shareSpaceOnResize){if(s==null)return n[c]={...n[c],[m]:R},S=w==="min",T=w==="max",{adjustedDiff:R-d,reservedWidth:t,columnSizing:n,minReached:S,maxReached:T,constrained:S||T};let{value:x,clamped:P,diff:E}=Rr(h-r,g,y,C);if(w&&P&&(Math.abs(v)>Math.abs(E)?P=!1:w=!1),!(!w&&!P)){if(w){let _=Rr(h-r-v,g,y,C);x=_.value,P=_.clamped,E=_.diff}else if(P){let _=Rr(d+r+E,f,p,C);R=_.value,w=_.clamped,v=_.diff}}n[c]={...n[c],[m]:R},n[u]={...n[u],[b]:x},S=w==="min"||P==="min",T=w==="max"||P==="max"}else n[c]={...n[c],[m]:R},S=w==="min",T=w==="max";let I=R-d;return{adjustedDiff:I,reservedWidth:o.shareSpaceOnResize?t:t-I,columnSizing:n,minReached:S,maxReached:T,constrained:S||T}};function $c(o,e){return o+e}function Rg(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var Uc=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((y,b)=>(y[b]={...o.columnSizing[b]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((y,b)=>o.dragHandlePositionAfter-b).reverse(),a=i.map(y=>o.items[y]),l=a.map(y=>y.computedWidth),s=a.map(y=>y.computedFlex?"flex":"width"),c=0,{computedSizes:u}=Pa({items:a.map(y=>(y.resizable===!1&&(c+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce($c,0)+r-c,0)}),d=a.map((y,b)=>u[b]-y.computedWidth),f=!0,p=!0,m=!0,h=[];d.forEach((y,b)=>{let T=a[b];if(!T.resizable){h.push(0);return}let S=s[b],C=l[b],R=Rg(n),{maxReached:w,minReached:v,constrained:I,adjustedDiff:x}=Da({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[b],shareSpaceOnResize:!1,items:o.items,columnSizing:R});n[T.id]={...R[T.id],[S]:C+x},h.push(x),w||(p=!1),v||(f=!1),I||(m=!1)});let g=h.reduce($c,0);return{minReached:f,maxReached:p,constrained:m,adjustedDiffs:h,adjustedDiff:g,columnSizing:n,reservedWidth:t-g}};var vr;function Wt(){if(vr!=null)return vr;let o=Ae().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),vr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),vr}var Yc=["start",void 0,"end"],qc=(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:Yc.indexOf(r)-Yc.indexOf(i)}),o);function Xc(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 Aa(o,...e){return Xc(t=>t!=null,o,...e)}function Zc(o,e,...t){return Xc((n,r)=>!(r in o),e,...t)}var Ir=Object.freeze({}),vg={string:Ir,number:{}};function Ea(o,e){let t=e.default||Ir;return o.type===void 0?t:o.type===null?Ir:typeof o.type=="string"?e[o.type]||vg[o.type]||Ir:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var xr=!0,Ig=!0,xg=!0,Pg="string",Ln="unknown",Dg=Gt("getComputedVisibleColumns"),Ag=(o,e,t)=>o[t]!==!1,Ma=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},Qc=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:f,sortInfo:p,multiSort:m,filterTypes:h=un,viewportReservedWidth:g,resizableColumns:y,draggableColumns:b,columnDefaultDraggable:T,columnOrder:S,columnPinning:C,editable:R,columnDefaultEditable:w,columnDefaultFilterable:v,columnDefaultSortable:I,columnSizing:x,columnTypes:P,columnVisibility:E,columnVisibilityAssumeVisible:_})=>{let A=0,F=(d||[]).reduce((K,oe)=>{let{id:G,field:re}=oe;return re&&(K[re]=oe),G&&(K[G]=oe),K},{}),D=qc(S===!0?Object.keys(o):S,C),M=D.filter(K=>o[K]?Ag(E,_,K):(Dg(`Column with id "${K}" specified in columnOrder array cannot be found in the columns map.`),!1)),N=new Map,V=M.map((K,oe)=>{let G=o[K];return N.set(K,oe),G}),$=(p??[]).reduce((K,oe,G)=>(oe.id?K[oe.id]={sortInfo:oe,index:G}:oe.field&&(K[oe.field]={sortInfo:oe,index:G}),K),{});function te(K){let oe=o[K],G=Ea(oe,P),re={minWidth:G?.minWidth,maxWidth:G?.maxWidth,width:G?.defaultWidth,flex:G?.defaultFlex},ge=Aa({width:oe?.defaultWidth,flex:oe?.defaultFlex,minWidth:oe?.minWidth,maxWidth:oe?.maxWidth},x[K]);ge.width!=null&&delete re.flex,ge.flex!=null&&delete re.width,ge=Aa(re,ge);let ie=ge.flex??void 0,Be=ge.minWidth??oe?.minWidth??t,ut=ge.maxWidth??oe?.maxWidth??n,Tt=ie!=null?void 0:ge.width??(i?void 0:r);return!Tt&&ie==null&&(i?ie=i:Tt=Be),{size:Tt,flex:ie,minSize:Be,maxSize:ut}}let he=Pa({availableSize:Math.max(e.width-(g??0)-(a??Wt()),0),maxSize:n,minSize:t,items:M.map(te)}),{computedSizes:ce,flexSizes:k,minSizes:B,maxSizes:ae}=he,ne=[],W=[],z=[],L=[];L.length=M.length;let Z=new Map,j=new Map,le=0,Q=0,O=0,Te=null,Ce=[],H=0,ee=0,ue=0;V.forEach((K,oe)=>{let G=M[oe],re=ce[oe],ge=Ce[oe]=Ma(G,C);ge==="start"?H+=re:ge==="end"?ue+=re:ee+=re});let Ie=e.width-ue,ve=[],Fe=new Map;M.forEach((K,oe)=>{let G=V[oe];Fe.set(K,G)});let De=[];Object.keys(o).forEach(K=>{let oe=o[K];De.push(K),Fe.has(K)||Fe.set(K,oe)});let Ke=new Map;Fe.forEach((K,oe)=>{let G=N.get(oe);G==null&&(G=-1);let re=G!=-1,ge=M[G+1],ie=Ea(K,P),Be=G,ut=$[oe]?$[oe]:K.field?$[K.field]??null:null,Tt=ut?.sortInfo??null,on=!!Tt,Rn=on&&Tt.dir===1,Uo=on&&!Rn,Yo=ut?.index??-1,no=re?{}:te(oe),qo=re?ce[G]:no.size||0,Oi=re&&k[G]||null,Ni=re?B[G]||0:no.minSize||0,Li=re?ae[G]||1e4:no.maxSize||1e4,de=re?Ma(oe,C):!1,We=re?G===M.length-1:!1,dt=Be,mt=re?de==="start"?Q:de==="end"?O:A-Q:0;de=="start"?dt=re?Be:-1:de==="end"?dt=re?Be-(ne.length+z.length):-1:dt=re?Be-ne.length:-1;let oo=re?de==="start"||de===!1?A:Ie+O:-1,Vm=re?de!==Te:!1,Gm=re?We||de!==Ma(ge,C):!1,Ul=K.cssEllipsis??ie.cssEllipsis??l,Km=K.headerCssEllipsis??ie.cssEllipsis??K.cssEllipsis??ie.headerCssEllipsis??s??Ul,Xo=re&&(F[oe]||K.field||K.groupByForColumn)&&(F[oe]||F[K.field||K.groupByForColumn])||null,Hm=K.defaultFilterable??ie.defaultFilterable??v??!0,Bm=R??K.defaultEditable??ie.defaultEditable??w??!1,zi=K.dataType||ie.dataType||(Array.isArray(K.type)?K.type[0]:K.type)||Pg,Wm=K.sortType||ie.sortType||zi,Yl=K.filterType||ie.filterType||zi,ql=!1;if(Xo!=null&&!Xo.disabled){let Vi=h[Yl];Vi&&(!Vi.emptyValues||!Vi.emptyValues.includes(Xo.filter.value))&&(ql=!0)}let Xl=K.field??ie.field,Zl=K.valueGetter??ie.valueGetter,ki=K.defaultSortable??ie.defaultSortable;ki==null&&!K.groupByForColumn&&Xl==null&&Zl==null&&(ki=!1);let jm=f??ki??I??xr,$m=K.resizable??ie.resizable??y??Ig,ze={colType:ie,align:ie.align,headerAlign:ie.headerAlign,computedVisible:re,verticalAlign:ie.verticalAlign,defaultHiddenWhenGroupedBy:ie.defaultHiddenWhenGroupedBy,valueGetter:Zl,valueFormatter:ie.valueFormatter,renderValue:ie.renderValue,render:ie.render,style:ie.style,contentFocusable:ie.contentFocusable,renderMenuIcon:ie.renderMenuIcon,renderSortIcon:ie.renderSortIcon,renderRowDetailIcon:ie.renderRowDetailIcon,renderSelectionCheckBox:ie.renderSelectionCheckBox,renderHeaderSelectionCheckBox:ie.renderHeaderSelectionCheckBox,headerStyle:ie.headerStyle,headerClassName:ie.headerClassName,columnGroup:ie.columnGroup,getValueToEdit:ie.getValueToEdit,getValueToPersist:ie.getValueToPersist,shouldAcceptEdit:ie.shouldAcceptEdit,field:Xl,...K,components:{...ie.components,...K.components},computedResizable:$m,computedMinWidth:Ni,computedMaxWidth:Li,computedFlex:Oi,computedDataType:zi,computedEditable:Bm,computedSortType:Wm,computedFilterType:Yl,cssEllipsis:Ul,headerCssEllipsis:Km,computedFilterValue:Xo,computedFiltered:ql,computedFilterable:Hm,computedWidth:qo,computedAbsoluteOffset:oo,computedPinningOffset:mt,computedVisibleIndexInCategory:dt,computedOffset:A,computedSortable:jm,computedSortInfo:Tt,computedSortIndex:Yo,computedMultiSort:m,computedSorted:on,computedSortedAsc:Rn,computedSortedDesc:Uo,computedVisibleIndex:Be,computedPinned:de,computedDraggable:b??K.defaultDraggable??T??xg,computedFirstInCategory:Vm,computedLastInCategory:Gm,computedFirst:G===0,computedLast:We,id:oe,header:K.header??ie.header??K.name??K.field};re&&(A+=qo,Z.set(ze.id,ze),L[G]=ze,de==="start"&&(ne.push(ze),Q+=ze.computedWidth),de==="end"&&(W.push(ze),O+=ze.computedWidth),de||(z.push(ze),le+=ze.computedWidth),Te=de),ze.groupByForColumn&&(ze.computedSortType=K.sortType||ie.sortType||Ln,ve.push(ze)),j.set(ze.id,ze),ze.field&&!ze.groupByForColumn&&!Ke.has(ze.field)&&Ke.set(ze.field,ze)}),ve.forEach(K=>{K.computedSortable=Jc(K,{fieldsToColumn:Ke,sortable:f,columnDefaultSortable:I})});let $e=new Map;De.forEach(K=>{let oe=j.get(K);oe&&$e.set(K,oe)}),j.forEach(K=>{$e.has(K.id)||$e.set(K.id,K)});let He=c!=null?Math.min(c,Q):Q,ot=u!=null?Math.min(u,O):O;return{computedRemainingSpace:e.width-(H+ue+ee),computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:le,computedColumnOrder:D,computedPinnedStartColumns:ne,computedPinnedEndColumns:W,computedUnpinnedOffset:Q,computedPinnedEndOffset:Q+le,computedUnpinnedColumns:z,computedVisibleColumns:L,computedColumnsMap:j,computedColumnsMapInInitialOrder:$e,computedVisibleColumnsMap:Z,computedPinnedEndWidth:ot,computedPinnedStartWidth:He,renderSelectionCheckBox:L.reduce((K,oe)=>K||!!oe.renderSelectionCheckBox,!1),fieldsToColumn:Ke}};function Jc(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r}=e;if(t)return t;let i=o.defaultSortable??o.colType.defaultSortable;if(i!=null)return i;let a=r??xr;return o.computedSortType!==Ln&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((f,p)=>{if(!f)return!1;let m=p.field||p.groupField,h;if(m){let g=n.get(m),y=g?u.getColumnApi(g.id):void 0;g&&y?h=y.isSortable():h=!1}return h===void 0&&p.valueGetter&&(h=!0),h??r??xr},!0)}}function Ye(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)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function Pr(o,e){let t=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:n,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,c=i(),{allRowsSelected:u,someRowsSelected:d,selectionMode:f}=c,p=r(),m=t.header&&typeof t.header!="function"?t.header:t.name||t.id||"";if(typeof t.header=="function"){let h=Ye(t.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});m=t.header({horizontalLayoutPageIndex:null,column:t,columnApi:h,dataSourceApi:s,insideColumnMenu:!0,dragging:!1,columnsMap:p.computedColumnsMap,columnSortInfo:t.computedSortInfo,columnFilterValue:t.computedFilterValue,filtered:t.computedFiltered,allRowsSelected:u,someRowsSelected:d,selectionMode:f,api:n,renderBag:{header:m}})??null}return m}import*as eu from"react";var Dr=`${et}HeaderCell__filter`,_a=`${et}HeaderCell__filterOperator`,Fa=eu.createContext(null);var Mg=`${Dr}__input`,Ar=o=>o.stopPropagation();function nu(o){let{filterOperatorMenuVisibleForColumnId:e}=Pc(),{column:t}=Er(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=tu(!1),l=je.useCallback(()=>{a(!0)},[]),s=je.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return je.createElement("div",{onPointerUp:Ar,onPointerDown:Ar,onFocus:l,onBlur:s,className:`${Dr} ${xa({active:c})}`,style:{height:o.columnHeaderHeight}},je.createElement(Fa.Provider,{value:o},je.createElement(r,null),je.createElement(n,null)))}function ou(){let{columnApi:o,disabled:e,operator:t}=Ro(),n=t?.components?.Icon??Nn;return je.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:J(_a,Nc,e?`${_a}--disabled`:"")},je.createElement(n,{size:20,className:`${Lc({disabled:e})}`}))}function ru(){return je.createElement("div",{onPointerUp:Ar,onPointerDown:Ar,className:`${Dr} ${xa({active:!1})} ${ac["50%"]}`})}function Ro(){let o=X(),{column:e,columnApi:t}=Er(),n=Pr(e,o),r=je.useContext(Fa),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=tu(l?.filter.value??""),d=je.useCallback(g=>{u(g),r.onChange(g)},[r.onChange]),f=je.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),p=je.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);Eg(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let g=[...s.emptyValues][0];g!==c&&u(g)}},[l?.filter.value]);let m=r.operator,h=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:h,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:f,removeColumnFilter:p,ariaLabel:`Filter for ${n}`,className:`${Fc} ${Mg}`}}function zn(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Ro();return Oa.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function Mr(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Ro();return Oa.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})}function _g(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:zn},operators:[{name:"includes",components:{Icon:Cc},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:ba},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:xc},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Tc},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Mr},operators:[{label:"Equals",components:{Icon:ba},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:Ic},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:wc},fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>t},{name:"gte",components:{Icon:Sc},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>=t},{name:"lt",components:{Icon:vc},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<t},{name:"lte",components:{Icon:Rc},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<=t}]}}}var un=_g();function _r(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 Ru,useState as jg}from"react";var iu="_16lm1iw1",au="_1yeub2v0 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw0",lu="_1yeub2vs",su="_1yeub2vr",cu=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 Na="_1yeub2vp";var zP=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var La=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};var vo={bodyWidth:{name:Y(se.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Y(se.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Y(se.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Y(se.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Y(se.runtime.browserScrollbarWidth),value:""}},Fg=Y(U.scrollbarWidthHorizontal),uu=Y(U.scrollbarWidthVertical),Og=Y(U.columnWidthAtIndex),Ng=Y(U.columnZIndexAtIndex),du=Y(U.scrollLeft),Lg=Y(U.activeCellColWidth),fu=Y(U.activeCellColOffset),gu=Y(U.baseZIndexForCells),zg=Y(U.pinnedStartWidth),pu=Y(U.bodyWidth),kg=Y(U.bodyHeight),mu=Y(U.pinnedEndOffset),hu=Y(U.pinnedEndWidth),Vg=Y(U.computedVisibleColumnsCount);function za(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(${gu}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function yu(o){let e=Wt(),{computed:t,state:n,actions:r,getState:i}=X(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:c,onBlurWithin:u,onFocusWithin:d,onSelfFocus:f,onSelfBlur:p,bodySize:m,activeCellIndex:h,wrapRowsHorizontally:g}=n,{computedPinnedStartColumnsWidth:y,computedPinnedEndColumnsWidth:b,computedPinnedStartColumns:T,computedPinnedEndColumns:S,computedVisibleColumns:C,computedUnpinnedColumnsWidth:R,scrollbars:w}=t,v=[],I=C.reduce((D,M)=>{let N=M.computedVisibleIndex;D[be.columnWidths.varName.get(N)]=M.computedWidth+"px",D[be.columnOffsets.varName.get(N)]=M.computedPinned==="start"?`calc( ${M.computedOffset}px + var(${du}) )`:M.computedPinned==="end"?`calc( var(${mu}) ${v.length?"+":""} ${v.map($=>be.columnWidths.get($.computedVisibleIndex)).join(" + ")} + var(${du}) )`:`${M.computedOffset}px`;let V=za(M,{pinnedStartColsCount:T.length,visibleColsCount:C.length});return D[`${Ng}-${N}`]=`${V}`,M.computedPinned==="end"&&v.push(M),D},{});if(m.width&&(I[vo.browserScrollbarWidth.name]=`${Wt()}px`),I[vo.bodyWidth.name]=`calc(${U.bodyWidth} - ${U.scrollbarWidthVertical})`,I[vo.totalVisibleColumnsWidthValue.name]=`${y+b+R}px`,I[vo.totalVisibleColumnsWidthVar.name]=`calc(${C.map((D,M)=>`var(${Og}-${M})`).join(" + ")})`,I[vo.visibleColumnsCount.name]=C.length,h!=null){I[Lg]=be.columnWidths.get(h[1]);let D=be.columnOffsets.get(h[1]);if(n.brain.isHorizontalLayoutBrain){let M=n.brain.getPageIndexForRow(h[0]);I[fu]=M?`calc( ${se.runtime.totalVisibleColumnsWidthVar} * ${M} + ${D})`:D}else I[fu]=D}I[Vg]=C.length,I[Fg]=w.horizontal?`${e}px`:"0px",I[uu]=w.vertical?`${e}px`:"0px",I[zg]="calc( "+T.map(D=>be.columnWidths.get(D.computedVisibleIndex)).join(" + ")+")",I[hu]="calc( "+S.map(D=>be.columnWidths.get(D.computedVisibleIndex)).join(" + ")+")",I[gu]=C.length*10,I[mu]=`calc( var(${pu}) - var(${hu}) - var(${uu}) )`,I[pu]=`${m.width}px`,I[kg]=`${m.height}px`;let x=La(D=>{r.focused=D}),P=La(D=>{r.focusedWithin=D}),A={...o,onFocus:D=>{if(o?.onFocus?.(D),D.target===s.current||D.target===c.current){if(i().focused)return;x(!0),f?.(D),l&&(P(!1),u?.(D));return}l||(P(!0),d?.(D))},onBlur:D=>{if(o?.onBlur?.(D),D.target===s.current||D.target===c.current){if(!i().focused)return;x(!1),p?.(D),l&&(P(!1),u?.(D));return}s.current?.contains(D.relatedTarget)||(P(!1),u?.(D))}},F=J(Et,au,g?`${Et}--horizontal-layout`:null,A?.className,y?`${Et}--has-pinned-start ${su}`:null,b?`${Et}--has-pinned-end ${lu}`:null,a?`${Et}--focused`:null,l?`${Et}--focused-within`:null,a&&n.focusedClassName?n.focusedClassName:null,l&&n.focusedWithinClassName?n.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Et}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Et}--has-pinned-end-overflow`:null,cu({horizontalLayout:!!g,hasPinnedStart:!!y,hasPinnedEnd:!!b,focused:a,focusedWithin:l}));return A.className=F,A.style={...o?.style,...I},a&&n.focusedStyle&&Object.assign(A.style,n.focusedStyle),l&&n.focusedWithinStyle&&Object.assign(A.style,n.focusedWithinStyle),A}var Su=ro(Pn());function Fr(o){return o.map(e=>e instanceof jt?e:new jt(null,[e]))}var jt=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=>Gg(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 Gg(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var Kg=(...o)=>new jt("+",Fr(o)),bu=(...o)=>new jt("-",Fr(o)),Hg=(...o)=>new jt("*",Fr(o)),Bg=(...o)=>new jt("/",Fr(o)),Or={add:Kg,subtract:bu,minus:bu,multiply:Hg,divide:Bg};var Io=(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 Cu=o=>{let e=null,t=null;return{stop(){e!==null&&ht(e),t!=null&&ht(t)},scroll(n){e!==null&&ht(e),t!=null&&ht(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return n.scrollLeft=n.scrollLeft-f,e=Pe(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return n.scrollLeft=n.scrollLeft+f,t=Pe(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Tu=10,Wg=Y(U.pinnedStartWidth);function wu(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,setProxyPosition:d,api:f,horizontalLayoutPageIndex:p,pageWidth:m}=o;function h(W){let z=W==="start"?A:F;return P===_?z:_===W?z+I.computedWidth:P===W?z-I.computedWidth:z}function g(W){if(W.columnIndex===x||p!=null)return!0;let z=e[W.columnIndex];if(z.computedPinned)return!0;let L=l.getScrollPosition().scrollLeft,Z=z.computedOffset+(p!=null&&m!=null?m*p:0);return Z>=L+h("start")&&Z+z.computedWidth<=L+u.width-h("end")}let y=(W,z)=>{let{restrictToParentGroup:L,dragColumn:Z}=z,j=[];if(W.forEach(Q=>{if(Q.computedVisibleIndex===x)return;let O={columnId:Q.id,columnIndex:Q.computedVisibleIndex,offsetX:Q.computedOffset+Math.round(Q.computedWidth/2)};g(O)&&j.push(O)}),L){let O=function(Ce,H,ee){let ue=W[Ce];ue&&(ue.columnGroup!==Z.columnGroup&&ee.add(ue.id),O(Ce+H,H,ee))};var le=O;let Q=Z.computedVisibleIndex,Te=new Set;O(Q-1,-1,Te),O(Q+1,1,Te),j=j.filter(Ce=>!Te.has(Ce.columnId))}return j},T=r.length,S={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},C={left:S.clientX-u.left-(S.clientX-s.left)+Tu,top:S.clientY-u.top-(S.clientY-s.top)+Tu},R=l.getScrollPosition(),w=e.map(W=>W.computedVisibleIndex),v=w,I=t.get(i),x=I.computedVisibleIndex,P=I?.computedPinned,E=x,_=P,A=l.getFixedStartColsWidth(),F=l.getFixedEndColsWidth(),D=S,M={x:0,y:0},N=1,V=0;function $(W){let z=Math.round(W.clientX),L=Math.round(W.clientY);if(z===D.clientX&&L===D.clientY)return;D={clientX:z,clientY:L};let j=l.getScrollPosition().scrollLeft-R.scrollLeft;M.x=D.clientX-S.clientX,M.y=D.clientY-S.clientY,V=M.x+j,N=V<0?-1:1,d({left:C.left+M.x,top:C.top+M.y})}function te(W){let z=0;P?P==="start"&&W.forEach((L,Z)=>{z||e[L]?.computedPinned!=="start"&&(z=Z)}):W.forEach((L,Z)=>{e[L]?.computedPinned==="start"&&(z=Z+1)}),T=z,he("start",W,z)}function he(W,z,L){if(W==="start"){let Z=0;for(let j=0;j<L;j++){let le=z[j],Q=e[le];Z+=Q.computedWidth}Pt(Wg,`${Z}px`,a)}}function ce(W){if(W==null||W===E)return;E=W;let z=Io(w,x,E>x?E-1:E);T=0;let Z=new Set;return z.forEach((j,le)=>{let Q=v[le];j!==Q&&Z.add(j),te(z)}),v=z,k(Z),{newColumnIndexes:z,indexesWithTransition:Z,pinnedStartCount:T}}function k(W){e.forEach(z=>{let L=z.computedVisibleIndex;W.has(L)?xs(L,a):rr(L,a);let Z=L===x,j=N===-1?L<E||L>x:L<x||L>=E,le="";N===-1?le=Z?be.columnOffsets.get(E):j?be.columnOffsets.get(L):Or.add(be.columnOffsets.get(L),be.columnWidths.get(x)).done():le=j?be.columnOffsets.get(L):Z?Or.add(be.columnOffsets.get(E-1),be.columnWidths.get(E-1)).minus(be.columnWidths.get(x)).done():Or.minus(be.columnOffsets.get(L),be.columnWidths.get(x)).done(),po(L,le,a)})}let B=u.left+h("start"),ae=u.right-h("end"),ne=Cu({scrollOffsetStart:B,scrollOffsetEnd:ae});return $(S),{speedScroller:ne,stop(){ne.stop()},onMove(W){$(W),ne.scroll({mousePosition:D,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(Q){f.scrollLeft=Q}});let z=y(e,{dragColumn:I,restrictToParentGroup:c==="group"}),L=N===-1?I.computedOffset+V:I.computedOffset+I.computedWidth+V,Z=(0,Su.default)(z,L,({offsetX:Q},O)=>Q<O?-1:Q>O?1:0);Z<0&&(Z=~Z),z.length?Z=z[Z]?z[Z].columnIndex:z[z.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),Z=0),Z===x+1&&(Z=x),ce(Z);let j={};n.forEach(Q=>{j[Q.id]="end"});for(let Q=0;Q<T;Q++){let O=v[Q],Te=e[O];j[Te.id]="start"}let le=v.map(Q=>e[Q].id);return{columnPinning:j,columnOrder:le}}}}function $t(o,e,t){if(o===e)return!0;if(!o||!e)return!1;var n=Object.keys(o),r=Object.keys(e);t&&(n=n.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=n[a];if(!(t&&t.has(l))&&(o[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function ka(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return n;if(a>i){let l=e.indexOf(r),s=e[l-1],c=n.indexOf(s),u=n.indexOf(r);return Io(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return Io(n,u,c)}return e}var $g=Y(U.baseZIndexForCells),Ug=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:$t(o,e)},vu=({columnId:o,domRef:e,horizontalLayoutPageIndex:t})=>{let[n,r]=jg(null),{actions:i,computed:a,getComputed:l,getState:s,api:c,state:{domRef:u}}=X(),d=Ru(p=>{let m=l().computedVisibleColumnsMap.get(o);if(!m||!m.computedSortable)return;let{multiSortBehavior:h}=s();c.toggleSortingForColumn(o,{multiSortBehavior:h==="replace"&&(p.ctrlKey||p.metaKey)?"append":h})},[]),f=Ru(p=>{let m=p.target?.tagName;if(m==="INPUT"||m==="BUTTON")return;let{brain:h,draggableColumnsRestrictTo:g}=s(),{computedVisibleColumns:y,computedVisibleColumnsMap:b,computedPinnedStartColumns:T,computedUnpinnedColumns:S,computedPinnedEndColumns:C}=l(),R=b.get(o);if(!R.computedDraggable){d(p);return}let w=e.current,v=w.getBoundingClientRect(),I=u.current.getBoundingClientRect(),x=h.getAvailableSize(),P=R.computedVisibleIndex,E=h.getVirtualColIndex(R.computedVisibleIndex,{pageIndex:t||0}),_=h.isHorizontalLayoutBrain?h.getPageWidth():null,A=w.style.cursor??"auto",F=!1,D=wu({brain:h,horizontalLayoutPageIndex:t,pageWidth:_,draggableColumnsRestrictTo:g,computedPinnedEndColumns:C,computedPinnedStartColumns:T,computedUnpinnedColumns:S,computedVisibleColumns:y,computedVisibleColumnsMap:b,dragColumnHeaderTargetRect:v,dragColumnId:o,api:c,infiniteDOMNode:u.current,setProxyPosition:r,tableRect:I,initialMousePosition:{clientX:p.clientX,clientY:p.clientY}}),M=null,N,V;function $(ce){let{columnPinning:k,columnOrder:B}=ce;Ug(s().columnPinning,k)||(i.columnPinning=k);let ae=l().computedColumnOrder;JSON.stringify(B,ae)&&(y.forEach(ne=>{po(ne.computedVisibleIndex,"",u.current)}),i.columnOrder=ka({newColumnOrder:B,visibleColumnOrder:l().computedVisibleColumns.map(ne=>ne.id),existingColumnOrder:ae,dragColumnId:o}))}let te=ce=>{let{headerBrain:k,brain:B}=s();if(!F){F=!0;let ae=B.keepColumnRendered(E),ne=k.keepColumnRendered(E);if(B.isHorizontalLayoutBrain){let z=B.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),L=k.extendRenderRange({start:!0,end:!0,direction:"horizontal"});V=()=>{z(),L()}}N=()=>{ae(),ne()},i.columnReorderDragColumnId=R.id,t!=null&&(i.columnReorderInPageIndex=t),ea(P,`calc( var(${$g}) + 10000 )`,u.current),u.current?.classList.add(Na),w.style.cursor="grabbing"}M=D.onMove(ce)},he=ce=>{let{multiSortBehavior:k}=s(),B=e.current;u.current?.classList.remove(Na),D.stop(),h.update({...x}),N?.(),V?.(),y.forEach(ne=>{rr(ne.computedVisibleIndex,u.current),po(ne.computedVisibleIndex,"",u.current)}),ea(P,za(R,{pinnedStartColsCount:T.length,visibleColsCount:y.length}),u.current),B.style.cursor=A,B.releasePointerCapture(ce.pointerId),B.removeEventListener("pointermove",te),B.removeEventListener("pointerup",he),r(null);let ae=c.getColumnApi(R.id)?.isSortable()??!1;!F&&ae&&c.toggleSortingForColumn(R.id,{multiSortBehavior:k==="replace"&&(ce.ctrlKey||ce.metaKey)?"append":k}),M&&$(M),i.columnReorderDragColumnId=!1,t!=null&&(i.columnReorderInPageIndex=null)};w.addEventListener("pointermove",te),w.addEventListener("pointerup",he),w.setPointerCapture(p.pointerId)},[o,t]);return{onPointerDown:a.computedVisibleColumnsMap.get(o)?.computedDraggable?f:d,proxyPosition:n}};import*as Vn from"react";import*as pe from"react";import{useCallback as nt,useContext as ly,useMemo as sy}from"react";import*as fn from"react";var Iu=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import*as xo from"react";import{useState as Yg}from"react";var xu="_6rdmyg0 _16lm1iwn _16lm1iwi _16lm1iw9",Pu=ye({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwg",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwh"]]});var Nr=`${it}-expand-collapse`;function dn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=Yg(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),Bt("expanded",o)||i(!r)};xo.useEffect(()=>{Bt("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return xo.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:J(o.className,xu,Pu({direction:t||"start",expanded:r,disabled:n}),`${it}`,`${Nr}`,`${Nr}--${l}`,`${Nr}--${t==="end"?"end":"start"}`,n?`${Nr}--disabled`:"")},xo.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as Lr from"react";var Du="_16lm1iwb _16lm1iwn _16lm1iwi";var Au=o=>Lr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:J(o.className,Du,"InfiniteIcon","InfiniteIcon-loading")},Lr.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},Lr.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Eu=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Mu="_7pupv00",_u=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Fu({rowInfo:o}){return{[Y(se.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function zr({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=n,d=J(_n.flex,i.align==="end"?To.rowReverse:To.row,rc.center,`${pn}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c)?Eu({align:a}):null);if(e==="multi-column"){if(o+1!==u.groupNesting&&u.isGroupRow)return c?fn.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return fn.createElement("div",{className:d},s,c,fn.createElement("div",{className:wt},l??null))}}function kr({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let f=u.groupKeys,p=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return Iu(u)?p=fn.createElement(Au,null):m&&(p=fn.createElement(dn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(f)}})),n&&(r.renderBag.groupIcon=p,p=fn.createElement(tt,{render:n,renderParam:r})),p}}function Ou(o,e,t){let{groupByForColumn:n,groupIndexForColumn:r,groupRenderStrategy:i}=o,a=n.column?{...n.column}:{},l={header:`Group by ${n.field||n.groupField}`,groupByForColumn:n,render:zr({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:kr({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(o,e)}:l={...l,...t}),l}function Nu(o,e,t){let n=typeof t=="function"?t(o,e):t,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:zr({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...n,renderGroupIcon:kr({initialRenderGroupIcon:n?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Lu(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}import*as Vr from"react";import{useEffect as qg,useRef as Xg}from"react";var zu="qz8ht90 _16lm1iwi";function Zg(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:Qg}=At({forwardProps:Zg,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function Jg(){let{componentState:o,componentActions:e}=Ge(),{checked:t,domProps:n,disabled:r}=o,i=Xg(null);return qg(()=>{i.current.indeterminate=t==null},[t]),Vr.createElement("input",{...n,className:J("InfiniteCheckBox",zu,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function Ut(o){return Vr.createElement(Qg,{...o},Vr.createElement(Jg,null))}function ey(o){return typeof o.field=="string"}function ku(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?n.get(i.field||i.groupField):void 0}!r&&e.field&&(r=n.get(e.field))}return r}function at(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,f=e().computedColumnsMap.get(i),{activeRowIndex:p,keyboardNavigation:m,isRowDetailEnabled:h}=n(),g=r===p&&m==="row",y=!h||typeof h=="function"&&!h(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:T}}=kn({column:f,rowInfo:c,rowDetailState:y,columnsMap:e().computedColumnsMap,context:o}),S=Ye(f.id,o);return u?{api:a,dataSourceApi:l,column:f,columnApi:S,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:c.data,rowActive:g,rowInfo:c,rowSelected:c.rowSelected,value:b,rawValue:T}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:S,column:f,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:y,data:c.data,rowActive:g,rowInfo:c,rowSelected:c.rowSelected,value:b,rawValue:T}:{api:a,dataSourceApi:l,columnApi:S,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:y,data:c.data,rowActive:g,rowInfo:c,rowSelected:c.rowSelected,value:b,rawValue:T}:{api:a,dataSourceApi:l,columnApi:S,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:y,data:c.data,rowActive:g,rowInfo:c,rowSelected:c.rowSelected,value:b,rawValue:T}}function Vu(o){return Ku(o.column,o.rowInfo)}function Gu(o){let{column:e,context:t,rowInfo:n,visibleColumnsIds:r}=o,i=ku({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=kn(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let f=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",p=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:ty({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnsIds:o.visibleColumnsIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:p,formattedValueContext:c}),groupByColumnReference:i}}function ty(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:f,getState:p,dataSourceApi:m}=t,{editingCell:h}=p(),{indexInAll:g}=n,y=f(),{selectionMode:b,cellSelection:T}=y,S=ku({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,R=T?.isCellSelected(n.id,e.id)??!1,w={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:R,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...c,editError:h&&h.primaryKey===n.id&&h.columnId===e.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:S,selectionMode:b,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:g,toggleGroupRow:C,toggleCurrentGroupRow:()=>{n.isGroupRow&&C(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:y.groupBy,pivotBy:y.pivotBy};return Object.defineProperty(w,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),w}function Ku(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:ey(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function ny(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function kn(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Ku(e,t),a=ny(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as Mt from"react";var{rootClassName:Hu}=xe,mn=`${Hu}Cell`,Va=`${Hu}Cell_content`,oy=Y(U.columnWidthAtIndex),ry=Y(U.columnReorderEffectDurationAtIndex);function iy(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:f,cssPosition:p,renderChildren:m,horizontalLayoutPageIndex:h,...g}=o,y=m(),b={width:`var(${oy}-${i.computedVisibleIndex})`,transition:`transform var(${ry}-${i.computedVisibleIndex}, 0s)`,...g.style},T={...g,style:b,"data-column-id":i.id,"data-z-index":b.zIndex,className:J(g.className,mn,Us),children:Mt.createElement(Mt.Fragment,null,d,Mt.createElement("div",{className:J(Va,e?wt:uc.hidden,s),style:r},y),u)};c!=null&&(T["data-row-id"]=`${c}`);let S=f==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return S?Mt.createElement(S,{...T,ref:a}):Mt.createElement("div",{...T,ref:a})}var Gr=Mt.memo(iy);import*as hn from"react";import{useCallback as Bu,useRef as ay}from"react";function Wu(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=Ga(),i=ay(null),a=hn.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=Bu(s=>{let{key:c}=s;c==="Enter"||c==="Tab"?t():c==="Escape"?n():s.stopPropagation()},[]);return hn.createElement(hn.Fragment,null,hn.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:J(oc,cc.none),type:"text",defaultValue:o,onChange:Bu(s=>{e(s.target.value)},[])}))}var{rootClassName:cy}=xe,uy=Y(U.columnZIndexAtIndex);function dy({rowInfo:o}){return{[Y(se.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}var Po=pe.createContext(null),pn=`${cy}ColumnCell`,fy=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return pe.createElement(dn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},py={display:"inline-block",visibility:"visible"},Ka=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return pe.createElement(dn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:py,expanded:n,onChange:t})},my=o=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:n,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=o;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||Ut;return pe.createElement(u,{domProps:{className:yr},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():n()},checked:e.rowSelected})};function Ha(o,e){return o?typeof o=="function"?o(e):o:void 0}function Ba(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function hy(o){let{rowInfo:e,rowStyle:t,rowClassName:n,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:c,width:u,column:d,onMouseLeave:f,onMouseEnter:p,onRowMouseEnter:m,onRowMouseLeave:h,rowIndex:g,rowHeight:y,columnsMap:b,fieldsToColumn:T,domRef:S,hidden:C,showZebraRows:R}=o,w=pe.useRef(null),v=nt(de=>{w.current=de,S&&S(de)},[S]);if(!d)return pe.createElement("div",{ref:v},"no column");let{rowSelected:I}=e,{getState:x,actions:P,computed:E,api:_,getDataSourceMasterContext:A}=X(),{componentState:F,getState:D,api:M,componentActions:N}=Re(),{activeRowIndex:V,keyboardNavigation:$,columnReorderInPageIndex:te}=x(),he=g===V&&$==="row",ce={getState:x,getDataSourceState:D,getDataSourceMasterContext:A,actions:P,dataSourceActions:N,api:_,dataSourceApi:M},k=e.rowDisabled,B=E.computedVisibleColumns.map(de=>de.id),ae=Gu({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:c,columnsMap:b,visibleColumnsIds:B,fieldsToColumn:T,context:ce}),{stylingParam:ne,renderParams:W,formattedValueContext:z,renderFunctions:L,groupByColumnReference:Z,inEdit:j}=ae,{align:le,verticalAlign:Q}=W,O=W,Te=pe.useRef(O),Ce=m&&p?de=>{let dt={...z,rowIndex:g};m(dt,de),p(de)}:p,H=h&&f?de=>{let We={...z,rowIndex:g,rowInfo:e};h(We,de),f(de)}:f,ee=nt(de=>{let We=d.computedVisibleIndex;x().cellClick({rowIndex:g,colIndex:We,event:de})},[g,d.computedVisibleIndex,$]),ue=nt(de=>{let We=d.computedVisibleIndex;if(x().cellMouseDown({rowIndex:g,colIndex:We,event:de}),$==="row"){k||(P.activeRowIndex=g);return}$==="cell"&&(P.activeCellIndex=[g,We])},[g,k,d.computedVisibleIndex,$]),{selectionMode:Ie,cellSelection:ve,isNodeReadOnly:Fe}=F,De=O.cellSelected;O.domRef=v,O.htmlElementRef=w,O.toggleCurrentTreeNode=nt(O.toggleCurrentTreeNode,[e]),O.selectCell=nt(O.selectCell,[e]),O.deselectCell=nt(O.deselectCell,[e]),O.selectCurrentRow=nt(O.selectCurrentRow,[e]),O.deselectCurrentRow=nt(O.deselectCurrentRow,[e]),O.toggleCurrentGroupRow=nt(O.toggleCurrentGroupRow,[e]),O.toggleCurrentRowSelection=nt(O.toggleCurrentRowSelection,[e]),O.toggleCurrentGroupRowSelection=nt(O.toggleCurrentGroupRowSelection,[e]),O.toggleCurrentTreeNodeSelection=nt(O.toggleCurrentTreeNodeSelection,[e]);let Ke=d.components?.Editor??Wu,$e=j?pe.createElement($u,{contextValue:O},pe.createElement(Ke,null)):null,He=nt(Ue(()=>{if(C||j)return null;if(Te.current=O,L.renderGroupIcon&&(O.renderBag.groupIcon=pe.createElement(tt,{render:L.renderGroupIcon,renderParam:{...O,renderBag:{...O.renderBag}}})),L.renderSelectionCheckBox&&Ie=="multi-row"&&(O.renderBag.selectionCheckBox=pe.createElement(tt,{render:my,renderParam:O}),L.renderSelectionCheckBox!==!0&&(O.renderBag.selectionCheckBox=pe.createElement(tt,{render:L.renderSelectionCheckBox,renderParam:{...O,renderBag:{...O.renderBag}}}))),e.isTreeNode){let{isParentNode:dt}=e,mt;mt=(dt?L.renderTreeIconForParentNode:L.renderTreeIconForLeafNode)||typeof L.renderTreeIcon=="function"?L.renderTreeIcon:dt&&L.renderTreeIcon===!0?Ka:void 0,mt===!0?mt=Ka:mt&&(O.renderBag.treeIcon=pe.createElement(tt,{render:Ka,renderParam:O})),mt&&(O.renderBag.treeIcon=pe.createElement(tt,{render:mt,renderParam:{...O,renderBag:{...O.renderBag}}}))}L.renderRowDetailIcon&&(O.renderBag.rowDetailsIcon=pe.createElement(tt,{render:fy,renderParam:{...O,renderBag:{...O.renderBag}}}),typeof L.renderRowDetailIcon=="function"&&(O.renderBag.rowDetailsIcon=pe.createElement(tt,{render:L.renderRowDetailIcon,renderParam:{...O,renderBag:{...O.renderBag}}}))),L.renderValue&&(O.renderBag.value=pe.createElement(tt,{render:L.renderValue,renderParam:{...O,renderBag:{...O.renderBag}}})),e.isGroupRow&&L.renderGroupValue&&(O.renderBag.value=pe.createElement(tt,{render:L.renderGroupValue,renderParam:{...O,renderBag:{...O.renderBag}}})),!e.isGroupRow&&L.renderLeafValue&&(O.renderBag.value=pe.createElement(tt,{render:L.renderLeafValue,renderParam:{...O,renderBag:{...O.renderBag}}})),Te.current=O;let de=O.renderBag.value;de instanceof Date&&(de=de.toLocaleDateString());let We=pe.createElement(pe.Fragment,null,le!=="end"?O.renderBag.treeIcon:null,le!=="end"?O.renderBag.groupIcon:null,le!=="end"?O.renderBag.rowDetailsIcon:null,le!=="end"?O.renderBag.selectionCheckBox:null,de,le==="end"?O.renderBag.selectionCheckBox:null,le==="end"?O.renderBag.rowDetailsIcon:null,le==="end"?O.renderBag.groupIcon:null,le==="end"?O.renderBag.treeIcon:null);return d.render?pe.createElement(tt,{render:d.render,renderParam:{...O,renderBag:{...O.renderBag,all:We}}}):We}),[d,C,j,c,d.renderTreeIcon||d.renderTreeIconForParentNode?Fe:!1,...Lu(O,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),ot=E.computedVisibleColumns.map(de=>de.id),Qe=E.computedColumnOrder,K={...z,visibleColumnIds:ot,allColumnIds:Qe,rowIndex:g,rowHasSelectedCells:!1};Object.defineProperty(K,"rowHasSelectedCells",{get(){return e.hasSelectedCells(ot)}});let oe=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),G=typeof n=="function"?n(K):n,re;Z?.className&&(re=Ha(Z.className,ne)),s&&(re=J(re,Ha(s,ne))),d.className&&(re=J(re,Ha(d.className,ne))),oe&&(re=J(re,_u({align:le})));let ge;e.dataSourceHasGrouping&&d.groupByForColumn&&(ge=Fu({rowInfo:e})),oe&&(ge=dy({rowInfo:e})),t&&(ge=typeof t=="function"?{...ge,...t(K)}:{...ge,...t}),l&&(ge=Ba(ge,l,ne)),Z?.style&&(ge=Ba(ge,Z.style,ne)),d.style&&(ge=Ba(ge,d.style,ne)),ge=ge||{},ge.height=y,ge.zIndex=`var(${uy}-${d.computedVisibleIndex})`;let ie=sy(()=>ge,[ge?JSON.stringify(ge):null]),Be=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:g)%2===1,ut=R?Be?"odd":"even":!1,Tt=!1,on=!1,Rn=!1,Uo=!1;if(ve&&De){let de=a(),We=de[e.indexInAll-1],dt=de[e.indexInAll+1],mt=E.computedVisibleColumns[d.computedVisibleIndex+1],oo=E.computedVisibleColumns[d.computedVisibleIndex-1];Tt=We?!ve.isCellSelected(We.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?on=!0:on=oo?!ve.isCellSelected(e.id,oo.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?Rn=!0:Rn=mt?!ve.isCellSelected(e.id,mt.id):!0,Uo=dt?!ve.isCellSelected(dt.id,d.id):!0}let Yo=ve&&De?{top:Tt,left:on,right:Rn,bottom:Uo}:null,no=te!=null?i!==te:!1,qo=$e,Oi=He(),Ni={domRef:v,cellType:"body",column:d,width:u,rowId:e.id,horizontalLayoutPageIndex:i,style:ie,onMouseLeave:H,onMouseEnter:Ce,onClick:ee,afterChildren:qo,onMouseDown:ue,cssEllipsis:d.cssEllipsis??!0,className:J(Yo?qs(Yo):"",_r(d,[pn,mn],Ys,{dragging:!1,insideDisabledDraggingPage:no,zebra:ut,align:le,verticalAlign:Q,rowDisabled:k,rowActive:he,cellSelected:De,rowSelected:I,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),re,G),renderChildren:nt(()=>Oi,[He])},Li=Po.Provider;return pe.createElement(Li,{value:Te.current},pe.createElement(Gr,{...Ni}))}var ju=pe.memo(hy);function Kr(){return ly(Po)}function Ga(){let{api:o,state:{editingValueRef:e,editingCell:t}}=X(),{column:n,rowInfo:r}=Kr(),[i]=pe.useState(()=>t?.value),[a,l]=pe.useState(i),s=t?!t.active&&!!t.waiting:!1,c=pe.useCallback(p=>{e.current=p,l(p)},[]);pe.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,f=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:f}}function Do(o){return o.render(o.renderParam)??null}function tt(o){let e=Po.Provider;return Vn.createElement(e,{value:o.renderParam},Vn.createElement(Do,{render:o.render,renderParam:o.renderParam}))}function $u(o){let e=Po.Provider;return Vn.createElement(e,{value:o.contextValue},o.children)}function Yt(o){let e=Hr.Provider;return Vn.createElement(e,{value:o.renderParam},Vn.createElement(Do,{render:o.render,renderParam:o.renderParam}))}import*as qt from"react";var gy={width:"100%",pointerEvents:"none"},Wa=`${it}-menu`,ja=wr({"data-name":""}),$a={[ja["data-name"]]:"menu-icon"};function Ao(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...gy,borderTop:`${se.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return qt.createElement("div",{...n,style:e,...$a,onPointerDown:s=>s.stopPropagation(),className:J(t,kc({menuVisible:i,reserveSpaceWhenHidden:r}),it,`${it}-menu`)},a??qt.createElement(qt.Fragment,null,qt.createElement("div",{className:Wa,style:l}),qt.createElement("div",{className:Wa,style:l}),qt.createElement("div",{className:Wa,style:l})))}import*as Gn from"react";import{useEffect as yy,useState as Yu}from"react";var Uu="_1ek6mqy0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v";var by={transition:"width 0.25s, opacity 0.25s"};function qu(o){let[e,t]=Yu(!0),[n,r]=Yu(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.size??16,f=Math.floor(d/4),p=i?[d-3*f,d-2*f,d-f]:[0,0,0];i===-1&&p.reverse();let m={...by,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};yy(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==n){let b=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(b)}}return()=>{}},[i,e]);let h=()=>{let b=!(n===0&&i===0);b!==e&&t(b)};if(!e)return null;let g={};return i===-1&&(g.top="100%"),Gn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:J(s,it,Uu,`${it}-sort`)},u?Gn.createElement("div",{"data-name":"index",style:g,className:Kc},c):null,Gn.createElement("div",{style:{width:p[0],...m},onTransitionEnd:h}),Gn.createElement("div",{style:{width:p[1],...m}}),Gn.createElement("div",{style:{width:p[2],...m}}))}import*as td from"react";import{useCallback as ed}from"react";import{useRef as Qu,useState as Cy}from"react";import*as Eo from"react";function Xu(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){be.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;be.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?Ji(l,i,n.current):be.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){Ji(c,i,n.current);continue}c.computedPinned!=="end"&&be.columnOffsets.set(l,c.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||be.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function Zu(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,c=i.current;if(n.forEach((u,d)=>{s+=u;let f=o[d],p=r[f],m=p.computedWidth+u;be.columnWidths.set(f,m,c),p.computedPinned!=="end"&&(l&&be.columnOffsets.set(f,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&be.columnOffsets.set(u,d.computedOffset+s,c)}}}}var Br="zneyzh0 _16lm1iw2 _16lm1iw1d _16lm1iw1k _16lm1iw1i _16lm1iwk _16lm1iw1y",Wr=ye({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw1d _16lm1iw1i",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0},"zneyzhn"]]}),jr=ye({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw1f _16lm1iw1m",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:Ty}=xe,Sy=`${Ty}HeaderCell_ResizeHandle`;function wy(o){let{state:{brain:e,headerBrain:t}}=X(),n=Qu(null),[r,i]=Cy(!1),a=Qu(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,f=()=>{},p=h=>{h.stopPropagation();let g=!!h.shiftKey,y=h.pointerId,b=h.clientX,T=h.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),I=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});f=()=>{v(),I()}}T.setPointerCapture(y);let S=Xu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:g,domRef:n}),C=(v,{done:I}={})=>{s&&(v=v/(s+1),I&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:x,constrained:P}=o.computeResize({diff:v,shareSpaceOnResize:g});return a.current!==P&&i(P),S.resize(x),x},R=v=>{C(Math.round(v.clientX-b))},w=v=>{T.releasePointerCapture(y),T.removeEventListener("pointermove",R),T.removeEventListener("pointerup",w);let I=Math.round(v.clientX-b),x=C(I,{done:!0});f(),o.onResize({diff:x,shareSpaceOnResize:g})};T.addEventListener("pointermove",R),T.addEventListener("pointerup",w)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Eo.createElement("div",{ref:n,className:`${Sy} ${Br} ${jr({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:p},Eo.createElement("div",{style:m,className:Wr({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Ju=Eo.memo(wy);function nd(o,e){let{computed:{computedVisibleColumns:t},getState:n,getComputed:r,actions:i}=X(),a=ed(({diff:c,shareSpaceOnResize:u})=>{let d=n(),{columnSizing:f,viewportReservedWidth:p,bodySize:m}=d,h=r().computedVisibleColumns,g=!1,y=h.reduce((S,C)=>(C.computedFlex&&(S[C.id]={...f[C.id],flex:C.computedWidth},g=!0),S),{}),b=g?{...f,...y}:f;return Da({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:p||0,dragHandleOffset:c,dragHandlePositionAfter:o.computedVisibleIndex,columnSizing:b,items:h.map(S=>({id:S.id,computedFlex:S.computedFlex,computedWidth:S.computedWidth,computedMinWidth:S.computedMinWidth,computedMaxWidth:S.computedMaxWidth}))})},[o]),l=ed(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:f}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=f),i.columnSizing=d},[a]);return o.computedResizable?td.createElement(Ju,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var gn=`${et}HeaderCell`,od=`${et}HeaderWrapper`;var Dy=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||Ut;return Se.createElement(s,{domProps:{className:yr},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Hr=Se.createContext(null);var Ay=Y(U.columnZIndexAtIndex),Ua=Se.createElement("div",{className:Sr[1]}),rd=wr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":""});function id(o){let e=o.column,{api:t,getComputed:n,getState:r,actions:i,state:{showColumnFilters:a,components:l,portalDOMRef:s,columnHeaderHeight:c,columnReorderDragColumnId:u,columnMenuVisibleForColumnId:d,columnReorderInPageIndex:f},getDataSourceMasterContext:p}=X(),{api:m,componentActions:h,getState:g,componentState:{filterDelay:y,filterTypes:b}}=Re(),{allRowsSelected:T,someRowsSelected:S,selectionMode:C}=vn(),R=o.horizontalLayoutPageIndex,w=u===e.id,v=f!=null?R!==f:!1,{onResize:I,height:x,width:P,headerOptions:E,columnsMap:_}=o,A=e.computedSortInfo,F=e.header,D=Ry(G=>{L.current=G,o.domRef?.(G)},[o.domRef]),M=E.alwaysReserveSpaceForSortIcon,N=e.headerAlign??e.align,V=(typeof N=="function"?N({isHeader:!0,column:e}):N)??"start",$=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",te=Ye(e,{actions:i,api:t,dataSourceActions:h,dataSourceApi:m,getComputed:n,getDataSourceState:g,getDataSourceMasterContext:p,getState:r}),he=te.isSortable(),ce=he&&(e.computedSorted||M)?Se.createElement(qu,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:se.spacing[2],marginInlineEnd:se.spacing[2]},className:`${gn}__sort-icon ${Gc} ${Hc({align:V})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,B=e.computedFilterable&&e.computedFiltered?Se.createElement(Nn,null):null,ae=e.headerCssEllipsis??e.cssEllipsis??!0,ne={reserveSpaceWhenHidden:V==="center",menuVisible:d===e.id,style:V==="end"?{marginInlineStart:`calc(${se.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:se.spacing[2]}:{marginInlineEnd:`calc(${se.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:se.spacing[2]},domProps:{onMouseDown:G=>{G.stopPropagation(),te.toggleContextMenu(G.target)}}},W=e.components?.MenuIcon||l?.MenuIcon||Ao,z=Se.createElement(W,{...ne}),L=xy(null),Z={horizontalLayoutPageIndex:R,dragging:w,domRef:D,htmlElementRef:L,insideColumnMenu:!1,column:e,columnsMap:_,columnSortInfo:A,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:S,allRowsSelected:T,selectionMode:C,api:t,dataSourceApi:m,columnApi:te,renderBag:{sortIcon:ce,filterIcon:B,menuIcon:z,menuIconProps:ne,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},j=Z,le=()=>{let G={...Z,renderBag:{...Z.renderBag}};if(e.renderSortIcon&&(G.renderBag.sortIcon=Se.createElement(Yt,{render:e.renderSortIcon,renderParam:{...G,renderBag:{...G.renderBag}}})),e.renderFilterIcon&&(G.renderBag.filterIcon=Se.createElement(Yt,{render:e.renderFilterIcon,renderParam:{...G,renderBag:{...G.renderBag}}})),typeof e.renderMenuIcon=="function"&&(G.renderBag.menuIcon=Se.createElement(Yt,{render:Be=>{if(typeof e.renderMenuIcon!="function")return null;let ut=e.renderMenuIcon(Be);return ut?ut.type===W||ut.type===Ao?ut:Se.createElement(W,{...ne},ut):null},renderParam:{...G,renderBag:{...G.renderBag}}})),e.renderSelectionCheckBox&&C==="multi-row"){G.renderBag.selectionCheckBox=Se.createElement(Yt,{render:Dy,renderParam:{...G,renderBag:{...G.renderBag}}});let Be=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Be&&Be!==!0&&(G.renderBag.selectionCheckBox=Se.createElement(Yt,{render:Be,renderParam:{...G,renderBag:{...G.renderBag}}}))}F instanceof Function&&(G.renderBag.header=Se.createElement(Yt,{render:F,renderParam:{...G,renderBag:{...G.renderBag}}}));let re=e.renderMenuIcon===!1?null:G.renderBag.menuIcon,ge=ae?Se.createElement("div",{className:wt},G.renderBag.header):G.renderBag.header,ie=Se.createElement(Se.Fragment,null,V==="center"?Ua:null,G.renderBag.selectionCheckBox,ge,G.renderBag.sortIcon,G.renderBag.filterIcon,V==="center"?Ua:null,V!=="center"?Ua:null,re);return e.renderHeader?Se.createElement(Yt,{render:e.renderHeader,renderParam:{...G,renderBag:{...G.renderBag,all:ie}}}):ie};Iy(()=>{let G=null,re=L.current;return I&&re&&(G=co(re,I)),()=>{G?.()}},[L.current,o.onResize]);let Q={height:x};e.headerStyle&&(Q=typeof e.headerStyle=="function"?{...Q,...e.headerStyle(j)||{}}:{...Q,...e.headerStyle});let O=typeof e.headerClassName=="function"?e.headerClassName(j):e.headerClassName,{onPointerDown:Te,proxyPosition:Ce}=vu({columnId:e.id,domRef:L,horizontalLayoutPageIndex:R}),H=null;w&&Ce&&(H=Se.createElement("div",{key:e.id,className:`${gn}Proxy ${Ec}`,style:{position:"absolute",height:x,width:P,left:Ce.left??0,top:Ce.top??0,zIndex:1e9}},j.renderBag.header),H=Py(H,s.current));let ee=Hr.Provider,ue={filtered:e.computedFiltered,verticalAlign:$,align:V},Ie=Se.useMemo(()=>{let G=re=>{t.setColumnFilter(e.id,re)};return y>0?xt(G,{wait:y}):G},[y,e.id]),ve=e.computedFilterType,Fe=b[ve],De=e.computedFilterable?e.computedFilterValue?.filter.operator??Fe?.defaultOperator:void 0,Ke=e.computedFilterable&&Fe?Fe.operators.find(G=>G.name===De):void 0,$e=Ke?.components?.FilterEditor||Fe?.components?.FilterEditor||e.components?.FilterEditor||zn,He=Fe?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,ot=nd(e,{horizontalLayoutPageIndex:R}),Qe=`var(${Ay}-${e.computedVisibleIndex})`;Q.zIndex=Qe;let K={"data-field":`${e.field||""}`,"data-column-id":e.id,"data-header-align":V,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},oe=e.computedFilterable?Se.createElement(nu,{horizontalLayoutPageIndex:R,filterEditor:$e,filterOperatorSwitch:He??ou,operator:Ke,filterTypes:b,onChange:Ie,columnFilterType:ve,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:c}):Se.createElement(ru,null);return j.renderBag.filterEditor=oe,Se.createElement(ee,{value:j},Se.createElement(Gr,{domRef:D,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...K,"data-z-index":Qe,style:Q,width:P,onPointerDown:Te,contentClassName:J(Ac(ue),lc[V]),contentStyle:a?{height:x/2}:void 0,className:J(gn,pc.none,he?ic.pointer:"",O,_r(e,[gn,mn],Mc,{dragging:w,insideDisabledDraggingPage:v,align:V,verticalAlign:$,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Dc),cssEllipsis:ae,afterChildren:Se.createElement(Se.Fragment,null,a?oe:null,ot),renderChildren:le}),H)}function Er(){return vy(Hr)}import*as gt from"react";function ad(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let f=u.id,p=o[d-1],m=p?.id??"",h=new Set,g=p?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(f,h);let y={type:"column",id:f,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([f],y);let b=u.columnGroup,T,S=y;for(;b;){let C=e[b];if(C){h.add(b);let R=[f,...h];T=g.has(b)?i.get(b):void 0,T||(T={id:b,type:"group",ref:C,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:y.computedPinned,depth:t.get(b)??0},r.set(R,T),i.set(b,T)),T.columnItems.push(y),T.uniqueGroupId.push(y.id),S&&!g.has(S.id)&&T.children.push(S),S=T,b=C.columnGroup}else break}});let l=[],s=new q,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((f,p)=>f+p.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&ld(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=n+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function ld(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"&&ld(t.children),e+=n})}import*as yn from"react";import{useCallback as gd,useEffect as Ny,useRef as Ly}from"react";import*as Ya from"react";import*as dd from"react";import{useCallback as ud}from"react";import{useRef as sd,useState as Ey}from"react";import*as Mo from"react";var{rootClassName:My}=xe,_y=`${My}HeaderCell_ResizeHandle`;function Fy(o){let e=sd(null),[t,n]=Ey(!1),r=sd(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let f=d.pointerId,p=d.clientX,m=d.target;m.setPointerCapture(f);let h=!0,g=Zu(o.groupColumns.map(S=>S.computedVisibleIndex),{columns:o.columns,domRef:e}),y=S=>{a==="end"&&(S*=-1);let{constrained:C,adjustedDiffs:R,adjustedDiff:w}=o.computeResize(S);return r.current!==C&&n(C),g.resize(R),w},b=S=>{if(h){let C=o.groupColumns.reduce((v,I)=>v+I.computedWidth-I.computedMinWidth,0),R=o.brain.getAvailableSize(),w={width:R.width+C,height:R.height};o.brain.update(w),h=!1}y(Math.round(S.clientX-p))},T=S=>{m.releasePointerCapture(f),m.removeEventListener("pointermove",b),m.removeEventListener("pointerup",T);let C=Math.round(S.clientX-p),R=y(C);o.onResize(R)};m.addEventListener("pointermove",b),m.addEventListener("pointerup",T)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:se.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Mo.createElement("div",{ref:e,className:`${_y} ${Br} ${jr({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Mo.createElement("div",{style:{...u,...o.style},className:Wr({constrained:t})}))}var cd=Mo.memo(Fy);function fd(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:c}=X(),u=o[o.length-1],d=ud(h=>{let g=l(),{columnSizing:y,viewportReservedWidth:b,bodySize:T}=g,S=s().computedVisibleColumns,C=!1,R=S.reduce((I,x)=>(x.computedFlex&&(I[x.id]={...y[x.id],flex:x.computedWidth},C=!0),I),{}),w=C?{...y,...R}:y;return Uc({availableSize:T.width,reservedWidth:b||0,dragHandleOffset:h,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:w,columnGroupSize:o.length,items:S.map(I=>({id:I.id,resizable:I.computedResizable,computedFlex:I.computedFlex,computedWidth:I.computedWidth,computedMinWidth:I.computedMinWidth,computedMaxWidth:I.computedMaxWidth}))})},[u]),f=ud(h=>{let{columnSizing:g,reservedWidth:y}=d(h);c.viewportReservedWidth=y,c.columnSizing=g},[d]);return o.some(h=>h.computedResizable)?dd.createElement(cd,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:f}):null}var pd=`${et}HeaderGroup`,md=Y(U.columnWidthAtIndex),Oy=Y(U.columnZIndexAtIndex);function hd(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=fd(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(p=>`var(${md}-${p.computedVisibleIndex})`).join(" + ")+" )":`var(${md}-${c.computedVisibleIndex})`,d=`calc(var(${Oy}-${c.computedVisibleIndex}) + ${i-e.depth})`,f=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return f=f&&typeof f=="object"?f:{},f.width=u,f.height=t,Ya.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:J(zc,pd),style:f,"data-z-index":d},Ya.createElement("div",{className:J(`${pd}__header-content`,wt)},a),s)}var{rootClassName:zy}=xe,ky=[],yd=`${zy}Header`,Vy=_c({overflow:!1});function Gy(o){let{bodyBrain:e,columns:t,style:n,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=o,{computed:s,getState:c,state:{headerBrain:u,headerOptions:d,showColumnFilters:f,headerRenderer:p,headerOnRenderUpdater:m}}=X(),{computedColumnsMap:h}=s,g=Ly(null),y=gd(S=>{g.current&&(g.current.style.transform=`translate3d(-${S.scrollLeft}px, 0px, 0px)`)},[]);Ny(()=>{let S=u.onScroll(y);return y(u.getScrollPosition()||{scrollLeft:0,scrollTop:0}),S},[u]);let b={ref:g,className:J(yd,`${yd}--virtualized`,r,Vy),style:{...n,height:i}},T=gd(S=>{let{rowIndex:C,colIndex:R,domRef:w,height:v,widthWithColspan:I,heightWithRowspan:x,hidden:P}=S,E=t[R];if(!E||P)return null;let _=u.isHorizontalLayoutBrain?u.getPageIndexForRow(C):null,A=a?a.pathsToCells.get([C,R]):null;if(A&&A.type==="group"){let F=A.columnItems.map(N=>N.ref),D={...A.ref,id:A.id,uniqueGroupId:A.uniqueGroupId,depth:A.depth,columns:F.map(N=>N.id),computedWidth:A.computedWidth,groupOffset:A.groupOffset};return c().columnGroupVisibility[A.id]!==!1?yn.createElement(hd,{horizontalLayoutPageIndex:_,bodyBrain:e,columnGroupsMaxDepth:l,domRef:w,columns:F,width:I,height:v,columnGroup:D}):null}return yn.createElement(id,{domRef:w,column:E,horizontalLayoutPageIndex:_,headerOptions:d,width:I,height:x,columnsMap:h})},[d,t,i,a,l,f,u]);return yn.createElement("div",{...b},yn.createElement(mr,{name:"header",renderCell:T,brain:u,renderer:p,onRenderUpdater:m,cellHoverClassNames:ky,cellDetachedClassNames:br}))}var bd=yn.memo(Gy);function Cd(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,r=X(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:c,columnGroupsDepthsMap:u,columnGroupsMaxDepth:d,computedColumnGroups:f,showColumnFilters:p}}=r,m=!f||!Object.keys(f).length?1:d+2,h=m*c+(p?c:0),g=gt.useMemo(()=>{if(!(!f||!Object.keys(f).length))return ad(l,f,u,d)},[l,f,u]),y=gt.useCallback(({rowIndex:w,colIndex:v})=>{let I=l[v],x=1,P=1;if(!I||!g)return{rowspan:x,colspan:P};let E=g.pathsToCells.get([w,v]);if(!E)return{rowspan:x,colspan:P};if(E.type==="column")return{colspan:P,rowspan:m-E.depth};let _=E.columnItems.findIndex(A=>A.id===I.id);return{rowspan:x,colspan:_===0?E.columnItems.length:1}},[f,d,l,g,m,u]),b=gt.useCallback(({rowIndex:w,colIndex:v})=>y({rowIndex:w,colIndex:v}).rowspan,[y]),T=gt.useCallback(({rowIndex:w,colIndex:v})=>y({rowIndex:w,colIndex:v}).colspan,[y]),S=gt.useCallback(w=>p?w<m-1?c:2*c:c,[m,p,c]);Cr(e,{colWidth:s,rowHeight:S,rows:m,cols:l.length,height:h,rowspan:b,colspan:T},{fixedColsEnd:a.length,fixedColsStart:i.length});let C=gt.createElement(bd,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:h,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:g}),R=n.vertical&&Wt()?gt.createElement("div",{className:Vc,style:{zIndex:1e3,width:Wt()}}):null;return gt.createElement("div",{className:`${od} ${Bc}`,style:{height:h}},C,R)}import*as _t from"react";import{useEffect as Ky}from"react";function Td(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 Sd={padding:se.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},Hy={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},wd=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Td(t),n,"important")},Rd=_t.forwardRef(function(e,t){let{rootClassName:n}=Tr(),r=_t.useRef(null),i=_t.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return Ky(()=>{let a=()=>{setTimeout(()=>{wd(r.current,Sd),wd(r.current?.firstElementChild,Hy)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),_t.createElement("div",{ref:i,...e,className:J(`${n}-Footer`,iu,e.className),style:Sd},"Powered by"," ",_t.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});import*as Kn from"react";var vd={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i"},Id="qy58ya3 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",xd="qy58ya4";var{rootClassName:By}=xe,qa=`${By}-LoadMask`;function Wy(o){let{visible:e,children:t="Loading"}=o;return Kn.createElement("div",{className:`${vd[e?"visible":"hidden"]} ${qa}`},Kn.createElement("div",{className:`${Id} ${qa}-Overlay`}),Kn.createElement("div",{className:`${xd} ${qa}-Text`},t))}var $r=Kn.memo(Wy);function Xa(o){return o.map(Rt)}function Rt(o){if(Ae().structuredClone)return Ae().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Xa(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Xa(Array.from(o)));if(o instanceof Map)return new Map(Xa(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Rt(o[t]));return e}function _o(o){return o}var bn=Object.seal({data:null,field:null});var Zt="____root____",Dd="____not_loaded_yet____";function Xt(){return!1}function Za(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 Ur(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 Ad(o,e){let{reducers:t={},pivot:n,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=o,c=new q;function u(g,y,b,T=0,S=[]){let C=!b.length||T===b.length-1,R=y[s?.values||"values"]||{};for(let w in R)if(R.hasOwnProperty(w)){let v=w;S.push(v),d.set(S,!0),g.set(S,{reducerResults:R[w][s?.totals||"totals"]||{},items:[]}),C||u(g,R[w],b,T+1,S),S.pop()}}let d=n?new q:void 0,f=[],p=Za(t),m=Rt(p);e.visitDepthFirst((g,y,b,T)=>{let[S,...C]=y,R=g.children,w=c.get(C);if(w&&(w.cache=g.cache,w.childrenLoading=g.childrenLoading,w.childrenAvailable=g.childrenAvailable,w.error=g.error),C.length==r.length&&r.length){if(w){w.items=R;for(let I=0,x=C.length;I<x;I++){let P=C.slice(0,I),E=c.get(P);E&&(E.items=E.items||[],E.items=E.items.concat(R))}R=i.indexArray(R,{toPrimaryKey:a,cache:l,nodesKey:void 0})}return T?.()}for(let v=0,I=R.length;v<I;v++){if(!R[v]){let _={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...C,`${Dd}${v}`],_);continue}let x=R[v].data,P=R[v].keys||[];if(P.length){let _=P[P.length-1];C.push(_)}let E={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:R[v].totalChildrenCount,reducerResults:R[v].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(C,E),n){let _=E.pivotDeepMap=new q,A=R[v].pivot;u(_,A,n,0,f)}P.length&&C.pop()}T?.()});let h={deepMap:c,groupParams:o,initialData:e,reducerResults:m};return n&&(h.topLevelPivotColumns=d,h.pivot=n),h}function Pd(o,e,t,n,r,i,a,l,s,c=_o){let{items:u,reducerResults:d,pivotDeepMap:f}=o.get(e);if(u.push(n),a&&Ur(n,r,a,d,e),i){for(let p=0,m=i.length;p<m;p++){let{field:h,valueGetter:g,toKey:y}=i[p],b=h?n[h]:null;g&&(bn.data=n,bn.field=h,b=g(bn));let T=(y||c)(b,n);t.push(T),f.has(t)||(l.set(t,!0),f?.set(t,{reducerResults:Rt(s),items:[]}));let{reducerResults:S,items:C}=f.get(t);C.push(n),a&&Ur(n,r,a,S,e)}t.length=0}}function Ed(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),f=[...n,d],p=s(r);if(t.set(f,!0),p){for(let y=0,b=n.length;y<=b;y++){let T=n.slice(0,y),S=e.get(T),{reducerResults:C,items:R}=S;R.push(r),S.leavesAvailableCount++,S.totalLeafNodesCount++,a&&Ur(r,i,a,C,T)}return}let m=Rt(l),h=[];e.set(f,{items:h,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let g=c(r);if(!(!g||!Array.isArray(g))){for(let y=0,b=g.length;y<b;y++){let T=g[y];Ed(o,e,t,f,T,y,a,l)}a&&Fo(a,m,h)}}function Md(o,e){let{reducers:t}=o,n=Za(t),r=Rt(n),i=new q,a=new q;i.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,c=e.length;s<c;s++)Ed(o,i,a,[],e[s],s,t,n);return t&&Fo(t,r,e),{deepMap:i,treeParams:o,treePaths:a,initialData:e,reducerResults:r}}function Qa(o,e){let{groupBy:t,defaultToKey:n=_o,pivot:r,reducers:i}=o,a=t.length,l=r?new q:void 0,s=new q,c=[],u=[],d=Za(i),f=Rt(d);if(!a){let m={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Rt(d)};r&&(m.pivotDeepMap=new q),s.set(c,m)}for(let m=0,h=e.length;m<h;m++){let g=e[m],y={};for(let b=0;b<a;b++){let{field:T,groupField:S,valueGetter:C,toKey:R}=t[b],w=T?g[T]:null;C&&(bn.data=g,bn.field=T,w=C(bn));let v=(R||n)(w,g);if(y[T||S]=v,c.push(v),!s.has(c)){let I={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Rt(d)};r&&(I.pivotDeepMap=new q),s.set(c,I)}Pd(s,c,u,g,m,r,i,l,d,n)}a||Pd(s,c,u,g,m,r,i,l,d,n),i&&Ur(g,m,i,f,c),c.length=0}i&&(s.visitDepthFirst((m,h,g,y)=>{Fo(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:b,reducerResults:T},S,C,R)=>{Fo(i,T,b),R?.()}),y?.()}),Fo(i,f,e));let p={deepMap:s,groupParams:o,initialData:e,reducerResults:f};return r&&(p.topLevelPivotColumns=l,p.pivot=r),p}function jy(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 $y(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,f=d??null,p;if(Object.keys(c).length>0){f={...d},p={};for(let b in i)if(i.hasOwnProperty(b)){let S=i[b].field;S&&(p[S]=c[b]),S&&f[S]==null&&(f[S]=c[b])}}let m=!0,h=n[n.length-1],g=h;if(f!=null){let b=t[n.length-1];b&&b.field&&(g=f[b.field]),b&&b.toKey&&(g=b.toKey(g,f)),g=g??h}return typeof g=="string"&&g.startsWith(Dd)&&(m=!1,g=null),{data:f,reducerData:p,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Xt,hasSelectedCells:Xt,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:g,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function Yr(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function Fo(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 _d(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:f,withRowInfo:p,isNodeExpanded:m,treeSelectionState:h,repeatWrappedGroupRows:g,rowsPerPage:y}=r,{deepMap:b}=u,T=o.length,S=t[t.length-1],C=S?S.nodeExpanded:!0;for(let R=0;R<T;R++){let w=o[R],v=c(w,R),I=[...e,v];if(l(w)){let D={id:v,nodePath:I,isGroupRow:!1,data:w,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Xt,hasSelectedCells:Xt,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,R],indexInParent:R,indexInAll:C?i.length:-1};f&&(D.rowSelected=f(D)),d&&(D.rowDisabled=d(D)),p&&p(D);let M=g&&y!=null&&y>0&&D.indexInAll%y===0?D.indexInAll/y:null;for(let N=0,V=t.length;N<V;N++){let $=t[N];if(C||($.collapsedLeafNodesCount+=1),$.deepRowInfoArray.push(D),M!=null&&C){if(typeof g=="function"&&g($)!==!0)continue;let te=Yr($,D.indexInAll,M);i[te.indexInAll]=te,D.indexInAll++}}C&&(i[D.indexInAll]=D);continue}let E=b.get(I)?.totalLeafNodesCount??0,_={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:I,id:v,data:w,indexInAll:i.length,indexInParent:R,indexInParentNodes:[...n,R],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Xt,hasSelectedCells:Xt,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(_.rowSelected=f(_),h)){let D=h.getSelectionCountFor(_.nodePath);_.selectedLeafNodesCount=D.selectedCount,_.deselectedLeafNodesCount=D.deselectedCount}d&&(_.rowDisabled=d(_)),p&&p(_);let A=!0;if(m&&(_.selfExpanded=A=m(_)),C||(A=!1),_.nodeExpanded=A,C&&g&&y!=null&&y>0){let D=_.indexInAll,M=_.parentNodes;if(M.length>0&&D%y===0){let N=D/y,V=0;M.forEach($=>{typeof g=="function"&&g($)!==!0||(i.push(Yr($,D+V,N)),V++,_.indexInAll++)})}}C&&(i[_.indexInAll]=_);let F=s(w);Array.isArray(F)&&_d(F,I,[...t,_],_.indexInParentNodes,r,i)}return i}function Fd(o){let{dataArray:e}=o,t=[];return _d(e,[],[],[],o,t),{data:t}}function Od(o){let{lazyLoad:e,groupResult:t,rowsPerPage:n,repeatWrappedGroupRows:r,withRowInfo:i,toPrimaryKey:a,groupRowsState:l,isRowDisabled:s,isRowSelected:c,rowSelectionState:u,generateGroupRows:d,reducers:f={}}=o,{groupParams:p,deepMap:m,pivot:h}=t,{groupBy:g}=p,y=[],b=[],T=[],S=[];return m.visitDepthFirst((C,R,w,v)=>{let I=C.items,x=R.length,P=l?.isGroupRowCollapsed(R)??!1;S.push(w);let E=$y({lazyLoad:e,groupBy:g,parents:Array.from(T),reducers:f,indexInGroup:w,indexInParentGroups:Array.from(S),indexInAll:y.length,groupKeys:R,error:C.error,totalChildrenCount:C.totalChildrenCount,childrenLoading:(C.childrenLoading||!P&&!C.childrenAvailable)&&e,childrenAvailable:C.childrenAvailable,directChildrenCount:R.length===g.length?C.items.length:m.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},C);if(c&&(E.rowSelected=c(E),u)){let M=u.getSelectionCountFor(E.groupKeys);E.selectedChildredCount=M.selectedCount,E.deselectedChildredCount=M.deselectedCount}s&&(E.rowDisabled=s(E));let _=T[T.length-1],A=_?.collapsed??!1;A&&(P=!0),E.collapsed=P;let F=d||P;if(A&&(F=!1),F){if(r&&n!=null&&n>0){let M=E.indexInAll,N=E.parents;if(N.length>0&&M%n===0){let V=M/n,$=0;N.forEach(te=>{typeof r=="function"&&r(te)!==!0||(y.push(Yr(te,M+$,V)),$++,E.indexInAll++)})}}y.push(E),b.push(y.length-1)}E.collapsedChildrenCount=0,T.forEach(M=>{M.deepRowInfoArray.push(E),M.collapsedGroupsCount+=P?1:0}),_&&E.selfLoaded&&e&&(_.directChildrenLoadedCount+=1),i&&i(E),T.push(E);let D=!0;if(D){if(v)v();else if(!h){let M=y.length;P||(y.length+=I.length);let N=0;for(let V=0,$=I.length;V<$;V++){let te=I[V];if(!P&&r&&n!=null&&n>0){let B=M+V+N;if(B%n===0){let ae=B/n;T.forEach(ne=>{if(typeof r=="function"&&r(ne)!==!0)return;let W=M+V+N;y[W]=Yr(ne,W,ae),N++,y.length++})}}let he=M+V+N,k={id:te?a(te,he):`${R}-${V}`,data:te,isCellSelected:Xt,hasSelectedCells:Xt,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!te,rowSelected:!1,rowDisabled:!1,rootGroupBy:g,collapsed:P,groupKeys:R,parents:Array.from(T),indexInParentGroups:[...S,V],indexInGroup:V,indexInAll:he,groupBy:g,groupNesting:x+1,groupCount:E.groupCount};c&&(k.rowSelected=c(k)),s&&(k.rowDisabled=s(k)),i&&i(k),T.forEach((B,ae)=>{ae===T.length-1&&te&&(B.directChildrenLoadedCount+=1),P&&(B.collapsedChildrenCount+=1),B.deepRowInfoArray.push(k)}),P||(y[M+V+N]=k)}}}T.pop(),S.pop()}),{data:y,groupRowsIndexes:b}}import*as vf from"react";var Uy=()=>{};function Yy(o,e){let t=new q,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,!0,1);for(let u of c){let d=[...l,u[u.length-1]],f=t.get(d),p=f?f[n]??[]:[];a(d,p),p.length&&(f||(f=typeof r=="function"?r(d,p):r),f[n]=p),s.push(f)}return s}return a([],[])}function Nd(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],f=r(n),p=Ue(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let h=0,g=m.length;h<g;h++){let y=m[h];Nd(o,e,d,y)}});f?(c?.(n),s?.(n,Uy)):(l?.(n,p,i(n)),s?.(n,p))}function Ld(o,e,t){for(let n=0,r=t.length;n<r;n++)Nd(o,e,[],t[n])}var qy=function(o,e){return o-e},Xy=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},Zy=function(o,e){return o-e},Qy={number:qy,string:Xy,date:Zy},Oo=Qy;function zd(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 Ft=(o,e,t)=>{let n=typeof t=="function"?t:t?.get;return e.sort(kd(zd(o),n)),e},Ja=(o,e,t)=>{let n=kd(zd(o),t.get),r=t.depthFirst??!1,i=t.inplace??!1;r||(i?e.sort(n):e=[...e].sort(n));let{nodesKey:a,toKey:l}=t,s=u=>u[a],c=u=>u[a]===void 0;return Ld({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??s,toKey:l},{onParentNode:(u,d,f)=>{if(r&&d(),Array.isArray(f)){let p=i?f.sort(n):[...f].sort(n);u[a]=p}r||d()}},e),r&&(i?e.sort(n):e=[...e].sort(n)),e};Ft.knownTypes=Oo;var Jy=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=Ft.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Ft.knownTypes).join(", ")}`)}return r||(r=Oo.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:n*c}},eb=o=>o.map(Jy).filter(e=>e instanceof Function),kd=(o,e)=>{let t=eb(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var qr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new q(n.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new q(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var lt=class extends qr{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 Hn(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||_o)(l,o);return t.push(s),t},[])}var we=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new q;this.deselectedMap=new q;this.onlyUsePrimaryKeys=!1;this.selectionCache=new q;this.selectionCountCache=new q;this.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?Hn(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(e);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,!0,1)||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],!0,1)||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let n=t?.get(e);return n?n.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()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(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}this.selectedMap.getKeysStartingWith(e,!0).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,!0).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(p=>{if(this.defaultSelection){if(this.deselectedMap.has([p])){d++;return}u++}else{if(this.selectedMap.has([p])){u++;return}d++}});let f={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,f),f}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,!0,1).length,f=this.deselectedMap.getKeysStartingWith(e,!0,1).length,p=u-(d+f),m={selectedCount:d+(c?p:0),deselectedCount:f+(c?0:p)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),f=u?!0:d?!1:t,{selectedCount:p,deselectedCount:m}=this.getSelectionCountFor(c,f);a+=p,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var tb="*",Ne=class{constructor(e){this.wildcard=tb;this.cache=new q;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[f,p]=d;p===t&&l.push([f,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[f]=d;f===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(n){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(n){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,n=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),n&&n.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let n=this.selectedRowsToColumns.get(e);if(n){if(n.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>n.has(r)):!1}return!1}error(e){Gt(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let p=this.selectedRowsToColumns.get(e);return p&&p.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var nb=ke("InfiniteTable"),ob="#dc3545",rb="#eb9316";var Gd="Warn",Kd="Error",ib="Info",ab="Success",lb="Logs",Xr=nb.extend(lb),J1=Xr.extend(ib),sb=Xr.extend(Gd),cb=Xr.extend(Kd),e_=Xr.extend(ab);var ub=rb,db=ob;var fb=(o,e)=>{e=e?e.extend?e.extend(Gd):e:sb,e(typeof e.color=="function"?e.color(ub,o):o)},pb=(o,e)=>{e=e?e.extend?e.extend(Kd):e:cb,e(typeof e.color=="function"?e.color(db,o):o)};var Vd=new q,Hd=(o,...e)=>{Vd.has(e)||(Vd.set(e,!0),o())};var Bn=(o,e=o,t)=>{Hd(()=>fb(o,t),e,"warn")},Bd=(o,e=o,t)=>{Hd(()=>pb(o,t),e,"error")};function Zr(o,e){return new we(o,qe(e))}function qe(o){return()=>{let e=typeof o=="function"?o():o;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function Wd(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 we))throw"Invalid row selection";let a=new we(r,qe(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 we))throw"Invalid row selection";let a=new we(r,qe(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof we))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Hn(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof we))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Hn(d,c):[]}let u=new we(a,qe(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof we))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Hn(d,c):[]}let u=new we(l,qe(e));u.deselectRow(r,i),t.rowSelection=u}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof we))throw"Invalid row selection";let s=new we(a,qe(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 we))throw"Invalid row selection";let s=new we(a,qe(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 we))throw"Invalid row selection";let s=new we(a,qe(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new we(i,qe(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof we))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new we(r,qe(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}var el=new WeakMap,mb=o=>o;function jd(o,e=50,t){el.set(o,{lastCallTime:0,lastCallArg:null});let n=t??mb;return r=>{let{lastCallTime:i,lastCallArg:a}=el.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=$t(n(a),n(r));s<e&&c||(el.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var Qr=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new q;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,f=u.length;d<f;d++){let p=u[d];if(p.type==="insert"){let m=r(p.data);s?this.addNodePath([m],p.data,t):this.add(m,p.data),e.push(p.data)}}n?.removeInfo(void 0)}}else{let u=(d,f)=>{for(let p=0;p<d.length;p++){let m=d[p];c&&s&&Array.isArray(m[l])&&(m=d[p]={...m});let h=!1;if(m!=null){let g=r(m),y=s?[...f,g]:void 0,b=s&&!!y,T=b?n?.getMutationsForNodePath(y):n?.getMutationsForPrimaryKey(g);if(T&&T.length){for(let S=0,C=T.length;S<C;S++){let R=T[S];if(R.type==="delete"&&!h&&(b?this.removeNodePath(y,t):this.remove(g),h=!0,d.splice(p,1),p--),R.type==="update"&&!h&&(m={...m,...R.data},d[p]=m),R.type==="update-children"&&!h){let w=R.children(m[l],m);m={...m},w!==void 0?m[l]=w:delete m[l],d[p]=m}R.type==="insert"&&(R.position==="before"?(d.splice(p,0,R.data),p--):d.splice(p+1,0,R.data))}b?n?.removeNodePathInfo(y):n?.removeInfo(g)}if(!h)if(b){this.addNodePath(y,m);let S=a(m),C=S?null:i(m);!S&&Array.isArray(C)&&(f.push(g),c&&(m[l]=C=C.concat()),u(C,f),f.pop())}else this.add(g,m)}}};u(e,[])}return e}}};import{useEffect as Yn,useMemo as lf,useRef as ai,useState as Ib}from"react";import{useEffect as $d,useLayoutEffect as hb,useRef as Wn}from"react";function jn(o,e){let t=Wn({}),n=Wn({}),r=n.current,i=Wn({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,$d(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function p_(o,e){let t=Wn({}),n=Wn({}),r=n.current,i=Wn({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,hb(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function m_(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);$d(o,t)}function tl(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function nl(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 ol(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 Ud({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(p=>({...r[p],id:p}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=Ue(function(){l.forEach((p,m)=>{s[`total:${p.id}`]=nl({header:`${p.name||p.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:p,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[p.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((p,m,h,g)=>{if(m=[...m],t==="end"&&g?.(),m.length===a){let y=e[m.length-1],T=m.slice(0,-1).join("/");if(!d){let S=T;T=m.join("/");let C=m[m.length-1];c[T]=ol({header:`${C}`,columnGroup:S,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((S,C)=>{let R=d?`${m[m.length-1]}`:S.name||S.id,w=nl({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:S,pivotAggregatorIndex:C,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,defaultSortable:!1,columnGroup:T,header:R,valueFormatter:({rowInfo:I})=>I.isGroupRow?I.pivotValuesMap?.get(m)?.reducerResults[S.id]:null}),v=`${S.id}:${m.join("/")}`;s[v]=w})}else{let y=m.join("/"),b=m.slice(0,-1);if(c[y]=ol({columnGroup:b.length?b.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],S=b.length?b.join("/"):void 0;if(!d){let C=S;S=`total:${m.join("/")}`,c[S]=ol({header:`${m[m.length-1]} total`,columnGroup:C,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:T,pivotGroupKey:m[m.length-1]})}l.forEach((C,R)=>{let w=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,v=nl({columnGroup:S,header:w,pivotAggregator:C,pivotAggregatorIndex:R,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:T,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:I})=>I.isGroupRow?I.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&g?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var Yd=Symbol("CLEAR"),Cn=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new q;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Yd,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(Yd);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>q.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:q.clone(e.nodePathToData),n}};function Qt(o,e){return e().dataArray[o]}function Jr(o){return o().dataArray}var Xe=class{constructor(e){this.collapsedPathsMap=new q;this.expandedPathsMap=new q;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:n,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?n.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?n.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var gb=(o,e)=>o.length-e.length,Ze=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new q;this.cache=new q;let n=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.setConfigFn(t),this.update(n)}getTreeDeepMap(){return this.getConfig().treeDeepMap}isLeafNode(e){return!this.getTreeDeepMap().has(e)}getLeafNodesCount(e){let n=this.getTreeDeepMap().get(e);return n?n.items.length:1}static from(e,t){return new o(e,t)}setConfigFn(e){this.getConfig=e,this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths: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.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(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let n=this.cache.get(e);if(n)return n;if(this.isLeafNode(e)){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getUnnestedKeysStartingWith(e,!0).sort(gb);if(!l.length){if(i!==null){let f=r?i:!1;return this.cacheIt(e,{selected:f,selectedCount:f?r:0,deselectedCount:f?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,f=l.length;d<f;d++){let p=l[d],{selectedCount:m,deselectedCount:h}=this.getSelectionStateForNode(p);if(u?(s-=h,c+=h):(c-=m,s+=m),t&&m>0&&h>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.getSelectionStateForNode(e,!0).selected}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.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.getConfig=null,this.xcache(),this.selectionMap.clear()}};function ti(o,e){return new Ze(o,$n(e))}function $n(o){return()=>({treeDeepMap:(typeof o=="function"?o():o).treeDeepMap})}var ei=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 Ze))throw"Invalid tree selection";let a=new Ze(r,$n(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current=e,this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),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 Xe({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new Xe({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 Xe(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 Xe(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 Xe(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){let{treeDeepMap:t}=this.getState();if(!t||!e.length)return null;let n=this.getRowInfoByPath(e);return n?n.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?Qt(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 Ze))throw"Invalid node selection";let n=new Ze(e,$n(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 Ze))throw"Invalid node selection";let n=new Ze(e,$n(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 Ze))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var Un=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 st=class extends Un{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)}};var rl=1e3;function qd(o){return new il(o)}var il=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=()=>Jr(this.getState);this.getRowInfoByIndex=e=>Qt(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?rl:r;return isNaN(a)||(a=rl),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=n?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.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 st(n):new st({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 st({enabledRows:!0,disabledRows:[]});return}let t=new st(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new st({disabledRows:!0,enabledRows:[]});return}let t=new st(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new ei({...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?Cn.clone(t,{light:!0}):new Cn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let f=a.primaryKeys[d],p=this.getDataByPrimaryKey(f);p&&i.update(a.primaryKeys[d],u,p,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[d]);f&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,f,a.metadata):i.updateNodePath(a.nodePaths[d],u,f,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??rl,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=f=>{clearTimeout(d),u=f,n.waitForNodePathPromises.delete(e),c(f)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Xd(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:f,isTree:p}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let h=m.field;if(h&&(h=Array.isArray(h)?h:[h],t=h.reduce((g,y)=>g||typeof y!="function"?l.has(y):!1,!1),t))break}if(c&&c.length){if(l===!0)n=!0;else for(let m of c)if(m.field&&l.has(m.field)){n=!0;break}}if(p&&(l===!0?r=!0:r=l.has(f)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let h=d[m];if(h.field){if(l.has(h.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function ni(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 oi(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 ri(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 ll(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var vt=(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 al(){return!1}function yb(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:al,hasSelectedCells:al};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 bb=Ue(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
2
2
 
3
3
  Your filtering function probably looks like this:
4
4
 
@@ -10,21 +10,21 @@ function treeFilterFunction({ data }) {
10
10
 
11
11
  Make sure you avoid mutations.
12
12
 
13
- `)});function Qd(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a}=n,l=[],s=u=>{let c=r(u);if(i(u)||!Array.isArray(c))return u;let d=Qd({...n,dataArray:c});return d.length===0?!1:(u={...u,[a]:d},u)};for(let u=0,c=e.length;u<c;u++){let d=e[u],p=r(d),f=t({data:d,index:u,dataArray:e,primaryKey:o(d,u),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&yC(),l.push(f))}return l}function CC(n){let{filterTypes:e,operatorsByFilterType:t,filterFunction:o,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=n,{dataArray:u}=n;o&&(u=u.filter((d,p,f)=>o({data:d,index:p,dataArray:f,primaryKey:r(d,p)}))),i&&(u=Qd({...n,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}));let c=al(n.filterValue,e)||[];return c&&c.length?u.filter((d,p,f)=>{let m={data:d,index:p,dataArray:f,primaryKey:r(d,p),field:void 0};for(let h=0,g=c.length;h<g;h++){let y=c[h],{disabled:C,field:S,valueGetter:b,filter:{type:T,value:I,operator:R}}=y,w=e[T];if(C||!w)continue;let P=t[T]?.[R];if(!P)continue;let D=b||w.valueGetter||(({data:_,field:E})=>E?_[E]:_);m.field=S;let A=m;if(A.filterValue=I,A.currentValue=D(A),A.emptyValues=w.emptyValues,!P.fn(A))return!1}return!0}):u}function Jd(n){let{state:e,previousState:t}=n,o=Zd(e),r=e.sortInfo,i=e.sortMode,a=r?.length?i==="local":!1;(e.lazyLoad||e.livePagination)&&(a=!1);let l=Pt(t,e,["refetchKey"]),s=Pt(t,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&l&&(s=!0),!1&&(e.originalLazyGroupData=new q,s=!0);let c=e.cache?Nt.clone(e.cache):void 0;c&&!c.isEmpty()&&(s=!0);let d=e.toPrimaryKey,p=e.nodesKey,f=e.isTree,m=p?B=>B[p]:void 0,h=p?B=>B[p]===void 0:void 0,g,y;s&&(e.indexer.clear(),e.lazyLoad||(g=c?.getMutations(),y=c?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:d,cache:c,getNodeChildren:m,isLeafNode:h,nodesKey:p}),f&&e.waitForNodePathPromises.visit(({value:B},ee)=>{B&&e.indexer.getDataForNodePath(ee)!==void 0&&B.resolve(!0)}))),c&&(c.clear(),e.cache=void 0);let{filterFunction:S,treeFilterFunction:b,filterValue:T,filterTypes:I,operatorsByFilterType:R}=e,w=!!S||!!b||Array.isArray(T)&&T.length,P=w&&e.filterMode==="local",x=Pt(t,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=s||x,A=Pt(t,e,["sortInfo"]),_=s||x||A,E=e.filterMode==="local"&&(D||!e.lastFilterDataArray),F=a&&(_||!e.lastSortDataArray||o.sortInfo),v=e.groupBy,M=e.pivotBy,N=!f&&(v.length>0||!!M),G=f,$=Pt(t,e,["rowDisabledState","isRowDisabled"]),te=Pt(t,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),he=Pt(t,e,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ue=s||_||Pt(t,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),z=s||_||Pt(t,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),k=Pt(t,e,["rowInfoReducers"]),ae=N&&(ue||!e.lastGroupDataArray||o.groupBy)||te||$||k,oe=G&&(z||o.tree||!e.lastTreeDataArray)||he||$||k,W=Date.now(),V=e.originalDataArray;if(w||(e.unfilteredCount=V.length),P){e.unfilteredCount=V.length;let B=W;E?(e.devToolsDetected&&(B=Date.now()),V=CC({getNodeChildren:m,isLeafNode:h,nodesKey:p,treeFilterFunction:b,dataArray:V,toPrimaryKey:d,filterTypes:I,operatorsByFilterType:R,filterFunction:S,filterValue:T}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-B)):V=e.lastFilterDataArray,e.lastFilterDataArray=V,e.filteredAt=W}if(e.filteredCount=V.length,e.postFilterDataArray=V,a){let B=Ot.knownTypes;if(Ot.knownTypes={...B,...e.sortTypes},F){let ee=W;if(e.devToolsDetected&&(ee=Date.now()),e.sortFunction?V=e.sortFunction(r,[...V]):f?V=Za(r,V,{inplace:!1,isLeafNode:h,getNodeChildren:m,toKey:d,nodesKey:p}):V=Ot(r,[...V]),e.devToolsDetected){let ce=Date.now()-ee;e.debugTimings.set("sort",ce)}}else V=e.lastSortDataArray;Ot.knownTypes=B,e.lastSortDataArray=V,e.sortedAt=W}e.postSortDataArray=V;let L=e.dataArray,Z=e.rowSelection instanceof Se?e.rowSelection:void 0,j=e.treeExpandState instanceof Ze?e.treeExpandState:void 0,se=e.cellSelection instanceof Ve?e.cellSelection:void 0;Z?.xcache();let Q=e.selectionMode==="single-row"?B=>B.id===e.rowSelection:e.selectionMode==="multi-row"?B=>{let ee=Z;return B.isGroupRow?ee.getGroupRowSelectionState(B.groupKeys):ee.isRowSelected(B.id,B.dataSourceHasGrouping?B.groupKeys:void 0)}:void 0,O=e.isRowDisabled||il;e.isRowSelected&&e.selectionMode==="multi-row"&&(Q=B=>e.isRowSelected(B,Z,e.selectionMode));let be;e.isNodeExpanded&&(be=B=>e.isNodeExpanded(B,j)),e.isNodeCollapsed&&(be=B=>!e.isNodeExpanded(B,j)),be||(be=ee=>j.isNodeExpanded(ee.nodePath));let Te=e.rowInfoReducers;if(N){if(ae){let B=W;e.devToolsDetected&&(B=Date.now());let ee=e.aggregationReducers,ce=e.lazyLoad?Ed({groupBy:v,pivot:M,mappings:e.pivotMappings,reducers:ee,indexer:e.indexer,toPrimaryKey:d,cache:c},e.originalLazyGroupData):Xa({groupBy:v,pivot:M,reducers:ee},V);e.groupDeepMap=ce.deepMap,Z&&(Z.getConfig=Xe(e));let xe=Object.keys(Te||{}),we=oi(Te),Ne={reducers:Te,results:we,reducerKeys:xe,rowInfo:{}},Ae=we?Qe=>{Ne.rowInfo=Qe,ni(Ne)}:void 0,He=se?Qe=>{Qe.isCellSelected=H=>se.isCellSelected(Qe.id,H)}:void 0,Ue=Ae||He?el(Ae,He):void 0,ke=Nd({groupResult:ce,lazyLoad:!!e.lazyLoad,reducers:ee,toPrimaryKey:d,isRowSelected:Q,rowSelectionState:Z,withRowInfo:Ue,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});L=ke.data,e.rowInfoReducerResults=ri({reducers:Te,results:we,array:L}),e.groupRowsIndexesInDataArray=ke.groupRowsIndexes,e.reducerResults=ce.reducerResults;let nt=M?Yd({deepMap:ce.topLevelPivotColumns,pivotBy:M,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=nt?.columns,e.pivotColumnGroups=nt?.columnGroups,e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-B)}else L=e.lastGroupDataArray;e.lastGroupDataArray=L,e.groupedAt=W}else if(G){if(oe){let B=W;e.devToolsDetected&&(B=Date.now());let ee=e.aggregationReducers,ce={isLeafNode:h,getNodeChildren:m,toKey:d,reducers:ee},xe=_d(ce,V);e.treeDeepMap=xe.deepMap,e.treePaths=xe.treePaths;let we=e.selectionMode==="multi-row"?ep(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=we;let Ne=Object.keys(Te||{}),Ae=oi(Te),He={reducers:Te,results:Ae,reducerKeys:Ne,rowInfo:{}},Ue=Ae?K=>{He.rowInfo=K,ni(He)}:void 0,ke=se?K=>{K.isCellSelected=re=>se.isCellSelected(K.id,re)}:void 0,nt=Ue||ke?el(Ue,ke):void 0,Qe=e.selectionMode==="single-row"?K=>K.id===e.treeSelection:e.selectionMode==="multi-row"?K=>we.isNodeSelected(K.nodePath):void 0,H=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;L=Od({treeResult:xe,treeParams:ce,dataArray:V,reducers:ee,toPrimaryKey:d,isNodeSelected:Qe,isNodeExpanded:be,treeSelectionState:we,withRowInfo:nt,repeatWrappedGroupRows:H,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=ri({reducers:Te,results:Ae,array:L}),e.reducerResults=xe.reducerResults,e.totalLeafNodesCount=xe.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=W,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-B)}else L=e.lastTreeDataArray;e.lastTreeDataArray=L}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,t.postSortDataArray!=e.postSortDataArray||ue||te||$||k){let ee=Object.keys(Te||{}),ce=oi(Te),xe={reducers:Te,results:ce,reducerKeys:ee,rowInfo:{}};L=V.map((we,Ne)=>{let Ae=gC(we,we?d(we):Ne,Ne,Q,O,se);return ce&&(xe.rowInfo=Ae,ni(xe)),Ae}),e.rowInfoReducerResults=ri({reducers:Te,results:ce,array:L})}if(e.postGroupDataArray=L,L!==e.dataArray&&(e.updatedAt=W),e.dataArray=L,e.reducedAt=W,e.selectionMode==="multi-row")if(N&&e.lazyLoad){let B=!0,ee=!1;e.dataArray.forEach(ce=>{if(!ce.isTreeNode&&ce.isGroupRow&&ce.groupKeys.length===1){let{rowSelected:xe}=ce;xe!==!0&&(B=!1),(xe===!0||xe===null)&&(ee=!0)}}),e.allRowsSelected=B,e.someRowsSelected=ee}else{let B=e.isTree?e.totalLeafNodesCount:e.filteredCount,ee=e.isTree?e.treeSelectionState?e.treeSelectionState.getSelectedCount():0:e.rowSelection.getSelectedCount();e.allRowsSelected=B===ee,e.someRowsSelected=ee>0}return e.originalDataArrayChanged=s,s&&(e.originalDataArrayChangedInfo={timestamp:W,mutations:g?.size?g:void 0,treeMutations:y?.size?y:void 0}),e}function Ct(){let n=Ee().performance?.now();return`${Date.now()}:${n}`}function TC(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
13
+ `)});function Zd(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a}=o,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=Zd({...o,dataArray:u});return d.length===0?!1:(c={...c,[a]:d},c)};for(let c=0,u=e.length;c<u;c++){let d=e[c],f=r(d),p=t({data:d,index:c,dataArray:e,primaryKey:n(d,c),filterTreeNode:s});p&&(p===!0?p=d:typeof p=="object"&&p===d&&f!==r(p)&&bb(),l.push(p))}return l}function Qd(o){let{filterTypes:e,operatorsByFilterType:t,filterFunction:n,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=o,{dataArray:c}=o;n&&(c=c.filter((d,f,p)=>n({data:d,index:f,dataArray:p,primaryKey:r(d,f)}))),i&&(c=Zd({...o,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}));let u=ll(o.filterValue,e)||[];return u&&u.length?c.filter((d,f,p)=>{let m={data:d,index:f,dataArray:p,primaryKey:r(d,f),field:void 0};for(let h=0,g=u.length;h<g;h++){let y=u[h],{disabled:b,field:T,valueGetter:S,filter:{type:C,value:R,operator:w}}=y,v=e[C];if(b||!v)continue;let I=t[C]?.[w];if(!I)continue;let P=S||v.valueGetter||(({data:_,field:A})=>A?_[A]:_);m.field=T;let E=m;if(E.filterValue=R,E.currentValue=P(E),E.emptyValues=v.emptyValues,!I.fn(E))return!1}return!0}):c}function Jd(o){let{state:e,previousState:t}=o,n=Xd(e),r=e.sortInfo,i=e.sortMode,a=r?.length?i==="local":!1;(e.lazyLoad||e.livePagination)&&(a=!1);let l=vt(t,e,["refetchKey"]),s=vt(t,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&l&&(s=!0),!1&&(e.originalLazyGroupData=new q,s=!0);let u=e.cache?Cn.clone(e.cache):void 0;u&&!u.isEmpty()&&(s=!0);let d=e.toPrimaryKey,f=e.nodesKey,p=e.isTree,m=f?H=>H[f]:void 0,h=f?H=>H[f]===void 0:void 0,g,y;s&&(e.indexer.clear(),e.lazyLoad||(g=u?.getMutations(),y=u?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:d,cache:u,getNodeChildren:m,isLeafNode:h,nodesKey:f}),p&&e.waitForNodePathPromises.visit(({value:H},ee)=>{H&&e.indexer.getDataForNodePath(ee)!==void 0&&H.resolve(!0)}))),u&&(u.clear(),e.cache=void 0);let{filterFunction:T,treeFilterFunction:S,filterValue:C,filterTypes:R,operatorsByFilterType:w}=e,v=!!T||!!S||Array.isArray(C)&&C.length,I=v&&e.filterMode==="local",x=vt(t,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),P=s||x,E=vt(t,e,["sortInfo"]),_=s||x||E,A=e.filterMode==="local"&&(P||!e.lastFilterDataArray),F=a&&(_||!e.lastSortDataArray||n.sortInfo),D=e.groupBy,M=e.pivotBy,N=!p&&(D.length>0||!!M),V=p,$=vt(t,e,["rowDisabledState","isRowDisabled"]),te=vt(t,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),he=vt(t,e,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ce=s||_||vt(t,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),k=s||_||vt(t,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),B=vt(t,e,["rowInfoReducers"]),ae=N&&(ce||!e.lastGroupDataArray||n.groupBy)||te||$||B,ne=V&&(k||n.tree||!e.lastTreeDataArray)||he||$||B,W=Date.now(),z=e.originalDataArray;if(v||(e.unfilteredCount=z.length),I){e.unfilteredCount=z.length;let H=W;A?(e.devToolsDetected&&(H=Date.now()),z=Qd({getNodeChildren:m,isLeafNode:h,nodesKey:f,treeFilterFunction:S,dataArray:z,toPrimaryKey:d,filterTypes:R,operatorsByFilterType:w,filterFunction:T,filterValue:C}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-H)):z=e.lastFilterDataArray,e.lastFilterDataArray=z,e.filteredAt=W}if(e.filteredCount=z.length,e.postFilterDataArray=z,a){let H=Ft.knownTypes;if(Ft.knownTypes={...H,...e.sortTypes},F){let ee=W;if(e.devToolsDetected&&(ee=Date.now()),e.sortFunction?z=e.sortFunction(r,[...z]):p?z=Ja(r,z,{inplace:!1,isLeafNode:h,getNodeChildren:m,toKey:d,nodesKey:f}):z=Ft(r,[...z]),e.devToolsDetected){let ue=Date.now()-ee;e.debugTimings.set("sort",ue)}}else z=e.lastSortDataArray;Ft.knownTypes=H,e.lastSortDataArray=z,e.sortedAt=W}e.postSortDataArray=z;let L=e.dataArray,Z=e.rowSelection instanceof we?e.rowSelection:void 0,j=e.treeExpandState instanceof Xe?e.treeExpandState:void 0,le=e.cellSelection instanceof Ne?e.cellSelection:void 0;Z?.xcache();let Q=e.selectionMode==="single-row"?H=>H.id===e.rowSelection:e.selectionMode==="multi-row"?H=>{let ee=Z;return H.isGroupRow?ee.getGroupRowSelectionState(H.groupKeys):ee.isRowSelected(H.id,H.dataSourceHasGrouping?H.groupKeys:void 0)}:void 0,O=e.isRowDisabled||al;e.isRowSelected&&e.selectionMode==="multi-row"&&(Q=H=>e.isRowSelected(H,Z,e.selectionMode));let Te;e.isNodeExpanded&&(Te=H=>e.isNodeExpanded(H,j)),e.isNodeCollapsed&&(Te=H=>!e.isNodeExpanded(H,j)),Te||(Te=ee=>j.isNodeExpanded(ee.nodePath));let Ce=e.rowInfoReducers;if(N){if(ae){let H=W;e.devToolsDetected&&(H=Date.now());let ee=e.aggregationReducers,ue=e.lazyLoad?Ad({groupBy:D,pivot:M,mappings:e.pivotMappings,reducers:ee,indexer:e.indexer,toPrimaryKey:d,cache:u},e.originalLazyGroupData):Qa({groupBy:D,pivot:M,reducers:ee},z);e.groupDeepMap=ue.deepMap,Z&&(Z.getConfig=qe(e));let Ie=Object.keys(Ce||{}),ve=ni(Ce),Fe={reducers:Ce,results:ve,reducerKeys:Ie,rowInfo:{}},De=ve?Qe=>{Fe.rowInfo=Qe,oi(Fe)}:void 0,Ke=le?Qe=>{Qe.isCellSelected=K=>le.isCellSelected(Qe.id,K)}:void 0,$e=De||Ke?tl(De,Ke):void 0,He=Od({groupResult:ue,lazyLoad:!!e.lazyLoad,reducers:ee,toPrimaryKey:d,isRowSelected:Q,rowSelectionState:Z,withRowInfo:$e,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});L=He.data,e.rowInfoReducerResults=ri({reducers:Ce,results:ve,array:L}),e.groupRowsIndexesInDataArray=He.groupRowsIndexes,e.reducerResults=ue.reducerResults;let ot=M?Ud({deepMap:ue.topLevelPivotColumns,pivotBy:M,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=ot?.columns,e.pivotColumnGroups=ot?.columnGroups,e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-H)}else L=e.lastGroupDataArray;e.lastGroupDataArray=L,e.groupedAt=W}else if(V){if(ne){let H=W;e.devToolsDetected&&(H=Date.now());let ee=e.aggregationReducers,ue={isLeafNode:h,getNodeChildren:m,toKey:d,reducers:ee},Ie=Md(ue,z);e.treeDeepMap=Ie.deepMap,e.treePaths=Ie.treePaths;let ve=e.selectionMode==="multi-row"?ef(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=ve;let Fe=Object.keys(Ce||{}),De=ni(Ce),Ke={reducers:Ce,results:De,reducerKeys:Fe,rowInfo:{}},$e=De?G=>{Ke.rowInfo=G,oi(Ke)}:void 0,He=le?G=>{G.isCellSelected=re=>le.isCellSelected(G.id,re)}:void 0,ot=$e||He?tl($e,He):void 0,Qe=e.selectionMode==="single-row"?G=>G.id===e.treeSelection:e.selectionMode==="multi-row"?G=>ve.isNodeSelected(G.nodePath):void 0,K=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;L=Fd({treeResult:Ie,treeParams:ue,dataArray:z,reducers:ee,toPrimaryKey:d,isNodeSelected:Qe,isNodeExpanded:Te,treeSelectionState:ve,withRowInfo:ot,repeatWrappedGroupRows:K,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=ri({reducers:Ce,results:De,array:L}),e.reducerResults=Ie.reducerResults,e.totalLeafNodesCount=Ie.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=W,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-H)}else L=e.lastTreeDataArray;e.lastTreeDataArray=L}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,t.postSortDataArray!=e.postSortDataArray||ce||te||$||B){let ee=Object.keys(Ce||{}),ue=ni(Ce),Ie={reducers:Ce,results:ue,reducerKeys:ee,rowInfo:{}};L=z.map((ve,Fe)=>{let De=yb(ve,ve?d(ve):Fe,Fe,Q,O,le);return ue&&(Ie.rowInfo=De,oi(Ie)),De}),e.rowInfoReducerResults=ri({reducers:Ce,results:ue,array:L})}if(e.postGroupDataArray=L,L!==e.dataArray&&(e.updatedAt=W),e.dataArray=L,e.reducedAt=W,e.selectionMode==="multi-row")if(N&&e.lazyLoad){let H=!0,ee=!1;e.dataArray.forEach(ue=>{if(!ue.isTreeNode&&ue.isGroupRow&&ue.groupKeys.length===1){let{rowSelected:Ie}=ue;Ie!==!0&&(H=!1),(Ie===!0||Ie===null)&&(ee=!0)}}),e.allRowsSelected=H,e.someRowsSelected=ee}else{let H=e.isTree?e.totalLeafNodesCount:e.filteredCount,ee=e.isTree?e.treeSelectionState?e.treeSelectionState.getSelectedCount():0:e.rowSelection.getSelectedCount();e.allRowsSelected=H===ee,e.someRowsSelected=ee>0}return e.originalDataArrayChanged=s,s&&(e.originalDataArrayChangedInfo={timestamp:W,mutations:g?.size?g:void 0,treeMutations:y?.size?y:void 0}),e}function yt(){let o=Ae().performance?.now();return`${Date.now()}:${o}`}function Cb(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
14
14
 
15
- ERROR_CODE = ${n}
15
+ ERROR_CODE = ${o}
16
16
 
17
- See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function tp(n){return Object.entries(n).reduce((e,[t,o])=>{let r=t,i=TC(r,typeof o=="string"?o:o.message,typeof o=="string"?void 0:o.type);return e[r]=i,e},{})}function SC(n){return{message:n.join(""),type:"warning"}}function bC(n){return{message:n.join(""),type:"error"}}var RC=tp({DS001:SC`The "data" prop of your DataSource seems to be updating too frequently.
18
- Make sure you don't pass a new reference on every render.`}),IC=tp({CSS001_CSS:bC`It appears you have not loaded the CSS file for InfiniteTable.
17
+ See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function tf(o){return Object.entries(o).reduce((e,[t,n])=>{let r=t,i=Cb(r,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return e[r]=i,e},{})}function Tb(o){return{message:o.join(""),type:"warning"}}function Sb(o){return{message:o.join(""),type:"error"}}var wb=tf({DS001:Tb`The "data" prop of your DataSource seems to be updating too frequently.
18
+ Make sure you don't pass a new reference on every render.`}),Rb=tf({CSS001_CSS:Sb`It appears you have not loaded the CSS file for InfiniteTable.
19
19
  In most environments, you should be able to fix this by adding the following line:
20
20
 
21
21
  import '@infinite-table/infinite-react/index.css'
22
- `}),op={...RC,...IC};var Lt=new Map,Vt=new Map,Jt=new Map,zt=new Map;var ft=new Map,np=n=>{ft.delete(n),Jt.delete(n),Lt.delete(n),zt.delete(n),Vt.delete(n)};function ll(n,e,t){let o=ft.get(n);if(!o)return;let r=Jt.get(n);(!r||!Object.hasOwn(r,e))&&Jt.set(n,{...r||{},[e]:o.getState()[e]}),Lt.set(n,{...Lt.get(n)||{},[e]:t}),o.actions[e]=t}function ii(n,e,t){let o=ft.get(n);if(!o)return;let r=zt.get(n);(!r||!Object.hasOwn(r,e))&&zt.set(n,{...r||{},[e]:o.getDataSourceState()[e]}),Vt.set(n,{...Vt.get(n)||{},[e]:t}),o.dataSourceActions[e]=t}var wC=n=>{let e=n.type==="error"?Ht(n.debugId):rt(n.debugId),t=n.type==="error"?Wd:Bo,o=n.debugId?`${n.code}-${n.debugId}`:n.code,r=n.message;n.debugId&&(r=`${r}
22
+ `}),nf={...wb,...Rb};var Ot=new Map,Nt=new Map,Jt=new Map,Lt=new Map;var ft=new Map,of=o=>{ft.delete(o),Jt.delete(o),Ot.delete(o),Lt.delete(o),Nt.delete(o)};function sl(o,e,t){let n=ft.get(o);if(!n)return;let r=Jt.get(o);(!r||!Object.hasOwn(r,e))&&Jt.set(o,{...r||{},[e]:n.getState()[e]}),Ot.set(o,{...Ot.get(o)||{},[e]:t}),n.actions[e]=t}function ii(o,e,t){let n=ft.get(o);if(!n)return;let r=Lt.get(o);(!r||!Object.hasOwn(r,e))&&Lt.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),Nt.set(o,{...Nt.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var vb=o=>{let e=o.type==="error"?Gt(o.debugId):rt(o.debugId),t=o.type==="error"?Bd:Bn,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
23
23
 
24
- Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},Nn=n=>{let{debugId:e,key:t}=n,o=op[t];if(o&&(wC({...o,debugId:e}),e&&t)){let r=ft.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),Ln(e))}};globalThis.logDevToolsWarning=Nn;var Ln=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=ft.get(n);t&&e(n,t)};var rp=!0,xC=()=>new Promise(n=>{ve(n)}),DC={originalDataArray:!0,changes:!0},vC={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function Gt(n,e,t){let o=n.multiSort?n.sortInfo:n.sortInfo?.[0]??null,r={append:!1,originalDataArray:n.originalDataArray,sortInfo:o,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(r.livePaginationCursor=n.livePaginationCursor,r.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=n.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=lp(r.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=n.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!DC[l]){let s=l,u=vC[s],c=r[s],d=a[s];(u?u(c,d):c===d)||(i[s]=!0)}return r.changes=i,r}function bo(n,e,t,o,r){let i=Gt(e,o,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,u=[Zt,...i.groupKeys||[]],c=s.get(u);if(!c){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(c&&c.cache&&u.length>1){let d=c.children,p=d.length,f=!0;for(let m=0;m<p;m++)if(d[m]==null){f=!1;break}if(f)return Promise.resolve(!0)}c?c.childrenLoading||(c.childrenLoading=!0):s.set(u,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:rp,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Ct()}typeof n=="function"&&(n=n(i));let l=typeof n=="object"&&typeof n.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(n).then(s=>{let u=[],c=!1;if(Array.isArray(s.data)){let p=s;if(u=p.data,p.livePaginationCursor!==void 0&&(t.livePaginationCursor=p.livePaginationCursor),p.mappings&&(t.pivotMappings=p.mappings),p.totalCountUnfiltered&&(t.unfilteredCount=p.totalCountUnfiltered),e.lazyLoad){let m=function(h,g,y){let C=[Zt,...h],S=g.data,b={cache:g.cache??rp,childrenLoading:!1,childrenAvailable:!0,totalCount:g.totalCount??S.length,totalCountUnfiltered:g.totalCount??S.length,children:S,error:g.error},T=[];if(i.lazyLoadBatchSize&&!y){let R=f.get(C),w=!R,P=Qu({children:!0},R||{},b);w&&(P.chidren=[]),P.children.length=P.totalCount;let x=i.lazyLoadStartIndex??0,D=Math.min(g.totalCount??S.length,x+i.lazyLoadBatchSize);for(let A=x;A<D;A++){let _=b.children[A-x];if(!_)throw`lazily loaded item not found at index ${A-x}`;P.children[A]=_,_.dataset&&T.push({keys:_.keys,dataset:_.dataset})}w&&f.set(C,P)}else b.children.forEach(R=>{R&&R.dataset&&T.push({keys:R.keys,dataset:R.dataset})}),b.children.length=b.totalCount,f.set(C,b);let I=!1;if(!h||!h.length){let R=f.get([Zt]);t.originalDataArray=[...R.children],I=!0}if(I||(t.originalLazyGroupDataChangeDetect=Ct()),T.length){let R=h;T.forEach(({keys:w,dataset:P})=>{m(w,P,R)})}};var d=m;let f=e.originalLazyGroupData;c=!0,m(i.groupKeys||[],p)}}else u=s;c||(t.originalDataArray=a?e.originalDataArray.concat(u):u),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function lp(n,{filterTypes:e,filterMode:t}){return t==="local"?n:(al(n,e)||[]).map(o=>{let r={...o};return delete r.valueGetter,r})}function ip(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function sp(n){let{getComponentState:e,componentActions:t,componentState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:h,filterTypes:g,cursorId:y}=o,[C,S]=PC({vertical:!1,horizontal:!1}),b=ai(C);$o(()=>(a.onChange(x=>{x&&(b.current=x,S(x))}),()=>a.destroy()),[a]),$o(()=>{if(!m)return;let x=requestAnimationFrame(()=>{b.current?.vertical||h&&(t.cursorId=h)});return()=>cancelAnimationFrame(x)},[h]),$o(()=>{if(!m||h!==void 0)return;let x=requestAnimationFrame(()=>{b.current?.vertical||y!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(x)},[i.length,h]),$o(()=>{let x=e(),{livePaginationCursor:D,livePagination:A,dataArray:_}=x;!C.vertical&&A&&(D?t.cursorId=D:D===void 0&&_.length&&(t.cursorId=_.length))},[C.vertical]);let T=ap(()=>lp(p,{filterTypes:g,filterMode:f}),[p,f,g]),I={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?T:null,cursorId:m?y:null},R=ai(!0);AC(n,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?y:null});let w=_e(Le()),P=ai([]);ko(()=>{let x=e(),D=w(),{isDetail:A,isDetailReady:_}=ip(D,e);if(A&&!_)return;let E=Date.now(),F=P.current;F.length>=10&&F.splice(0,1),F.push(E),E-F[0]<200&&F.length>=10&&Nn({debugId:x.debugId,key:"DS001"}),typeof x.data!="function"&&bo(x.data,x,t,void 0,D)},{data:r}),ko(x=>{let D=Object.keys(x),A=!1;if(D.length===1){if(A=!!x.cursorId,x.filterValue&&e().filterMode==="local")return;let M=e().data;if(Array.isArray(M)&&x.refetchKey){t.originalDataArray=M;return}}let _=w(),{isDetail:E,isDetailReady:F}=ip(_,e);if(E&&!F)return;let v=e();typeof v.data=="function"&&bo(v.data,v,t,{append:A},_)},{...I,data:r}),ko(()=>{let x=e();if(R.current){R.current=!1;let D=Gt(x,void 0,w());t.dataParams=D}},I)}function AC(n,e){let{getComponentState:t,componentActions:o,componentState:r}=n;$o(()=>{o.lazyLoadCacheOfLoadedBatches=new q},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:u,groupRowsState:c,scrollStopDelayUpdatedByTable:d}=r,p=ai(null),f=(h,g,y=t().lazyLoadCacheOfLoadedBatches)=>{let C=t();if(h=h||p.current,!h)return;let{renderStartIndex:S,renderEndIndex:b}=h,{lazyLoadBatchSize:T,lazyLoad:I}=C;I&&((!T||T<=0)&&(!C.groupBy||C.groupBy.length===0)||EC({startIndex:S,endIndex:b,lazyLoadBatchSize:T,componentState:C,componentActions:o,dismissLoadedRows:g?.dismissLoadedRows??!1},y))},m=ap(()=>Dt(f,{wait:d}),[d]);ko(h=>{if(a)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),f(s.get(),{dismissLoadedRows:!0})):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&f(s.get()),s.onChange(g=>{p.current=g,f(g)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:c}),$o(()=>{i&&i>0&&m()},[u])}function EC(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,u=l?()=>!1:h=>s[h].data!=null,c=!l,d=new q,p=["_______xxx______"];for(let h=t;h<=o;h++){let g=s[h];if(!g)continue;let y=u(h),C=g.dataSourceHasGrouping&&g.groupKeys?[...g.groupKeys]:[];g.isGroupRow&&g.dataSourceHasGrouping&&g.groupKeys&&C.pop();let S=C.length?C:p,b=g.dataSourceHasGrouping?g.indexInGroup:g.indexInAll;if(g.isGroupRow&&!g.collapsed&&!g.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:g.groupKeys,append:c},I=g.groupKeys,R=d.get(I);if(!R?.[g.id]){let w=!R;R=R||{},R[g.id]||(R[g.id]=T),w&&d.set(I,R)}}if(!y&&r!=null){let T=d.get(S),I=Math.floor(b/r)*r,R=b-I,w=s[g.indexInAll-R].indexInAll,P=u(w),x=s[w].id;if(P||T?.[x])continue;let D=!T;T=T||{};let A={lazyLoadStartIndex:I,lazyLoadBatchSize:r,groupKeys:C,append:c};T[x]||(T[x]=A),D&&d.set(S,T)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(h=>{m.push(...Object.values(h))}),m.reduce((h,g)=>{let y=[...g.groupKeys,g.lazyLoadStartIndex];if(e&&e.has(y))return h;e?.set(y,!0);let C=[i.data,i,a,g];return h.then(()=>xC()).then(()=>bo(...C))},f)}var MC=Object.freeze([]),up=(n,e)=>{let t=n??MC,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};var _C=Symbol("cursorId"),cp=n=>n.totalLeafNodesCount===0,FC=n=>n.isParentNode?!cp(n):!0;function dp(n){let e=Date.now(),t=[],o=[],r=new q;return{logger:rt(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,indexer:new Qr,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new q,waitForNodePathPromises:new q,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new q,dataParams:void 0,onCleanup:pe(),notifyScrollbarsChange:pe(),notifyScrollStop:pe(),notifyRenderRangeChange:pe(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:_C,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function OC(n){let e={...n};return delete e.originalDataArray,e}var NC=[],pp=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear()},fp=(n,e)=>({onDataParamsChange:t=>t?$d(t,100,OC):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??cp,isNodeSelectable:t=>t??FC,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({...po,...t}),sortTypes:t=>({...On,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof ut)return t;let o=n.propsCache.get("rowDisabledState")??Tt,r=o.get(t);return r||(r=new ut(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>up(t,n.propsCache.get("sortInfo")),groupBy:t=>t??NC});function LC(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}var Tt=new WeakMap;function VC(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var zC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function ep(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
24
+ Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},No=o=>{let{debugId:e,key:t}=o,n=nf[t];if(n&&(vb({...n,debugId:e}),e&&t)){let r=ft.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Lo(e))}};globalThis.logDevToolsWarning=No;var Lo=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=ft.get(o);t&&e(o,t)};var rf=!0,xb=()=>new Promise(o=>{Pe(o)}),Pb={originalDataArray:!0,changes:!0},Db={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function zt(o,e,t){let n=o.multiSort?o.sortInfo:o.sortInfo?.[0]??null,r={append:!1,originalDataArray:o.originalDataArray,sortInfo:n,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(r.livePaginationCursor=o.livePaginationCursor,r.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=o.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=sf(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=o.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!Pb[l]){let s=l,c=Db[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function Tn(o,e,t,n,r){let i=zt(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[Zt,...i.groupKeys||[]],u=s.get(c);if(!u){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(u&&u.cache&&c.length>1){let d=u.children,f=d.length,p=!0;for(let m=0;m<f;m++)if(d[m]==null){p=!1;break}if(p)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:rf,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=yt()}typeof o=="function"&&(o=o(i));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(o).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let f=s;if(c=f.data,f.livePaginationCursor!==void 0&&(t.livePaginationCursor=f.livePaginationCursor),f.mappings&&(t.pivotMappings=f.mappings),f.totalCountUnfiltered&&(t.unfilteredCount=f.totalCountUnfiltered),e.lazyLoad){let m=function(h,g,y){let b=[Zt,...h],T=g.data,S={cache:g.cache??rf,childrenLoading:!1,childrenAvailable:!0,totalCount:g.totalCount??T.length,totalCountUnfiltered:g.totalCount??T.length,children:T,error:g.error},C=[];if(i.lazyLoadBatchSize&&!y){let w=p.get(b),v=!w,I=Zc({children:!0},w||{},S);v&&(I.chidren=[]),I.children.length=I.totalCount;let x=i.lazyLoadStartIndex??0,P=Math.min(g.totalCount??T.length,x+i.lazyLoadBatchSize);for(let E=x;E<P;E++){let _=S.children[E-x];if(!_)throw`lazily loaded item not found at index ${E-x}`;I.children[E]=_,_.dataset&&C.push({keys:_.keys,dataset:_.dataset})}v&&p.set(b,I)}else S.children.forEach(w=>{w&&w.dataset&&C.push({keys:w.keys,dataset:w.dataset})}),S.children.length=S.totalCount,p.set(b,S);let R=!1;if(!h||!h.length){let w=p.get([Zt]);t.originalDataArray=[...w.children],R=!0}if(R||(t.originalLazyGroupDataChangeDetect=yt()),C.length){let w=h;C.forEach(({keys:v,dataset:I})=>{m(v,I,w)})}};var d=m;let p=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],f)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function sf(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(ll(o,e)||[]).map(n=>{let r={...n};return delete r.valueGetter,r})}function af(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function cf(o){let{getComponentState:e,componentActions:t,componentState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:f,filterMode:p,livePagination:m,livePaginationCursor:h,filterTypes:g,cursorId:y}=n,[b,T]=Ib({vertical:!1,horizontal:!1}),S=ai(b);Yn(()=>(a.onChange(x=>{x&&(S.current=x,T(x))}),()=>a.destroy()),[a]),Yn(()=>{if(!m)return;let x=requestAnimationFrame(()=>{S.current?.vertical||h&&(t.cursorId=h)});return()=>cancelAnimationFrame(x)},[h]),Yn(()=>{if(!m||h!==void 0)return;let x=requestAnimationFrame(()=>{S.current?.vertical||y!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(x)},[i.length,h]),Yn(()=>{let x=e(),{livePaginationCursor:P,livePagination:E,dataArray:_}=x;!b.vertical&&E&&(P?t.cursorId=P:P===void 0&&_.length&&(t.cursorId=_.length))},[b.vertical]);let C=lf(()=>sf(f,{filterTypes:g,filterMode:p}),[f,p,g]),R={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?C:null,cursorId:m?y:null},w=ai(!0);Ab(o,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:f,refetchKey:l,cursorId:m?y:null});let v=Me(Oe()),I=ai([]);jn(()=>{let x=e(),P=v(),{isDetail:E,isDetailReady:_}=af(P,e);if(E&&!_)return;let A=Date.now(),F=I.current;F.length>=10&&F.splice(0,1),F.push(A),A-F[0]<200&&F.length>=10&&No({debugId:x.debugId,key:"DS001"}),typeof x.data!="function"&&Tn(x.data,x,t,void 0,P)},{data:r}),jn(x=>{let P=Object.keys(x),E=!1;if(P.length===1){if(E=!!x.cursorId,x.filterValue&&e().filterMode==="local")return;let M=e().data;if(Array.isArray(M)&&x.refetchKey){t.originalDataArray=M;return}}let _=v(),{isDetail:A,isDetailReady:F}=af(_,e);if(A&&!F)return;let D=e();typeof D.data=="function"&&Tn(D.data,D,t,{append:E},_)},{...R,data:r}),jn(()=>{let x=e();if(w.current){w.current=!1;let P=zt(x,void 0,v());t.dataParams=P}},R)}function Ab(o,e){let{getComponentState:t,componentActions:n,componentState:r}=o;Yn(()=>{n.lazyLoadCacheOfLoadedBatches=new q},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,f=ai(null),p=(h,g,y=t().lazyLoadCacheOfLoadedBatches)=>{let b=t();if(h=h||f.current,!h)return;let{renderStartIndex:T,renderEndIndex:S}=h,{lazyLoadBatchSize:C,lazyLoad:R}=b;R&&((!C||C<=0)&&(!b.groupBy||b.groupBy.length===0)||Eb({startIndex:T,endIndex:S,lazyLoadBatchSize:C,componentState:b,componentActions:n,dismissLoadedRows:g?.dismissLoadedRows??!1},y))},m=lf(()=>xt(p,{wait:d}),[d]);jn(h=>{if(a)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),p(s.get(),{dismissLoadedRows:!0})):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&p(s.get()),s.onChange(g=>{f.current=g,p(g)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:u}),Yn(()=>{i&&i>0&&m()},[c])}function Eb(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,c=l?()=>!1:h=>s[h].data!=null,u=!l,d=new q,f=["_______xxx______"];for(let h=t;h<=n;h++){let g=s[h];if(!g)continue;let y=c(h),b=g.dataSourceHasGrouping&&g.groupKeys?[...g.groupKeys]:[];g.isGroupRow&&g.dataSourceHasGrouping&&g.groupKeys&&b.pop();let T=b.length?b:f,S=g.dataSourceHasGrouping?g.indexInGroup:g.indexInAll;if(g.isGroupRow&&!g.collapsed&&!g.childrenAvailable){let C={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:g.groupKeys,append:u},R=g.groupKeys,w=d.get(R);if(!w?.[g.id]){let v=!w;w=w||{},w[g.id]||(w[g.id]=C),v&&d.set(R,w)}}if(!y&&r!=null){let C=d.get(T),R=Math.floor(S/r)*r,w=S-R,v=s[g.indexInAll-w].indexInAll,I=c(v),x=s[v].id;if(I||C?.[x])continue;let P=!C;C=C||{};let E={lazyLoadStartIndex:R,lazyLoadBatchSize:r,groupKeys:b,append:u};C[x]||(C[x]=E),P&&d.set(T,C)}}let p=Promise.resolve(!0),m=[];d.topDownValues().forEach(h=>{m.push(...Object.values(h))}),m.reduce((h,g)=>{let y=[...g.groupKeys,g.lazyLoadStartIndex];if(e&&e.has(y))return h;e?.set(y,!0);let b=[i.data,i,a,g];return h.then(()=>xb()).then(()=>Tn(...b))},p)}var Mb=Object.freeze([]),uf=(o,e)=>{let t=o??Mb,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 _b=Symbol("cursorId"),df=o=>o.totalLeafNodesCount===0,Fb=o=>o.isParentNode?!df(o):!0;function ff(o){let e=Date.now(),t=[],n=[],r=new q;return{logger:rt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,indexer:new Qr,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new q,waitForNodePathPromises:new q,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new q,dataParams:void 0,onCleanup:fe(),notifyScrollbarsChange:fe(),notifyScrollStop:fe(),notifyRenderRangeChange:fe(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:_b,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt: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 Ob(o){let e={...o};return delete e.originalDataArray,e}var Nb=[],pf=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.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear()},mf=(o,e)=>({onDataParamsChange:t=>t?jd(t,100,Ob):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??df,isNodeSelectable:t=>t??Fb,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({...un,...t}),sortTypes:t=>({...Oo,...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 st)return t;let n=o.propsCache.get("rowDisabledState")??bt,r=n.get(t);return r||(r=new st(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=>uf(t,o.propsCache.get("sortInfo")),groupBy:t=>t??Nb});function Lb(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}var bt=new WeakMap;function zb(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 kb={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function ef(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.
25
25
 
26
26
 
27
- `);let o=Wo(t);if(n instanceof Be)return n.setConfigFn(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??zC,i=Tt.get(r);return i&&i.setConfigFn(o),i=i??new Be(r,o),Tt.set(r,i),i}function mp(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=Tn(e.sortInfo),a=Tn(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((E,F)=>{let v=l[F].operators;E[F]=E[F]||{};let M=E[F];return v.forEach(N=>{M[N.name]=N}),E},{}),u=e,c=e.selectionMode;if(c===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)c="multi-cell";else{let E=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(E!==void 0&&(E&&typeof E=="object"?c="multi-row":c="single-row"),!c){let F=u.treeSelection??u.defaultTreeSelection;F!==void 0&&(c=typeof F=="object"?"multi-row":"single-row")}c=c??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(c!==!1&&(c==="single-row"||c==="multi-row")&&(f===null?d=c==="single-row"?null:new Se({selectedRows:[],deselectedRows:[],defaultSelection:!1},Xe(t)):c==="single-row"||f instanceof Se?d=f:d=new Se(f,Xe(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new Ve;else if(m instanceof Ve)p=m;else{let E=Tt.get(m)??new Ve(m);Tt.set(m,E),p=E}let h=t.primaryKey,g=typeof h=="function"?E=>h(E):E=>E[h],y=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(y&&!(y instanceof Ze)){let E=Tt.get(y)??new Ze(y);Tt.set(y,E),y=E}y=y||new Ze({defaultExpanded:!0,collapsedPaths:[]});let C=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(C&&!(C instanceof st)){let E=Tt.get(C)??new st(C);Tt.set(C,E),C=E}C=C||new st(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=VC(e.shouldReloadData||{}),b=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,I=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&Bo('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&Bo('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&Bo('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let R=typeof e.data=="function"?b??"local":"local",w=e.sortFunction?"local":T??(i?"remote":"local"),P=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":I??(typeof e.data=="function"?"remote":"local"),x=S.pivotBy?"remote":"local",D=t.rowDisabledState,A=e.isRowDisabled;if(!A&&D){let E=Tt.get(D);E?A=E:(A=F=>D.isRowDisabled(F.id),Tt.set(D,A))}let _={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:C,treeExpandState:y,treeExpandMode:y.mode,shouldReloadData:{filterValue:S?.filterValue??P==="remote",sortInfo:S?.sortInfo??w==="remote",groupBy:S?.groupBy??R==="remote",pivotBy:S?.pivotBy??x==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:p,groupMode:R,sortMode:w,filterMode:P,pivotMode:x,toPrimaryKey:g,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let E=!o||o.originalDataArray!==t.originalDataArray,F=typeof e.livePaginationCursor=="function"?E?LC(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;_.livePaginationCursor=F}if(t.devToolsDetected&&t.debugId){let E=Vt.get(t.debugId);E&&(_={..._,...E})}return _}var GC=rt("DataSource:fullLazyLoad");function hp(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&GC('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new st({collapsedRows:!0,expandedRows:[]})))}function gp(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,{selectionMode:"single-row"}]}:{callbackParams:[n.getState(),{selectionMode:"multi-row",lastUpdatedNodePath:e.lastSelectionUpdatedNodePathRef.current,dataSourceApi:e.__apiRef.current}]},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof Ve?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function yp(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ve(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ve(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ve(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ve(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>$t(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(rt(kt(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function Cp(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}import Tp,{useCallback as KC,useEffect as Sp,useLayoutEffect as bp,useState as HC}from"react";function Vn(n){let e=Le(),t=_e(e),o=!!e,r=o?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=Rp(n),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=_e(s),[d]=HC(()=>Xd({getState:c,actions:l})),p={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:c,assignState:u,api:d},f=_e(i),m=_e(p),h=un(),g=KC(({children:y})=>(typeof y=="function"&&(y=y(c())),Tp.createElement(a.Provider,{key:r,value:f()},Tp.createElement(h.Provider,{value:m()},y))),[a,o,r]);return bp(()=>{e&&e.registerDetail(p)},[]),bp(()=>()=>{let y=c();y.onCleanup(y)},[]),sp({componentState:s,componentActions:l,getComponentState:c}),Sp(()=>{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]),Sp(()=>{s.onReady?.(d)},[]),{DataSource:g,state:p.componentState}}var mt=class extends jo{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var sl=class{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??sl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}},zn=sl;zn.DEFAULT_SIZE=10;var ul=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},li=class{constructor(e){this.storage=new zn(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)}},cl=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)}},Gn=class{constructor(e){this.cacheStorage=e===!1?new ul:e===!0?new cl:typeof e=="number"?new li(e):new li(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 BC=(e=>(e.INIT="INIT",e))(BC||{});var{useManagedComponent:Rp}=Et({debugName:"DataSource",initSetupState:dp,forwardProps:fp,concludeReducer:Jd,mapPropsToState:mp,onPropChange:hp,cleanup:pp,interceptActions:yp(),mappedCallbacks:gp()});function t1(n){let{DataSource:e}=Vn(n);return Ip.createElement(e,null,n.children??null)}function o1(){let{rowInfoReducerResults:n}=Po();return n}function n1(){let n=Le();if(n)return n.masterRowInfo}function dl(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(f,m){let h=l[u+f*m],g=a.get(h);if(g&&g.renderMenuIcon!==!1)return h}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(o.columnMenuVisibleForColumnId=p),p}function pl(n){if(n==null)return!1;let e=n;return!0}function si(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function fl(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function wp(n,e,t){if(fl(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/o),p=Math.floor(u/o),f=l%o,m=u%o,h=Math.min(f,m),g=Math.max(f,m),y=[];for(let C=d;C<=p;C++)for(let S=h;S<=g;S++){let b=C*o+S;if(C===d)for(let T=s;T<r;T++)y.push({rowIndex:b,colIndex:T});else if(C===p)for(let T=0;T<=c;T++)y.push({rowIndex:b,colIndex:T});else for(let T=0;T<r;T++)y.push({rowIndex:b,colIndex:T})}return y}function kC(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var ml=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Qt(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ve(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,h=Qt(l,this.getDataSourceState),g=Qt(u,this.getDataSourceState);if(!h||!g)return;let y=h.indexInAll,C=g.indexInAll,[S,b]=si({rowIndex:y,colIndex:f},{rowIndex:C,colIndex:m});for(let T=S.rowIndex;T<=b.rowIndex;T++)for(let I=S.colIndex;I<=b.colIndex;I++){let R={rowIndex:T,colIndex:I},[w,P]=this.getCellSelectionPosition(R);o?a.selectCell(w,P):a.deselectCell(w,P)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=Jr(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=kC(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ve(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ve(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ve:new Ve(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ve(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new Ve(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new Ve(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Pp(n){return new ml(n)}function xp(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new mt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new mt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(i){let a=t().isRowDetailExpanded;if(!a)return!0;let l=e.getRowInfoByPrimaryKey(i);return l?!a(l):!0},isRowDetailEnabledForRow(i){let{isRowDetailEnabled:a}=t();if(!a)return!1;if(typeof a=="function"){let l=e.getRowInfoByPrimaryKey(i);return l?a(l):!1}return!0},isRowDetailExpanded(i){return!r.isRowDetailCollapsed(i)},collapseRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new mt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new mt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function eo(n,e,t){return Math.min(Math.max(n,e),t)}function ui(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return eo(a,r,i)}function WC(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,u=s.length,c=t(),{brain:d}=c,{activeRowIndex:p}=c;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),h=p,g=m-f-1,y=0,C=u-1,S={ArrowDown:()=>{p=ui(o,p,1)},ArrowUp:()=>{p=ui(o,p,-1)},ArrowLeft:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p-I>=y?p=p-I:S.ArrowUp();return}return T&&T.isGroupRow?i.collapseGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p+I<=C?p=p+I:S.ArrowDown();return}return T&&T.isGroupRow?i.expandGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=s[p];return T&&T.isGroupRow?i.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{p=Math.min(p+g,u-1)},PageUp:()=>{p=Math.max(p-g,y)},End:()=>{p=C},Home:()=>{p=y}},b=S[l];return b?(b(),h!==p?(r.activeRowIndex=p,!0):!1):!1}function hl(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,u=i().dataArray,c=o(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[h,g],end:[y,C]}=p.getRenderRange(),S=y-h-1,b=C-g-1,T=i().dataArray.length-1,I=r().computedVisibleColumns.length-1,R=0,w=0;f=eo(f,0,T),m=eo(m,0,I);let P={ArrowDown:()=>{f=eo(f+1,R,T)},ArrowUp:()=>{f=eo(f-1,R,T)},ArrowLeft:()=>{if(m===w)if(f!==R&&(m=I),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f-D>=R?f=f-D:P.ArrowUp()}else P.ArrowUp();else m=eo(m-1,w,I)},ArrowRight:()=>{if(m===I)if(f!==T&&(m=w),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f+D<=T?f=f+D:P.ArrowDown()}else P.ArrowDown();else m=eo(m+1,w,I)},Enter:()=>{let D=u[f];return D&&D.isGroupRow?t.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&t.rowDetailApi.isRowDetailEnabledForRow(D.id)?t.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{s?m=Math.min(m+b,I):f=Math.min(f+S,T)},PageUp:()=>{s?m=Math.max(m-b,w):f=Math.max(f-S,R)},End:()=>{s?m=I:f=T},Home:()=>{s?m=w:f=R}},x=P[l];return x?(x(),[f,m]):!1}function jC(n,e){let t=hl(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var $C={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Dp(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!$C[t]?!1:i!=null&&l==="row"?WC(n,e):a!=null&&l==="cell"?jC(n,e):!1}var gl=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=ui(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=hl(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function vp(n){return new gl(n)}function Ap(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var yl=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...lt({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;o.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),u;try{u=await s(a)}catch(d){u=d}let c=u instanceof Error?u:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...lt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(lt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>qe(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),u=l.get(r),c=i.getRowInfoByIndex(s),d=c?.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",h=Vo({column:u,rowInfo:c,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new st(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),o=new st(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[Zt,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||bo(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=q.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Ct())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let h=i.computedVisibleColumnsMap.get(t);if(!h)return!1;a=h.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let h=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=h||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(o.offset||0),m=u.scrollTop>p+(o.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=jd({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=vp({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=xp({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Pp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(dl(t),e?.()),setTimeout(()=>{this.isDestroyed()||(dl(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Kc({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(lt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=i.groupByForColumn,s=i.field,u=l?Array.isArray(l)?l:[l]:[],c=u.map(f=>f.valueGetter?m=>f.valueGetter({data:m,field:f.field}):f.field?f.field:f.groupField??void 0).filter(pl);c.length&&(s=c);let d=i.computedSortType;u.length&&d===No&&(d=u.flatMap(m=>{let h=m.field??m.groupField,g=h?r.get(h):null;return g?g.computedSortType:No}));let p={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(p.valueGetter=f=>i.valueGetter({data:f,field:i.field})),this.setSortInfoForColumn(e,p,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Ap(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:Ap(d,l)?(u=!0,t):d),u||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;o.computedFilterValue?(c={...o.computedFilterValue,filter:{...o.computedFilterValue.filter,operator:u}},s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:o.valueGetter},o.field&&(c.field=o.field)),c.id=o.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],u=o.filterTypes[l];if(i=!0,!u)return null;let c=a.filter.operator??u?.defaultOperator,p=s[c].defaultFilterValue??(u.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:c,value:p}}}return a}).filter(pl),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current.scrollLeft=Math.max(e,0)}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current.scrollTop=Math.max(e,0)}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=o.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&(o.scrollerDOMRef.current.scrollTop=s.scrollTop),c&&(o.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),u=o.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(o.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Ep(n){return new yl(n)}import{useEffect as Mp,useRef as UC,useState as YC}from"react";var qC=10;function XC(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${go} > .${Va}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${Co}`);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(...It.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let h=Ee().getComputedStyle(c);s[p]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+qC}if(m+=s[p],d){let h=0;c.childNodes.forEach(g=>{if(g!==u){let y=g,C=Math.max(y.offsetWidth,parseInt(y.style.width,10));if(isNaN(C)&&(C=0),h+=C,C>0){let S=Ee().getComputedStyle(y);h+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=h}r&&r.has(p)||o&&!o.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function _p(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=Ke(),[a,l]=YC(0),s=typeof r=="object"?r.key:r,u=_e(s),c=UC(null);Mp(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),Mp(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let h=XC(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),g=Object.keys(h);if(!g.length)return;let y=n().columnSizing,C={...y},S=!1;g.forEach(b=>{C[b]={width:h[b]},S=S||C[b].width!==y[b]?.width}),S&&(e.columnSizing=C)},[s,o,a])}import{useMemo as rT}from"react";import{useCallback as iT,useEffect as Uo,useRef as aT}from"react";import*as ci from"react";function Fp(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return Tr(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}import*as Kn from"react";var Op=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as Np,useRef as ZC}from"react";function QC(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function JC(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=Cp(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function eT(n,e){let t=ZC(!1);return{currentRowCache:Np(()=>({getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)}),[e,n]),cacheCalledByRowDetailRenderer:t}}function Lp(n){let{rowDetailsCache:e,rowInfo:t}=n,{getState:o,componentActions:r}=Ie(),{getState:i}=X(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=eT(t.id,e),s=Np(()=>{let u=o().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:Ye(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}QC(t.id,{masterState:o(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&JC(t.id,{detailState:d.getState(),masterActions:r,masterState:o(),cacheEntryForRow:p})})}),shouldRestoreState:u}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:tT}=De,oT=`${tT}RowDetail`;function nT(n){let e=tr(),{domRef:t,rowDetailRenderer:o,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=n,{masterDetailContextValue:s,currentRowCache:u}=Lp({rowDetailsCache:l,rowInfo:i});return Kn.createElement(e.Provider,{value:s},Kn.createElement("div",{ref:t,className:J(oT,Op({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${U.bodyWidth} - ${U.scrollbarWidthVertical})`,height:r}},o(i,u)))}var Vp=Kn.memo(nT);var lT=1;function zp(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,state:i,getState:a}=X(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedColumnsMap:c,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:h,columnSize:g}=e,{componentState:y,getState:C,componentActions:S,api:b}=Ie(),{dataArray:T,isNodeReadOnly:I}=y,R=_e(T),{rowHeight:w,rowDetailHeight:P,onRowMouseEnter:x,onRowMouseLeave:D,groupRenderStrategy:A,brain:_,showZebraRows:E,rowDetailRenderer:F,isRowDetailExpanded:v,isRowDetailEnabled:M,cellClassName:N,cellStyle:G,rowStyle:$,rowDetailCache:te,rowClassName:he,onScrollToTop:ue,onScrollToBottom:z,onScrollStop:k,scrollToBottomOffset:ae,wrapRowsHorizontally:oe,ready:W}=i,V=y.updatedAt;Fp({columnSize:g,brain:_,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedRowHeight:d,dataArray:T,bodySize:t,rowspan:m});let L=aT(0);Uo(()=>_.onRenderCountChange(()=>{L.current=_.scrollTopMax}),[_]),Uo(()=>_.onRenderRangeChange(Q=>{a().onRenderRangeChange?.(Q)}),[_]),Uo(()=>_.onScrollStop(Q=>{let{scrollTop:O,scrollLeft:be}=Q;if(O===0&&ue?.(),O+(ae??lT)>=L.current){z?.();let{livePagination:ee,livePaginationCursor:ce,dataArray:xe}=C();ee&&(S.cursorId=ce!==void 0?Date.now():xe.length)}if(k){let ee=_.getRenderRange();k({scrollTop:O,scrollLeft:be,renderRange:ee,viewportSize:a().bodySize,firstVisibleRowIndex:ee.start[0],lastVisibleRowIndex:ee.end[0],firstVisibleColIndex:ee.start[1],lastVisibleColIndex:ee.end[1]})}}),[_,ue,z,k]),Uo(()=>{t.height&&(r.ready=!0)},[!!t.height]),Uo(()=>{let{onReady:Q}=a();Q&&Q({api:o,dataSourceApi:b})},[W]);let[,Z]=Rt();Uo(()=>{Z()},[y]);let j=iT(Q=>{let{rowIndex:O,colIndex:be,heightWithRowspan:Te,domRef:B,hidden:ee,width:ce,onMouseLeave:xe,onMouseEnter:we}=Q,Ae=R()[O],He=u[be];if(!Ae)return null;let Ue=p?p.getRowHeight(O):Te,ke=!1;!M||typeof M=="function"&&!M(Ae)?ke=!1:v&&(ke=v(Ae)?"expanded":"collapsed");let nt=oe?_.getRowIndexInPage(O):null,Qe=oe?_.getPageIndexForRow(O):null;return ci.createElement($c,{...{getData:R,virtualized:!0,showZebraRows:E,groupRenderStrategy:A,rowIndexInHorizontalLayoutPage:nt,horizontalLayoutPageIndex:Qe,rowIndex:O,rowInfo:Ae,hidden:ee,toggleGroupRow:h,rowHeight:Ue,rowDetailState:ke,onMouseEnter:we,onMouseLeave:xe,onRowMouseEnter:x,onRowMouseLeave:D,domRef:B,width:ce,column:He,columnsMap:c,fieldsToColumn:f,rowStyle:$,rowClassName:he,cellStyle:G,cellClassName:N}})},[w,P,x,D,p,d,v,R,u,c,f,A,oe,h,E,_,V,I,$,he,N,G]),se=rT(()=>{if(v)return Q=>{let{rowIndex:O,domRef:be}=Q,B=R()[O];if(!B||!v(B)||!p)return ci.createElement("div",{ref:be,className:hu.hidden});let{rowDetailHeight:ee,rowHeight:ce}=p.getSize(O);return ci.createElement(Vp,{rowInfo:B,rowDetailsCache:te,rowIndex:O,domRef:be,detailOffset:ce,rowDetailHeight:ee,rowDetailRenderer:F})}},[W,j,F,P,v,te]);return{renderCell:j,renderDetailRow:se}}import{useEffect as DT,useState as Rl}from"react";var di=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!fl(e,t,r)){wp(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=si(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let u=i.rowIndex;u<=a.rowIndex;u++)for(let c=i.colIndex;c<=a.colIndex;c++){let d=this.getCellSelectionPosition({rowIndex:u,colIndex:c});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function Gp(n,e){return n<e?[n,e]:[e,n]}var pi=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[o,r]=Gp(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[o,r]=Gp(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let o;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))o=r;else break}this.multiSelectEndIndex=o}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};import{useMemo as sT}from"react";function Kp(n){let{getState:e}=Ie();return sT(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=n[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}import{useCallback as uT}from"react";var HL=rt("useColumnSizeFn");function Hp(n){return uT(t=>{let o=n[t];return o?o.computedWidth:0},[n])}import{useEffect as Yo,useLayoutEffect as fT,useMemo as mT}from"react";import{createRef as Ro}from"react";var cT={scrollLeft:0,scrollTop:0},Hn=class{constructor(){this.scrollPosition=cT;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};function Bp(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as kp from"react";function Wp(n){return(e,t)=>kp.createElement(n,{key:e.id,rowInfo:e,cache:t})}var Bn=class extends lo{constructor(t,o){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=ar(u,c.concat(c)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.availableWidth,p=c&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof o=="number",m=typeof r=="number",h=f&&o!==this.initialRows,g=m&&r!==this.initialCols;f&&h&&(this.initialRows=o,this.rows=o),m&&g&&(this.initialCols=r,this.cols=r);let y=i!=null,C=a!=null,S=y&&i!==this.rowHeight,b=C&&a!==this.initialColWidth;y&&(this.rowHeight=i),C&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||S||p,I=g||b||d||T;(I||T)&&this.updateRenderCount({horizontal:I,vertical:T})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=At){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{ve(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var jp={};function Cl(n){return`.${ho}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function Tl(n,e){let t=kt(n),o=e?new Bn(t,{isHeader:!1}):new lo(t),r=e?new Bn(t,{isHeader:!0,masterBrain:o}):new lo(t);o.onScroll(l=>{r.setScrollPosition({scrollLeft:l.scrollLeft,scrollTop:0})});let{renderer:i,onRenderUpdater:a}=pr(o);return o.onAvailableSizeChange(l=>{r.update({width:l.width})}),{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a}}function $p({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a}=Tl(n,!!e),l=Ro();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:s=>{if(!l.current)return null;let u=Cl(s);return l.current.querySelector(u)||null},brain:o,headerBrain:r,domRef:l,columnMenuTargetRef:Ro(),editingValueRef:Ro(),scrollerDOMRef:Ro(),portalDOMRef:Ro(),focusDetectDOMRef:Ro(),activeCellIndicatorDOMRef:Ro(),onColumnMenuClick:pe(),cellContextMenu:pe(),contextMenu:pe(),onFilterOperatorMenuClick:pe(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:pe(),onRowHeightCSSVarChange:pe(),onRowDetailHeightCSSVarChange:pe(),onColumnHeaderHeightCSSVarChange:pe(),cellClick:pe(),cellMouseDown:pe(),keyDown:pe(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new Hn,pinnedEndScrollListener:new Hn,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Up=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new Gn(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??jp,columnGroupVisibility:e=>e??jp,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 dT(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Yp=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.onRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function qp(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var fi=new WeakMap;function Xp(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Zp=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=o?.pivotColumnGroups?Bp(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=dT({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let g=fi.get(d);g||(g=Wp(d),fi.set(d,g)),c=g}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof mt)&&(u=new mt(u)),u=u||new mt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=fi.get(u),f||(f=g=>u.isRowDetailsExpanded(g.id),typeof u=="object"&&fi.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1,h={isTree:r.isTree,rowDetailRenderer:c,rowDetailState:u,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||le.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let g=Lt.get(t.debugId);g&&(h={...h,...g})}return h};function Qp(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function Jp(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===s-1))break}return Object.keys(o).forEach(d=>{let p=o[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import{useCallback as pT}from"react";function Sl(){let{getState:n,componentActions:e,getDataSourceMasterContext:t}=Ie();return pT(r=>{let i=n(),a=new st(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Zt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||bo(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=q.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Ct())}},[])}function hT(n){return mT(()=>qp(n),[n])}function ef(){let{componentState:{groupBy:n},componentActions:e}=Ie(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:o,pivotGrandTotalColumnPosition:r}}=Ke();Yo(()=>{e.generateGroupRows=t!=="inline"},[t]),Yo(()=>{e.pivotTotalColumnPosition=o},[o]),Yo(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=hT(n);gT(i);let{toggleGroupRow:a}=yT();return CT(i),{toggleGroupRow:a}}function gT(n){let e=Sl(),{componentActions:t,componentState:{columns:o,groupRenderStrategy:r,isTree:i}}=Ke();function a(l,s,u,c){let d={};if(u==="inline")return Object.keys(l).forEach(p=>{let f=l[p],m={},h=s.get(f.field);if(h&&u==="inline"){let{groupIndex:y}=h;m={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:C})=>C.isGroupRow?C.groupKeys?.[y]:C.value,rowspan:({rowInfo:C,dataArray:S})=>{if(C.isTreeNode||!C.isGroupRow)return 1;let b=S[C.indexInAll-1]||{indexInParentGroups:[]};if(!b||!b.dataSourceHasGrouping)return 1;let T=b.indexInParentGroups||[],I=C.indexInParentGroups||[],R=!1;for(let x=0;x<=y;x++){let D=T[x];if(I[x]!==D){R=!0;break}}if(!R)return 1;let w=C.parents[y];return w?w.groupCount-(w.collapsedChildrenCount||0)+(w.collapsedGroupsCount||0):1},renderGroupIcon:zr({groupIndexForColumn:y,groupRenderStrategy:u,toggleGroupRow:c,initialRenderGroupIcon:f.renderGroupIcon}),render:Vr({groupIndexForColumn:y,groupRenderStrategy:u})}}let g={...m,...f};d[p]=g}),Object.keys(d).length===0?void 0:d}Yo(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(o,n,r,e)})()},[o,n,r,e])}function yT(){let{componentState:{groupBy:n,pivotBy:e,selectionMode:t}}=Ie(),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=Ke(),f=Sl();return Yo(()=>{(()=>{let{columns:h,groupColumnIds:g}=TT({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});o.columnsWhenGrouping=h;let y=p().columnOrder;if(g.length&&Array.isArray(y)){let C=new Set(y),S=!1;g.forEach(b=>{C.has(b)||(S=!0,y=[b,...y])}),S&&(o.columnOrder=y)}})()},[r,n,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function CT(n){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:o,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=Ie(),{getComponentState:l,componentActions:s,componentState:{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=Ke();fT(()=>{if(f!=="multi-column")return;let m=l(),h=Qp(c,n),g=Jp({computedGroupColumns:h,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:o,groupByMap:n});$t(m.columnVisibility,g)||(s.columnVisibility=g)},[a,f,i,o,n,c,p?e:null,p?r:null,p?t:null,p]),Yo(()=>{let m=o.length>0,h=l(),{columnVisibility:g,columnVisibilityForGrouping:y,hideColumnWhenGrouped:C}=h,S={...g},b={...y},T=!1,I=new Set,R=new Set;Object.keys(c).forEach(w=>{let P=c[w];if(P.defaultHiddenWhenGroupedBy||C!=null)if(P.defaultHiddenWhenGroupedBy==="*"&&m||(P.defaultHiddenWhenGroupedBy===!0||C)&&P.field&&n.get(P.field)||typeof P.defaultHiddenWhenGroupedBy=="string"&&n.get(P.defaultHiddenWhenGroupedBy)||typeof P.defaultHiddenWhenGroupedBy=="object"&&Object.keys(P.defaultHiddenWhenGroupedBy).reduce((D,A)=>D||n.has(A),!1)){if(b[w]!==!1){if(g[w]===!1)return;b[w]=!1,T=!0,I.add(w)}}else b[w]===!1&&(delete b[w],T=!0,R.add(w))}),T&&(s.columnVisibilityForGrouping=b,R.forEach(w=>{delete S[w]}),I.forEach(w=>{S[w]=!1}),s.columnVisibility=S)},[c,u,o,n,d])}function TT(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=n;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,h,g)=>{let y=Nc({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:h,groupCount:g.length,groupRenderStrategy:u,selectionMode:r},c,i),C=y.id||`group-by-${m.field||m.groupField}`;f.push(C),p[C]=y});else if(u==="single-column"&&t.length){let m=Lc({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:u,selectionMode:r},c,i),h=m.id||"group-by";f.push(h),p[h]=m}if(e){let m={};Object.keys(d).forEach(h=>{let g=d[h];g.field&&(m[g.field]=g)}),Object.keys(e).forEach(h=>{let g=e[h],y=g.pivotTotalColumn&&g.columnGroup,C=g.pivotTotalColumn&&!g.columnGroup;if(y&&a===!1||C&&l===!1)return;let S={...g};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:o,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=b=>S.renderValue(b)),p[h]=S})}else Object.keys(d).forEach(m=>{let h=d[m];p[m]=h});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}import{useMemo as ST}from"react";var tf=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:u,columnDefaultDraggable:c,sortInfo:d,multiSort:p,filterValue:f,filterTypes:m,columnOrder:h,columnPinning:g,editable:y,columnDefaultEditable:C,columnDefaultFilterable:S,columnDefaultSortable:b,scrollbarWidth:T,columnTypes:I,pinnedEndMaxWidth:R,pinnedStartMaxWidth:w,viewportReservedWidth:P,resizableColumns:x,columnVisibility:D,columnVisibilityAssumeVisible:A,columnSizing:_})=>{let{computedRemainingSpace:F,computedColumnOrder:v,computedVisibleColumns:M,computedVisibleColumnsMap:N,computedPinnedStartColumns:G,computedPinnedEndColumns:$,computedUnpinnedColumns:te,computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ue,computedUnpinnedColumnsWidth:z,computedUnpinnedOffset:k,computedPinnedEndOffset:ae,computedPinnedEndWidth:oe,computedPinnedStartWidth:W,renderSelectionCheckBox:V,computedColumnsMap:L,computedColumnsMapInInitialOrder:Z,fieldsToColumn:j}=ST(()=>Ju({columns:n,scrollbarWidth:T,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:P,resizableColumns:x,filterValue:f,filterTypes:m,sortable:a,sortInfo:d,multiSort:p,pinnedEndMaxWidth:R,pinnedStartMaxWidth:w,draggableColumns:u,columnDefaultDraggable:c,columnOrder:h,columnPinning:g,columnDefaultEditable:C,columnDefaultFilterable:S,columnDefaultSortable:b,editable:y,columnSizing:_,columnTypes:I,columnVisibility:D,columnVisibilityAssumeVisible:A??!0}),[n,e.width,t,o,r,P,T,a,d,p,f,m,h,D,A,c,u,x,R,w,_,I,g,C,S,y,1]);return{renderSelectionCheckBox:V,columns:n,computedColumnsMap:L,computedPinnedEndWidth:oe,computedPinnedStartWidth:W,computedRemainingSpace:F,computedUnpinnedOffset:k,computedPinnedEndOffset:ae,computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ue,computedUnpinnedColumnsWidth:z,computedPinnedStartColumns:G,computedPinnedEndColumns:$,computedUnpinnedColumns:te,computedVisibleColumns:M,computedVisibleColumnsMap:N,computedColumnOrder:v,computedColumnsMapInInitialOrder:Z,fieldsToColumn:j}};import{useMemo as bT}from"react";var bl=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function RT(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?o(d):0;return e&&e.rowHeight.set(c,p),p}:o;let l=typeof o=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function of(n){return bT(()=>{let e=new bl;return{computedRowHeight:RT(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}},[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}import{useState as IT,useEffect as wT,useLayoutEffect as PT}from"react";var xT={vertical:!1,horizontal:!1};function nf(n){let{getComponentState:e}=Ke(),{getState:t}=Ie(),[o,r]=IT(xT);return wT(()=>n.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=n;r({vertical:i>0,horizontal:a>0})}),[n]),PT(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function rf(){let{componentActions:n,componentState:e}=Ke(),{componentActions:t,componentState:o,getState:r,api:i}=Ie(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:u,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,columnTypes:f,rowHeight:m,rowDetailHeight:h,isRowDetailExpanded:g,isRowDetailEnabled:y,brain:C,bodySize:S,showSeparatePivotColumnForSingleAggregation:b}=e;Rl(()=>{e.onRowHeightCSSVarChange.onChange(B=>{B&&(n.rowHeight=B)}),e.onFlashingDurationCSSVarChange.onChange(B=>{let ee=B?B*1:null;ee!=null&&!isNaN(ee)&&(n.flashingDurationCSSVarValue=ee)}),e.onRowDetailHeightCSSVarChange.onChange(B=>{B&&(n.rowDetailHeight=B)}),e.onColumnHeaderHeightCSSVarChange.onChange(B=>{B&&(n.columnHeaderHeight=B)})}),DT(()=>{t.showSeparatePivotColumnForSingleAggregation=b},[b]);let{multiSort:T,filterValue:I,filterTypes:R}=o,{toggleGroupRow:w}=ef(),P=e.computedColumns,{computedColumnOrder:x,computedVisibleColumns:D,computedVisibleColumnsMap:A,computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:v,computedPinnedEndColumnsWidth:M,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:G,computedPinnedEndOffset:$,computedRemainingSpace:te,computedPinnedStartWidth:he,computedPinnedEndWidth:ue,renderSelectionCheckBox:z,computedColumnsMap:k,computedColumnsMapInInitialOrder:ae,fieldsToColumn:oe}=tf({columns:P,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:S,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:o.sortInfo??void 0,multiSort:T,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,filterValue:I,filterTypes:R,columnSizing:u,columnTypes:f}),W=Kp(D),V=Hp(D),L=nf(C),Z=he?v>he:!1,j=ue?M>ue:!1,[se]=Rl(()=>new pi({isRowDisabledAt:ee=>r().dataArray[ee]?.rowDisabled??!1,getIdForIndex:ee=>r().dataArray[ee]?.id??-1})),Q=_e(D),[O]=Rl(()=>new di({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:B=>Q()[B]?.id||""})),{computedRowHeight:be,computedRowSizeCacheForDetails:Te}=of({rowDetailHeight:h,rowHeight:m,isRowDetailsExpanded:g,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:se,multiCellSelector:O,computedRowSizeCacheForDetails:Te,computedRowHeight:be,scrollbars:L,columnSize:V,rowspan:W,toggleGroupRow:w,computedColumnsMap:k,computedColumnsMapInInitialOrder:ae,renderSelectionCheckBox:z,computedPinnedStartOverflow:Z,computedPinnedEndOverflow:j,computedPinnedStartWidth:he,computedPinnedEndWidth:ue,computedVisibleColumns:D,computedColumnOrder:x,computedRemainingSpace:te,computedVisibleColumnsMap:A,computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:v,computedPinnedEndColumnsWidth:M,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:G,computedPinnedEndOffset:$,fieldsToColumn:oe}}import{useMemo as OT}from"react";function vT(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function AT(){return 4294967295}function ET(n,e,t){return e=e>>>8^n[t^e&255],e}function MT(n){return n=~n,n=n<0?4294967295+n+1:n,n}function Il(n,e=3988292384){var t=vT(e),o=0,r;for(o=AT(),r=0;r<n.length;r++)o=ET(t,o,n.charCodeAt(r));return o=MT(o),`${o}`}var _T=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},af=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+4*2,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},lf=(n="",e,t)=>{let o;try{o=FT(n)}catch{return af(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(af([`
27
+ `);let n=$n(t);if(o instanceof Ze)return o.setConfigFn(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??kb,i=bt.get(r);return i&&i.setConfigFn(n),i=i??new Ze(r,n),bt.set(r,i),i}function hf(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=Co(e.sortInfo),a=Co(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((A,F)=>{let D=l[F].operators;A[F]=A[F]||{};let M=A[F];return D.forEach(N=>{M[N.name]=N}),A},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let A=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(A!==void 0&&(A&&typeof A=="object"?u="multi-row":u="single-row"),!u){let F=c.treeSelection??c.defaultTreeSelection;F!==void 0&&(u=typeof F=="object"?"multi-row":"single-row")}u=u??!1}let d=null,f=null,p=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(p===null?d=u==="single-row"?null:new we({selectedRows:[],deselectedRows:[],defaultSelection:!1},qe(t)):u==="single-row"||p instanceof we?d=p:d=new we(p,qe(t))),u==="single-cell"||u==="multi-cell"))if(m===null)f=u==="single-cell"?null:new Ne;else if(m instanceof Ne)f=m;else{let A=bt.get(m)??new Ne(m);bt.set(m,A),f=A}let h=t.primaryKey,g=typeof h=="function"?A=>h(A):A=>A[h],y=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(y&&!(y instanceof Xe)){let A=bt.get(y)??new Xe(y);bt.set(y,A),y=A}y=y||new Xe({defaultExpanded:!0,collapsedPaths:[]});let b=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(b&&!(b instanceof lt)){let A=bt.get(b)??new lt(b);bt.set(b,A),b=A}b=b||new lt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let T=zb(e.shouldReloadData||{}),S=e.groupMode??(T.groupBy!=null?T.groupBy?"remote":"local":void 0),C=e.sortMode??T.sortInfo!=null?T.sortInfo?"remote":"local":void 0,R=e.filterMode??T.filterValue!=null?T.filterValue?"remote":"local":void 0;e.groupMode&&Bn('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&Bn('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&Bn('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let w=typeof e.data=="function"?S??"local":"local",v=e.sortFunction?"local":C??(i?"remote":"local"),I=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":R??(typeof e.data=="function"?"remote":"local"),x=T.pivotBy?"remote":"local",P=t.rowDisabledState,E=e.isRowDisabled;if(!E&&P){let A=bt.get(P);A?E=A:(E=F=>P.isRowDisabled(F.id),bt.set(P,E))}let _={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:b,treeExpandState:y,treeExpandMode:y.mode,shouldReloadData:{filterValue:T?.filterValue??I==="remote",sortInfo:T?.sortInfo??v==="remote",groupBy:T?.groupBy??w==="remote",pivotBy:T?.pivotBy??x==="remote"},isRowDisabled:E,rowSelection:d,cellSelection:f,groupMode:w,sortMode:v,filterMode:I,pivotMode:x,toPrimaryKey:g,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let A=!n||n.originalDataArray!==t.originalDataArray,F=typeof e.livePaginationCursor=="function"?A?Lb(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;_.livePaginationCursor=F}if(t.devToolsDetected&&t.debugId){let A=Nt.get(t.debugId);A&&(_={..._,...A})}return _}var Vb=rt("DataSource:fullLazyLoad");function gf(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&Vb('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new lt({collapsedRows:!0,expandedRows:[]})))}function yf(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,{selectionMode:"single-row"}]}:{callbackParams:[o.getState(),{selectionMode:"multi-row",lastUpdatedNodePath:e.lastSelectionUpdatedNodePathRef.current,dataSourceApi:e.__apiRef.current}]},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 Ne?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function bf(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=zt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Pe(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=zt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Pe(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=zt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Pe(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=zt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Pe(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=zt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=zt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>$t(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(rt(Ht(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function Cf(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}import Tf,{useCallback as Gb,useEffect as Sf,useLayoutEffect as wf,useState as Kb}from"react";function zo(o){let e=Oe(),t=Me(e),n=!!e,r=n?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=Rf(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Me(s),[d]=Kb(()=>qd({getState:u,actions:l})),f={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:u,assignState:c,api:d},p=Me(i),m=Me(f),h=fo(),g=Gb(({children:y})=>(typeof y=="function"&&(y=y(u())),Tf.createElement(a.Provider,{key:r,value:p()},Tf.createElement(h.Provider,{value:m()},y))),[a,n,r]);return wf(()=>{e&&e.registerDetail(f)},[]),wf(()=>()=>{let y=u();y.onCleanup(y)},[]),cf({componentState:s,componentActions:l,getComponentState:u}),Sf(()=>{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]),Sf(()=>{s.onReady?.(d)},[]),{DataSource:g,state:f.componentState}}var pt=class extends Un{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)}};var si=class si{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??si.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}};si.DEFAULT_SIZE=10;var li=si;var cl=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},ci=class{constructor(e){this.storage=new li(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)}},ul=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)}},ko=class{constructor(e){this.cacheStorage=e===!1?new cl:e===!0?new ul:typeof e=="number"?new ci(e):new ci(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 Hb=(e=>(e.INIT="INIT",e))(Hb||{});var{useManagedComponent:Rf}=At({debugName:"DataSource",initSetupState:ff,forwardProps:mf,concludeReducer:Jd,mapPropsToState:hf,onPropChange:gf,cleanup:pf,interceptActions:bf(),mappedCallbacks:yf()});function tN(o){let{DataSource:e}=zo(o);return vf.createElement(e,null,o.children??null)}function nN(){let{rowInfoReducerResults:o}=vn();return o}function oN(){let o=Oe();if(o)return o.masterRowInfo}function dl(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(p,m){let h=l[c+p*m],g=a.get(h);if(g&&g.renderMenuIcon!==!1)return h}let c=l.indexOf(r),u=0,d=-1,f;for(;!f&&u<l.length&&(u++,f=s(u,d),f||(d*=-1,f=s(u,d)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function fl(o){if(o==null)return!1;let e=o;return!0}function ui(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function pl(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function If(o,e,t){if(pl(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/n),f=Math.floor(c/n),p=l%n,m=c%n,h=Math.min(p,m),g=Math.max(p,m),y=[];for(let b=d;b<=f;b++)for(let T=h;T<=g;T++){let S=b*n+T;if(b===d)for(let C=s;C<r;C++)y.push({rowIndex:S,colIndex:C});else if(b===f)for(let C=0;C<=u;C++)y.push({rowIndex:S,colIndex:C});else for(let C=0;C<r;C++)y.push({rowIndex:S,colIndex:C})}return y}function Bb(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var ml=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Qt(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 Ne(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),f=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!f)return;let p=d.computedVisibleIndex,m=f.computedVisibleIndex,h=Qt(l,this.getDataSourceState),g=Qt(c,this.getDataSourceState);if(!h||!g)return;let y=h.indexInAll,b=g.indexInAll,[T,S]=ui({rowIndex:y,colIndex:p},{rowIndex:b,colIndex:m});for(let C=T.rowIndex;C<=S.rowIndex;C++)for(let R=T.colIndex;R<=S.colIndex;R++){let w={rowIndex:C,colIndex:R},[v,I]=this.getCellSelectionPosition(w);n?a.selectCell(v,I):a.deselectCell(v,I)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=Jr(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(f=>{this.isCellSelected({rowId:d.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=Bb(Array.from(a),i),u=l.map(d=>c.map(f=>this.isCellSelected({rowId:d.id,colId:f})?e(d,f):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new Ne(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 Ne(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 Ne:new Ne(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 Ne(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 Ne(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 Ne(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 xf(o){return new ml(o)}function Pf(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new pt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new pt({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 pt(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 pt(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 en(o,e,t){return Math.min(Math.max(o,e),t)}function di(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 en(a,r,i)}function Wb(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:f}=u;if(f==null)return!1;let{start:[p],end:[m]}=d.getRenderRange(),h=f,g=m-p-1,y=0,b=c-1,T={ArrowDown:()=>{f=di(n,f,1)},ArrowUp:()=>{f=di(n,f,-1)},ArrowLeft:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let R=d.rowsPerPage;f-R>=y?f=f-R:T.ArrowUp();return}return C&&C.isGroupRow?i.collapseGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.collapseRowDetail(C.id):!1},ArrowRight:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let R=d.rowsPerPage;f+R<=b?f=f+R:T.ArrowDown();return}return C&&C.isGroupRow?i.expandGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.expandRowDetail(C.id):!1},Enter:()=>{let C=s[f];return C&&C.isGroupRow?i.toggleGroupRow(C.groupKeys):C&&C.isTreeNode&&C.isParentNode?a.treeApi.toggleNode(C.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.toggleRowDetail(C.id):!1},PageDown:()=>{f=Math.min(f+g,c-1)},PageUp:()=>{f=Math.max(f-g,y)},End:()=>{f=b},Home:()=>{f=y}},S=T[l];return S?(S(),h!==f?(r.activeRowIndex=f,!0):!1):!1}function hl(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,c=i().dataArray,u=n(),{activeCellIndex:d,brain:f}=u;if(!d)return!1;let[p,m]=d,{start:[h,g],end:[y,b]}=f.getRenderRange(),T=y-h-1,S=b-g-1,C=i().dataArray.length-1,R=r().computedVisibleColumns.length-1,w=0,v=0;p=en(p,0,C),m=en(m,0,R);let I={ArrowDown:()=>{p=en(p+1,w,C)},ArrowUp:()=>{p=en(p-1,w,C)},ArrowLeft:()=>{if(m===v)if(p!==w&&(m=R),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p-P>=w?p=p-P:I.ArrowUp()}else I.ArrowUp();else m=en(m-1,v,R)},ArrowRight:()=>{if(m===R)if(p!==C&&(m=v),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p+P<=C?p=p+P:I.ArrowDown()}else I.ArrowDown();else m=en(m+1,v,R)},Enter:()=>{let P=c[p];return P&&P.isGroupRow?t.toggleGroupRow(P.groupKeys):P&&P.isTreeNode&&P.isParentNode?a.treeApi.toggleNode(P.nodePath):P&&t.rowDetailApi.isRowDetailEnabledForRow(P.id)?t.rowDetailApi.toggleRowDetail(P.id):!1},PageDown:()=>{s?m=Math.min(m+S,R):p=Math.min(p+T,C)},PageUp:()=>{s?m=Math.max(m-S,v):p=Math.max(p-T,w)},End:()=>{s?m=R:p=C},Home:()=>{s?m=v:p=w}},x=I[l];return x?(x(),[p,m]):!1}function jb(o,e){let t=hl(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var $b={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Df(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!$b[t]?!1:i!=null&&l==="row"?Wb(o,e):a!=null&&l==="cell"?jb(o,e):!1}var gl=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=di(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=hl(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Af(o){return new gl(o)}function Ef(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var yl=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(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(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...at({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;n.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,f=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(f)}),c;try{c=await s(a)}catch(d){c=d}let u=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:u},Promise.resolve(u)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...at({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(d).then(f=>{if(f===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let c=l.computedEditable(at({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>Ye(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let f=this,{isRowDetailEnabled:p}=a(),m=!p||typeof p=="function"&&!p(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",h=kn({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:f},rowDetailState:m});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new lt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),n=new lt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[Zt,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||Tn(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=q.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=yt())}};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 h=i.computedVisibleColumnsMap.get(t);if(!h)return!1;a=h.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let h=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=h||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,f=r.brain.scrollTopMax;if(d<0&&f<0)return!0;let p=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>f+(n.offset||0);return p&&m?!1:(c.scrollLeft!==u.scrollLeft&&!p&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=Wd({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Af({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Pf({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=xf({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)&&(dl(t),e?.()),setTimeout(()=>{this.isDestroyed()||(dl(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],f=i??Vu({column:u,rowInfo:d}),p=f;u.getValueToEdit&&(f=await u.getValueToEdit(at({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:f,initialValue:p,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.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(p=>p.valueGetter?m=>p.valueGetter({data:m,field:p.field}):p.field?p.field:p.groupField??void 0).filter(fl);u.length&&(s=u);let d=i.computedSortType;c.length&&d===Ln&&(d=c.flatMap(m=>{let h=m.field??m.groupField,g=h?r.get(h):null;return g?g.computedSortType:Ln}));let f={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(f.valueGetter=p=>i.valueGetter({data:p,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=>!Ef(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:Ef(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;n.computedFilterValue?(u={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(u.field=n.field)),u.id=n.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],c=n.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,f=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:f}}}return a}).filter(fl),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.scrollLeft=Math.max(e,0)}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current.scrollTop=Math.max(e,0)}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=n.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(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(),c=n.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Mf(o){return new yl(o)}import{useEffect as _f,useRef as Ub,useState as Yb}from"react";var qb=10;function Xb(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${mn} > .${Va}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${gn}`);if(t===!1&&d)return;let f=u.getAttribute("data-column-id"),p=c.cloneNode(!0);p.style.visibility="hidden",p.style.pointerEvents="none",p.classList.remove(...wt.split(" ")),p.style.position="absolute",p.style.width="auto",u.appendChild(p);let m=p.offsetWidth;if(u.removeChild(p),!s[f]){let h=Ae().getComputedStyle(u);s[f]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+qb}if(m+=s[f],d){let h=0;u.childNodes.forEach(g=>{if(g!==c){let y=g,b=Math.max(y.offsetWidth,parseInt(y.style.width,10));if(isNaN(b)&&(b=0),h+=b,b>0){let T=Ae().getComputedStyle(y);h+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10)}}}),m+=h}r&&r.has(f)||n&&!n.has(f)||(l[f]=Math.max(m,l[f]||0))}),l}function Ff(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=Ge(),[a,l]=Yb(0),s=typeof r=="object"?r.key:r,c=Me(s),u=Ub(null);_f(()=>{if(c()==null)return;let{current:f}=u,p=()=>{r!==f&&l(a+1)};return i.onRenderRangeChange(p)},[i]),_f(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),f,p,m=!0;typeof d=="object"&&(d.columnsToResize&&(f=new Set(d.columnsToResize)),d.columnsToSkip&&(p=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let h=Xb(t,{includeHeader:m,columnsToResize:f,columnsToSkip:p}),g=Object.keys(h);if(!g.length)return;let y=o().columnSizing,b={...y},T=!1;g.forEach(S=>{b[S]={width:h[S]},T=T||b[S].width!==y[S]?.width}),T&&(e.columnSizing=b)},[s,n,a])}import{useMemo as rC}from"react";import{useCallback as iC,useEffect as qn,useRef as aC}from"react";import*as fi from"react";function Of(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return Cr(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}import*as Vo from"react";var Nf=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as Lf,useRef as Zb}from"react";function Qb(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 Jb(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=Cf(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 eC(o,e){let t=Zb(!1);return{currentRowCache:Lf(()=>({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)}),[e,o]),cacheCalledByRowDetailRenderer:t}}function zf(o){let{rowDetailsCache:e,rowInfo:t}=o,{getState:n,componentActions:r}=Re(),{getState:i}=X(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=eC(t.id,e),s=Lf(()=>{let c=n().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:Ue(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}Qb(t.id,{masterState:n(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let f=a.get();f&&Jb(t.id,{detailState:d.getState(),masterActions:r,masterState:n(),cacheEntryForRow:f})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:tC}=xe,nC=`${tC}RowDetail`;function oC(o){let e=er(),{domRef:t,rowDetailRenderer:n,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=o,{masterDetailContextValue:s,currentRowCache:c}=zf({rowDetailsCache:l,rowInfo:i});return Vo.createElement(e.Provider,{value:s},Vo.createElement("div",{ref:t,className:J(nC,Nf({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${U.bodyWidth} - ${U.scrollbarWidthVertical})`,height:r}},n(i,c)))}var kf=Vo.memo(oC);var lC=1;function Vf(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,state:i,getState:a}=X(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedColumnsMap:u,computedRowHeight:d,computedRowSizeCacheForDetails:f,fieldsToColumn:p,rowspan:m,toggleGroupRow:h,columnSize:g}=e,{componentState:y,getState:b,componentActions:T,api:S}=Re(),{dataArray:C,isNodeReadOnly:R}=y,w=Me(C),{rowHeight:v,rowDetailHeight:I,onRowMouseEnter:x,onRowMouseLeave:P,groupRenderStrategy:E,brain:_,showZebraRows:A,rowDetailRenderer:F,isRowDetailExpanded:D,isRowDetailEnabled:M,cellClassName:N,cellStyle:V,rowStyle:$,rowDetailCache:te,rowClassName:he,onScrollToTop:ce,onScrollToBottom:k,onScrollStop:B,scrollToBottomOffset:ae,wrapRowsHorizontally:ne,ready:W}=i,z=y.updatedAt;Of({columnSize:g,brain:_,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedRowHeight:d,dataArray:C,bodySize:t,rowspan:m});let L=aC(0);qn(()=>_.onRenderCountChange(()=>{L.current=_.scrollTopMax}),[_]),qn(()=>_.onRenderRangeChange(Q=>{a().onRenderRangeChange?.(Q)}),[_]),qn(()=>_.onScrollStop(Q=>{let{scrollTop:O,scrollLeft:Te}=Q;if(O===0&&ce?.(),O+(ae??lC)>=L.current){k?.();let{livePagination:ee,livePaginationCursor:ue,dataArray:Ie}=b();ee&&(T.cursorId=ue!==void 0?Date.now():Ie.length)}if(B){let ee=_.getRenderRange();B({scrollTop:O,scrollLeft:Te,renderRange:ee,viewportSize:a().bodySize,firstVisibleRowIndex:ee.start[0],lastVisibleRowIndex:ee.end[0],firstVisibleColIndex:ee.start[1],lastVisibleColIndex:ee.end[1]})}}),[_,ce,k,B]),qn(()=>{t.height&&(r.ready=!0)},[!!t.height]),qn(()=>{let{onReady:Q}=a();Q&&Q({api:n,dataSourceApi:S})},[W]);let[,Z]=St();qn(()=>{Z()},[y]);let j=iC(Q=>{let{rowIndex:O,colIndex:Te,heightWithRowspan:Ce,domRef:H,hidden:ee,width:ue,onMouseLeave:Ie,onMouseEnter:ve}=Q,De=w()[O],Ke=c[Te];if(!De)return null;let $e=f?f.getRowHeight(O):Ce,He=!1;!M||typeof M=="function"&&!M(De)?He=!1:D&&(He=D(De)?"expanded":"collapsed");let ot=ne?_.getRowIndexInPage(O):null,Qe=ne?_.getPageIndexForRow(O):null;return fi.createElement(ju,{...{getData:w,virtualized:!0,showZebraRows:A,groupRenderStrategy:E,rowIndexInHorizontalLayoutPage:ot,horizontalLayoutPageIndex:Qe,rowIndex:O,rowInfo:De,hidden:ee,toggleGroupRow:h,rowHeight:$e,rowDetailState:He,onMouseEnter:ve,onMouseLeave:Ie,onRowMouseEnter:x,onRowMouseLeave:P,domRef:H,width:ue,column:Ke,columnsMap:u,fieldsToColumn:p,rowStyle:$,rowClassName:he,cellStyle:V,cellClassName:N}})},[v,I,x,P,f,d,D,w,c,u,p,E,ne,h,A,_,z,R,$,he,N,V]),le=rC(()=>{if(D)return Q=>{let{rowIndex:O,domRef:Te}=Q,H=w()[O];if(!H||!D(H)||!f)return fi.createElement("div",{ref:Te,className:mc.hidden});let{rowDetailHeight:ee,rowHeight:ue}=f.getSize(O);return fi.createElement(kf,{rowInfo:H,rowDetailsCache:te,rowIndex:O,domRef:Te,detailOffset:ue,rowDetailHeight:ee,rowDetailRenderer:F})}},[W,j,F,I,D,te]);return{renderCell:j,renderDetailRow:le}}import{useEffect as PC,useState as wl}from"react";var pi=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&&!pl(e,t,r)){If(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=ui(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function Gf(o,e){return o<e?[o,e]:[e,o]}var mi=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[n,r]=Gf(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[n,r]=Gf(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let n;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))n=r;else break}this.multiSelectEndIndex=n}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};import{useMemo as sC}from"react";function Kf(o){let{getState:e}=Re();return sC(()=>o.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,c=o[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}import{useCallback as cC}from"react";var KL=rt("useColumnSizeFn");function Hf(o){return cC(t=>{let n=o[t];return n?n.computedWidth:0},[o])}import{useEffect as Xn,useLayoutEffect as pC,useMemo as mC}from"react";import{createRef as Sn}from"react";var uC={scrollLeft:0,scrollTop:0},Go=class{constructor(){this.scrollPosition=uC;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let n=0,r=t.length;n<r;n++)t[n](e)}};function Bf(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 Wf from"react";function jf(o){return(e,t)=>Wf.createElement(o,{key:e.id,rowInfo:e,cache:t})}var Ko=class extends an{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 c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=ir(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,f=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=s,this.availableRenderHeight=s),(d||f)&&this.notifyAvailableSizeChange();let p=typeof n=="number",m=typeof r=="number",h=p&&n!==this.initialRows,g=m&&r!==this.initialCols;p&&h&&(this.initialRows=n,this.rows=n),m&&g&&(this.initialCols=r,this.cols=r);let y=i!=null,b=a!=null,T=y&&i!==this.rowHeight,S=b&&a!==this.initialColWidth;y&&(this.rowHeight=i),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=h||T||f,R=g||S||d||C;(R||C)&&this.updateRenderCount({horizontal:R,vertical:C})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Dt){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=>{Pe(()=>{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}};var $f={};function bl(o){return`.${pn}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Cl(o,e){let t=Ht(o),n=e?new Ko(t,{isHeader:!1}):new an(t),r=`${t}:header`,i=e?new Ko(r,{isHeader:!0,masterBrain:n}):new an(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=go(n),{renderer:s,onRenderUpdater:c}=go(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function Uf({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Cl(o,!!e),c=Sn();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:u=>{if(!c.current)return null;let d=bl(u);return c.current.querySelector(d)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:Sn(),editingValueRef:Sn(),scrollerDOMRef:Sn(),portalDOMRef:Sn(),focusDetectDOMRef:Sn(),activeCellIndicatorDOMRef:Sn(),onColumnMenuClick:fe(),cellContextMenu:fe(),contextMenu:fe(),onFilterOperatorMenuClick:fe(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:fe(),onRowHeightCSSVarChange:fe(),onRowDetailHeightCSSVarChange:fe(),onColumnHeaderHeightCSSVarChange:fe(),cellClick:fe(),cellMouseDown:fe(),keyDown:fe(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new Go,pinnedEndScrollListener:new Go,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Yf=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,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new ko(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??$f,columnGroupVisibility:e=>e??$f,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 dC(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 qf=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 Xf(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 hi=new WeakMap;function Zf(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Qf=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?Bf(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=dC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let g=hi.get(d);g||(g=jf(d),hi.set(d,g)),u=g}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof pt)&&(c=new pt(c)),c=c||new pt({expandedRows:[],collapsedRows:!0}));let f=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,p=c?e.isRowDetailExpanded:void 0;!p&&c&&(p=hi.get(c),p||(p=g=>c.isRowDetailsExpanded(g.id),typeof c=="object"&&hi.set(c,p)));let m=u?e.isRowDetailEnabled||!0:!1,h={isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:p,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:f,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||se.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let g=Ot.get(t.debugId);g&&(h={...h,...g})}return h};function Jf(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 ep(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let f=r[d],p=i[f];if(!p.isTreeNode&&p.isGroupRow&&(c=Math.max(c,p.groupNesting-1),c===s-1))break}return Object.keys(n).forEach(d=>{let f=n[d],{groupByForColumn:p}=f;if(Array.isArray(p))return;let m=p.field||p.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import{useCallback as fC}from"react";function Tl(){let{getState:o,componentActions:e,getDataSourceMasterContext:t}=Re();return fC(r=>{let i=o(),a=new lt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Zt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Tn(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=q.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=yt())}},[])}function hC(o){return mC(()=>Xf(o),[o])}function tp(){let{componentState:{groupBy:o},componentActions:e}=Re(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:n,pivotGrandTotalColumnPosition:r}}=Ge();Xn(()=>{e.generateGroupRows=t!=="inline"},[t]),Xn(()=>{e.pivotTotalColumnPosition=n},[n]),Xn(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=hC(o);gC(i);let{toggleGroupRow:a}=yC();return bC(i),{toggleGroupRow:a}}function gC(o){let e=Tl(),{componentActions:t,componentState:{columns:n,groupRenderStrategy:r,isTree:i}}=Ge();function a(l,s,c,u){let d={};if(c==="inline")return Object.keys(l).forEach(f=>{let p=l[f],m={},h=s.get(p.field);if(h&&c==="inline"){let{groupIndex:y}=h;m={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:b})=>b.isGroupRow?b.groupKeys?.[y]:b.value,rowspan:({rowInfo:b,dataArray:T})=>{if(b.isTreeNode||!b.isGroupRow)return 1;let S=T[b.indexInAll-1]||{indexInParentGroups:[]};if(!S||!S.dataSourceHasGrouping)return 1;let C=S.indexInParentGroups||[],R=b.indexInParentGroups||[],w=!1;for(let x=0;x<=y;x++){let P=C[x];if(R[x]!==P){w=!0;break}}if(!w)return 1;let v=b.parents[y];return v?v.groupCount-(v.collapsedChildrenCount||0)+(v.collapsedGroupsCount||0):1},renderGroupIcon:kr({groupIndexForColumn:y,groupRenderStrategy:c,toggleGroupRow:u,initialRenderGroupIcon:p.renderGroupIcon}),render:zr({groupIndexForColumn:y,groupRenderStrategy:c})}}let g={...m,...p};d[f]=g}),Object.keys(d).length===0?void 0:d}Xn(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(n,o,r,e)})()},[n,o,r,e])}function yC(){let{componentState:{groupBy:o,pivotBy:e,selectionMode:t}}=Re(),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:f}=Ge(),p=Tl();return Xn(()=>{(()=>{let{columns:h,groupColumnIds:g}=CC({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:p,selectionMode:t});n.columnsWhenGrouping=h;let y=f().columnOrder;if(g.length&&Array.isArray(y)){let b=new Set(y),T=!1;g.forEach(S=>{b.has(S)||(T=!0,y=[S,...y])}),T&&(n.columnOrder=y)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:p}}function bC(o){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:n,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=Re(),{getComponentState:l,componentActions:s,componentState:{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:f,groupRenderStrategy:p}}=Ge();pC(()=>{if(p!=="multi-column")return;let m=l(),h=Jf(u,o),g=ep({computedGroupColumns:h,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:f,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:n,groupByMap:o});$t(m.columnVisibility,g)||(s.columnVisibility=g)},[a,p,i,n,o,u,f?e:null,f?r:null,f?t:null,f]),Xn(()=>{let m=n.length>0,h=l(),{columnVisibility:g,columnVisibilityForGrouping:y,hideColumnWhenGrouped:b}=h,T={...g},S={...y},C=!1,R=new Set,w=new Set;Object.keys(u).forEach(v=>{let I=u[v];if(I.defaultHiddenWhenGroupedBy||b!=null)if(I.defaultHiddenWhenGroupedBy==="*"&&m||(I.defaultHiddenWhenGroupedBy===!0||b)&&I.field&&o.get(I.field)||typeof I.defaultHiddenWhenGroupedBy=="string"&&o.get(I.defaultHiddenWhenGroupedBy)||typeof I.defaultHiddenWhenGroupedBy=="object"&&Object.keys(I.defaultHiddenWhenGroupedBy).reduce((P,E)=>P||o.has(E),!1)){if(S[v]!==!1){if(g[v]===!1)return;S[v]=!1,C=!0,R.add(v)}}else S[v]===!1&&(delete S[v],C=!0,w.add(v))}),C&&(s.columnVisibilityForGrouping=S,w.forEach(v=>{delete T[v]}),R.forEach(v=>{T[v]=!1}),s.columnVisibility=T)},[u,c,n,o,d])}function CC(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=o;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let f={},p=[];if(c==="multi-column")t.forEach((m,h,g)=>{let y=Ou({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:h,groupCount:g.length,groupRenderStrategy:c,selectionMode:r},u,i),b=y.id||`group-by-${m.field||m.groupField}`;p.push(b),f[b]=y});else if(c==="single-column"&&t.length){let m=Nu({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),h=m.id||"group-by";p.push(h),f[h]=m}if(e){let m={};Object.keys(d).forEach(h=>{let g=d[h];g.field&&(m[g.field]=g)}),Object.keys(e).forEach(h=>{let g=e[h],y=g.pivotTotalColumn&&g.columnGroup,b=g.pivotTotalColumn&&!g.columnGroup;if(y&&a===!1||b&&l===!1)return;let T={...g};s&&(typeof s=="function"?T={...T,...s({column:T,pivotBy:n,groupBy:t})}:T={...T,...s}),T.inheritFromColumn!==!1&&(T={...typeof T.inheritFromColumn=="string"?d[T.inheritFromColumn]:T.pivotAggregator?.field?m[T.pivotAggregator?.field]:void 0,...T}),!T.render&&T.renderValue&&(T.render=S=>T.renderValue(S)),f[h]=T})}else Object.keys(d).forEach(m=>{let h=d[m];f[m]=h});return{columns:Object.keys(f).length?f:void 0,groupColumnIds:p}}import{useMemo as TC}from"react";var np=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:f,filterValue:p,filterTypes:m,columnOrder:h,columnPinning:g,editable:y,columnDefaultEditable:b,columnDefaultFilterable:T,columnDefaultSortable:S,scrollbarWidth:C,columnTypes:R,pinnedEndMaxWidth:w,pinnedStartMaxWidth:v,viewportReservedWidth:I,resizableColumns:x,columnVisibility:P,columnVisibilityAssumeVisible:E,columnSizing:_})=>{let{computedRemainingSpace:F,computedColumnOrder:D,computedVisibleColumns:M,computedVisibleColumnsMap:N,computedPinnedStartColumns:V,computedPinnedEndColumns:$,computedUnpinnedColumns:te,computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ce,computedUnpinnedColumnsWidth:k,computedUnpinnedOffset:B,computedPinnedEndOffset:ae,computedPinnedEndWidth:ne,computedPinnedStartWidth:W,renderSelectionCheckBox:z,computedColumnsMap:L,computedColumnsMapInInitialOrder:Z,fieldsToColumn:j}=TC(()=>Qc({columns:o,scrollbarWidth:C,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:I,resizableColumns:x,filterValue:p,filterTypes:m,sortable:a,sortInfo:d,multiSort:f,pinnedEndMaxWidth:w,pinnedStartMaxWidth:v,draggableColumns:c,columnDefaultDraggable:u,columnOrder:h,columnPinning:g,columnDefaultEditable:b,columnDefaultFilterable:T,columnDefaultSortable:S,editable:y,columnSizing:_,columnTypes:R,columnVisibility:P,columnVisibilityAssumeVisible:E??!0}),[o,e.width,t,n,r,I,C,a,d,f,p,m,h,P,E,u,c,x,w,v,_,R,g,b,T,y,1]);return{renderSelectionCheckBox:z,columns:o,computedColumnsMap:L,computedPinnedEndWidth:ne,computedPinnedStartWidth:W,computedRemainingSpace:F,computedUnpinnedOffset:B,computedPinnedEndOffset:ae,computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ce,computedUnpinnedColumnsWidth:k,computedPinnedStartColumns:V,computedPinnedEndColumns:$,computedUnpinnedColumns:te,computedVisibleColumns:M,computedVisibleColumnsMap:N,computedColumnOrder:D,computedColumnsMapInInitialOrder:Z,fieldsToColumn:j}};import{useMemo as SC}from"react";var Sl=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 wC(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],f=d?n(d):0;return e&&e.rowHeight.set(u,f),f}:n;let l=typeof n=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let f=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,0)),f;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,m)),f+m}}function op(o){return SC(()=>{let e=new Sl;return{computedRowHeight:wC(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}},[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}import{useState as RC,useEffect as vC,useLayoutEffect as IC}from"react";var xC={vertical:!1,horizontal:!1};function rp(o){let{getComponentState:e}=Ge(),{getState:t}=Re(),[n,r]=RC(xC);return vC(()=>o.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=o;r({vertical:i>0,horizontal:a>0})}),[o]),IC(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function ip(){let{componentActions:o,componentState:e}=Ge(),{componentActions:t,componentState:n,getState:r,api:i}=Re(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:c,editable:u,columnDefaultEditable:d,columnDefaultFilterable:f,columnTypes:p,rowHeight:m,rowDetailHeight:h,isRowDetailExpanded:g,isRowDetailEnabled:y,brain:b,bodySize:T,showSeparatePivotColumnForSingleAggregation:S}=e;wl(()=>{e.onRowHeightCSSVarChange.onChange(H=>{H&&(o.rowHeight=H)}),e.onFlashingDurationCSSVarChange.onChange(H=>{let ee=H?H*1:null;ee!=null&&!isNaN(ee)&&(o.flashingDurationCSSVarValue=ee)}),e.onRowDetailHeightCSSVarChange.onChange(H=>{H&&(o.rowDetailHeight=H)}),e.onColumnHeaderHeightCSSVarChange.onChange(H=>{H&&(o.columnHeaderHeight=H)})}),PC(()=>{t.showSeparatePivotColumnForSingleAggregation=S},[S]);let{multiSort:C,filterValue:R,filterTypes:w}=n,{toggleGroupRow:v}=tp(),I=e.computedColumns,{computedColumnOrder:x,computedVisibleColumns:P,computedVisibleColumnsMap:E,computedPinnedStartColumns:_,computedPinnedEndColumns:A,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:D,computedPinnedEndColumnsWidth:M,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:V,computedPinnedEndOffset:$,computedRemainingSpace:te,computedPinnedStartWidth:he,computedPinnedEndWidth:ce,renderSelectionCheckBox:k,computedColumnsMap:B,computedColumnsMapInInitialOrder:ae,fieldsToColumn:ne}=np({columns:I,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:T,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:n.sortInfo??void 0,multiSort:C,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:u,columnDefaultEditable:d,columnDefaultFilterable:f,filterValue:R,filterTypes:w,columnSizing:c,columnTypes:p}),W=Kf(P),z=Hf(P),L=rp(b),Z=he?D>he:!1,j=ce?M>ce:!1,[le]=wl(()=>new mi({isRowDisabledAt:ee=>r().dataArray[ee]?.rowDisabled??!1,getIdForIndex:ee=>r().dataArray[ee]?.id??-1})),Q=Me(P),[O]=wl(()=>new pi({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:H=>Q()[H]?.id||""})),{computedRowHeight:Te,computedRowSizeCacheForDetails:Ce}=op({rowDetailHeight:h,rowHeight:m,isRowDetailsExpanded:g,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:le,multiCellSelector:O,computedRowSizeCacheForDetails:Ce,computedRowHeight:Te,scrollbars:L,columnSize:z,rowspan:W,toggleGroupRow:v,computedColumnsMap:B,computedColumnsMapInInitialOrder:ae,renderSelectionCheckBox:k,computedPinnedStartOverflow:Z,computedPinnedEndOverflow:j,computedPinnedStartWidth:he,computedPinnedEndWidth:ce,computedVisibleColumns:P,computedColumnOrder:x,computedRemainingSpace:te,computedVisibleColumnsMap:E,computedPinnedStartColumns:_,computedPinnedEndColumns:A,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:D,computedPinnedEndColumnsWidth:M,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:V,computedPinnedEndOffset:$,fieldsToColumn:ne}}import{useMemo as OC}from"react";function DC(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 AC(){return 4294967295}function EC(o,e,t){return e=e>>>8^o[t^e&255],e}function MC(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Rl(o,e=3988292384){var t=DC(e),n=0,r;for(n=AC(),r=0;r<o.length;r++)n=EC(t,n,o.charCodeAt(r));return n=MC(n),`${n}`}var _C=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")??""}},ap=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+4*2,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))},lp=(o="",e,t)=>{let n;try{n=FC(o)}catch{return ap(["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?(ap([`
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},FT=n=>{let e="",t=n.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let u=t[s];if(Il(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Il(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),_T(t)};var NT=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,LT=/(https):\/\/\S+(\.csb\.app)/g,sf=typeof window<"u"?window.location.origin:"",VT=()=>{let[n,e,t]=Array.from(NT.exec(sf)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},zT=()=>{let[n,e,t]=Array.from(LT.exec(sf)||[]);return e==="https"&&t===".csb.app"},GT=zT()||VT(),uf=(n="")=>{let t=!!Le();return OT(()=>{if(t)return!0;let r=lf(n,{publishedAt:1624970570587,version:"7.0.1"});return!n&&!r&&GT?!0:r},[n,t])};import{useRef as cf,useEffect as df}from"react";var KT=10;function pf(n,e,t){let o=cf(!1),r=cf(null);df(()=>{n!=null&&(o.current=!1,gt(r.current))},[n]),df(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,gt(r.current),r.current=ve(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<KT&&a(l)})};var i=a;a()}return()=>{gt(r.current)}},[n,e])}import{useRef as ff,useEffect as mf}from"react";var HT=10;function hf(n,e,t){let o=ff(!1),r=ff(null);mf(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),mf(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<HT&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}var gf=n=>`--infinite-${n}`;import{useCallback as ZT,useMemo as QT,useEffect as JT}from"react";function yf(n,e){wl(n,e),kT(n,e),e.detail===2&&BT(n,e),n.getState().onCellClick?.(n,e)}function BT(n,e){let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function kT(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=o(),{rowsPerPage:h}=f,g=p.length,y=new Ve(c);y.debugId=m??"",d.cellSelectionState=y;let C={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(C);else if(e.shiftKey){let S=!!o().wrapRowsHorizontally;d.multiSelectClick(C,S?{horizontalLayout:S,rowsPerPage:h,columnsPerSet:g}:{horizontalLayout:S})}else d.resetClick(C);l.cellSelection=y}function wl(n,e){let{rowIndex:t,getDataSourceState:o,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=n,{multiRowSelector:s,renderSelectionCheckBox:u}=r(),c=o(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=c;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(u&&!e.key)return!1;let{rowSelection:g}=c;if(g=l(g),s.rowSelectionState=g,g&&typeof g=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=g,!0}else if(d==="single-row"){let y=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(y):a.rowSelectionApi.selectRow(y)}return!1}function Cf(n,e){e.detail!==2&&void 0}var WT={Enter:!0," ":!0,a:!0};function Tf(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=n,{key:u,ctrlKey:c,metaKey:d}=e;if(!WT[u])return!1;let p=t(),f=o(),{activeRowIndex:m,activeCellIndex:h,keyboardNavigation:g,keyboardSelection:y}=p,{selectionMode:C,groupBy:S,rowSelection:b,treeSelectionState:T,isTree:I}=f;if(y===!1)return!1;let R=g==="row"&&m!=null?m:g==="cell"&&h!=null?h[0]:null,w=R!=null?f.dataArray[R]:null;if(!w||R==null)return!1;if(C==="single-row"&&u===" ")return i.rowSelectionApi.toggleRowSelection(w.id),!0;if(C!=="multi-row")return!1;if(u==="a"&&(c||d)){if(I&&T){let x=s(T);return x.selectAll(),r.treeSelection=x,!0}let P=l(b);return P.selectAll(),r.rowSelection=P,!0}if(u===" "){if(S.length)return w.isGroupRow&&w.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(w.groupKeys):i.rowSelectionApi.toggleRowSelection(w.id),!0;if(I){if(w.isTreeNode&&w.nodePath)return a.treeApi.toggleNodeSelection(w.nodePath),!0}else{let P={...e},{renderSelectionCheckBox:x}=n.getComputed();return x&&(P.metaKey=!1,P.ctrlKey=!0),wl({...n,rowIndex:R},P)}}return!1}var Sf=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),bf=n=>Array.from(n.querySelectorAll(Sf)).filter(t=>!!t.offsetParent),mi=n=>n.querySelector(Sf);var If=tn(vo());async function Rf(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var jT=10,$T=(n,e)=>n-e;function hi(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=o(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[n.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===n.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[n.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",h=qe(p.id,e);return p.contentFocusable({column:p,...Vo({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:h,api:i,dataSourceApi:a})}function Pl(n,e,t){let o=t.getState().editingCell;return UT(n,e,t,{isCellFocusable:hi,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function wf(n,e,t){let o=(0,If.default)(t,n+e,$T);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=wf;function UT(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=n.rowIndex,c=n.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:wf(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 Pf(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=hi(e,n)?e:Pl(e,-1,n);if(t){await xl([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;mi(o)?.focus()}}async function xl([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=jT,l=null,s=!1;function u(c=0){c++,gt(l),l=ve(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&c<a&&u(c),s){try{await Rf(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var YT=`.${ho}`;function xf(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:xo(o,YT),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:c}=n.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&hi({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:Pl({rowIndex:l,colIndex:s},t,n);if(!u){if(t===-1)r.focus();else{let c=bf(document.body),d=n.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return xl([u.rowIndex,u.colIndex],n).then(()=>{let c=n.getState().getDOMNodeForCell(u);if(!c)return;mi(c)?.focus()}),!0}var Df={control:"ctrl"},vf={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},qT={esc:"escape"},Ef={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},Mf=Object.keys(Ef),Dl=new Set(Mf),XT=new Set(["shift","alt"]);function vl(n,e){return Array.isArray(e)?e.some(t=>Af(n,t)):Af(n,e)}function Af(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(p=>p.toLowerCase().trim()),r=o.find(p=>vf[p]),i=o.map(p=>Df[p]||vf[p]||qT[p]||p),a=i.filter(p=>Dl.has(p)),l=i.filter(p=>!Dl.has(p)),s=Mf.reduce((p,f)=>(p[f]=Ef[f](n),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!XT.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Dl.has(t)||t==="meta"||Df[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function _f(n,e){let t={...n,cloneRowSelection:a=>Zr(a,n.getDataSourceState),cloneTreeSelection:a=>ti(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&Tf(t,e)&&e.preventDefault(),(xf(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&Dp(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,u=n.getComputed().computedVisibleColumns[s];u.computedEditable&&n.api.startEdit({rowIndex:l,columnId:u.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!vl(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function eS(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=X(),{getState:i,componentActions:a,api:l}=Ie();return QT(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>ti(c,i),cloneRowSelection:c=>Zr(c,i)}),[n,e,i,a,t,l,o])}function tS(){let n=eS();JT(()=>{let e=n.getState().keyDown.onChange(a=>{_f(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],u=qe(s.id,n);yf({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=n.getComputed().computedVisibleColumns[u],d=qe(c.id,n);Cf({...n,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function oS(){let{getState:n}=X();return{onKeyDown:ZT(t=>{n().keyDown(t)},[])}}function Ff(){return tS(),oS()}import{useEffect as im}from"react";import*as Me from"react";import{useCallback as El,useEffect as aS,useLayoutEffect as lS,useState as yi}from"react";import{createPortal as sS}from"react-dom";var Oe=class{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new Oe(e)}static from(e){return new Oe(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function Of(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Nf(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function nS(n,e,t){let o=Of(n,t),r=Of(e,t);return o===r?Nf(t,e)-Nf(t,n):o-r}function rS(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>nS(o,r,t)),e}function Lf(n,e){n=rS(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(iS([t,i,a],e))return!0}return!1}function iS(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var qo=class{containsPoint(e){return Lf(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var to=class extends qo{constructor(t){super();this.points=t.map(Oe.clone)}static clone(t){return new to(t)}getPoints(){return this.points}shift(t){return this.points.forEach(o=>{o.shift(t)}),this}};var Pe=class extends qo{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new Pe(t)}static clone(t){return new Pe(t)}static from(t){return Pe.clone(t)}static fromPoint(t){return Pe.from({top:t.top,left:t.left,width:0,height:0})}containsPoint(t){return new to(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Oe.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};function Al(n){return!!n.tagName}function Gf(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=Pe.from(Al(e)?e.getBoundingClientRect():e),a=Pe.from(Al(t)?t.getBoundingClientRect():t),l=o?Pe.from(Al(o)?o.getBoundingClientRect():o):null;if(!l)return{...Vf({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=Vf({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 Vf(n){let e=Pe.from(n.targetRect),t=Pe.from(n.anchorRect),o=n.constrainRect?Pe.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=zf(e,i),s=zf(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function zf(n,e){return e==="TopLeft"?Oe.from({top:n.top,left:n.left}):e==="TopCenter"?Oe.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?Oe.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?Oe.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?Oe.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?Oe.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?Oe.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?Oe.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):Oe.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}var gi="__is_infinite_menu_component";function uS(n){return n&&typeof n.then=="function"||n instanceof Promise}function Bf(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function Kf(n){return typeof n=="function"&&(n=n()),uS(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&Bf(n)&&(n=n.getBoundingClientRect()),n?Pe.from(n):null}async function cS(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),Bf(o)&&(r=o),r||null}return t(await e)}function dS(n){return Me.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function pS(n){let e=Me.useRef(null);return aS(()=>n.realign.onChange(t=>{e.current&&t&&Hf(e.current,t)}),[n.realign]),Me.createElement("div",{style:{position:"absolute",top:0,left:0},ref:El(t=>{t&&Hf(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}async function Hf(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Kf(t)||void 0,a=o?await Kf(o):void 0,l=Pe.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Gf({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=n.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=n.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,h=s.top-f;n.style.transform=`translate3d(${m}px,${h}px, 0px)`}}}function fS(n,e){let[t,o]=yi(null);return lS(()=>{async function r(){let i=e?await cS(e):null;i!=null&&o(i)}e&&r()},[e]),e?t?sS(n,t):Me.createElement(Me.Fragment,null):e===null||e===!1?n:Me.createElement(dS,null,n)}function mS(n){if(Me.Children.count(n)===1){let e=Me.Children.only(n);if(Me.isValidElement(e))return e.props.id||e.key}return null}function hS(n,e,t){if(Me.Children.count(n)===1){let o=Me.Children.only(n);if(Me.isValidElement(o)&&o.type[gi]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),Me.cloneElement(o,r)}}return n}globalThis.allhandles={};globalThis.thehandles={};function Kt(n){let e=n,[t]=yi(()=>new Map),[o,r]=yi(null),[i,a]=yi(0),l=El(()=>{let m=[];for(let[h,g]of t)m.push(Me.createElement(pS,{...g,key:g.key}));return m},[]),[s,u]=Rt(),c=fS(l(),n.portalContainer),d=El((m,h)=>{let y=`${h.id||mS(m)||Ct()}`,C=t.get(y),S=I=>()=>{let R=typeof I=="function"?I():I;return hS(R,e.portalContainer,h.constrainTo??e.constrainTo)},b=S(m),T=(I,R)=>{if(!C)return;let w=S(I);Object.assign(C,{children:w}),u(),!!!R?.skipRealign&&(r(C.key),a(Date.now()))};return C?(Object.assign(C,h),T(m),T):(C={key:y,children:b,alignPosition:h.alignPosition,alignTo:h.alignTo,constrainTo:h.constrainTo,realign:pe()},t.set(C.key,C),u(),T)},[t,e.portalContainer,u]);Me.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return Me.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}import*as nm from"react";import*as Zo from"react";import*as Xo from"react";import*as kn from"react";function Ci(n){return null}Ci.defaultProps={__is_menu_item:!0};var kf="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw16 _16lm1iw1n _16lm1iw8",Wf=ye({defaultClassName:"db3arf2 _16lm1iwz _16lm1iw1r _16lm1iw17",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwj _16lm1iw17",false:"_16lm1iwi"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),jf="db3arf1",$f="db3arfd";var gS="-";function yS(){return kn.createElement("hr",{className:$f})}var Ti=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===gS?kn.createElement(yS,null):r:null;return i!=null?{type:"item",parentMenuId:o,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}};function Uf(n,e){return kn.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Ci)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),Ti(n,o)}return Ti(n,t)})||[]}var Yf="submenu";function qf(){let n=Xo.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ct(),focused:!1,destroyed:!1,domRef:n}}var Xf=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),CS=[{name:"label"}],Zf=n=>{let{props:e,state:t}=n,{activeItemKey:o,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,u=e.id||t.generatedId;s&&(u=`${s}-${u}`);let c=[...e.columns||CS],d={columns:c,keyboardActiveItemKey:r,activeItemKey:o,menuId:u},p=[];i?p=i.map(Ti.bind(null,d)):!i&&typeof a!="function"&&(p=Uf(d,a)),l&&p.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!c.find(h=>h.name==Yf)&&c.push({name:Yf,render:({domProps:h,item:g})=>g.menu?Xo.createElement("div",{...h},Xo.createElement(fo,{expanded:!1})):Xo.createElement("div",{...h})});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:c,menuId:u}};import*as St from"react";import{useCallback as Io,useLayoutEffect as DS,useRef as vS,useState as Fl}from"react";var Wn=class extends to{constructor(e){super(e.slice(0,3))}};var TS=250;function SS(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}ve(i)};ve(()=>{i()})})}var bS=Ee(),Si=class{constructor(e){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||TS;this.getPointerMoveTarget=()=>document.documentElement||bS;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 Oe({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 Wn([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Wn([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,SS(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Oe({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};import{createContext as RS,useContext as IS}from"react";var Ml=RS(null);function _l(){return IS(Ml)}import{useCallback as wS,useEffect as PS,useRef as xS}from"react";function Qf(){let n=xS(!0);return PS(()=>(n.current=!0,()=>{n.current=!1}),[]),wS(()=>n.current,[])}function AS(n,e){let{parentMenuId:t,setSubmenuApi:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=n.menu;return c?(typeof c=="function"&&(c=c()),St.createElement(xt,{key:u,parentMenuItemKey:n.key,parentMenuId:t,constrainTo:a,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),o(p)},onHideIntent:d=>{c?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(n.key),s.focus())}})):null}function ES(n,e){let t=Jf(n,e);if(!t.length)return null;let o=Pe.from(t[0]?.getBoundingClientRect()),r=Pe.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function Jf(n,e){let t=xo(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function MS(n,e){let t=Jf(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function _S({onItemActivate:n}){let{getState:e}=_l(),[{onItemEnter:t,onItemLeave:o}]=Fl(()=>new Si({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?Pe.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:Io(t,[]),onItemLeave:Io(o,[])}}function em(n){let{domProps:e}=n,{componentState:{columns:t,runtimeItems:o,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:h},componentActions:g,getState:y}=_l(),C=Io(z=>{g.keyboardActiveItemKey=z},[]),S=Io(z=>{g.activeItemKey=z},[]),b=Qf(),[T,I]=Fl(null),R=null;DS(()=>{let{runtimeItems:z}=y(),k=z.filter(ae=>ae.type==="item"&&i===ae.key)[0];if(!k||!k.menu){I(null),D();return}if(k){let ae=ES(r,k.key);ae&&P(()=>AS(k,{constrainTo:l,setSubmenuApi:I,setActiveItemKey:S,setKeyboardActiveItemKey:C,parentMenuId:r,onHideIntent:$,api:te}),{id:`${r}-submenu`,alignTo:ae,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let w=(z,k)=>{C(k.key),S(k.key),k.originalMenuItem.onClick&&k.originalMenuItem.onClick(z);let ae={key:k.key,item:k.originalMenuItem,hideMenu:$};k.originalMenuItem.onAction&&k.originalMenuItem.onAction(ae),u&&u(ae),k.originalMenuItem.hideMenuOnAction&&$()},{showOverlay:P,portal:x,clearAll:D}=Kt({portalContainer:!1}),{onItemEnter:A,onItemLeave:_}=_S({onItemActivate:z=>{if(!b())return;let k=z?z.key:null;S(k)}});R=o.map((z,k)=>St.createElement(FS,{key:z.type==="item"?z.key:k,onItemEnter:(ae,oe)=>{A(ae.key,oe)},onItemLeave:(ae,oe)=>{_(ae.key,oe)},columns:t,active:z.type==="item"&&z.key===i,keyboardActive:z.type==="item"&&z.key===a,item:z,index:k,onClick:w}));let E=t.map(z=>z.width||(typeof z.flex=="number"?`${z.flex}fr`:z.flex)||"auto").join(" "),F={...e.style,gridTemplateColumns:E,gridTemplateRows:o.map(()=>"auto").join(" ")};c||(F.whiteSpace="nowrap");function v(z){let{runtimeItems:k,runtimeSelectableItems:ae}=y(),oe=k.findIndex(j=>j.type==="item"&&j.key===a),W=a,V=k[oe],L={ArrowUp:()=>{let j=k.slice(0,oe).filter(se=>se.type==="item"&&!se.disabled).pop();j&&j.type==="item"&&j.key&&(W=j.key)},ArrowDown:()=>{let j=k.slice(oe+1).filter(se=>se.type==="item"&&!se.disabled)[0];j&&j.type==="item"&&j.key&&(W=j.key)},Home:()=>{L.PageUp()},End:()=>{L.PageDown()},PageUp:()=>{W=ae[0].key},PageDown:()=>{W=ae[ae.length-1].key},ArrowLeft:()=>{S(null),y().parentMenuId&&(g.destroyed=!0)},ArrowRight:()=>{V&&(S(V.key),ve(()=>{b()&&T&&T.getParentMenuId()===y().menuId&&T.focus()}))},Enter:()=>{if(V)if(V.originalMenuItem?.menu){if(V&&V.originalMenuItem.menu&&T){L.ArrowLeft();return}V&&S(V.key)}else w(z,V)}," ":()=>{if(!V)return;V.originalMenuItem.menu||w(z,V);let j=MS(r,V.key);j&&j.click()},Escape:()=>{L.ArrowLeft();let j=y();j.parentMenuId||j.onHideIntent?.(j)}},Z=L[z.key];Z&&(Z(),z.preventDefault()),W!=a&&C(W)}function M(){g.focused=!1}let N=Io(function(){g.focused=!0,setTimeout(()=>{G.current&&h.current&&h.current===document.activeElement&&y().keyboardActiveItemKey==null&&C(y().runtimeSelectableItems[0]?.key??null)})},[]),G=vS(!0),$=Io(()=>{let z=y();z.onHideIntent?.(z)},[y]),[te]=Fl(()=>({hideMenu:$,focus:()=>{h.current&&(h.current.focus(),setTimeout(()=>{h.current&&h.current!==document.activeElement&&h.current.focus()},10),N())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),he=Io(z=>{z?(h.current=z,d?.(y(),te),f&&te.focus()):(p?.(y()),h.current=z)},[]),ue=St.createElement("div",{className:Mo.contents},St.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:he,onKeyDown:z=>{e.onKeyDown?.(z),v(z)},onMouseDown:z=>{G.current=!1,e.onMouseDown?.(z)},onMouseUp:z=>{G.current=!0,e.onMouseUp?.(z)},onFocus:N,onBlur:M,className:J(kf,e.className,"InfiniteMenu"),style:F},R),x);return s?null:ue}function FS(n){let[e,t]=St.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=St.createElement("div",{style:r.style},r.value);else{let c=0;u=o.map((d,p)=>{let f=r.value,m=d.field||d.name,h=p+1,g=h+r.span;if(h<c)return null;c=g;let C={style:{...d.style,...r.style,gridColumnStart:h,gridColumnEnd:g},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:J(Wf({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||n.active}),r.className),onPointerEnter:S=>{r.disabled||n.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||n.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||n.onClick(S,r)}};return d.render?St.createElement(vn,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:C}}):St.createElement("div",{key:`${s}-${m}`,...C},f[m])}).filter(Boolean)}return St.createElement("div",{className:jf},u)}var{ManagedComponentContextProvider:OS}=Et({initSetupState:qf,forwardProps:Xf,mapPropsToState:Zf,layoutEffect:!0});function NS(n){let{componentActions:e,componentState:t}=Ke(),o=_e(t);return Zo.createElement(Ml.Provider,{value:{componentActions:e,componentState:t,getState:o}},Zo.createElement(em,{domProps:n.domProps}))}function xt(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:h,onHideIntent:g,__is_infinite_menu_component:y,...C}=n;return Zo.createElement(OS,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...n},Zo.createElement(NS,{domProps:C}))}xt[gi]=!0;import*as tm from"react";function om(n,e){let{columnApi:t,column:o,getComputed:r,api:i}=e,l=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...l,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((d,p)=>{let f=Dr(d,e);u.push({key:p,label:f,check:tm.createElement(Ut,{key:d.id,disabled:d.computedVisible&&i.getVisibleColumnsCount()===1,checked:d.computedVisible,onChange:m=>{let h=!!m;i.setVisibilityForColumn(d.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function rm(n,e,t){if(n==null)return null;let{getComputed:o,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??xt,s=o().computedColumnsMap.get(n);if(!s)return null;let u={column:s,columnApi:qe(s.id,e),...e},c=om([],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:nm.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var LS=`[${ka["data-name"]}="${Wa["data-name"]}"]`;function VS(n){let{columnId:e,context:t,clearAll:o,showOverlay:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){o(),a.columnMenuVisibleForColumnId=null}let c=n.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[${id["data-column-id"]}="${e}"] ${LS}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>rm(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function am(){let n=X(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});im(()=>{let{actions:u,getState:c}=n,d=c();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,u.contextMenuVisibleFor=null,u.cellContextMenuVisibleFor=null,u.filterOperatorMenuVisibleForColumnId=null,u.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return im(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=t();if(u){let p=function(f){f.__insideMenu!==!0&&(a(),o.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),VS({columnId:u,context:n,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}import*as lm from"react";import{useCallback as zS}from"react";var GS={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function sm(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=X(),{getState:a,getDataSourceMasterContext:l}=Ie(),{focusDetectDOMRef:s}=n(),u=zS(async()=>{Pf({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return lm.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:GS})}import{useEffect as jn}from"react";function KS(){let n=X(),{getState:e}=n,{editingCell:t}=e(),o=t&&!t.active?t.cancelled:void 0;jn(()=>{if(o){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...lt({rowIndex:r,columnId:i,...n}),initialValue:a})}},[o])}function HS(){let n=X(),{getState:e,state:{editingCell:t}}=n,o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;jn(()=>{if(o){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...lt({rowIndex:r,columnId:i,...n}),value:a,error:o,initialValue:l})}},[o])}function BS(){let n=X(),{state:{editingCell:e}}=n,t=e?.active,o=co(t);jn(()=>{!t&&o&&n.api.focus()},[t,o])}function kS(){let n=X(),{state:{editingCell:e},getState:t}=n,o=e&&!e.active&&!e.cancelled&&e.accepted===!0;jn(()=>{if(o){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,u={...lt({rowIndex:a,columnId:l,...n}),value:i,initialValue:s};t().onEditAccepted?.(u),n.api.persistEdit({value:i})}},[o])}function WS(){let n=X(),{state:{editingCell:e},getState:t}=n,o=e?e.persisted:void 0;jn(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:u,initialValue:c}=r,d={...lt({rowIndex:l,columnId:s,...n}),value:u,initialValue:c};o instanceof Error?i?.({...d,error:o}):a?.(d)}},[o])}function um(){KS(),HS(),kS(),WS(),BS()}import{useEffect as fm}from"react";import*as oo from"react";import*as Ol from"react";var cm=n=>Ol.createElement(Fe,{...n},Ol.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));import*as Nl from"react";var dm=n=>Nl.createElement(Fe,{...n},Nl.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function pm(n,e,t){if(n==null)return null;let{getComputed:o,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=c?.Menu??xt,f=o().computedColumnsMap.get(n);if(!f)return null;let m=R=>{R.__insideMenu=!0},h=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:g}=i(),y=g[f.computedFilterType];if(!y)return null;let C=y.operators.map(R=>{let w=R.name,P=f.computedFilterValue?f.computedFilterValue.filter.operator===w:w===y.defaultOperator,x=R.components?.Icon??Oo;return{key:w,icon:oo.createElement(x,null),label:oo.createElement(oo.Fragment,null,R.label??R.name),onAction:()=>{u.setColumnFilterOperator(n,w)},checked:P?oo.createElement(dm,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:oo.createElement(cm,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(n)}},"-"],...C],T={column:f,api:u,getState:r,getDataSourceState:i,getComputed:o,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:g},I=d?d(b,T):b;return oo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:h,onHideIntent:R=>{h(R),t?.()}})}var bi=10;function mm(){let n=X(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return fm(()=>{let{actions:l,getState:s}=n;return s().onFilterOperatorMenuClick.onChange(c=>{if(!c)return;let{target:d,column:p}=c;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,h=Pe.from(m.getBoundingClientRect());h.top-=bi,h.left-=bi,h.width+=2*bi,h.height+=2*bi,r(()=>pm(p.id,n,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:h,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),fm(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as Ii}from"react";import*as Gl from"react";import*as Ll from"react";function Ri(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function Vl(n){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),n.onHideIntent?.()}}}function zl(n,e,t){if(!n)return null;let o=pe();return n.then(r=>{let{items:i,columns:a}=Ri(r);i&&i.length&&o(Ll.createElement(t,{...e,items:i||[],columns:a}))}),Ll.createElement(Bt,{updater:o})}function hm(n,e,t){let{columnId:o,rowIndex:r,event:i}=n,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=s?.Menu??xt,{computedColumnsMap:d}=a(),p=d.get(o),f={...lt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=Vl({onHideIntent:t}),h=u(f,e),g=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:f,menu:zl(h,m,c),preventDefault:g};let{items:y,columns:C}=Ri(h);return!y||!y.length?{cellContext:f,menu:null,preventDefault:Array.isArray(y)}:{preventDefault:g,menu:Gl.createElement(c,{...m,columns:C,items:y}),cellContext:f}}function gm(n,e,t){let{getState:o,getComputed:r}=e,{components:i,getContextMenuItems:a}=o(),l=i?.Menu??xt,{computedColumnsMap:s}=r(),u=n.columnId?s.get(n.columnId):void 0,c=u?{...n,...lt({...e,rowIndex:n.rowIndex,columnId:u.id})}:n;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=Vl({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:zl(p,d,l),preventDefault:f};let{items:m,columns:h}=Ri(p);return!m||!m.length?{cellContext:c,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:Gl.createElement(l,{...d,columns:h,items:m}),cellContext:c}}var wi=5,ym=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Cm(){let n=X(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Ii(()=>{let{actions:l,getState:s,getDataSourceState:u}=n;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:h,preventDefault:g}=hm(d,n,f),y=Pe.fromPoint({top:p.clientY,left:p.clientX});y.width+=wi,y.height+=wi,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:ym}),g&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:C}=s();C&&C({...h,getState:s,getDataSourceState:u},p)})},[]),Ii(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Tm(){let n=X(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Ii(()=>{let{actions:l,getState:s}=n;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:h}=gm(c,n,p),g={top:d.clientY,left:d.clientX},y=Pe.fromPoint(g);y.width+=wi,y.height+=wi,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:ym}),h&&d.preventDefault(),l.contextMenuVisibleFor={point:g,...c};let{onContextMenu:C}=s();C&&C({...n,...m},d)})},[]),Ii(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as US}from"react";import*as Sm from"react";import{useCallback as jS,useEffect as $S}from"react";function Kl(n,e){let{state:{brain:t}}=X(),o=jS(n,e);$S(()=>t.onScroll(o),[t,o])}var Hl="yzx0vj0";function bm(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=US(null);Kl(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=le.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=le.runtime.bodyWidth),o==="column"?l.minWidth=le.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=le.runtime.bodyWidth),t==="column"?l.maxWidth=le.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=le.runtime.bodyWidth),Sm.createElement("div",{ref:a,...i,className:i.className?J(i.className,Hl):Hl,style:l},i.children)}var YS=Y(U.columnWidthAtIndex),qS=Y(U.columnOffsetAtIndex);function XS(){return X().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${YS}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${qS}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Pi="InfiniteTable";import{useEffect as ZS}from"react";function Rm(){let{state:n,getState:e,actions:t}=X(),{wrapRowsHorizontally:o}=n,r=co(o);ZS(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=Tl(Pi,!!o);t.brain=u.brain,t.headerBrain=u.headerBrain,t.renderer=u.renderer,t.onRenderUpdater=u.onRenderUpdater}},[r,o])}import{useEffect as QS}from"react";function Im(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=X(),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),QS(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=o(),h=!1,g=l.rowsPerPage,y=(r&&r.length>0||i)&&g>0?g:null;return f!=y&&(t.rowsPerPage=y,h=!0),m!=u&&(t.repeatWrappedGroupRows=u??!1,h=!0),h};c();let d,p=l.onVerticalRenderRangeChange(()=>{c()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,u])}import{useEffect as xi,useRef as JS}from"react";var $n=ye({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),wm="_143ofgf5",Pm="_143ofgf3";var eb=Y(le.loaded),Bl={source:"infinite-table-page",target:"infinite-table-devtools-background"};function xm(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...Bl,url:kl(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Bl,url:kl(),type:t,payload:{debugId:o,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(u=>u.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(u=>[u.id,{field:u.field,dataType:u.computedDataType,sortType:u.computedSortType,filtered:u.computedFiltered,sorted:u.computedSorted,width:u.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(u=>u.field?`${u.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(u=>typeof u.field=="string").map(u=>({field:`${u.field}`,dir:u.dir,type:Array.isArray(u.type)?u.type[0]:u.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var kl=Ye(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function tb(n){window.postMessage(n)}var ob=Ye(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){ft.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(xm({type:"update",debugId:e},t))}else np(e),window.postMessage(xm({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Ge.onLogIntent("*",e=>{tb({...Bl,url:kl(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>typeof t=="object"&&t!==null?JSON.stringify(t):String(t)),timestamp:e.timestamp}})}),n});function Dm(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=X(),o=n(),{domRef:r,debugId:i}=o;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(eb)!==`${Rs}`&&Nn({debugId:i,key:"CSS001_CSS"}),xi(()=>{e().debugId!==i&&(t.debugId=i)},[i]),ib()}var Di=pe(),nb={revertAll:n=>{let e=ft.get(n.debugId);if(e){let t=Jt.get(n.debugId);Jt.delete(n.debugId),Lt.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=zt.get(n.debugId);zt.delete(n.debugId),Vt.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=ft.get(n.debugId);if(e){let t=n.property,o=Lt.get(n.debugId),r=Jt.get(n.debugId),i=Vt.get(n.debugId),a=zt.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=zt.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:n=>{let e=ft.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),Ln(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Ln(n.debugId))}}},discardAllWarnings:n=>{let e=ft.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Ln(n.debugId))},setColumnVisibility:n=>{ll(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{ii(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{ll(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{ii(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{ii(n.debugId,"multiSort",n.multiSort)},highlight:n=>{let e=ft.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${$n.classNames.base}`);r||(r=document.createElement("div"),r.classList.add($n.classNames.base),r.innerHTML=[`<div class="${Pm}"></div>`,`<div class="${wm}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove($n.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add($n.classNames.variants.active.true)}}}}};function rb(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&n.data.target==="infinite-table-page"&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(ob(),Di(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=nb[e];t&&t(n.data.payload)}})}rb();function ib(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=X(),s=n().debugId,u=JS(s);return u.current=s,xi(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},p=Di.get();if(p){d(p);return}return Di.onChange(f=>{f&&d(f)})},[]),xi(()=>{let c=u.current;if(!c)return;let d=Di.get();d&&d(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),xi(()=>{if(s)return()=>{let c=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;c&&c(s,null)}},[s]),s}function ab(){let n=Le(),e=n?n.getMasterState():null,t=X().getState();return(e||t).portalDOMRef.current}var Mt=De.rootClassName,lb=[_c,"InfiniteColumnCell--hovered"],{ManagedComponentContextProvider:sb}=Et({initSetupState:$p,forwardProps:Up,mapPropsToState:Zp,cleanup:Yp,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Xp(),getParentState:()=>Po(),debugName:n=>kt(n.debugId,Pi)});function Am(){let n=X(),{state:e,getComputed:t}=n,{header:o,brain:r,headerBrain:i,wrapRowsHorizontally:a}=e,{scrollbars:l}=t();return o?me.createElement(Sd,{wrapRowsHorizontally:!!a,bodyBrain:r,headerBrain:i,scrollbars:l}):null}var vm=J(`${et}Body`,bn.relative,br[1],fu);function ub(n){return me.createElement("div",{...n,className:n.className?J(vm,n.className):vm})}function Em(){let n=X(),e=Le(),{state:t,getComputed:o,api:r}=n,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,scrollStopDelay:d,brain:p,scrollerDOMRef:f,components:m,bodySize:h,activeCellIndex:g,rowDetailRenderer:y,showHoverRows:C,wrapRowsHorizontally:S,domProps:b,domRef:T}=t,I=m?.LoadMask??$r,R=o(),{computedRowHeight:w,computedRowSizeCacheForDetails:P}=R,x=P?.getRowHeight||w,{componentState:{loading:D}}=Ie(),A=me.useCallback(M=>{let N=n.getState(),G=M.target;if(!e&&M._from_row_detail)return;e&&(M._from_row_detail=!0);let $=bs(G,Cl(),N.domRef.current),te,he,ue,z;$&&(he=Number($.dataset.colIndex),z=Number($.dataset.rowIndex),te=n.getComputed().computedVisibleColumns[he].id,ue=n.dataSourceApi.getRowInfoArray()[z].id);let k={columnId:te,colIndex:he,rowId:ue,rowIndex:z,event:M,target:$??M.target};$&&N.cellContextMenu(k),N.contextMenu(k)},[]),{renderCell:_,renderDetailRow:E}=zp({imperativeApi:r,getComputed:o,domRef:T,bodySize:h,computed:R}),{autoFocus:F,tabIndex:v}=b??{};return Rm(),me.createElement(ub,{onContextMenu:A},me.createElement(Js,{forceRerenderTimestamp:t.forceBodyRerenderTimestamp,debugId:l,tabIndex:v??0,autoFocus:F??void 0,activeRowIndex:t.ready&&s==="row"?u:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?g:null,scrollStopDelay:d,renderer:i,wrapRowsHorizontally:S,onRenderUpdater:a,brain:p,activeCellRowHeight:x,renderCell:_,renderDetailRow:y?E:void 0,cellHoverClassNames:C?lb:void 0,scrollerDOMRef:f,scrollVarHostRef:T}),me.createElement(I,{visible:D},c))}var cb=me.memo(function(){let e=X(),t=Le(),{state:o,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=Ie(),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:h,rowDetailHeightCSSVar:g,columnHeaderHeightCSSVar:y,scrollStopDelay:C,brain:S,activeRowIndex:b,activeCellIndex:T}=o,{licenseKey:I}=o;!I&&no.licenseKey&&(I=no.licenseKey),hf(b,a.length,r),pf(T,a.length,r);let{onKeyDown:R}=Ff();me.useEffect(()=>{let G=l(),$=Dt(te=>{G.notifyRenderRangeChange({renderStartIndex:te[0],renderEndIndex:te[1]})},{wait:C});return S.onVerticalRenderRangeChange($)},[S,C]);let w=uf(I),{autoFocus:P,tabIndex:x,...D}=o.domProps??{},A=Cc(D);me.useEffect(()=>{S.setScrollStopDelay(C),s.scrollStopDelayUpdatedByTable=C},[C]),_p(),Im(),um();let{menuPortal:_}=am(),{menuPortal:E}=Cm(),{menuPortal:F}=Tm(),{menuPortal:v}=mm();me.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(o.id,o.ready,e.api,e)},[o.ready]);let M=Dm();me.useEffect(()=>{t&&(c.current=t.getMasterState().portalDOMRef.current)},[]);let N=i??me.createElement(me.Fragment,null,me.createElement(Am,null),me.createElement(Em,null));return me.createElement("div",{"data-debug-id":M,onKeyDown:R,ref:u,...A},N,me.createElement("div",{ref:c,className:J(`${et}Portal`,gu[1e7],bn.absolute,pu[0],uu[0])},_,E,F,v),h?me.createElement(sn,{key:"row-height",varName:h,onChange:d}):null,me.createElement(sn,{key:"flashing-duration",allowInts:!0,varName:le.components.Cell.flashingDuration,onChange:p}),g?me.createElement(sn,{key:"row-detail-height",varName:g,onChange:f}):null,y?me.createElement(sn,{key:"column-header-height",varName:y,onChange:m}):null,w?null:me.createElement(wd,null),me.createElement(sm,null))});function db({children:n}){let{componentActions:e,componentState:t}=Ke(),{scrollerDOMRef:o,scrollTopKey:r}=t,i=rf(),a=_e(i),l=_e(t),s=Le(),{getState:u,componentActions:c,getDataSourceMasterContext:d,api:p}=Ie(),[f]=me.useState(()=>Ep({getComputed:a,getState:l,getDataSourceState:u,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:c})),m={actions:e,state:t,computed:i,dataSourceActions:c,getDataSourceMasterContext:d,getDataSourceState:u,getComputed:a,getState:l,api:f,dataSourceApi:p,children:n};er(o,g=>{let y={width:g.width,height:g.height};e.bodySize=y},{earlyAttach:!0,debounce:50}),me.useEffect(()=>{o.current&&(o.current.scrollTop=0)},[r,o]);let h=_o();return me.createElement(h.Provider,{value:m},me.createElement(cb,null))}var pb=40,fb=gf(Is),no=function(n){return me.createElement(sb,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:pb,columnHeaderHeight:fb,...n},me.createElement(db,{children:n.children}))};no.Header=Am;no.Body=Em;no.HScrollSyncContent=bm;no.Footer=()=>me.createElement(Cu,null);import*as Mm from"react";function RB(n){let{DataSource:e}=Vn({nodesKey:"children",...n});return Mm.createElement(e,null,n.children??null)}import*as _m from"react";function mb(n){return _m.createElement(no,{...n})}var vi=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Ge(`${e}:DataQuery`)}};function Qo(n){if(Array.isArray(n))return n.map(Qo);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Qo(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var ro=class{constructor(e){this.queryCache=new q;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Qo(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new vi(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Qo(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Qo(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Qo(e);this.queryCache.delete(t)};if(this.options=e,ro.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)}ro.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=ro.clients.get(e);t&&t.destroy()}static destroyAll(){ro.clients.forEach(e=>{ro.destroy(e.name)})}destroy(){ro.clients.delete(this.options.name)}},Wl=ro;Wl.clients=new Map;var hb={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},gb={instantEdit:hb};import{useEffect as WB}from"react";function yb(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var jl=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??jl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}},Ai=jl;Ai.DEFAULT_SIZE=10;var $l=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??$l.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}},Ei=$l;Ei.DEFAULT_SIZE=10;import{useEffect as Cb,useRef as Mi}from"react";var Tb=(n,e)=>n.every((t,o)=>t===e[o]),Sb=(n,e)=>{let t=Mi(e),o=Tb(e,t.current),r=Mi(!0);t.current=e;let i=Mi(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=Mi(n);l.current=n,Cb(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as bb,useRef as Un}from"react";var Fm=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),Ul=(n,e)=>{let{same:t,different:o,compare:r}=e,i=Un(t),a=Un(o),l=Fm(t,i.current,r),s=!Fm(o,a.current,r),u=Un(!0);i.current=t,a.current=o;let c=Un(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=Un(n);p.current=n,l&&s&&(u.current=!1),bb(()=>{if(!u.current)return p.current()},d)};import*as ct from"react";var Om=Y(U.currentFlashingDuration),Rb=({children:n})=>ct.createElement(ct.Fragment,null,n),Nm=1e3,Lm={up:gr({direction:"up"}).split(" "),down:gr({direction:"down"}).split(" "),neutral:gr({direction:"neutral"}).split(" ")},Vm=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=Rb}=n;return ct.forwardRef((i,a)=>{let l=Hr(),{state:{flashingDurationCSSVarValue:s}}=X(),u=typeof s=="number"?s??e??Nm:e??Nm,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,h=f.id,g=p.id,y=ct.useRef(!0),C=ct.useRef(d),S=y.current?null:C.current;y.current=!1;let b=ct.useRef(),T=ct.useRef(),I=ct.useRef();return Ul(()=>{if(d===C.current)return;let R=()=>{let D=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),I.current&&(clearTimeout(I.current),I.current=void 0),T.current&&D){let A=T.current,_=Lm[A];D.classList.remove(...t?[t,..._]:_),D.style.removeProperty(Om),T.current=void 0}};C.current=d;let w=m.current;if(!w)return;R();let P=typeof d=="number"?d>S?"up":"down":"neutral",x=Lm[P];return w.style.setProperty(Om,`${u}`),w.classList.add(...t?[t,...x]:x),T.current=P,b.current=setTimeout(R,u),R},{same:[g,h],different:[d]}),ct.createElement("div",{ref:c,...i,className:J(i.className)},o({children:i.children,oldValue:S}))})},Ib=Vm();var mk={CheckBox:Ut,LoadMask:$r,MenuIcon:An,StringFilterEditor:Lo,NumberFilterEditor:Mr};export{Ve as CellSelectionState,Wl as DataClient,t1 as DataSource,BC as DataSourceActionType,q as DeepMap,Ai as FixedSizeSet,Ib as FlashingColumnCell,st as GroupRowsState,no as InfiniteTable,Mt as InfiniteTableClassName,cb as InfiniteTableComponent,xt as Menu,Gn as RowDetailCache,mt as RowDetailState,ut as RowDisabledState,Se as RowSelectionState,RB as TreeDataSource,Ze as TreeExpandState,mb as TreeGrid,Be as TreeSelectionState,Ei as WeakFixedSizeSet,Hf as alignNode,mk as components,Vm as createFlashingColumnCellComponent,Dt as debounce,Ge as debug,po as defaultFilterTypes,vl as eventMatchesKeyboardShortcut,po as filterTypes,jy as flatten,Et as getComponentStateRoot,Xa as group,yb as interceptMap,gb as keyboardShortcuts,Ot as multisort,Za as multisortNested,Qo as queryKeyToCacheKey,Yy as toTreeDataArray,Ke as useComponentState,Vn as useDataSourceInternal,Po as useDataSourceState,Ul as useEffectWhen,Sb as useEffectWhenSameDeps,ko as useEffectWithChanges,mF as useEffectWithObject,Kl as useGridScroll,Hr as useInfiniteColumnCell,za as useInfiniteColumnEditor,In as useInfiniteColumnFilterEditor,Er as useInfiniteHeaderCell,ab as useInfinitePortalContainer,Rp as useManagedDataSource,n1 as useMasterRowInfo,Kt as useOverlay,fS as useOverlayPortal,co as usePrevious,o1 as useRowInfoReducers,XS as useVisibleColumnSizes};
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},FC=o=>{let e="",t=o.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if(Rl(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Rl(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),_C(t)};var NC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,LC=/(https):\/\/\S+(\.csb\.app)/g,sp=typeof window<"u"?window.location.origin:"",zC=()=>{let[o,e,t]=Array.from(NC.exec(sp)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},kC=()=>{let[o,e,t]=Array.from(LC.exec(sp)||[]);return e==="https"&&t===".csb.app"},VC=kC()||zC(),cp=(o="")=>{let t=!!Oe();return OC(()=>{if(t)return!0;let r=lp(o,{publishedAt:1624970570587,version:"7.1.0"});return!o&&!r&&VC?!0:r},[o,t])};import{useRef as up,useEffect as dp}from"react";var GC=10;function fp(o,e,t){let n=up(!1),r=up(null);dp(()=>{o!=null&&(n.current=!1,ht(r.current))},[o]),dp(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,ht(r.current),r.current=Pe(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<GC&&a(l)})};var i=a;a()}return()=>{ht(r.current)}},[o,e])}import{useRef as pp,useEffect as mp}from"react";var KC=10;function hp(o,e,t){let n=pp(!1),r=pp(null);mp(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),mp(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<KC&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}var gp=o=>`--infinite-${o}`;import{useCallback as ZC,useMemo as QC,useEffect as JC}from"react";function yp(o,e){vl(o,e),BC(o,e),e.detail===2&&HC(o,e),o.getState().onCellClick?.(o,e)}function HC(o,e){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 BC(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:f}=r(),{brain:p,debugId:m}=n(),{rowsPerPage:h}=p,g=f.length,y=new Ne(u);y.debugId=m??"",d.cellSelectionState=y;let b={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(b);else if(e.shiftKey){let T=!!n().wrapRowsHorizontally;d.multiSelectClick(b,T?{horizontalLayout:T,rowsPerPage:h,columnsPerSet:g}:{horizontalLayout:T})}else d.resetClick(b);l.cellSelection=y}function vl(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=n(),{selectionMode:d,groupBy:f,dataArray:p,isTree:m}=u;if(f.length||m||p[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:g}=u;if(g=l(g),s.rowSelectionState=g,g&&typeof g=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=g,!0}else if(d==="single-row"){let y=p[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(y):a.rowSelectionApi.selectRow(y)}return!1}function bp(o,e){e.detail!==2&&void 0}var WC={Enter:!0," ":!0,a:!0};function Cp(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:c,ctrlKey:u,metaKey:d}=e;if(!WC[c])return!1;let f=t(),p=n(),{activeRowIndex:m,activeCellIndex:h,keyboardNavigation:g,keyboardSelection:y}=f,{selectionMode:b,groupBy:T,rowSelection:S,treeSelectionState:C,isTree:R}=p;if(y===!1)return!1;let w=g==="row"&&m!=null?m:g==="cell"&&h!=null?h[0]:null,v=w!=null?p.dataArray[w]:null;if(!v||w==null)return!1;if(b==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(b!=="multi-row")return!1;if(c==="a"&&(u||d)){if(R&&C){let x=s(C);return x.selectAll(),r.treeSelection=x,!0}let I=l(S);return I.selectAll(),r.rowSelection=I,!0}if(c===" "){if(T.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(R){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let I={...e},{renderSelectionCheckBox:x}=o.getComputed();return x&&(I.metaKey=!1,I.ctrlKey=!0),vl({...o,rowIndex:w},I)}}return!1}var Tp=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Sp=o=>Array.from(o.querySelectorAll(Tp)).filter(t=>!!t.offsetParent),gi=o=>o.querySelector(Tp);var Rp=ro(Pn());async function wp(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 jC=10,$C=(o,e)=>o-e;function yi(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),f=u[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let p=c[o.rowIndex],m=!s||typeof s=="function"&&!s(p)?!1:i.rowDetailApi.isRowDetailExpanded(p.id)?"expanded":"collapsed",h=Ye(f.id,e);return f.contentFocusable({column:f,...kn({column:f,rowInfo:p,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:h,api:i,dataSourceApi:a})}function Il(o,e,t){let n=t.getState().editingCell;return UC(o,e,t,{isCellFocusable:yi,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function vp(o,e,t){let n=(0,Rp.default)(t,o+e,$C);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=vp;function UC(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,f)=>(d.push(f.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:vp(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function Ip(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=yi(e,o)?e:Il(e,-1,o);if(t){await xl([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;gi(n)?.focus()}}async function xl([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=jC,l=null,s=!1;function c(u=0){u++,ht(l),l=Pe(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await wp(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var YC=`.${pn}`;function xp(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:In(n,YC),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=o.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&yi({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:Il({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=Sp(document.body),d=o.getState().focusDetectDOMRef.current,f=u.findIndex(m=>m===d);u[f+1]?.focus()}return!0}return xl([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;gi(u)?.focus()}),!0}var Pp={control:"ctrl"},Dp={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},qC={esc:"escape"},Ep={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Mp=Object.keys(Ep),Pl=new Set(Mp),XC=new Set(["shift","alt"]);function Dl(o,e){return Array.isArray(e)?e.some(t=>Ap(o,t)):Ap(o,e)}function Ap(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(f=>f.toLowerCase().trim()),r=n.find(f=>Dp[f]),i=n.map(f=>Pp[f]||Dp[f]||qC[f]||f),a=i.filter(f=>Pl.has(f)),l=i.filter(f=>!Pl.has(f)),s=Mp.reduce((f,p)=>(f[p]=Ep[p](o),f),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(f=>s[f]);if(!a.every(f=>s[f]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(p=>!XC.has(p)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||Pl.has(t)||t==="meta"||Pp[t]?!1:l.reduce((f,p)=>f?p==="*"||t===p:!1,!0)}async function _p(o,e){let t={...o,cloneRowSelection:a=>Zr(a,o.getDataSourceState),cloneTreeSelection:a=>ti(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&&Cp(t,e)&&e.preventDefault(),(xp(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&Df(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,c=o.getComputed().computedVisibleColumns[s];c.computedEditable&&o.api.startEdit({rowIndex:l,columnId:c.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!Dl(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function eT(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=X(),{getState:i,componentActions:a,api:l}=Re();return QC(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>ti(u,i),cloneRowSelection:u=>Zr(u,i)}),[o,e,i,a,t,l,n])}function tT(){let o=eT();JC(()=>{let e=o.getState().keyDown.onChange(a=>{_p(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=Ye(s.id,o);yp({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=o.getComputed().computedVisibleColumns[c],d=Ye(u.id,o);bp({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function nT(){let{getState:o}=X();return{onKeyDown:ZC(t=>{o().keyDown(t)},[])}}function Fp(){return tT(),nT()}import{useEffect as im}from"react";import*as Ee from"react";import{useCallback as El,useEffect as aT,useLayoutEffect as lT,useState as Ci}from"react";import{createPortal as sT}from"react-dom";var Ve=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 Op(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Np(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function oT(o,e,t){let n=Op(o,t),r=Op(e,t);return n===r?Np(t,e)-Np(t,o):n-r}function rT(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)=>oT(n,r,t)),e}function Lp(o,e){o=rT(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(iT([t,i,a],e))return!0}return!1}function iT(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 Zn=class{containsPoint(e){return Lp(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Qn=class o extends Zn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(Ve.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};var Le=class o extends Zn{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})}containsPoint(t){return new Qn(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Ve.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};function Al(o){return!!o.tagName}function Vp(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Le.from(Al(e)?e.getBoundingClientRect():e),a=Le.from(Al(t)?t.getBoundingClientRect():t),l=n?Le.from(Al(n)?n.getBoundingClientRect():n):null;if(!l)return{...zp({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=zp({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function zp(o){let e=Le.from(o.targetRect),t=Le.from(o.anchorRect),n=o.constrainRect?Le.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=kp(e,i),s=kp(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function kp(o,e){return e==="TopLeft"?Ve.from({top:o.top,left:o.left}):e==="TopCenter"?Ve.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Ve.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Ve.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Ve.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Ve.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Ve.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Ve.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Ve.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)})}var bi="__is_infinite_menu_component";function cT(o){return o&&typeof o.then=="function"||o instanceof Promise}function Hp(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Gp(o){return typeof o=="function"&&(o=o()),cT(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&Hp(o)&&(o=o.getBoundingClientRect()),o?Le.from(o):null}async function uT(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)),Hp(n)&&(r=n),r||null}return t(await e)}function dT(o){return Ee.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function fT(o){let e=Ee.useRef(null);return aT(()=>o.realign.onChange(t=>{e.current&&t&&Kp(e.current,t)}),[o.realign]),Ee.createElement("div",{style:{position:"absolute",top:0,left:0},ref:El(t=>{t&&Kp(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}async function Kp(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 Gp(t)||void 0,a=n?await Gp(n):void 0,l=Le.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Vp({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),f=d.left,p=d.top,m=s.left-f,h=s.top-p;o.style.transform=`translate3d(${m}px,${h}px, 0px)`}}}function pT(o,e){let[t,n]=Ci(null);return lT(()=>{async function r(){let i=e?await uT(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?sT(o,t):Ee.createElement(Ee.Fragment,null):e===null||e===!1?o:Ee.createElement(dT,null,o)}function mT(o){if(Ee.Children.count(o)===1){let e=Ee.Children.only(o);if(Ee.isValidElement(e))return e.props.id||e.key}return null}function hT(o,e,t){if(Ee.Children.count(o)===1){let n=Ee.Children.only(o);if(Ee.isValidElement(n)&&n.type[bi]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Ee.cloneElement(n,r)}}return o}globalThis.allhandles={};globalThis.thehandles={};function kt(o){let e=o,[t]=Ci(()=>new Map),[n,r]=Ci(null),[i,a]=Ci(0),l=El(()=>{let m=[];for(let[h,g]of t)m.push(Ee.createElement(fT,{...g,key:g.key}));return m},[]),[s,c]=St(),u=pT(l(),o.portalContainer),d=El((m,h)=>{let y=`${h.id||mT(m)||yt()}`,b=t.get(y),T=R=>()=>{let w=typeof R=="function"?R():R;return hT(w,e.portalContainer,h.constrainTo??e.constrainTo)},S=T(m),C=(R,w)=>{if(!b)return;let v=T(R);Object.assign(b,{children:v}),c(),!!!w?.skipRealign&&(r(b.key),a(Date.now()))};return b?(Object.assign(b,h),C(m),C):(b={key:y,children:S,alignPosition:h.alignPosition,alignTo:h.alignTo,constrainTo:h.constrainTo,realign:fe()},t.set(b.key,b),c(),C)},[t,e.portalContainer,c]);Ee.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let f=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},p=()=>{t.clear(),c()};return Ee.useEffect(()=>{},[]),{portal:u,hideOverlay:f,clearAll:p,rerenderOverlays:c,showOverlay:d}}import*as om from"react";import*as eo from"react";import*as Jn from"react";import*as Ho from"react";function Ti(o){return null}Ti.defaultProps={__is_menu_item:!0};var Bp="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw16 _16lm1iw1n _16lm1iw8",Wp=ye({defaultClassName:"db3arf2 _16lm1iwz _16lm1iw1r _16lm1iw17",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwj _16lm1iw17",false:"_16lm1iwi"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),jp="db3arf1",$p="db3arfd";var gT="-";function yT(){return Ho.createElement("hr",{className:$p})}var Si=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===gT?Ho.createElement(yT,null):r:null;return i!=null?{type:"item",parentMenuId:n,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}};function Up(o,e){return Ho.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Ti)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Si(o,n)}return Si(o,t)})||[]}var Yp="submenu";function qp(){let o=Jn.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:yt(),focused:!1,destroyed:!1,domRef:o}}var Xp=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),bT=[{name:"label"}],Zp=o=>{let{props:e,state:t}=o,{activeItemKey:n,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||bT],d={columns:u,keyboardActiveItemKey:r,activeItemKey:n,menuId:c},f=[];i?f=i.map(Si.bind(null,d)):!i&&typeof a!="function"&&(f=Up(d,a)),l&&f.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!u.find(h=>h.name==Yp)&&u.push({name:Yp,render:({domProps:h,item:g})=>g.menu?Jn.createElement("div",{...h},Jn.createElement(dn,{expanded:!1})):Jn.createElement("div",{...h})});let p=f.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:f,runtimeSelectableItems:p,columns:u,menuId:c}};import*as Ct from"react";import{useCallback as wn,useLayoutEffect as PT,useRef as DT,useState as Fl}from"react";var Bo=class extends Qn{constructor(e){super(e.slice(0,3))}};var CT=250;function TT(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}Pe(i)};Pe(()=>{i()})})}var ST=Ae(),wi=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||CT;this.getPointerMoveTarget=()=>document.documentElement||ST;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 Ve({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new Bo([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Bo([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,TT(()=>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 Ve({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 wT,useContext as RT}from"react";var Ml=wT(null);function _l(){return RT(Ml)}import{useCallback as vT,useEffect as IT,useRef as xT}from"react";function Qp(){let o=xT(!0);return IT(()=>(o.current=!0,()=>{o.current=!1}),[]),vT(()=>o.current,[])}function AT(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=o.menu;return u?(typeof u=="function"&&(u=u()),Ct.createElement(It,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,f)=>{u?.onShow?.(d,f),n(f)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function ET(o,e){let t=Jp(o,e);if(!t.length)return null;let n=Le.from(t[0]?.getBoundingClientRect()),r=Le.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function Jp(o,e){let t=In(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 MT(o,e){let t=Jp(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}function _T({onItemActivate:o}){let{getState:e}=_l(),[{onItemEnter:t,onItemLeave:n}]=Fl(()=>new wi({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?Le.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:wn(t,[]),onItemLeave:wn(n,[])}}function em(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:f,autoFocus:p,parentMenuItemKey:m,domRef:h},componentActions:g,getState:y}=_l(),b=wn(k=>{g.keyboardActiveItemKey=k},[]),T=wn(k=>{g.activeItemKey=k},[]),S=Qp(),[C,R]=Fl(null),w=null;PT(()=>{let{runtimeItems:k}=y(),B=k.filter(ae=>ae.type==="item"&&i===ae.key)[0];if(!B||!B.menu){R(null),P();return}if(B){let ae=ET(r,B.key);ae&&I(()=>AT(B,{constrainTo:l,setSubmenuApi:R,setActiveItemKey:T,setKeyboardActiveItemKey:b,parentMenuId:r,onHideIntent:$,api:te}),{id:`${r}-submenu`,alignTo:ae,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(k,B)=>{b(B.key),T(B.key),B.originalMenuItem.onClick&&B.originalMenuItem.onClick(k);let ae={key:B.key,item:B.originalMenuItem,hideMenu:$};B.originalMenuItem.onAction&&B.originalMenuItem.onAction(ae),c&&c(ae),B.originalMenuItem.hideMenuOnAction&&$()},{showOverlay:I,portal:x,clearAll:P}=kt({portalContainer:!1}),{onItemEnter:E,onItemLeave:_}=_T({onItemActivate:k=>{if(!S())return;let B=k?k.key:null;T(B)}});w=n.map((k,B)=>Ct.createElement(FT,{key:k.type==="item"?k.key:B,onItemEnter:(ae,ne)=>{E(ae.key,ne)},onItemLeave:(ae,ne)=>{_(ae.key,ne)},columns:t,active:k.type==="item"&&k.key===i,keyboardActive:k.type==="item"&&k.key===a,item:k,index:B,onClick:v}));let A=t.map(k=>k.width||(typeof k.flex=="number"?`${k.flex}fr`:k.flex)||"auto").join(" "),F={...e.style,gridTemplateColumns:A,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(F.whiteSpace="nowrap");function D(k){let{runtimeItems:B,runtimeSelectableItems:ae}=y(),ne=B.findIndex(j=>j.type==="item"&&j.key===a),W=a,z=B[ne],L={ArrowUp:()=>{let j=B.slice(0,ne).filter(le=>le.type==="item"&&!le.disabled).pop();j&&j.type==="item"&&j.key&&(W=j.key)},ArrowDown:()=>{let j=B.slice(ne+1).filter(le=>le.type==="item"&&!le.disabled)[0];j&&j.type==="item"&&j.key&&(W=j.key)},Home:()=>{L.PageUp()},End:()=>{L.PageDown()},PageUp:()=>{W=ae[0].key},PageDown:()=>{W=ae[ae.length-1].key},ArrowLeft:()=>{T(null),y().parentMenuId&&(g.destroyed=!0)},ArrowRight:()=>{z&&(T(z.key),Pe(()=>{S()&&C&&C.getParentMenuId()===y().menuId&&C.focus()}))},Enter:()=>{if(z)if(z.originalMenuItem?.menu){if(z&&z.originalMenuItem.menu&&C){L.ArrowLeft();return}z&&T(z.key)}else v(k,z)}," ":()=>{if(!z)return;z.originalMenuItem.menu||v(k,z);let j=MT(r,z.key);j&&j.click()},Escape:()=>{L.ArrowLeft();let j=y();j.parentMenuId||j.onHideIntent?.(j)}},Z=L[k.key];Z&&(Z(),k.preventDefault()),W!=a&&b(W)}function M(){g.focused=!1}let N=wn(function(){g.focused=!0,setTimeout(()=>{V.current&&h.current&&h.current===document.activeElement&&y().keyboardActiveItemKey==null&&b(y().runtimeSelectableItems[0]?.key??null)})},[]),V=DT(!0),$=wn(()=>{let k=y();k.onHideIntent?.(k)},[y]),[te]=Fl(()=>({hideMenu:$,focus:()=>{h.current&&(h.current.focus(),setTimeout(()=>{h.current&&h.current!==document.activeElement&&h.current.focus()},10),N())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),he=wn(k=>{k?(h.current=k,d?.(y(),te),p&&te.focus()):(f?.(y()),h.current=k)},[]),ce=Ct.createElement("div",{className:_n.contents},Ct.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:he,onKeyDown:k=>{e.onKeyDown?.(k),D(k)},onMouseDown:k=>{V.current=!1,e.onMouseDown?.(k)},onMouseUp:k=>{V.current=!0,e.onMouseUp?.(k)},onFocus:N,onBlur:M,className:J(Bp,e.className,"InfiniteMenu"),style:F},w),x);return s?null:ce}function FT(o){let[e,t]=Ct.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=Ct.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,f)=>{let p=r.value,m=d.field||d.name,h=f+1,g=h+r.span;if(h<u)return null;u=g;let b={style:{...d.style,...r.style,gridColumnStart:h,gridColumnEnd:g},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:J(Wp({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?Ct.createElement(Do,{key:`${s}-${m}`,render:d.render,renderParam:{item:p,column:d,value:p[m],domProps:b}}):Ct.createElement("div",{key:`${s}-${m}`,...b},p[m])}).filter(Boolean)}return Ct.createElement("div",{className:jp},c)}var{ManagedComponentContextProvider:OT}=At({initSetupState:qp,forwardProps:Xp,mapPropsToState:Zp,layoutEffect:!0});function NT(o){let{componentActions:e,componentState:t}=Ge(),n=Me(t);return eo.createElement(Ml.Provider,{value:{componentActions:e,componentState:t,getState:n}},eo.createElement(em,{domProps:o.domProps}))}function It(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:f,parentMenuItemKey:p,autoFocus:m,id:h,onHideIntent:g,__is_infinite_menu_component:y,...b}=o;return eo.createElement(OT,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},eo.createElement(NT,{domProps:b}))}It[bi]=!0;import*as tm from"react";function nm(o,e){let{columnApi:t,column:n,getComputed:r,api:i}=e,l=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()}},"-"]:[],...l,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 c=[];return r().computedColumnsMapInInitialOrder.forEach((d,f)=>{let p=Pr(d,e);c.push({key:f,label:p,check:tm.createElement(Ut,{key:d.id,disabled:d.computedVisible&&i.getVisibleColumnsCount()===1,checked:d.computedVisible,onChange:m=>{let h=!!m;i.setVisibilityForColumn(d.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}}].filter(c=>!!c)}function rm(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??It,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:Ye(s.id,e),...e},u=nm([],c),d=a?a(u,c):u,f=m=>{m.__insideMenu=!0},p=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!d||!d.length?null:om.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:p,onHideIntent:m=>{p(m),t?.()}})}var LT=`[${ja["data-name"]}="${$a["data-name"]}"]`;function zT(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){n(),a.columnMenuVisibleForColumnId=null}let u=o.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${rd["data-column-id"]}="${e}"] ${LT}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>rm(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function am(){let o=X(),e=Oe(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});im(()=>{let{actions:c,getState:u}=o,d=u();return d.onColumnMenuClick.onChange(f=>{f&&(d.columnMenuTargetRef.current=f.target,c.contextMenuVisibleFor=null,c.cellContextMenuVisibleFor=null,c.filterOperatorMenuVisibleForColumnId=null,c.columnMenuVisibleForColumnId=f.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return im(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=t();if(c){let f=function(p){p.__insideMenu!==!0&&(a(),n.columnMenuVisibleForColumnId=null)};var d=f;return document.documentElement.addEventListener("mousedown",f),zT({columnId:c,context:o,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",f)}}else u.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}import*as lm from"react";import{useCallback as kT}from"react";var VT={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function sm(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=X(),{getState:a,getDataSourceMasterContext:l}=Re(),{focusDetectDOMRef:s}=o(),c=kT(async()=>{Ip({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return lm.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:VT})}import{useEffect as Wo}from"react";function GT(){let o=X(),{getState:e}=o,{editingCell:t}=e(),n=t&&!t.active?t.cancelled:void 0;Wo(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...at({rowIndex:r,columnId:i,...o}),initialValue:a})}},[n])}function KT(){let o=X(),{getState:e,state:{editingCell:t}}=o,n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;Wo(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...at({rowIndex:r,columnId:i,...o}),value:a,error:n,initialValue:l})}},[n])}function HT(){let o=X(),{state:{editingCell:e}}=o,t=e?.active,n=cn(t);Wo(()=>{!t&&n&&o.api.focus()},[t,n])}function BT(){let o=X(),{state:{editingCell:e},getState:t}=o,n=e&&!e.active&&!e.cancelled&&e.accepted===!0;Wo(()=>{if(n){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...at({rowIndex:a,columnId:l,...o}),value:i,initialValue:s};t().onEditAccepted?.(c),o.api.persistEdit({value:i})}},[n])}function WT(){let o=X(),{state:{editingCell:e},getState:t}=o,n=e?e.persisted:void 0;Wo(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...at({rowIndex:l,columnId:s,...o}),value:c,initialValue:u};n instanceof Error?i?.({...d,error:n}):a?.(d)}},[n])}function cm(){GT(),KT(),BT(),WT(),HT()}import{useEffect as pm}from"react";import*as tn from"react";import*as Ol from"react";var um=o=>Ol.createElement(_e,{...o},Ol.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));import*as Nl from"react";var dm=o=>Nl.createElement(_e,{...o},Nl.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function fm(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),f=u?.Menu??It,p=n().computedColumnsMap.get(o);if(!p)return null;let m=w=>{w.__insideMenu=!0},h=w=>{w.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:g}=i(),y=g[p.computedFilterType];if(!y)return null;let b=y.operators.map(w=>{let v=w.name,I=p.computedFilterValue?p.computedFilterValue.filter.operator===v:v===y.defaultOperator,x=w.components?.Icon??Nn;return{key:v,icon:tn.createElement(x,null),label:tn.createElement(tn.Fragment,null,w.label??w.name),onAction:()=>{c.setColumnFilterOperator(o,v)},checked:I?tn.createElement(dm,{size:16}):null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:tn.createElement(um,null),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...b],C={column:p,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:p.computedFilterValue,filterTypes:g},R=d?d(S,C):S;return tn.createElement(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:R,onShow:w=>{w.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:h,onHideIntent:w=>{h(w),t?.()}})}var Ri=10;function mm(){let o=X(),e=Oe(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return pm(()=>{let{actions:l,getState:s}=o;return s().onFilterOperatorMenuClick.onChange(u=>{if(!u)return;let{target:d,column:f}=u;function p(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,h=Le.from(m.getBoundingClientRect());h.top-=Ri,h.left-=Ri,h.width+=2*Ri,h.height+=2*Ri,r(()=>fm(f.id,o,p),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:h,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=f.id})},[]),pm(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as Ii}from"react";import*as Vl from"react";import*as Ll from"react";function vi(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 zl(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 kl(o,e,t){if(!o)return null;let n=fe();return o.then(r=>{let{items:i,columns:a}=vi(r);i&&i.length&&n(Ll.createElement(t,{...e,items:i||[],columns:a}))}),Ll.createElement(Kt,{updater:n})}function hm(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??It,{computedColumnsMap:d}=a(),f=d.get(n),p={...at({...e,rowIndex:r,columnId:f.id}),event:i};if(!f||!c)return{cellContext:p,menu:null,preventDefault:!1};let m=zl({onHideIntent:t}),h=c(p,e),g=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:p,menu:kl(h,m,u),preventDefault:g};let{items:y,columns:b}=vi(h);return!y||!y.length?{cellContext:p,menu:null,preventDefault:Array.isArray(y)}:{preventDefault:g,menu:Vl.createElement(u,{...m,columns:b,items:y}),cellContext:p}}function gm(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??It,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...at({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=zl({onHideIntent:t}),f=a(u,e),p=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:u,menu:kl(f,d,l),preventDefault:p};let{items:m,columns:h}=vi(f);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:p,menu:Vl.createElement(l,{...d,columns:h,items:m}),cellContext:u}}var xi=5,ym=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function bm(){let o=X(),e=Oe(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Ii(()=>{let{actions:l,getState:s,getDataSourceState:c}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:f}=d;function p(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:h,preventDefault:g}=hm(d,o,p),y=Le.fromPoint({top:f.clientY,left:f.clientX});y.width+=xi,y.height+=xi,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:ym}),g&&f.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:b}=s();b&&b({...h,getState:s,getDataSourceState:c},f)})},[]),Ii(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Cm(){let o=X(),e=Oe(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Ii(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function f(){a(),l.contextMenuVisibleFor=null}let{menu:p,cellContext:m,preventDefault:h}=gm(u,o,f),g={top:d.clientY,left:d.clientX},y=Le.fromPoint(g);y.width+=xi,y.height+=xi,r(p,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:ym}),h&&d.preventDefault(),l.contextMenuVisibleFor={point:g,...u};let{onContextMenu:b}=s();b&&b({...o,...m},d)})},[]),Ii(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as UT}from"react";import*as Tm from"react";import{useCallback as jT,useEffect as $T}from"react";function Gl(o,e){let{state:{brain:t}}=X(),n=jT(o,e);$T(()=>t.onScroll(n),[t,n])}var Kl="yzx0vj0";function Sm(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=UT(null);Gl(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=se.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=se.runtime.bodyWidth),n==="column"?l.minWidth=se.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=se.runtime.bodyWidth),t==="column"?l.maxWidth=se.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=se.runtime.bodyWidth),Tm.createElement("div",{ref:a,...i,className:i.className?J(i.className,Kl):Kl,style:l},i.children)}var YT=Y(U.columnWidthAtIndex),qT=Y(U.columnOffsetAtIndex);function XT(){return X().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${YT}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${qT}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Pi="InfiniteTable";import{useEffect as ZT}from"react";function wm(){let{state:o,getState:e,actions:t}=X(),{wrapRowsHorizontally:n}=o,r=cn(n);ZT(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Cl(Pi,!!n);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,n])}import{useEffect as QT}from"react";function Rm(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=X(),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),QT(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:p,repeatWrappedGroupRows:m}=n(),h=!1,g=l.rowsPerPage,y=(r&&r.length>0||i)&&g>0?g:null;return p!=y&&(t.rowsPerPage=y,h=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,h=!0),h};u();let d,f=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),f()}},[l,s,r,i,c])}import{useEffect as Di,useRef as JT}from"react";var jo=ye({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),vm="_143ofgf5",Im="_143ofgf3";var eS=Y(se.loaded),Hl={source:"infinite-table-page",target:"infinite-table-devtools-background"};function xm(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...Hl,url:Bl(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Hl,url:Bl(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var Bl=Ue(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function tS(o){window.postMessage(o)}var nS=Ue(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){ft.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(xm({type:"update",debugId:e},t))}else of(e),window.postMessage(xm({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,ke.onLogIntent("*",e=>{tS({...Hl,url:Bl(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>typeof t=="object"&&t!==null?JSON.stringify(t):String(t)),timestamp:e.timestamp}})}),o});function Pm(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=X(),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(eS)!==`${Ss}`&&No({debugId:i,key:"CSS001_CSS"}),Di(()=>{e().debugId!==i&&(t.debugId=i)},[i]),iS()}var Ai=fe(),oS={revertAll:o=>{let e=ft.get(o.debugId);if(e){let t=Jt.get(o.debugId);Jt.delete(o.debugId),Ot.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Lt.get(o.debugId);Lt.delete(o.debugId),Nt.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=ft.get(o.debugId);if(e){let t=o.property,n=Ot.get(o.debugId),r=Jt.get(o.debugId),i=Nt.get(o.debugId),a=Lt.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=Lt.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=ft.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Lo(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Lo(o.debugId))}}},discardAllWarnings:o=>{let e=ft.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Lo(o.debugId))},setColumnVisibility:o=>{sl(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{ii(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{sl(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{ii(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{ii(o.debugId,"multiSort",o.multiSort)},highlight:o=>{let e=ft.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${jo.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(jo.classNames.base),r.innerHTML=[`<div class="${Im}"></div>`,`<div class="${vm}"></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(jo.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(jo.classNames.variants.active.true)}}}}};function rS(){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__||(nS(),Ai(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=oS[e];t&&t(o.data.payload)}})}rS();function iS(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=X(),s=o().debugId,c=JT(s);return c.current=s,Di(()=>{let u=c.current;if(!u)return;let d=p=>{p(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},f=Ai.get();if(f){d(f);return}return Ai.onChange(p=>{p&&d(p)})},[]),Di(()=>{let u=c.current;if(!u)return;let d=Ai.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),Di(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function aS(){let o=Oe(),e=o?o.getMasterState():null,t=X().getState();return(e||t).portalDOMRef.current}var Et=xe.rootClassName,lS=[Mu,"InfiniteColumnCell--hovered"],{ManagedComponentContextProvider:sS}=At({initSetupState:Uf,forwardProps:Yf,mapPropsToState:Qf,cleanup:qf,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Zf(),getParentState:()=>vn(),debugName:o=>Ht(o.debugId,Pi)});function Am(){let o=X(),{state:e,getComputed:t}=o,{header:n,brain:r,headerBrain:i,wrapRowsHorizontally:a}=e,{scrollbars:l}=t();return n?me.createElement(Cd,{wrapRowsHorizontally:!!a,bodyBrain:r,headerBrain:i,scrollbars:l}):null}var Dm=J(`${et}Body`,So.relative,Sr[1],fc);function cS(o){return me.createElement("div",{...o,className:o.className?J(Dm,o.className):Dm})}function Em(){let o=X(),e=Oe(),{state:t,getComputed:n,api:r}=o,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,scrollStopDelay:d,brain:f,scrollerDOMRef:p,components:m,bodySize:h,activeCellIndex:g,rowDetailRenderer:y,showHoverRows:b,wrapRowsHorizontally:T,domProps:S,domRef:C}=t,R=m?.LoadMask??$r,w=n(),{computedRowHeight:v,computedRowSizeCacheForDetails:I}=w,x=I?.getRowHeight||v,{componentState:{loading:P}}=Re(),E=me.useCallback(M=>{let N=o.getState(),V=M.target;if(!e&&M._from_row_detail)return;e&&(M._from_row_detail=!0);let $=Ts(V,bl(),N.domRef.current),te,he,ce,k;$&&(he=Number($.dataset.colIndex),k=Number($.dataset.rowIndex),te=o.getComputed().computedVisibleColumns[he].id,ce=o.dataSourceApi.getRowInfoArray()[k].id);let B={columnId:te,colIndex:he,rowId:ce,rowIndex:k,event:M,target:$??M.target};$&&N.cellContextMenu(B),N.contextMenu(B)},[]),{renderCell:_,renderDetailRow:A}=Vf({imperativeApi:r,getComputed:n,domRef:C,bodySize:h,computed:w}),{autoFocus:F,tabIndex:D}=S??{};return wm(),me.createElement(cS,{onContextMenu:E},me.createElement(Qs,{forceRerenderTimestamp:t.forceBodyRerenderTimestamp,debugId:l,tabIndex:D??0,autoFocus:F??void 0,activeRowIndex:t.ready&&s==="row"?c:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?g:null,scrollStopDelay:d,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:f,activeCellRowHeight:x,renderCell:_,renderDetailRow:y?A:void 0,cellHoverClassNames:b?lS:void 0,scrollerDOMRef:p,scrollVarHostRef:C}),me.createElement(R,{visible:P},u))}var uS=me.memo(function(){let e=X(),t=Oe(),{state:n,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=Re(),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:f,onRowDetailHeightCSSVarChange:p,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:h,rowDetailHeightCSSVar:g,columnHeaderHeightCSSVar:y,scrollStopDelay:b,brain:T,activeRowIndex:S,activeCellIndex:C}=n,{licenseKey:R}=n;!R&&nn.licenseKey&&(R=nn.licenseKey),hp(S,a.length,r),fp(C,a.length,r);let{onKeyDown:w}=Fp();me.useEffect(()=>{let V=l(),$=xt(te=>{V.notifyRenderRangeChange({renderStartIndex:te[0],renderEndIndex:te[1]})},{wait:b});return T.onVerticalRenderRangeChange($)},[T,b]);let v=cp(R),{autoFocus:I,tabIndex:x,...P}=n.domProps??{},E=yu(P);me.useEffect(()=>{T.setScrollStopDelay(b),s.scrollStopDelayUpdatedByTable=b},[b]),Ff(),Rm(),cm();let{menuPortal:_}=am(),{menuPortal:A}=bm(),{menuPortal:F}=Cm(),{menuPortal:D}=mm();me.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(n.id,n.ready,e.api,e)},[n.ready]);let M=Pm();me.useEffect(()=>{t&&(u.current=t.getMasterState().portalDOMRef.current)},[]);let N=i??me.createElement(me.Fragment,null,me.createElement(Am,null),me.createElement(Em,null));return me.createElement("div",{"data-debug-id":M,onKeyDown:w,ref:c,...E},N,me.createElement("div",{ref:u,className:J(`${et}Portal`,hc[1e7],So.absolute,dc[0],sc[0])},_,A,F,D),h?me.createElement(uo,{key:"row-height",varName:h,onChange:d}):null,me.createElement(uo,{key:"flashing-duration",allowInts:!0,varName:se.components.Cell.flashingDuration,onChange:f}),g?me.createElement(uo,{key:"row-detail-height",varName:g,onChange:p}):null,y?me.createElement(uo,{key:"column-header-height",varName:y,onChange:m}):null,v?null:me.createElement(Rd,null),me.createElement(sm,null))});function dS({children:o}){let{componentActions:e,componentState:t}=Ge(),{scrollerDOMRef:n,scrollTopKey:r}=t,i=ip(),a=Me(i),l=Me(t),s=Oe(),{getState:c,componentActions:u,getDataSourceMasterContext:d,api:f}=Re(),[p]=me.useState(()=>Mf({getComputed:a,getState:l,getDataSourceState:c,getDataSourceMasterContext:d,dataSourceApi:f,actions:e,dataSourceActions:u})),m={actions:e,state:t,computed:i,dataSourceActions:u,getDataSourceMasterContext:d,getDataSourceState:c,getComputed:a,getState:l,api:p,dataSourceApi:f,children:o};Jo(n,g=>{let y={width:g.width,height:g.height};e.bodySize=y},{earlyAttach:!0,debounce:50}),me.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[r,n]);let h=Fn();return me.createElement(h.Provider,{value:m},me.createElement(uS,null))}var fS=40,pS=gp(ws),nn=function(o){return me.createElement(sS,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:fS,columnHeaderHeight:pS,...o},me.createElement(dS,{children:o.children}))};nn.Header=Am;nn.Body=Em;nn.HScrollSyncContent=Sm;nn.Footer=()=>me.createElement(yc,null);import*as Mm from"react";function wH(o){let{DataSource:e}=zo({nodesKey:"children",...o});return Mm.createElement(e,null,o.children??null)}import*as _m from"react";function mS(o){return _m.createElement(nn,{...o})}var Ei=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=ke(`${e}:DataQuery`)}};function to(o){if(Array.isArray(o))return o.map(to);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]=to(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var Vt=class Vt{constructor(e){this.queryCache=new q;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=to(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 Ei(`${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=to(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=to(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=to(e);this.queryCache.delete(t)};if(this.options=e,Vt.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)}Vt.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Vt.clients.get(e);t&&t.destroy()}static destroyAll(){Vt.clients.forEach(e=>{Vt.destroy(e.name)})}destroy(){Vt.clients.delete(this.options.name)}};Vt.clients=new Map;var Fm=Vt;var hS={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})})}}}},gS={instantEdit:hS};import{useEffect as WH}from"react";function yS(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 Mi=class Mi{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Mi.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}};Mi.DEFAULT_SIZE=10;var Wl=Mi;var _i=class _i{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??_i.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}};_i.DEFAULT_SIZE=10;var jl=_i;import{useEffect as bS,useRef as Fi}from"react";var CS=(o,e)=>o.every((t,n)=>t===e[n]),TS=(o,e)=>{let t=Fi(e),n=CS(e,t.current),r=Fi(!0);t.current=e;let i=Fi(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=Fi(o);l.current=o,bS(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as SS,useRef as $o}from"react";var Om=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),$l=(o,e)=>{let{same:t,different:n,compare:r}=e,i=$o(t),a=$o(n),l=Om(t,i.current,r),s=!Om(n,a.current,r),c=$o(!0);i.current=t,a.current=n;let u=$o(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let f=$o(o);f.current=o,l&&s&&(c.current=!1),SS(()=>{if(!c.current)return f.current()},d)};import*as ct from"react";var Nm=Y(U.currentFlashingDuration),wS=({children:o})=>ct.createElement(ct.Fragment,null,o),Lm=1e3,zm={up:gr({direction:"up"}).split(" "),down:gr({direction:"down"}).split(" "),neutral:gr({direction:"neutral"}).split(" ")},km=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=wS}=o;return ct.forwardRef((i,a)=>{let l=Kr(),{state:{flashingDurationCSSVarValue:s}}=X(),c=typeof s=="number"?s??e??Lm:e??Lm,{domRef:u,value:d,column:f,rowInfo:p,htmlElementRef:m}=l,h=p.id,g=f.id,y=ct.useRef(!0),b=ct.useRef(d),T=y.current?null:b.current;y.current=!1;let S=ct.useRef(void 0),C=ct.useRef(void 0),R=ct.useRef(void 0);return $l(()=>{if(d===b.current)return;let w=()=>{let P=m.current;if(S.current&&(clearTimeout(S.current),S.current=void 0),R.current&&(clearTimeout(R.current),R.current=void 0),C.current&&P){let E=C.current,_=zm[E];P.classList.remove(...t?[t,..._]:_),P.style.removeProperty(Nm),C.current=void 0}};b.current=d;let v=m.current;if(!v)return;w();let I=typeof d=="number"?d>T?"up":"down":"neutral",x=zm[I];return v.style.setProperty(Nm,`${c}`),v.classList.add(...t?[t,...x]:x),C.current=I,S.current=setTimeout(w,c),w},{same:[g,h],different:[d]}),ct.createElement("div",{ref:u,...i,className:J(i.className)},n({children:i.children,oldValue:T}))})},RS=km();var mB={CheckBox:Ut,LoadMask:$r,MenuIcon:Ao,StringFilterEditor:zn,NumberFilterEditor:Mr};export{Ne as CellSelectionState,Fm as DataClient,tN as DataSource,Hb as DataSourceActionType,q as DeepMap,Wl as FixedSizeSet,RS as FlashingColumnCell,lt as GroupRowsState,nn as InfiniteTable,Et as InfiniteTableClassName,uS as InfiniteTableComponent,It as Menu,ko as RowDetailCache,pt as RowDetailState,st as RowDisabledState,we as RowSelectionState,wH as TreeDataSource,Xe as TreeExpandState,mS as TreeGrid,Ze as TreeSelectionState,jl as WeakFixedSizeSet,Kp as alignNode,mB as components,km as createFlashingColumnCellComponent,xt as debounce,ke as debug,un as defaultFilterTypes,Dl as eventMatchesKeyboardShortcut,Qd as filterDataArray,un as filterTypes,jy as flatten,At as getComponentStateRoot,Qa as group,yS as interceptMap,gS as keyboardShortcuts,Ft as multisort,Ja as multisortNested,to as queryKeyToCacheKey,Yy as toTreeDataArray,Ge as useComponentState,zo as useDataSourceInternal,vn as useDataSourceState,$l as useEffectWhen,TS as useEffectWhenSameDeps,jn as useEffectWithChanges,m_ as useEffectWithObject,Gl as useGridScroll,Kr as useInfiniteColumnCell,Ga as useInfiniteColumnEditor,Ro as useInfiniteColumnFilterEditor,Er as useInfiniteHeaderCell,aS as useInfinitePortalContainer,p_ as useLayoutEffectWithChanges,Rf as useManagedDataSource,oN as useMasterRowInfo,kt as useOverlay,pT as useOverlayPortal,cn as usePrevious,nN as useRowInfoReducers,XT as useVisibleColumnSizes};
30
30
  //!collapsed || lazyLoad;