@epam/ai-dial-ui-kit 0.9.0-rc.36 → 0.9.0-rc.37
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/dist/dial-ui-kit.cjs.js
CHANGED
|
@@ -66,4 +66,4 @@ If you are trying to annotate ${o} with application data, use the '${o}.context'
|
|
|
66
66
|
`,c6=class extends HT{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:s}=e;this.suppressQuotes=t,this.columnSeparator=s}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,mp),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((s,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(s.data.value||""),s.mergeAcross&&this.appendEmptyCells(s.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,s,o){s!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,s){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",s);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():($(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=mp),this.isFirstLine=!1}},d6=class extends NT{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){$(51);return}const t=this.getMergedParams(e),s=this.getData(t),o=new Blob(["\uFEFF",s],{type:"text/plain"}),n=typeof t.fileName=="function"?t.fileName(Se(this.gos,{})):t.fileName;GT(this.getFileName(n),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const s=t?Object.assign({},e):this.getMergedParams(e);return this.getData(s)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:o,valueSvc:n,gos:i}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u}=e;return new c6({colModel:t,colNames:s,valueSvc:n,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function u6(e,t){return e.csvCreator?.getDataAsCsv(t)}function h6(e,t){e.csvCreator?.exportDataAsCsv(t)}var g6={moduleName:"CsvExport",version:ee,beans:[d6],apiFunctions:{getDataAsCsv:u6,exportDataAsCsv:h6},dependsOn:[l6]},p6=class extends O{constructor(e,t,s){super(),this.id=e,this.parentCache=t,this.params=s,this.state="needsLoading",this.version=0,this.startRow=e*s.blockSize,this.endRow=this.startRow+s.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,s){this.successCommon(e,{rowData:t,rowCount:s})}isRequestMostRecentAndLive(e){const t=e===this.version,s=this.isAlive();return t&&s}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:s,beans:o,rowNodes:n}=this;for(let i=0;i<e;i++){const r=s+i,a=new co(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),n.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:s,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:s,pageStatus:o}}}setDataAndId(e,t,s){te(t)?e.setDataAndId(t,s.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Xe(this.params.datasource.getRows)){$(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:s,params:{sortModel:o,filterModel:n},gos:i}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,s),failCallback:this.pageLoadFailed.bind(this,s),sortModel:o,filterModel:n,context:Se(i,{}).context}}forEachNode(e,t,s){this.rowNodes.forEach((o,n)=>{this.startRow+n<s&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const s=e-this.startRow;return this.rowNodes[s]}processServerResult(e){const{rowNodes:t,beans:s}=this;t.forEach((n,i)=>{const r=e.rowData?e.rowData[i]:void 0;!n.id&&n.alreadyRendered&&r&&(t[i]=new co(s),t[i].setRowIndex(n.rowIndex),t[i].setRowTop(n.rowTop),t[i].setRowHeight(n.rowHeight),n.clearRowTopAndRowIndex()),this.setDataAndId(t[i],r,this.startRow+i)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},f6=2,m6=class extends O{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const s=Math.floor(e/this.params.blockSize);let o=this.blocks[s];if(!o){if(t)return;o=this.createBlock(s)}return o.getRow(e)}createBlock(e){const t=this.params,s=this.createBean(new p6(e,this,t));return this.blocks[s.id]=s,this.blockCount++,this.purgeBlocksIfNeeded(s),t.rowNodeBlockLoader.addBlock(s),s}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Go(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),s=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(s);const o=this.params.maxBlocksInCache>0,n=o?this.params.maxBlocksInCache-1:null,i=f6-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,c=o?a>=n:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:s,endRow:o}=e;return t.rowIndex>=s&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:s}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,s-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:s,overflowSize:o}=this.params,i=(e.id+1)*s+o;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,te(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const s of this.getBlocksInOrder())s.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(s,o)=>s.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const s=[];let o=-1,n=!1;const i={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(n&&o+1!==l.id){r=!0;continue}o=l.id,l.forEachNode(c=>{const d=c===e||c===t;(n||d)&&s.push(c),d&&(n=!n)},i,this.rowCount)}return r||n?[]:s}},C6=class extends O{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new co(e);this.rootNode=t,t.level=-1,this.rowHeight=Mo(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Mo(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){let e;this.cacheParams?e=!Ki(this.cacheParams.sortModel,this.beans.sortSvc?.getSortModel()??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?.getRowNodesInRange(e,t)??[]}reset(){if(!this.datasource)return;Wn(this.gos)!=null||this.beans.selectionSvc?.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:s,rowNodeBlockLoader:o,eventSvc:n,gos:i}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:s?.getSortModel()??[],rowNodeBlockLoader:o,initialRowCount:i.get("infiniteInitialRowCount"),maxBlocksInCache:i.get("maxBlocksInCache"),rowHeight:Mo(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new m6(this.cacheParams)),n.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(s=>{s.id===e&&(t=s)}),t}forEachNode(e){this.infiniteCache?.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),s=this.getRowCount()-1;return t>s?s:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache?.refreshCache()}purgeCache(){this.infiniteCache?.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?.isLastRowIndexKnown()??!1}setRowCount(e,t){this.infiniteCache?.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function v6(e){xl(e)?.refreshCache()}function w6(e){xl(e)?.purgeCache()}function b6(e){return xl(e)?.getRowCount()}var S6=class extends O{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Fy(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=ut(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){ds(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Go(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(s=>s.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const s of t)s.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:s,state:o}=t.getBlockStateJson();e[s]=o}),e}printCacheStatus(){Go(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},y6={moduleName:"InfiniteRowModelCore",version:ee,rowModels:["infinite"],beans:[C6,S6]},x6={moduleName:"InfiniteRowModel",version:ee,apiFunctions:{refreshInfiniteCache:v6,purgeInfiniteCache:w6,getInfiniteRowCount:b6},dependsOn:[y6,OI]},R6="↑",F6="↓",E6={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},D6=class extends et{constructor(){super(E6),this.eValue=we,this.eDelta=we,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const s=Math.abs(t),o=e.formatValue(s),n=te(o)?o:s,i=t>=0,r=this.eDelta;i?r.textContent=R6+n:r.textContent=F6+n,r.classList.toggle("ag-value-change-delta-up",i),r.classList.toggle("ag-value-change-delta-down",!i)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Lt(this.eDelta)}refresh(e,t=!1){const{value:s,valueFormatted:o}=e,{eValue:n,lastValue:i,beans:r}=this;if(s===i||(te(o)?n.textContent=o:te(s)?n.textContent=s:Lt(n),r.filterManager?.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=s&&typeof s=="object"&&"toNumber"in s?s.toNumber():s,l=i&&typeof i=="object"&&"toNumber"in i?i.toNumber():i;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return i&&n.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=s,!0}},P6=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",T6={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},M6=class extends et{constructor(){super(T6),this.eCurrent=we,this.refreshCount=0,this.registerCSS(P6)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:s}=this,o=Pt({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=s.textContent,this.getGui().insertBefore(o,s),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.ePrevious?.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let s=e.value;if(Xe(s)&&(s=""),s===this.lastValue||this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=s;const o=this.eCurrent;return te(e.valueFormatted)?o.textContent=e.valueFormatted:te(e.value)?o.textContent=s:Lt(o),!0}},I6=class extends O{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,s=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const n=this.animations[t];n.delete(e);const i=Date.now(),r=i+s,a=i+s+o,l={phase:"flash",flashEndTime:r,fadeEndTime:a};n.set(e,l);const c=`ag-cell-${t}`,d=`${c}-animation`,{comp:u,eGui:{style:h}}=e;u.toggleCss(c,!0),u.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),s)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const s of Object.keys(this.animations)){const o=this.animations[s],n=`ag-cell-${s}`,i=`${n}-animation`;for(const[r,a]of o){if(!r.isAlive()||!r.comp){o.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:d}=a,u=l==="flash"?c:d;if(!(e+15>=u)){t=Math.min(u,t??1/0);continue}const{comp:p,eGui:{style:m}}=r;switch(l){case"flash":p.toggleCss(n,!1),p.toggleCss(i,!0),m.transition=`background-color ${d-c}ms`,m.transitionDelay=`${c-e}ms`,t=Math.min(d,t??1/0),a.phase="fade";break;case"fade":p.toggleCss(n,!1),p.toggleCss(i,!1),m.removeProperty("transition"),m.removeProperty("transition-delay"),o.delete(r);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const s=yE(e.cellPosition);t.cells[s]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t?.flashDuration,t?.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function k6(e,t={}){const{cellFlashSvc:s}=e;s&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(o,t)})}var A6={moduleName:"HighlightChanges",version:ee,beans:[I6],userComponents:{agAnimateShowChangeCellRenderer:D6,agAnimateSlideCellRenderer:M6},apiFunctions:{flashCells:k6}};function L6(e){return e.stateSvc?.getState()??{}}function O6(e,t,s){return e.stateSvc?.setState(t,s)}function Cp(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=N6(e)),e.version=ee,e}function N6(e){return e.cellSelection=H6(e,"rangeSelection"),e}function H6(e,t){if(e&&typeof e=="object")return e[t]}var G6=class extends O{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=ut(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=ut(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=ut(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:s}=this.beans;this.isClientSideRowModel=tt(e);const o=Cp(e.get("initialState")??{}),n=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const i=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>i(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&s?.hideColumns("columnState");const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),i(()=>{this.setupStateOnColumnsInitialised(o,!!n),s?.revealColumns("columnState")}))},rowCountReady:()=>{a?.(),i(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l?.(),i(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const s=Cp(e);delete s.partialColumnState,this.cachedState=s,this.startSuppressEvents();const o="api",n=t?new Set(t):void 0;this.setGridReadyState(s,o,n),this.setColumnsInitialisedState(s,o,!!n,n),this.setRowCountState(s,o,n),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(s,o,n),this.stopSuppressEvents(o)})}setGridReadyState(e,t,s){t==="api"&&!s?.has("sideBar")&&this.beans.sideBar?.comp?.setState(e.sideBar),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,s,o){this.setColumnState(e,t,s,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const s=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:s("aggregation"),columnMoved:s("columnOrder"),columnPinned:s("columnPinning"),columnResized:s("columnSizing"),columnVisible:s("columnVisibility"),columnPivotChanged:s("pivot"),columnPivotModeChanged:s("pivot"),columnRowGroupChanged:s("rowGroup"),sortChanged:s("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,s){const{filter:o,rowGroupExpansion:n,ssrmRowGroupExpansion:i,rowSelection:r,pagination:a}=e,l=(d,u)=>!s?.has(d)&&(u||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",n)&&this.setRowGroupExpansionState(i,n,t),l("rowSelection",r)&&this.setRowSelectionState(r,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:n,colFilter:i}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:s,columnRowGroupChanged:s,rowDataUpdated:()=>{(n.get("groupDefaultExpanded")!==0||n.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(s)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),i&&this.addManagedListeners(i,{filterStateChanged:o})}setFirstDataRenderedState(e,t,s){const{scroll:o,cellSelection:n,focusedCell:i,columnOrder:r,rowPinning:a}=e,l=(u,h)=>!s?.has(u)&&(h||t==="api");l("focusedCell",i)&&this.setFocusedCellState(i),l("cellSelection",n)&&this.setCellSelectionState(n),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!r?.orderedColIds,t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const d=this.getRangeSelectionState();c("rangeSelection",d),c("cellSelection",d),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:s,cellFocusCleared:s,cellSelectionChanged:o=>{if(o.finished){const n=this.getRangeSelectionState();t("rangeSelection",n),t("cellSelection",n)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return kT($a(e),e.colModel.isPivotMode())}setColumnState(e,t,s,o){const{sort:n,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:d,columnOrder:u}=e;let h=!1;const p=(T,I)=>{const N=!o?.has(T)&&!!(I||t==="api");return h||(h=N),N},m={},C=T=>{let I=m[T];return I||(I={colId:T},m[T]=I,I)},v={},w=p("sort",n);w&&n?.sortModel.forEach(({colId:T,sort:I},N)=>{const q=C(T);q.sort=I,q.sortIndex=N}),(w||!s)&&(v.sort=null,v.sortIndex=null);const b=p("rowGroup",i);b&&i?.groupColIds.forEach((T,I)=>{const N=C(T);N.rowGroup=!0,N.rowGroupIndex=I}),(b||!s)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=p("aggregation",r);S&&r?.aggregationModel.forEach(({colId:T,aggFunc:I})=>{C(T).aggFunc=I}),(S||!s)&&(v.aggFunc=null);const x=p("pivot",a);x&&(a?.pivotColIds.forEach((T,I)=>{const N=C(T);N.pivot=!0,N.pivotIndex=I}),this.gos.updateGridOptions({options:{pivotMode:!!a?.pivotMode},source:t})),(x||!s)&&(v.pivot=null,v.pivotIndex=null);const y=p("columnPinning",l);if(y){for(const T of l?.leftColIds??[])C(T).pinned="left";for(const T of l?.rightColIds??[])C(T).pinned="right"}(y||!s)&&(v.pinned=null);const F=p("columnVisibility",c);if(F)for(const T of c?.hiddenColIds??[])C(T).hide=!0;(F||!s)&&(v.hide=null);const R=p("columnSizing",d);if(R)for(const{colId:T,flex:I,width:N}of d?.columnSizingModel??[]){const q=C(T);q.flex=I??null,q.width=N}(R||!s)&&(v.flex=null);const E=u?.orderedColIds,D=!!E?.length&&!o?.has("columnOrder"),P=D?E.map(T=>C(T)):Object.values(m);(P.length||h)&&(this.columnStates=P,cs(this.beans,{state:P,applyOrder:D,defaultState:v},t))}setColumnPivotState(e,t){const s=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const n=this.beans,{pivotResultCols:i,colGroupSvc:r}=n;if(i?.isPivotResultColsPresent()){if(s){const a=[];for(const l of s)i.getPivotResultCol(l.colId)&&a.push(l);cs(n,{state:a,applyOrder:e},t)}o&&r?.setColumnGroupState(o,t)}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return AT(t)}setColumnGroupState(e,t,s){const o=this.beans.colGroupSvc;if(!o||s?.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const n=new Set(e.columnGroup?.openColumnGroupIds),r=o.getColumnGroupState().map(({groupId:a})=>{const l=n.has(a);return l&&n.delete(a),{groupId:a,open:l}});for(const a of n)r.push({groupId:a,open:!0});r.length&&(this.columnGroupStates=r),o.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e?.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const s=e?.getFilterState(),o=e?.getAdvFilterModel()??void 0;return t||o||s?{filterModel:t,columnFilterState:s,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:s,columnFilterState:o,advancedFilterModel:n}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(s!==void 0||o!==void 0)&&t?.setFilterState(s??null,o??null,"columnFilter"),n!==void 0&&t?.setAdvFilterModel(n??null,"advancedFilter")}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map(t=>{const{id:s,type:o,startRow:n,endRow:i,columns:r,startColumn:a}=t;return{id:s,type:o,startRow:n,endRow:i,colIds:r.map(l=>l.getColId()),startColId:a.getColId()}});return e?.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:s,colModel:o,visibleCols:n}=this.beans;if(!ao(t)||!s)return;const i=[];for(const r of e?.cellRanges??[]){const a=[];for(const c of r.colIds){const d=o.getCol(c);d&&a.push(d)}if(!a.length)continue;let l=o.getCol(r.startColId);if(!l){const c=n.allCols,d=new Set(a);l=c.find(u=>d.has(u))}i.push({...r,columns:a,startColumn:l})}s.setCellRanges(i)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:s}=e?.getVScrollPosition()??{top:0};return s||t?{top:s,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:s}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:n,animationFrameSvc:i,ctrlsSvc:r}=this.beans;o.wrapIncoming(()=>{r.get("center").setCenterViewportScrollLeft(s),r.getScrollFeature()?.setVerticalScrollPosition(t),n.redraw({afterScroll:!0}),i?.flushAllFrames()})}getSideBarState(){return this.beans.sideBar?.comp?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:s,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:s,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:s}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:n,rowPinned:i}=e;t.setFocusedCell({column:s.getCol(o),rowIndex:n,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const s=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!s&&!o))return{page:s,pageSize:o}}setPaginationState(e,t){const{pagination:s,gos:o}=this.beans;if(!s)return;const{pageSize:n,page:i}=e??{page:0,pageSize:o.get("paginationPageSize")},r=t==="gridInitializing";n&&!o.get("paginationAutoPageSize")&&s.setPageSize(n,r?"initialState":"pageSizeSelector"),typeof i=="number"&&(r?s.setPage(i):s.goToPage(i))}getRowSelectionState(){const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!t?.toggledNodes?.length?void 0:t}setRowSelectionState(e,t){this.beans.selectionSvc?.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){return this.beans.pinnedRowModel?.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t?.setPinnedState(e):t?.reset()}setRowGroupExpansionState(e,t,s){const o=this.beans.expansionSvc;if(!o)return;const n=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(n,s)}updateColumnState(e){const t=this.getColumnState();let s=!1;const o=this.cachedState;for(const n of Object.keys(t)){const i=t[n];Ki(i,o[n])||(s=!0)}this.cachedState={...o,...t},s&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const s=this.cachedState[e];this.setCachedStateValue(e,t),Ki(t,s)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){this.suppressEvents=!0,this.beans.colAnimation?.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.beans.colAnimation?.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},B6={moduleName:"GridState",version:ee,beans:[G6],apiFunctions:{getState:L6,setState:O6}};function V6(e){return e.rowModel.isLastRowIndexKnown()}function z6(e){return e.pagination?.getPageSize()??100}function W6(e){return e.pagination?.getCurrentPage()??0}function _6(e){return e.pagination?.getTotalPages()??1}function j6(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function U6(e){e.pagination?.goToNextPage()}function $6(e){e.pagination?.goToPreviousPage()}function q6(e){e.pagination?.goToFirstPage()}function K6(e){e.pagination?.goToLastPage()}function Y6(e,t){e.pagination?.goToPage(t)}var X6=class extends O{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,s=()=>{const o=Math.max(Mo(t),1),n=Math.floor(e/o);t.pagination.setPageSize(n,"autoCalculated")};this.isBodyRendered?ut(this,s,50)():(s(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Fi="paginationPageSizeSelector",Z6={tag:"span",cls:"ag-paging-page-size"},Q6=class extends et{constructor(){super(Z6),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(Fi,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e?.newPageSize)return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Lt(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(Fi)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),s=!t||!e.includes(t);if(s){const n=this.gos.exists("paginationPageSize"),i=this.gos.get(Fi)!==!0;$(94,{pageSizeSet:n,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||$(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Fi}),e.unshift("")}const o=String(s?"":t);this.selectPageSizeComp?(ho(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=s}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const s=this.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),n=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Au).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(n).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Fi);return!Array.isArray(t)||!t?.length?e:[...t].sort((s,o)=>s-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},J6={selector:"AG-PAGE-SIZE-SELECTOR",component:Q6},ek=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",tk=class extends KF{constructor(){super(),this.btFirst=we,this.btPrevious=we,this.btNext=we,this.btLast=we,this.lbRecordCount=we,this.lbFirstRowOnPage=we,this.lbLastRowOnPage=we,this.lbCurrent=we,this.lbTotal=we,this.pageSizeComp=we,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(ek)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[J6]);const{btFirst:t,btPrevious:s,btNext:o,btLast:n}=this;this.activateTabIndex([t,s,o,n]),t.insertAdjacentElement("afterbegin",Jt(e?"last":"first",this.beans)),s.insertAdjacentElement("afterbegin",Jt(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",Jt(e?"previous":"next",this.beans)),n.insertAdjacentElement("afterbegin",Jt(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(i):hF(this.beans,i),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:s}=e;this.addManagedListeners(t,{click:s,keydown:o=>{(o.key===k.ENTER||o.key===k.SPACE)&&(o.preventDefault(),s())}})}uF(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):OT(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),s=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),n=e===s-1;this.nextButtonDisabled=n||o,this.lastButtonDisabled=!t||o||e===s-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){TS(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),s=this.pagination.getMasterRowCount(),o=e?s:null,n=this.pagination.getCurrentPage(),i=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=i*n+1,a=r+i-1,e&&a>o&&(a=o));const l=r+i-1,c=!e&&s<l,d=this.formatNumber(r);this.lbFirstRowOnPage.textContent=d;let u;const h=this.getLocaleTextFunc();c?u=h("pageLastRowUnknown","?"):u=this.formatNumber(a),this.lbLastRowOnPage.textContent=u;const m=t>0?n+1:0,C=this.formatNumber(m);this.lbCurrent.textContent=C;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const b=h("more","more");v=b,w=b}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(d,u,w,C,v)}announceAriaStatus(e,t,s,o,n){const i=this.getLocaleTextFunc(),r=i("page","Page"),a=i("to","to"),l=i("of","of"),c=`${e} ${a} ${t} ${l} ${s}`,d=`${r} ${o} ${l} ${n}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,this.ariaAnnounce?.announceValue(c,"paginationRow")),d!==this.ariaPageStatus&&(this.ariaPageStatus=d,this.ariaAnnounce?.announceValue(d,"paginationPage"))}},sk={selector:"AG-PAGINATION",component:tk},ok=class extends O{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return sk}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:s}=this.beans;s?.isEditing()&&(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){if(!this.active)return;let t=e;this.paginateChildRows||(t=this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(e)??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return te(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:te(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:te(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:te(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const s=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}s!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const s=this.pageSize,o=t-1;this.totalPages=Math.floor(o/s)+1,this.adjustCurrentPageIfInvalid();const n=this.currentPage,i=s*n;let r=s*(n+1)-1;if(r>o&&(r=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(i),r===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:s}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*s,this.bottomDisplayedRowIndex=t*(s+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:s=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:s,newPageSize:o,keepRenderedRows:t})}},nk={moduleName:"Pagination",version:ee,beans:[ok,X6],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:V6,paginationGetPageSize:z6,paginationGetCurrentPage:W6,paginationGetTotalPages:_6,paginationGetRowCount:j6,paginationGoToNextPage:U6,paginationGoToPreviousPage:$6,paginationGoToFirstPage:q6,paginationGoToLastPage:K6,paginationGoToPage:Y6},dependsOn:[Rl]};function ik(e,t={}){const s=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(s))}function wv(e,t,s,o,n){t&&(o&&t.parent&&t.parent.level!==-1&&wv(e,t.parent,s,o,n),t.setExpanded(s,void 0,n))}function rk(e,t){return e.rowModel.getRowNode(t)}function ak(e,t,s,o){e.rowRenderer.addRenderedRowListener(t,s,o)}function lk(e){return e.rowRenderer.getRenderedNodes()}function ck(e,t,s){e.rowModel.forEachNode(t,s)}function dk(e){return e.rowRenderer.firstRenderedRow}function uk(e){return e.rowRenderer.lastRenderedRow}function hk(e,t){return e.rowModel.getRow(t)}function gk(e){return e.rowModel.getRowCount()}var pk={moduleName:"RowApi",version:ee,apiFunctions:{redrawRows:ik,setRowNodeExpanded:wv,getRowNode:rk,addRenderedRowListener:ak,getRenderedNodes:lk,forEachNode:ck,getFirstDisplayedRowIndex:dk,getLastDisplayedRowIndex:uk,getDisplayedRowAtIndex:hk,getDisplayedRowCount:gk}},fk={moduleName:"ScrollApi",version:ee,apiFunctions:{getVerticalPixelRange:DM,getHorizontalPixelRange:PM,ensureColumnVisible:iv,ensureIndexVisible:rv,ensureNodeVisible:TM}};function mk(e,t,s){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,n=`aria-${t}`;s===null?o.removeAttribute(n):o.setAttribute(n,s)}function Ck(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function vk(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function wk(e){return e.animationFrameSvc?.isQueueEmpty()??!0}function bk(e){e.animationFrameSvc?.flushAllFrames()}function Sk(e){return{rowHeight:Mo(e),headerHeight:mr(e)}}function yk(e,t={}){const s=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const r=i.getCellRenderer();r!=null&&s.push(tr(r))}if(t.columns?.length)return s;const o=[],n=jd(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(n&&!Ud(i.rowNode,n)||!i.isFullWidth())continue;const r=i.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const l=r[a];l!=null&&o.push(tr(l))}}return[...o,...s]}var xk={moduleName:"RenderApi",version:ee,apiFunctions:{setGridAriaProperty:mk,refreshCells:Ck,refreshHeader:vk,isAnimationFrameQueueEmpty:wk,flushAllAnimationFrames:bk,getSizesForCurrentTheme:Sk,getCellRendererInstances:yk}};function Rk(e,t){typeof t=="number"?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)}function bv({colAutosize:e,visibleCols:t},s,o){Array.isArray(s)?e?.autoSizeCols({colKeys:s,skipHeader:o,source:"api"}):e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}function Fk(e,t){t&&typeof t=="object"?bv(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}var Ek=class extends O{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const n=e.get("rowData");s=n!=null&&n.length>0&&tt(e)}s&&this.beans.colDelayRenderSvc?.hideColumns(o)}}autoSizeCols(e){const{eventSvc:t,visibleCols:s}=this.beans;this.innerAutoSizeCols(e).then(o=>{const n=c=>_n(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return n(o);const i=vp(this.beans),r=c=>s.leftCols.some(d=>Bi(d,c)),a=c=>s.rightCols.some(d=>Bi(d,c)),l=e.colKeys.filter(c=>!Us(c)&&!Hs(c)&&!r(c)&&!a(c));this.sizeColumnsToFit(i,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map(c=>({...c,key:c.colId})),colKeys:l,onlyScaleUp:!0}),n(o)})}innerAutoSizeCols(e){return new Promise((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,s));const{colKeys:o,skipHeader:n,skipHeaderGroups:i,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:d="api"}=e,{animationFrameSvc:u,renderStatus:h,colModel:p,autoWidthCalc:m,visibleCols:C}=this.beans;if(u?.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,s)});return}this.timesDelayed=0;const v=new Set;let w=-1;const b=Object.fromEntries(c.map(({colId:y,...F})=>[y,F])),S=n??this.gos.get("skipHeaderOnAutoSize"),x=i??S;for(;w!==0;){w=0;const y=[];for(const F of o){if(!F||Vy(F))continue;const R=p.getCol(F);if(!R||v.has(R))continue;const E=m.getPreferredWidthForColumn(R,S);if(E>0){const D=b[R.colId]??{};D.minWidth??(D.minWidth=l),D.maxWidth??(D.maxWidth=a);const P=Dk(R,E,D);R.setActualWidth(P,d),v.add(R),w++}y.push(R)}y.length&&C.refresh(d)}x||this.autoSizeColumnGroupsByColumns(o,d,r),t(v)})}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){const{colModel:o,ctrlsSvc:n}=this.beans,i=new Set,r=o.getColsForKeys(e);for(const l of r){let c=l.getParent();for(;c&&c!=s;)c.isPadding()||i.add(c),c=c.getParent()}let a;for(const l of i){for(const c of n.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a?.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",o);const n=new So(e);return n.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),n.destroy()}}addColumnGroupResize(e,t,s){const o=this.gos.get("skipHeaderOnAutoSize"),n=()=>{const i=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||i.push(a.getColId());i.length>0&&this.autoSizeCols({colKeys:i,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),s()};return e.addEventListener("dblclick",n),()=>e.removeEventListener("dblclick",n)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const s=vp(this.beans);if(s>0){this.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):$(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,o){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,s,o));return}const n={};for(const{key:m,...C}of o?.columnLimits??[])n[typeof m=="string"?m:m.getColId()]=C;const i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=As(i);if(o?.onlyScaleUp&&r>e||e===r&&i.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const v=n?.[C.getId()],w=v?.minWidth??o?.defaultMinWidth,b=v?.maxWidth??o?.defaultMaxWidth,S=C.getActualWidth();return(w==null||S>=w)&&(b==null||S<=b)}))return;const l=[],c=[];for(const m of i){const C=o?.colKeys?.some(v=>Bi(m,v))??!0;m.getColDef().suppressSizeToFit||!C?c.push(m):l.push(m)}const d=l.slice(0);let u=!1;const h=m=>{ds(l,m),c.push(m)};for(const m of l){m.resetActualWidth(t);const C=n?.[m.getId()],v=C?.minWidth??o?.defaultMinWidth,w=C?.maxWidth??o?.defaultMaxWidth,b=m.getActualWidth();typeof v=="number"&&b<v?m.setActualWidth(v,t,!0):typeof w=="number"&&b>w&&m.setActualWidth(w,t,!0)}for(;!u;){u=!0;const m=e-As(c);if(m<=0)for(const C of l){const v=n?.[C.getId()]?.minWidth??o?.defaultMinWidth??C.minWidth;C.setActualWidth(v,t,!0)}else{const C=m/As(l);let v=m;for(let w=l.length-1;w>=0;w--){const b=l[w],S=n?.[b.getId()],x=S?.minWidth??o?.defaultMinWidth,y=S?.maxWidth??o?.defaultMaxWidth,F=b.getMinWidth(),R=b.getMaxWidth(),E=typeof x=="number"&&x>F?x:F,D=typeof y=="number"&&y<R?y:R;let P=Math.round(b.getActualWidth()*C);P<E?(P=E,h(b),u=!1):P>D?(P=D,h(b),u=!1):w===0&&(P=v),b.setActualWidth(P,t,!0),v-=P}}}for(const m of d)m.fireColumnWidthChangedEvent(t);const p=this.beans.visibleCols;p.setLeftValues(t),p.updateBodyWidths(),!s&&_n(this.eventSvc,d,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,s=e.get("autoSizeStrategy");s?.type!=="fitGridWidth"&&s?.type!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=s.type;if(o==="fitGridWidth"){const{columnLimits:n,defaultMinWidth:i,defaultMaxWidth:r}=s,a=n?.map(({colId:l,minWidth:c,maxWidth:d})=>({key:l,minWidth:c,maxWidth:d}));this.sizeColumnsToFitGridBody({defaultMinWidth:i,defaultMaxWidth:r,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{if(!this.isAlive())return;const s="autosizeColumns";e?this.autoSizeCols({...t,source:s,colKeys:e}):this.autoSizeAllColumns({...t,source:s}),this.beans.colDelayRenderSvc?.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function Dk(e,t,s={}){const o=s.minWidth??e.getMinWidth();t<o&&(t=o);const n=s.maxWidth??e.getMaxWidth();return t>n&&(t=n),t}function vp({ctrlsSvc:e,scrollVisibleSvc:t}){const s=e.getGridBodyCtrl(),n=s.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Zi(s.eGridBody)-n}var Pk={moduleName:"ColumnAutoSize",version:ee,beans:[Ek],apiFunctions:{sizeColumnsToFit:Rk,autoSizeColumns:bv,autoSizeAllColumns:Fk},dependsOn:[pC]},Tk=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function Mk(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0}function Ik(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0}function kk(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)}function Ak(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)}function Lk(e,t,s){return e.pinnedRowModel?.forEachPinnedRow(t,s)}var Ok={moduleName:"PinnedRow",version:ee,beans:[zF],css:[Tk],apiFunctions:{getPinnedTopRowCount:Mk,getPinnedBottomRowCount:Ik,getPinnedTopRow:kk,getPinnedBottomRow:Ak,forEachPinnedRow:Lk},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},Nk=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){const e=this.firstNode.__autoHeights?.[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},Hk=class extends O{constructor(e){super(),this.column=e}buildCache(e){const{column:t,beans:{gos:s,pinnedRowModel:o,rowModel:n,valueSvc:i,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,d=s.getCallback("isFullWidthRow"),u=a.equals,h=a.spanRows,p=typeof h=="function";let m=null,C=null,v;const w=(S,x)=>{m=S,C=null,v=x},b=S=>{const x=!S.isExpandable()&&!S.group&&!S.detail&&(d?!d({rowNode:S}):!0);if(S.rowIndex==null||!x){w(null,null);return}if(m==null||S.level!==m.level||S.footer||C&&S.rowIndex-1!==C?.getLastNode().rowIndex){w(S,i.getValue(t,S));return}const y=i.getValue(t,S);if(p){const F=Se(s,{valueA:v,nodeA:m,valueB:y,nodeB:S,column:t,colDef:a});if(!h(F)){w(S,y);return}}else if(u?!u(v,y):v!==y){w(S,y);return}if(!C){const F=l?.get(m);F?.firstNode===m?(F.reset(),C=F):C=new Nk(t,m),c.set(m,C)}C.addSpannedNode(S),c.set(S,C)};switch(e){case"center":n.forEachDisplayedNode?.(S=>{(!r||r.isRowInPage(S.rowIndex))&&b(S)}),this.centerValueNodeMap=c;break;case"top":o?.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":o?.forEachPinnedRow("bottom",b),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},Gk=class extends O{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=ut(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=ut(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const s=this.createManagedBean(new Hk(e));this.spanningColumns.set(e,s),s.buildCache("top"),s.buildCache("bottom"),s.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t?.createCtrls("top"),t?.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t?.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const s=this.spanningColumns.get(e);return s?s.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:s}=this.beans,o=e.column,n=e.rowIndex,i=this.spanningColumns.get(o);if(!i)return;let r;switch(e.rowPinned){case"top":r=t?.getPinnedTopRow(n);break;case"bottom":r=t?.getPinnedBottomRow(n);break;default:r=s.getRow(n)}if(r)return i.getCellSpan(r)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const s=this.spanningColumns.get(e);if(s)return s.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[s,o]of this.spanningColumns)if(o.isCellSpanning(e)){const n=o.getCellSpan(e);t(s,n)}}destroy(){super.destroy(),this.spanningColumns.clear()}},Bk=class extends Gn{constructor(e,t,s){super(e.col,e.firstNode,s,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,s,o,n,i,r){this.eWrapper=s,super.setComp(e,t,s,o,n,i,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Sf(e,t.rowIndex)}setAriaRowSpan(){AS(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(Sl(t)){this.focusedCellPosition=void 0;return}const s=this.isCellFocused();s||(this.focusedCellPosition=void 0),e&&s&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},Vk=class extends el{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){const t=this.beans.rowSpanSvc?.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new Bk(t,this,this.beans)}isCorrectCtrlForSpan(e){const t=this.beans.rowSpanSvc?.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},zk=class extends O{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,s=this.getCtrlsMap(e),o=s.size,n=this.getAllRelevantRowControls(e),i=new Map;let r=!1;for(const l of n)l.isAlive()&&t?.forEachSpannedColumn(l.rowNode,(c,d)=>{if(i.has(d.firstNode))return;const u=s.get(d.firstNode);if(u){i.set(d.firstNode,u),s.delete(d.firstNode);return}r=!0;const h=new Vk(d.firstNode,this.beans,!1,!1,!1);i.set(d.firstNode,h)});this.setCtrlsMap(e,i);const a=i.size===o;if(!(!r&&a)){for(const l of s.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,s=t?.getCellSpanByPosition(e);if(!s)return;const o=this.getCtrlsMap(e.rowPinned).get(s.firstNode);if(o)return o.getAllCellCtrls().find(n=>n.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},Wk={moduleName:"CellSpan",version:ee,beans:[Gk,zk]},_k=class extends O{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,s=e.colDef,o=s.cellClassRules,n=this.getCellClassParams(e,s);Zu(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,n,i=>t.toggleCss(i,!0),i=>t.toggleCss(i,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,s=t.cellStyle;if(!s)return;let o;if(typeof s=="function"){const n=this.getCellClassParams(e,t);o=s(n)}else o=s;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,s=e.colDef,o=this.getCellClassParams(e,s);for(const i of this.staticClasses)t.toggleCss(i,!1);const n=this.beans.cellStyles.getStaticCellClasses(s,o);this.staticClasses=n;for(const i of n)t.toggleCss(i,!0)}getCellClassParams(e,t){const{value:s,rowNode:o}=this.cellCtrl;return Se(this.beans.gos,{value:s,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},jk=class extends O{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,s,o){Zu(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,o),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){const{cellClass:s}=e;if(!s)return[];let o;return typeof s=="function"?o=s(t):o=s,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new _k(e,t)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach(n=>{s(n)})}},Uk={moduleName:"CellStyle",version:ee,beans:[jk]},$k={moduleName:"RowStyle",version:ee,beans:[I5]};function qk(e,t){return!!e.colHover?.isHovered(t)}var Kk=class extends O{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=s=>{const{beans:o,gos:n,element:i,columns:r}=this,a=o.colHover;if(s??!!n.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:a.setMouseOver.bind(a,r),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},Yk="ag-column-hover",Xk=class extends O{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,s){const o=()=>{const n=this.isHovered(s);t.toggleCss("ag-column-hover",n)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const s=this.isHovered(e);t.toggleCss(Yk,s)}addHeaderFilterColumnHoverListener(e,t,s,o){this.createHoverFeature(e,[s],o);const n=()=>{const i=this.isHovered(s);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:n}),n()}createHoverFeature(e,t,s){e.createManagedBean(new Kk(t,s))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},Zk={moduleName:"ColumnHover",version:ee,beans:[Xk],apiFunctions:{isColumnHovered:qk}},Qk=class extends O{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const s=this.wrapSvc?.wrap(e,t)??t,o=!Pa.has(e),n=o?this.asyncListeners:this.syncListeners;n.has(e)||n.set(e,new Set),n.get(e).add(s),this.eventSvc.addListener(e,s,o)}removeListener(e,t){const s=this.wrapSvc?.unwrap(e,t)??t,n=!!this.asyncListeners.get(e)?.delete(s);n||this.syncListeners.get(e)?.delete(s),this.eventSvc.removeListener(e,s,n)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,s=(i,r)=>{Pa.has(i)&&t(i,r)},o=(i,r)=>{Pa.has(i)||t(i,r)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:o});const n=this.eventSvc;n.addGlobalListener(s,!1),n.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:s,globalListenerPairs:o}=this,n=s?.unwrapGlobal(e)??e;if(o.has(n)){const{syncListener:r,asyncListener:a}=o.get(n);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(n),t.removeGlobalListener(n,!1)}destroyEventListeners(e,t){e.forEach((s,o)=>{s.forEach(n=>this.eventSvc.removeListener(o,n,t)),s.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const s of e)this.eventSvc.removeGlobalListener(s,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:s,asyncListener:o})=>{t.removeGlobalListener(s,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function Jk(e,t,s){e.apiEventSvc?.addListener(t,s)}function eA(e,t,s){e.apiEventSvc?.removeListener(t,s)}function tA(e,t){e.apiEventSvc?.addGlobalListener(t)}function sA(e,t){e.apiEventSvc?.removeGlobalListener(t)}var oA={moduleName:"EventApi",version:ee,apiFunctions:{addEventListener:Jk,addGlobalListener:tA,removeEventListener:eA,removeGlobalListener:sA},beans:[Qk]},nA={moduleName:"Locale",version:ee,beans:[IT]},iA=class extends O{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=ut(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){const{visibleCols:e,rowModel:t,rowSpanSvc:s,pinnedRowModel:o}=this.beans,n=e.autoHeightCols;let i=!1;const r=a=>{const l=a.__autoHeights;let c=ro(this.beans,a).height;for(const d of n){let u=l?.[d.getColId()];const h=s?.getCellSpan(d,a);if(h){if(h.getLastNode()!==a)continue;if(u=s?.getCellSpan(d,a)?.getLastNodeAutoHeight(),!u)return}if(u==null){if(this.colSpanSkipCell(d,a))continue;return}c=Math.max(u,c)}c!==a.rowHeight&&(a.setRowHeight(c),i=!0)};o?.forEachPinnedRow?.("top",r),o?.forEachPinnedRow?.("bottom",r),t.forEachDisplayedNode?.(r),i&&t.onRowHeightChanged?.()}setRowAutoHeight(e,t,s){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[s.getId()];return}const o=e.__autoHeights[s.getId()];e.__autoHeights[s.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:s,colViewport:o,visibleCols:n}=this.beans;if(!s.colSpanActive)return!1;let i=[];switch(e.getPinned()){case"left":i=n.getLeftColsForRow(t);break;case"right":i=n.getRightColsForRow(t);break;case null:i=o.getColsWithinViewport(t);break}return!i.includes(e)}setupCellAutoHeight(e,t,s){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:n,column:i}=e,r=this.beans,a=d=>{if(this.beans.editSvc?.isEditing(e)||!e.isAlive()||!s.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:p,borderTopWidth:m}=jo(o),C=u+h+p+m,w=t.offsetHeight+C;if(d<5){const S=!gt(r)?.contains(t),x=w==0;if(S||x){window.setTimeout(()=>a(d+1),0);return}}this.setRowAutoHeight(n,w,i)},l=()=>a(0);l();const c=_s(r,t,l);return s.addDestroyFunc(()=>{c(),this.setRowAutoHeight(n,void 0,i)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:s}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(s).filter(n=>n.isAutoHeight())),t.length!==0){if(!s.__autoHeights)return!1;for(const o of t){const n=s.__autoHeights[o.getColId()];if(!n||s.rowHeight<n)return!1}}return!0}},rA={moduleName:"RowAutoHeight",version:ee,beans:[iA]},aA={moduleName:"AllCommunity",version:ee,dependsOn:[i6,g6,x6,XT,rI,aI,lI,cI,dI,uI,hI,iI,Q4,J4,eM,Z4,sM,oM,B6,HI,nk,fC,pk,fk,xk,Pk,GE,Ok,DI,gT,Uk,Zk,$k,oA,mT,A6,nv,nA,rA,HE,r6,Wk]};function ce(e,t={}){const s=Object.keys(t).map(o=>{const n=t[o];return n!=null?`${o}=${n}`:null}).filter(Boolean).join(";");return[e,s].filter(o=>o.length>0).join(":")}var ne={grid(e){return ce("ag-grid-root",{gridId:e})},headerGroupCell(e){return ce("ag-header-group-cell",{colId:e})},headerCell(e){return ce("ag-header-cell",{colId:e})},headerCheckbox(e){return ce("ag-header-selection-checkbox",{colId:e})},headerFilterButton(e){return ce("ag-header-cell-filter-button",{colId:e})},floatingFilter(e){return ce("ag-floating-filter",{colId:e})},floatingFilterButton(e){return ce("ag-floating-filter-button",{colId:e})},headerCellMenuButton(e){return ce("ag-header-cell-menu-button",{colId:e})},headerResizeHandle(e){return ce("ag-header-cell-resize",{colId:e})},filterInstancePickerDisplay(e){return ce(`ag-${e.source}-picker-display`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},numberFilterInstanceInput(e){return ce(`ag-${e.source}-number-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},textFilterInstanceInput(e){return ce(`ag-${e.source}-text-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},dateFilterInstanceInput(e){return ce(`ag-${e.source}-date-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},setFilterInstanceMiniFilterInput(e){return ce(`ag-${e.source}-set-filter-mini-filter-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},setFilterInstanceItem(e,t){return ce(`ag-${e.source}-set-filter-item`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,itemLabel:t}:{colId:e.colId,itemLabel:t})},setFilterApplyPanelButton(e,t){return ce(`ag-${e.source}-set-filter-apply-panel-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},filterConditionRadioButton(e,t){return ce(`ag-${e.source}-filter-condition-radio-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},advancedFilterInput(){return ce("ag-advanced-filter-input")},advancedFilterButton(e){return ce("ag-advanced-filter-button",{label:e})},advancedFilterBuilderButton(){return ce("ag-advanced-filter-builder-button")},advancedFilterPanelMaximiseButton(){return ce("ag-advanced-filter-builder-panel-maximise")},advancedFilterPanelCloseButton(){return ce("ag-advanced-filter-builder-panel-close")},advancedFilterPill(e){return ce("ag-advanced-filter-builder-pill",{label:e})},advancedFilterBuilderAddItemButton(){return ce("ag-advanced-filter-builder-add-item-button")},rowNode(e){return ce("ag-row",{"row-id":e})},cell(e,t){return ce("ag-cell",{"row-id":e,colId:t})},autoGroupCell(e){return ne.cell(e,so)},checkbox(e,t){return ce("ag-selection-checkbox",{"row-id":e,colId:t})},selectionColumnCheckbox(e){return ne.checkbox(e,Ru)},autoGroupColumnCheckbox(e){return ne.checkbox(e,so)},dragHandle(e,t){return ce("ag-drag-handle",{"row-id":e,colId:t})},groupContracted(e,t){return ce("ag-group-contracted",{"row-id":e,colId:t})},groupExpanded(e,t){return ce("ag-group-expanded",{"row-id":e,colId:t})},autoGroupContracted(e){return ne.groupContracted(e,so)},autoGroupExpanded(e){return ne.groupExpanded(e,so)},rowNumber(e){return ne.cell(e,Fu)},menu(){return ce("ag-menu")},menuOption(e){return ce("ag-menu-option",{option:e})},sideBar(){return ce("ag-side-bar")},sideBarButton(e){return ce("ag-side-button",{label:e})},columnToolPanel(){return ce("ag-column-panel")},pivotModeSelect(){return ce("ag-pivot-mode-select")},columnPanelSelectHeaderCheckbox(){return ce("ag-column-panel-select-header-checkbox")},columnPanelSelectHeaderFilter(){return ce("ag-column-panel-select-header-filter")},columnSelectListItemGroupClosedIcon(e){return ce("ag-column-select-list-item-group-closed-icon",{label:e})},columnSelectListItemCheckbox(e){return ce("ag-column-select-list-item-checkbox",{label:e})},columnSelectListItemDragHandle(e){return ce("ag-column-select-list-item-drag-handle",{label:e})},columnDropCellDragHandle(e,t,s){return ce("ag-column-drop-cell-drag-handle",{source:e,area:t,label:s})},columnDropCellCancelButton(e,t,s){return ce("ag-column-drop-cell-cancel",{source:e,area:t,label:s})},columnDropArea(e,t){return ce("ag-column-drop-area",{source:e,name:t})},filterToolPanel(){return ce("ag-filter-panel")},filterToolPanelAddFilterButton(){return ce("ag-filter-panel-add-filter-button")},filterToolPanelFilterTypeSelector(e){return ce("ag-filter-panel-filter-type-selector",{colLabel:e})},filterToolPanelSearchInput(){return ce("ag-filter-toolpanel-search-input")},filterToolPanelGroup(e){return ce("ag-filter-toolpanel-group",{title:e})},filterToolPanelGroupCollapsedIcon(e){return ce("ag-filter-toolpanel-group-collapsed-icon",{title:e})},statusBarTotalAndFilteredRowCount(){return ce("ag-status-bar-total-and-filtered-row-count")},statusBarTotalRowCount(){return ce("ag-status-bar-total-row-count")},statusBarFilteredRowCount(){return ce("ag-status-bar-filtered-row-count")},statusBarSelectedRowCount(){return ce("ag-status-bar-selected-row-count")},statusBarAggregations(){return ce("ag-status-bar-aggregations")},paginationPanelSizePickerDisplay(e){return ce("ag-pagination-page-size-picker-field-display",{value:e})},paginationPanelFirstRowOnPage(e){return ce("ag-paging-row-summary-panel-first-row-on-page",{value:e})},paginationPanelLastRowOnPage(e){return ce("ag-paging-row-summary-panel-last-row-on-page",{value:e})},paginationPanelRecordCount(e){return ce("ag-paging-row-summary-panel-record-count",{value:e})},paginationSummaryPanelButton(e){return ce("ag-paging-page-summary-panel-btn",{label:e})},paginationSummaryPanelCurrentPage(e){return ce("ag-paging-page-summary-panel-current-page",{value:e})},paginationSummaryPanelTotalPage(e){return ce("ag-paging-page-summary-panel-total-page",{value:e})},fillHandle(){return ce("ag-fill-handle")},columnChooserCloseButton(){return ce("ag-column-chooser-close-button")},columnChooserSearchBarCheckbox(){return ce("ag-column-chooser-header-checkbox")},columnChooserSearchBarFilter(){return ce("ag-column-chooser-searchbar-filter")},columnChooserListItemGroupClosedIcon(e){return ce("ag-column-chooser-list-item-group-closed-icon",{label:e})},columnChooserListItemCheckbox(e){return ce("ag-column-chooser-list-item-checkbox",{label:e})},columnChooserListItemDragHandle(e){return ce("ag-column-chooser-list-item-drag-handle",{label:e})},overlay(){return ce("ag-overlay")}},Sv="data-testid";function ue(e,t){e?.setAttribute(Sv,t)}function lA(e){Sv=e}var cA=class extends O{constructor(){super(...arguments),this.beanName="testIdSvc"}postConstruct(){const e=ut(this,()=>this.setupAllTestIds(),500),t=ut(this,()=>{this.setupAllTestIds(),e()},0);this.addManagedEventListeners({firstDataRendered:t,displayedRowsChanged:t,displayedColumnsChanged:t,displayedColumnsWidthChanged:t,virtualColumnsChanged:t,columnMenuVisibleChanged:t,contextMenuVisibleChanged:t,advancedFilterBuilderVisibleChanged:t,fieldPickerValueSelected:t,modelUpdated:t,sideBarUpdated:t,pinnedHeightChanged:t,gridReady:t,overlayExclusiveChanged:t,rowGroupOpened:t,scrollVisibilityChanged:t,gridSizeChanged:t,filterOpened:t,filterChanged:t,cellSelectionChanged:t})}setupAllTestIds(){const e=rs(this.beans),t=rC(this.beans),s=e.querySelector(`[grid-id="${t}"]`);ue(s,ne.grid(t)),e.querySelectorAll(".ag-header-group-cell").forEach(i=>{ue(i,ne.headerGroupCell(i.getAttribute("col-id")))}),e.querySelectorAll(".ag-header-cell").forEach(i=>{const r=i.getAttribute("col-id"),l=i.classList.contains("ag-floating-filter")?ne.floatingFilter(r):ne.headerCell(r);ue(i,l),ue(i.querySelector(".ag-header-cell-filter-button"),ne.headerFilterButton(r)),ue(i.querySelector(".ag-header-cell-menu-button"),ne.headerCellMenuButton(r)),ue(i.querySelector(".ag-header-cell-resize"),ne.headerResizeHandle(r)),ue(i.querySelector(".ag-checkbox input[type=checkbox]"),ne.headerCheckbox(r)),ue(i.querySelector(".ag-floating-filter-button button"),ne.floatingFilterButton(r)),this.setupFilterInstance(i.querySelector(".ag-floating-filter-body"),{source:"floating-filter",colId:r})});const o=e.querySelector(".ag-filter-menu");this.setupFilterInstance(o,{source:"column-filter"}),ue(e.querySelector(".ag-advanced-filter input[type=text]"),ne.advancedFilterInput()),e.querySelectorAll(".ag-advanced-filter-buttons button").forEach(i=>{ue(i,ne.advancedFilterButton(i.textContent))}),ue(e.querySelector("button.ag-advanced-filter-builder-button"),ne.advancedFilterBuilderButton()),e.querySelectorAll('.ag-panel[aria-label="Advanced Filter"] .ag-panel-title-bar-button').forEach((i,r)=>{ue(i,r===0?ne.advancedFilterPanelMaximiseButton():ne.advancedFilterPanelCloseButton())}),e.querySelectorAll('.ag-panel[aria-lable="Advanced Filter"] .ag-advanced-filter-builder-pill').forEach(i=>{ue(i,ne.advancedFilterPill(i.querySelector(".ag-picker-field-display")?.textContent))}),ue(e.querySelector('.ag-panel[aria-label="Advanced Filter"] .ag-advanced-filter-builder-item-button'),ne.advancedFilterBuilderAddItemButton()),e.querySelectorAll(".ag-row").forEach(i=>{const r=i.getAttribute("row-id");ue(i,ne.rowNode(r)),i.querySelectorAll(".ag-cell").forEach(a=>{const l=a.getAttribute("col-id");ue(a,ne.cell(r,l)),ue(a.querySelector(".ag-selection-checkbox input[type=checkbox]"),ne.checkbox(r,l)),ue(a.querySelector(".ag-drag-handle"),ne.dragHandle(r,l)),ue(a.querySelector(".ag-group-contracted"),ne.groupContracted(r,l)),ue(a.querySelector(".ag-group-expanded"),ne.groupExpanded(r,l))})}),e.querySelectorAll(".ag-menu-list").forEach(i=>{ue(i,ne.menu()),i.querySelectorAll(".ag-menu-option").forEach(r=>{ue(r,ne.menuOption(r.querySelector(".ag-menu-option-text")?.textContent))})}),e.querySelectorAll(".ag-side-bar").forEach(i=>{ue(i,ne.sideBar()),i.querySelectorAll(".ag-side-button button").forEach(r=>{ue(r,ne.sideBarButton(r.querySelector(".ag-side-button-label")?.textContent))}),i.querySelectorAll(".ag-column-panel").forEach(r=>{ue(r,ne.columnToolPanel()),ue(r.querySelector(".ag-pivot-mode-select input[type=checkbox]"),ne.pivotModeSelect()),ue(r.querySelector(".ag-column-select-header-checkbox input[type=checkbox]"),ne.columnPanelSelectHeaderCheckbox()),ue(r.querySelector(".ag-column-select-header-filter-wrapper input[type=text]"),ne.columnPanelSelectHeaderFilter()),r.querySelectorAll(".ag-column-select-list").forEach(a=>{a.querySelectorAll(".ag-column-select-virtual-list-item").forEach(l=>{const c=l.getAttribute("aria-label");ue(l.querySelector(".ag-column-group-closed-icon"),ne.columnSelectListItemGroupClosedIcon(c)),ue(l.querySelector(".ag-column-select-checkbox input[type=checkbox]"),ne.columnSelectListItemCheckbox(c)),ue(l.querySelector(".ag-drag-handle"),ne.columnSelectListItemDragHandle(c))})}),this.setupColumnDropArea(r,"toolbar")}),i.querySelectorAll(".ag-filter-panel").forEach(r=>{ue(r,ne.filterToolPanel()),ue(r.querySelector("button.ag-filter-add-button"),ne.filterToolPanelAddFilterButton()),r.querySelectorAll(".ag-filter-card").forEach(a=>{const l=a.querySelector(".ag-filter-card-title")?.textContent,c=a.querySelector(".ag-filter-type-select");ue(c,ne.filterToolPanelFilterTypeSelector(l)),a.querySelectorAll(".ag-filter").forEach(d=>this.setupFilterInstance(d,{source:"filter-toolpanel",colLabel:l}))})}),i.querySelectorAll(".ag-filter-toolpanel").forEach(r=>{ue(r.querySelector(".ag-filter-toolpanel-search-input input[type=text]"),ne.filterToolPanelSearchInput()),r.querySelectorAll(".ag-filter-toolpanel-group").forEach(a=>{const l=a.querySelector(".ag-filter-toolpanel-group-title")?.textContent;ue(a,ne.filterToolPanelGroup(l)),ue(a.querySelector(".ag-filter-toolpanel-group-title-bar-icon .ag-icon-tree-closed"),ne.filterToolPanelGroupCollapsedIcon(l));const c=a.querySelector(".ag-filter-toolpanel-instance-filter");c&&this.setupFilterInstance(c,{source:"filter-toolpanel",colLabel:l})})})}),ue(e.querySelector(".ag-status-bar .ag-status-panel-total-and-filtered-row-count"),ne.statusBarTotalAndFilteredRowCount()),ue(e.querySelector(".ag-status-bar .ag-status-panel-total-row-count"),ne.statusBarTotalRowCount()),ue(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),ne.statusBarFilteredRowCount()),ue(e.querySelector(".ag-status-bar .ag-status-panel-selected-row-count"),ne.statusBarSelectedRowCount()),ue(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),ne.statusBarAggregations()),e.querySelectorAll(".ag-paging-panel").forEach(i=>{ue(i.querySelector(".ag-paging-page-size .ag-picker-field-display"),ne.paginationPanelSizePickerDisplay(i.querySelector(".ag-paging-page-size .ag-picker-field-display")?.textContent)),i.querySelectorAll(".ag-paging-row-summary-panel-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbFirstRowOnPage":ue(r,ne.paginationPanelFirstRowOnPage(r.textContent));break;case"lbLastRowOnPage":ue(r,ne.paginationPanelLastRowOnPage(r.textContent));break;case"lbRecordCount":ue(r,ne.paginationPanelRecordCount(r.textContent));break}}),i.querySelectorAll(".ag-paging-page-summary-panel .ag-button").forEach(r=>{ue(r,ne.paginationSummaryPanelButton(r.getAttribute("aria-label")?.toLowerCase()))}),i.querySelectorAll(".ag-paging-page-summary-panel .ag-paging-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbCurrent":ue(r,ne.paginationSummaryPanelCurrentPage(r.textContent));break;case"lbTotal":ue(r,ne.paginationSummaryPanelTotalPage(r.textContent));break}})}),ue(e.querySelector(".ag-fill-handle"),ne.fillHandle()),e.querySelectorAll('.ag-panel[aria-label="Choose Columns"]').forEach(i=>{ue(i.querySelector(".ag-panel-title-bar-button-icon"),ne.columnChooserCloseButton()),ue(i.querySelector('.ag-column-select-header-checkbox input[type="checkbox"]'),ne.columnChooserSearchBarCheckbox()),ue(i.querySelector('.ag-column-select-header-filter-wrapper input[type="text"]'),ne.columnChooserSearchBarFilter()),i.querySelectorAll(".ag-column-select-list").forEach(r=>{r.querySelectorAll(".ag-column-select-virtual-list-item").forEach(a=>{const l=a.getAttribute("aria-label");ue(a.querySelector(".ag-column-group-closed-icon"),ne.columnChooserListItemGroupClosedIcon(l)),ue(a.querySelector(".ag-column-select-checkbox input[type=checkbox]"),ne.columnChooserListItemCheckbox(l)),ue(a.querySelector(".ag-drag-handle"),ne.columnChooserListItemDragHandle(l))})})}),ue(e.querySelector(".ag-overlay-wrapper"),ne.overlay());const n=e.querySelector(".ag-column-drop-wrapper");n&&this.setupColumnDropArea(n,"panel")}setupFilterInstance(e,t){if(!e)return;e.querySelectorAll(".ag-filter-select .ag-picker-field-display").forEach(r=>{ue(r,ne.filterInstancePickerDisplay(t))});const s=e.querySelector('.ag-filter-body input[type="number"]');ue(s,ne.numberFilterInstanceInput(t));const o=e.querySelector('.ag-filter-body input[type="text"]');ue(o,ne.textFilterInstanceInput(t));const n=e.querySelector('.ag-filter-body input[type="date"]');ue(n,ne.dateFilterInstanceInput(t));const i=e.querySelector('.ag-mini-filter input[type="text"]');ue(i,ne.setFilterInstanceMiniFilterInput(t)),e.querySelectorAll(".ag-set-filter-list .ag-set-filter-item").forEach(r=>{const a=r.querySelector(".ag-checkbox-label")?.textContent,l=r.querySelector('input[type="checkbox"]');ue(l,ne.setFilterInstanceItem(t,a))}),e.querySelectorAll(".ag-filter-apply-panel button").forEach(r=>{ue(r,ne.setFilterApplyPanelButton(t,r.textContent))}),e.querySelectorAll(".ag-filter-condition .ag-radio-button").forEach(r=>{const a=r.querySelector(".ag-radio-button-label")?.textContent;ue(r.querySelector("input[type=radio]"),ne.filterConditionRadioButton(t,a))})}setupColumnDropArea(e,t){e.querySelectorAll(".ag-column-drop").forEach(s=>{const o=s.querySelector(".ag-column-drop-list")?.getAttribute("aria-label");ue(s,ne.columnDropArea(t,o)),s.querySelectorAll(".ag-column-drop-cell").forEach(n=>{const i=n.querySelector(".ag-column-drop-cell-text")?.textContent;ue(n.querySelector(".ag-drag-handle"),ne.columnDropCellDragHandle(t,o,i)),ue(n.querySelector(".ag-column-drop-cell-button .ag-icon-cancel"),ne.columnDropCellCancelButton(t,o,i))})})}},dA={moduleName:"Testing",version:ee,beans:[cA]};function uA({testIdAttribute:e}={}){e&&lA(e),Vf.registerModules([dA])}var St=g.createContext({}),yv=g.createContext("default"),vr=(e,t,s,o)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const i=e.newAgStackInstance();let r,a,l=!1;return i.then(c=>{if(l){t.destroyBean(c);return}r=c,a=r.getGui(),s.appendChild(a),wp(o,r)}),()=>{l=!0,r&&(a?.remove(),t.destroyBean(r),o&&wp(o,void 0))}},wp=(e,t)=>{if(e)if(e instanceof Function)e(t);else{const s=e;s.current=t}},Yt=(...e)=>e.filter(s=>s!=null&&s!=="").join(" "),es=class xv{constructor(...t){this.classesMap={};for(const s of t)this.classesMap[s]=!0}setClass(t,s){if(!!this.classesMap[t]==s)return this;const n=new xv;return n.classesMap={...this.classesMap},n.classesMap[t]=s,n}toString(){return Object.keys(this.classesMap).filter(s=>this.classesMap[s]).join(" ")}},si=e=>{const t=()=>typeof Symbol=="function"&&Symbol.for,s=()=>t()?Symbol.for("react.memo"):60115;return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===s()},Xd=g.version?.split(".")[0],Rv=Xd==="16"||Xd==="17";function hA(){return Xd==="19"}var Ma=!1;function gA(e){return Ma||setTimeout(()=>Ma=!1,0),Ma=!0,e()}var rr=(e,t)=>{!Rv&&e&&!Ma?Yn.flushSync(t):t()},pA=e=>{Rv?e():g.startTransition(e)};function fA(e,t,s){return g.useSyncExternalStore?g.useSyncExternalStore(e,t):s}function ol(e,t,s){if(t==null||e==null)return t;if(e===t||t.length===0&&e.length===0)return e;if(s||e.length===0&&t.length>0||e.length>0&&t.length===0)return t;const o=[],n=[],i=new Map,r=new Map;for(let a=0;a<t.length;a++){const l=t[a];r.set(l.instanceId,l)}for(let a=0;a<e.length;a++){const l=e[a];i.set(l.instanceId,l),r.has(l.instanceId)&&o.push(l)}for(let a=0;a<t.length;a++){const l=t[a],c=l.instanceId;i.has(c)||n.push(l)}return o.length===e.length&&n.length===0?e:o.length===0&&n.length===t.length?t:o.length===0?n:n.length===0?o:[...o,...n]}var Fv=g.forwardRef((e,t)=>{const{registry:s,context:o}=g.useContext(St),n=g.useRef(null),i=g.useRef(null),r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(),[d,u]=g.useState(),[h,p]=g.useState(),[m,C]=g.useState(),[v,w]=g.useState(()=>new es),[b,S]=g.useState(()=>new es("ag-hidden")),[x,y]=g.useState(()=>new es("ag-hidden")),[F,R]=g.useState(()=>new es("ag-invisible"));g.useImperativeHandle(t,()=>({refresh(){return!1}})),g.useLayoutEffect(()=>vr(d,o,i.current),[d]);const E=g.useCallback(H=>{if(n.current=H,!H||o.isDestroyed()){c.current=o.destroyBean(c.current);return}const A={setInnerRenderer:(M,B)=>{u(M),C(B)},setChildCount:M=>p(M),toggleCss:(M,B)=>w(U=>U.setClass(M,B)),setContractedDisplayed:M=>y(B=>B.setClass("ag-hidden",!M)),setExpandedDisplayed:M=>S(B=>B.setClass("ag-hidden",!M)),setCheckboxVisible:M=>R(B=>B.setClass("ag-invisible",!M)),setCheckboxSpacing:M=>R(B=>B.setClass("ag-group-checkbox-spacing",M))},de=s.createDynamicBean("groupCellRendererCtrl",!0);de&&(c.current=o.createBean(de),c.current.init(A,H,r.current,a.current,l.current,Fv,e))},[]),D=g.useMemo(()=>`ag-cell-wrapper ${v.toString()}`,[v]),P=g.useMemo(()=>`ag-group-expanded ${b.toString()}`,[b]),T=g.useMemo(()=>`ag-group-contracted ${x.toString()}`,[x]),I=g.useMemo(()=>`ag-group-checkbox ${F.toString()}`,[F]),N=d?.componentFromFramework,q=N?d.componentClass:void 0,L=d==null&&m!=null,V=Jn(m);return g.createElement("span",{className:D,ref:E,...e.colDef?{}:{role:c.current?.getCellAriaRole()}},g.createElement("span",{className:P,ref:a}),g.createElement("span",{className:T,ref:l}),g.createElement("span",{className:I,ref:r}),g.createElement("span",{className:"ag-group-value",ref:i},L?V:N?g.createElement(q,{...d.params}):null),g.createElement("span",{className:"ag-group-child-count"},h))}),bp=Fv,ih=g.createContext({setMethods:()=>{}}),mA=e=>{const{initialProps:t,addUpdateCallback:s,CustomComponentClass:o,setMethods:n}=e,[{key:i,...r},a]=g.useState(t);return g.useEffect(()=>{s(l=>a(l))},[]),g.createElement(ih.Provider,{value:{setMethods:n}},g.createElement(o,{key:i,...r}))},CA=g.memo(mA),vA=0;function Sp(){return`agPortalKey_${++vA}`}var Ev=class{constructor(e,t,s,o){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=s,this.suppressFallbackMethods=!!o,this.statelessComponent=this.isStateless(this.reactComponent),this.key=Sp(),this.portalKey=Sp(),this.instanceCreated=this.isStatelessComponent()?Le.resolve(!1):new Le(n=>{this.resolveInstanceCreated=n})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){this.componentInstance&&typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy();const e=this.portal;e&&this.portalManager.destroyPortal(e)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),s=document.createElement(t||"div");return s.classList.add("ag-react-container"),e.reactContainer=s,s}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return typeof Symbol=="function"&&Symbol.for}isStateless(e){return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&t[e]!=null||this.fallbackMethodAvailable(e)}callMethod(e,t){const s=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!s){setTimeout(()=>this.callMethod(e,t));return}const o=s[e];if(o)return o.apply(s,t);if(this.fallbackMethodAvailable(e))return this.fallbackMethod(e,t&&t[0]?t[0]:{})}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.createOrUpdatePortal(e),new Le(t=>this.createReactComponent(t))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=t=>{this.componentInstance=t,this.resolveInstanceCreated?.(!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,{...e,key:this.key}),this.portal=Yn.createPortal(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return g.createElement(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,e)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!!(!this.isStatelessComponent()&&this.getFrameworkComponentInstance())}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const s=this[`${e}Component`];if(!this.suppressFallbackMethods&&s)return s.bind(this)(t)}fallbackMethodAvailable(e){return this.suppressFallbackMethods?!1:!!this[`${e}Component`]}};function Dl(e,t,s){for(const o of e){const n=t[o];n&&(s[o]=n)}}var Ut=class extends Ev{constructor(){super(...arguments),this.awaitUpdateCallback=new Le(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=CA}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:s=>this.setMethods(s),addUpdateCallback:s=>{this.updateCallback=()=>(s(this.getProps()),new Le(o=>{setTimeout(()=>{o()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,Dl(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new Le(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},wA=class extends Ut{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},bA=class extends Ut{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},SA=class extends Ut{constructor(){super(...arguments),this.label="",this.icon=null,this.shake=!1}setIcon(e,t){this.icon=e,this.shake=t,this.refreshProps()}setLabel(e){this.label=e,this.refreshProps()}getProps(){const e=super.getProps(),{label:t,icon:s,shake:o}=this;return e.label=t,e.icon=s,e.shake=o,e}},yA=class extends Ut{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterModifiedCallback(),this.expectingNewMethods=!0,this.hasBeenActive=!1,this.awaitSetMethodsCallback=new Le(e=>{this.resolveSetMethodsCallback=e})}isFilterActive(){return this.model!=null}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.expectingNewMethods=!0,this.model=e,this.hasBeenActive||(this.hasBeenActive=this.isFilterActive()),this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}setMethods(e){this.expectingNewMethods===!1&&this.hasBeenActive&&this.providedMethods?.doesFilterPass!==e?.doesFilterPass&&setTimeout(()=>{this.sourceParams.filterChangedCallback()}),this.expectingNewMethods=!1,super.setMethods(e),this.resolveSetMethodsCallback(),this.resolveFilterPassCallback?.(),this.resolveFilterPassCallback=void 0}updateModel(e){this.resolveFilterPassCallback?.();const t=new Le(s=>{this.resolveFilterPassCallback=s});this.setModel(e).then(()=>{t.then(()=>{this.sourceParams.filterChangedCallback()})})}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,e}},xA=class extends Ut{constructor(){super(...arguments),this.awaitSetMethodsCallback=new Le(e=>{this.resolveSetMethodsCallback=e})}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","onAnyFilterChanged"]}setMethods(e){super.setMethods(e),this.resolveSetMethodsCallback()}};function Dv(e,t){e.parentFilterInstance(s=>{(s.setModel(t)||Le.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var RA=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=s=>this.updateModel(s)}getProps(){return{...this.floatingFilterParams,model:this.model,onModelChange:this.onModelChange}}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){Dl(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),Dv(this.floatingFilterParams,e)}},FA=class extends Ut{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),Dv(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},EA=class extends Ut{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},DA=class extends Ut{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},PA=class extends Ut{refresh(e){this.sourceParams=e,this.refreshProps()}},TA=class extends Ut{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},MA=class extends Ut{refresh(e){this.sourceParams=e,this.refreshProps()}},IA=class extends Ut{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},kA=class extends Ut{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}};function rh(){$(231)}var AA=1e3,LA=class{constructor(e,t,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=s||AA}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,s){this.portals=[...this.portals,e],this.waitForInstance(t,s),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,s=Date.now()){if(this.destroyed){t(null);return}if(e.rendered())t(e);else{if(Date.now()-s>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate){rr(!0,()=>this.refresher()),e.rendered()&&t(e);return}window.setTimeout(()=>{this.waitForInstance(e,t,s)})}}},OA=({ctrl:e})=>{const t=e.isAlive(),{context:s}=g.useContext(St),[o,n]=g.useState(),[i,r]=g.useState(),a=g.useRef(),l=g.useRef(null),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=g.useRef();t&&!h.current&&(h.current=new gr(()=>l.current));const p=g.useCallback(w=>{if(l.current=w,!w||!e.isAlive()||s.isDestroyed()){a.current=s.destroyBean(a.current);return}a.current=s.createBean(new ei);const b=()=>{const x=e.getSelectAllGui();x&&(c.current?.insertAdjacentElement("afterend",x),a.current.addDestroyFunc(()=>x.remove()))},S={setWidth:x=>{l.current&&(l.current.style.width=x)},toggleCss:(x,y)=>h.current.toggleCss(x,y),setUserStyles:x=>r(x),setAriaSort:x=>{l.current&&(x?NS(l.current,x):HS(l.current))},setUserCompDetails:x=>n(x),getUserCompInstance:()=>u.current||void 0,refreshSelectAllGui:b,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(S,w,c.current,d.current,a.current),b()},[]);g.useLayoutEffect(()=>vr(o,s,d.current,u),[o]),g.useEffect(()=>{e.setDragSource(l.current)},[o]);const m=g.useMemo(()=>!!(o?.componentFromFramework&&si(o.componentClass)),[o]),C=o?.componentFromFramework,v=o?.componentClass;return g.createElement("div",{ref:p,style:i,className:"ag-header-cell",role:"columnheader"},g.createElement("div",{ref:c,className:"ag-header-cell-resize",role:"presentation"}),g.createElement("div",{ref:d,className:"ag-header-cell-comp-wrapper",role:"presentation"},C?m?g.createElement(v,{...o.params}):g.createElement(v,{...o.params,ref:u}):null))},NA=g.memo(OA),HA=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){Dl(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},GA=({ctrl:e})=>{const{context:t,gos:s}=g.useContext(St),[o,n]=g.useState(),[i,r]=g.useState(()=>new es("ag-header-cell","ag-floating-filter")),[a,l]=g.useState(()=>new es),[c,d]=g.useState(()=>new es("ag-floating-filter-button","ag-hidden")),[u,h]=g.useState("false"),[p,m]=g.useState(),[,C]=g.useState(1),v=g.useRef(),w=g.useRef(null),b=g.useRef(null),S=g.useRef(null),x=g.useRef(null),y=g.useRef(),F=g.useRef(),R=M=>{M!=null&&y.current&&y.current(M)},E=g.useCallback(M=>{if(w.current=M,!M||!e.isAlive()||t.isDestroyed()){v.current=t.destroyBean(v.current);return}v.current=t.createBean(new ei),F.current=new Le(U=>{y.current=U});const B={toggleCss:(U,W)=>r(re=>re.setClass(U,W)),setUserStyles:U=>n(U),addOrRemoveBodyCssClass:(U,W)=>l(re=>re.setClass(U,W)),setButtonWrapperDisplayed:U=>{d(W=>W.setClass("ag-hidden",!U)),h(U?"false":"true")},setWidth:U=>{w.current&&(w.current.style.width=U)},setCompDetails:U=>m(U),getFloatingFilterComp:()=>F.current?F.current:null,setMenuIcon:U=>x.current?.appendChild(U)};e.setComp(B,M,x.current,b.current,v.current)},[]);g.useLayoutEffect(()=>vr(p,t,b.current,R),[p]);const D=g.useMemo(()=>i.toString(),[i]),P=g.useMemo(()=>a.toString(),[a]),T=g.useMemo(()=>c.toString(),[c]),I=g.useMemo(()=>!!(p&&p.componentFromFramework&&si(p.componentClass)),[p]),N=g.useMemo(()=>s.get("reactiveCustomComponents"),[]),q=g.useMemo(()=>s.get("enableFilterHandlers"),[]),[L,V]=g.useState();g.useEffect(()=>{if(p?.componentFromFramework)if(N){const M=q?HA:RA,B=new M(p.params,()=>C(U=>U+1));R(B),V(B)}else rh()},[p]);const H=L?.getProps(),A=p?.componentFromFramework,de=p?.componentClass;return g.createElement("div",{ref:E,style:o,className:D,role:"gridcell"},g.createElement("div",{ref:b,className:P,role:"presentation"},A?N?H&&g.createElement(ih.Provider,{value:{setMethods:M=>L.setMethods(M)}},g.createElement(de,{...H})):g.createElement(de,{...p.params,ref:I?()=>{}:R}):null),g.createElement("div",{ref:S,"aria-hidden":u,className:T,role:"presentation"},g.createElement("button",{ref:x,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},BA=g.memo(GA),VA=({ctrl:e})=>{const{context:t}=g.useContext(St),[s,o]=g.useState(),[n,i]=g.useState(()=>new es),[r,a]=g.useState(()=>new es),[l,c]=g.useState("false"),[d,u]=g.useState(),[h,p]=g.useState(),m=g.useRef(),C=g.useRef(null),v=g.useRef(null),w=g.useRef(null),b=g.useRef(),S=g.useCallback(D=>{if(C.current=D,!D||!e.isAlive()||t.isDestroyed()){m.current=t.destroyBean(m.current);return}m.current=t.createBean(new ei);const P={setWidth:T=>{C.current&&(C.current.style.width=T)},toggleCss:(T,I)=>i(N=>N.setClass(T,I)),setUserStyles:T=>o(T),setHeaderWrapperHidden:T=>{const I=w.current;I&&(T?I.style.setProperty("display","none"):I.style.removeProperty("display"))},setHeaderWrapperMaxHeight:T=>{const I=w.current;I&&(T!=null?I.style.setProperty("max-height",`${T}px`):I.style.removeProperty("max-height"),I.classList.toggle("ag-header-cell-comp-wrapper-limited-height",T!=null))},setUserCompDetails:T=>p(T),setResizableDisplayed:T=>{a(I=>I.setClass("ag-hidden",!T)),c(T?"false":"true")},setAriaExpanded:T=>u(T),getUserCompInstance:()=>b.current||void 0};e.setComp(P,D,v.current,w.current,m.current)},[]);g.useLayoutEffect(()=>vr(h,t,w.current),[h]),g.useEffect(()=>{C.current&&e.setDragSource(C.current)},[h]);const x=g.useMemo(()=>!!(h?.componentFromFramework&&si(h.componentClass)),[h]),y=g.useMemo(()=>"ag-header-group-cell "+n.toString(),[n]),F=g.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),R=h?.componentFromFramework,E=h?.componentClass;return g.createElement("div",{ref:S,style:s,className:y,role:"columnheader","aria-expanded":d},g.createElement("div",{ref:w,className:"ag-header-cell-comp-wrapper",role:"presentation"},R?x?g.createElement(E,{...h.params}):g.createElement(E,{...h.params,ref:b}):null),g.createElement("div",{ref:v,"aria-hidden":l,className:F}))},zA=g.memo(VA),WA=({ctrl:e})=>{const{gos:t,context:s}=g.useContext(St),{topOffset:o,rowHeight:n}=g.useMemo(()=>e.getTopAndHeight(),[]),i=g.useMemo(()=>t.get("tabIndex"),[]),[r,a]=g.useState(()=>e.getAriaRowIndex()),l=e.headerRowClass,[c,d]=g.useState(()=>n+"px"),[u,h]=g.useState(()=>o+"px"),p=g.useRef(null),[m,C]=g.useState(()=>e.getUpdatedHeaderCtrls()),v=g.useRef(),w=g.useRef(null),b=g.useCallback(y=>{if(w.current=y,!y||!e.isAlive()||s.isDestroyed()){v.current=s.destroyBean(v.current);return}v.current=s.createBean(new ei);const F={setHeight:R=>d(R),setTop:R=>h(R),setHeaderCtrls:(R,E,D)=>{const P=p.current,T=ol(P,R,E);T!==P&&(p.current=T,rr(D,()=>C(T)))},setWidth:R=>{w.current&&(w.current.style.width=R)},setRowIndex:R=>{a(R)}};e.setComp(F,v.current,!1)},[]),S=g.useMemo(()=>({height:c,top:u}),[c,u]),x=g.useCallback(y=>{switch(e.type){case"group":return g.createElement(zA,{ctrl:y,key:y.instanceId});case"filter":return g.createElement(BA,{ctrl:y,key:y.instanceId});default:return g.createElement(NA,{ctrl:y,key:y.instanceId})}},[]);return g.createElement("div",{ref:b,className:l,role:"row",style:S,tabIndex:i,"aria-rowindex":r},m.map(x))},_A=g.memo(WA),jA=({pinned:e})=>{const[t,s]=g.useState(!0),[o,n]=g.useState([]),{context:i}=g.useContext(St),r=g.useRef(null),a=g.useRef(null),l=g.useRef(),c=e==="left",d=e==="right",u=!c&&!d,h=g.useCallback(C=>{if(r.current=C,!C||i.isDestroyed()){l.current=i.destroyBean(l.current);return}l.current=i.createBean(new SF(e));const v={setDisplayed:s,setCtrls:w=>n(w),setCenterWidth:w=>{a.current&&(a.current.style.width=w)},setViewportScrollLeft:w=>{r.current&&(r.current.scrollLeft=w)},setPinnedContainerWidth:w=>{r.current&&(r.current.style.width=w,r.current.style.minWidth=w,r.current.style.maxWidth=w)}};l.current.setComp(v,r.current)},[]),p=t?"":"ag-hidden",m=()=>o.map(C=>g.createElement(_A,{ctrl:C,key:C.instanceId}));return c?g.createElement("div",{ref:h,className:"ag-pinned-left-header "+p,"aria-hidden":!t,role:"rowgroup"},m()):d?g.createElement("div",{ref:h,className:"ag-pinned-right-header "+p,"aria-hidden":!t,role:"rowgroup"},m()):u?g.createElement("div",{ref:h,className:"ag-header-viewport "+p,role:"rowgroup",tabIndex:-1},g.createElement("div",{ref:a,className:"ag-header-container",role:"presentation"},m())):null},Uc=g.memo(jA),UA=()=>{const[e,t]=g.useState(()=>new es),[s,o]=g.useState(),{context:n}=g.useContext(St),i=g.useRef(null),r=g.useRef(),a=g.useCallback(d=>{if(i.current=d,!d||n.isDestroyed()){r.current=n.destroyBean(r.current);return}r.current=n.createBean(new CF);const u={toggleCss:(h,p)=>t(m=>m.setClass(h,p)),setHeightAndMinHeight:h=>o(h)};r.current.setComp(u,d,d)},[]),l=g.useMemo(()=>"ag-header "+e.toString(),[e]),c=g.useMemo(()=>({height:s,minHeight:s}),[s]);return g.createElement("div",{ref:a,className:l,style:c,role:"presentation"},g.createElement(Uc,{pinned:"left"}),g.createElement(Uc,{pinned:null}),g.createElement(Uc,{pinned:"right"}))},$A=g.memo(UA),qA=(e,t)=>{g.useEffect(()=>{const s=t.current;if(s){const o=s.parentElement;if(o){const n=document.createComment(e);return o.insertBefore(n,s),()=>{n.remove()}}}},[e])},xo=qA,KA=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new Le(s=>{this.resolveInstanceCreated=s}),this.onValueChange=s=>this.updateValue(s),this.value=e.value}getProps(){return{...this.cellEditorParams,initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange}}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){Dl(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){this.componentInstance=e,this.resolveInstanceCreated?.(),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isCancelBeforeStart","isCancelAfterEnd","focusIn","focusOut","afterGuiAttached","getValidationErrors","getValidationElement"]}updateValue(e){this.value=e,this.refreshProps()}},YA=e=>{const t=g.useRef(e),s=g.useRef(),o=g.useRef(!1),n=g.useRef(!1),[,i]=g.useState(0);o.current&&(n.current=!0),g.useEffect(()=>(o.current||(s.current=t.current(),o.current=!0),i(r=>r+1),()=>{n.current&&s.current?.()}),[])},XA=e=>{const[t,s]=g.useState(),o=g.useContext(St),{context:n,popupSvc:i,gos:r,editSvc:a}=o,{editDetails:l,cellCtrl:c,eParentCell:d}=e;return YA(()=>{const{compDetails:u}=l,h=r.get("stopEditingWhenCellsLoseFocus");let p,m;if(!n.isDestroyed()){m=n.createBean(a.createPopupEditorWrapper(u.params));const C=m.getGui();if(e.jsChildComp){const y=e.jsChildComp.getGui();y&&C.appendChild(y)}const{column:v,rowNode:w}=c,b={column:v,rowNode:w,type:"popupCellEditor",eventSource:d,ePopup:C,position:l.popupPosition,keepWithinBounds:!0},S=i?.positionPopupByComponent.bind(i,b),x=i?.addPopup({modal:h,eChild:C,closeOnEsc:!0,closedCallback:()=>{c.onPopupEditorClosed()},anchorToElement:d,positionCallback:S,ariaOwns:d});p=x?x.hideFunc:void 0,s(m),e.jsChildComp?.afterGuiAttached?.()}return()=>{p?.(),n.destroyBean(m)}}),g.useLayoutEffect(()=>()=>{c.isCellFocused()&&t?.getGui().contains(Je(o))&&d.focus({preventScroll:!0})},[t]),t&&e.wrappedContent?Yn.createPortal(e.wrappedContent,t.getGui()):null},yp=g.memo(XA),ZA=(e,t,s)=>{const{compProxy:o}=e;s(o);const n=o.getProps(),i=si(t);return g.createElement(ih.Provider,{value:{setMethods:r=>o.setMethods(r)}},i?g.createElement(t,{...n}):g.createElement(t,{...n,ref:r=>o.setRef(r)}))},xp=(e,t,s)=>e.compProxy?ZA(e,t,s):g.createElement(t,{...e.compDetails.params,ref:s}),QA=(e,t,s,o,n)=>{const i=e.compDetails,r=i.componentClass,a=i.componentFromFramework&&!e.popup,l=i.componentFromFramework&&e.popup,c=!i.componentFromFramework&&e.popup;return a?xp(e,r,t):l?g.createElement(yp,{editDetails:e,cellCtrl:o,eParentCell:s,wrappedContent:xp(e,r,t)}):c&&n?g.createElement(yp,{editDetails:e,cellCtrl:o,eParentCell:s,jsChildComp:n}):null},JA=(e,t,s,o,n,i)=>{const{context:r}=g.useContext(St),a=g.useCallback(()=>{const l=n.current;if(!l)return;const c=l.getGui();c&&c.parentElement&&c.remove(),r.destroyBean(l),n.current=void 0},[]);g.useEffect(()=>{const l=e!=null,c=e?.compDetails&&!e.compDetails.componentFromFramework,d=t&&s==null;if(!(l&&c&&!d)){a();return}const h=e.compDetails;if(n.current){const m=n.current,v=m.refresh!=null&&e.force==!1?m.refresh(h.params):!1;if(v===!0||v===void 0)return;a()}h.newAgStackInstance().then(m=>{if(!m)return;const C=m.getGui();if(!C)return;(t?s:i.current).appendChild(C),n.current=m})},[e,t,o]),g.useEffect(()=>a,[])},Pv=JA,e8=({cellCtrl:e,parent:t})=>{const s=g.useRef(),o=g.useMemo(()=>{const{loadingComp:n}=e.getDeferLoadingCellRenderer();return n?{value:void 0,compDetails:n,force:!1}:void 0},[e]);if(Pv(o,!1,void 0,1,s,t),o?.compDetails?.componentFromFramework){const n=o.compDetails.componentClass;return g.createElement(n,{...o.compDetails.params})}return g.createElement(g.Fragment,null)},t8=({cellCtrl:e,printLayout:t,editingCell:s})=>{const o=g.useContext(St),{context:n}=o,{column:{colIdSanitised:i},instanceId:r}=e,a=g.useRef(),[l,c]=g.useState(()=>e.isCellRenderer()?void 0:{compDetails:void 0,value:e.getValueToDisplay(),force:!1}),[d,u]=g.useState(),[h,p]=g.useState(1),[m,C]=g.useState(),[v,w]=g.useState(!1),[b,S]=g.useState(!1),[x,y]=g.useState(!1),[F,R]=g.useState(),E=g.useMemo(()=>e.isForceWrapper(),[e]),D=g.useMemo(()=>e.getCellAriaRole(),[e]),P=g.useRef(null),T=g.useRef(null),I=g.useRef(null),N=g.useRef(),q=g.useRef(),L=g.useRef(),V=g.useRef([]),H=g.useRef(),A=g.useRef(),[de,M]=g.useState(0),B=g.useCallback(se=>{A.current=se,M(le=>le+1)},[]),U=l!=null&&(v||x||b)&&(d==null||!!d.popup),W=E||U,re=g.useMemo(()=>e.getCellValueClass(),[e]),be=g.useCallback(se=>{if(q.current=se,se){const le=se.isCancelBeforeStart&&se.isCancelBeforeStart();setTimeout(()=>{le?(e.stopEditing(!0),e.focusCell(!0)):(e.cellEditorAttached(),e.enableEditorTooltipFeature(se))})}},[e]),Q=g.useRef();Q.current||(Q.current=new gr(()=>P.current)),Pv(l,W,A.current,de,N,P);const _=g.useRef();g.useLayoutEffect(()=>{const se=_.current,le=l;if(_.current=l,se==null||se.compDetails==null||le==null||le.compDetails==null)return;H.current?.refreshVisibility();const Fe=se.compDetails,Oe=le.compDetails;if(Fe.componentClass!=Oe.componentClass||I.current?.refresh==null)return;I.current.refresh(Oe.params)!=!0&&p(Ee=>Ee+1)},[l]),g.useLayoutEffect(()=>{if(!(d&&!d.compDetails.componentFromFramework)||n.isDestroyed())return;const le=d.compDetails,Fe=d.popup===!0,Oe=le.newAgStackInstance();return Oe.then(ve=>{if(!ve)return;const Ee=ve.getGui();be(ve),Fe||((E?L:P).current?.appendChild(Ee),ve.afterGuiAttached?.()),R(ve)}),()=>{Oe.then(ve=>{const Ee=ve.getGui();e.disableEditorTooltipFeature(),n.destroyBean(ve),be(void 0),R(void 0),Ee?.remove()})}},[d]);const pe=g.useCallback(se=>{if(L.current=se,!se||n.isDestroyed()||!e.isAlive()){const Oe=V.current;V.current=[];for(const ve of Oe)ve();return}let le;const Fe=Oe=>{Oe&&(se.insertAdjacentElement("afterbegin",Oe.getGui()),V.current.push(()=>{io(Oe.getGui()),n.destroyBean(Oe),H.current===le&&(H.current=void 0)}))};v&&Fe(e.createSelectionCheckbox()),x&&Fe(e.createDndSource()),b&&(le=e.createRowDragComp(),H.current=le,le&&(Fe(le),le.refreshVisibility()))},[e,n,x,b,v]),oe=g.useCallback(()=>{const se=!e.isCellSpanning()||T.current,le=P.current;if(!le||!se||!e||!e.isAlive()||n.isDestroyed()){a.current=n.destroyBean(a.current);return}a.current=n.createBean(new ei);const Fe={toggleCss:(ve,Ee)=>Q.current.toggleCss(ve,Ee),setUserStyles:ve=>C(ve),getFocusableElement:()=>P.current,setIncludeSelection:ve=>w(ve),setIncludeRowDrag:ve=>S(ve),setIncludeDndSource:ve=>y(ve),getCellEditor:()=>q.current??null,getCellRenderer:()=>I.current??N.current,getParentOfValue:()=>A.current??L.current??P.current,setRenderDetails:(ve,Ee,_e)=>{const je=()=>{c(Ae=>Ae?.compDetails!==ve||Ae?.value!==Ee||Ae?.force!==_e?{value:Ee,compDetails:ve,force:_e}:Ae)};if(ve?.params?.deferRender&&!e.rowNode.group){const{loadingComp:Ae,onReady:Mt}=e.getDeferLoadingCellRenderer();if(Ae){c({value:void 0,compDetails:Ae,force:!1}),Mt.then(()=>pA(je));return}}je()},setEditDetails:(ve,Ee,_e,je)=>{if(ve){let Ae;ve.componentFromFramework&&(je?Ae=new KA(ve.params,()=>p(Mt=>Mt+1)):rh()),u({compDetails:ve,popup:Ee,popupPosition:_e,compProxy:Ae}),Ee||c(void 0)}else e.hasBrowserFocus()&&Fe.getFocusableElement().focus({preventScroll:!0}),q.current=void 0,u(void 0)},refreshEditStyles:(ve,Ee)=>{if(!P.current)return;const{current:_e}=Q;_e.toggleCss("ag-cell-value",!W),_e.toggleCss("ag-cell-inline-editing",!!ve&&!Ee),_e.toggleCss("ag-cell-popup-editing",!!ve&&!!Ee),_e.toggleCss("ag-cell-not-inline-editing",!ve||!!Ee)}},Oe=L.current||void 0;e.setComp(Fe,le,T.current??void 0,Oe,t,s,a.current)},[]),Z=g.useCallback(se=>{P.current=se,oe()},[]),j=g.useCallback(se=>{T.current=se,oe()},[]),ae=g.useMemo(()=>!!(l?.compDetails?.componentFromFramework&&si(l.compDetails.componentClass)),[l]);g.useLayoutEffect(()=>{if(!P.current)return;const{current:se}=Q;se.toggleCss("ag-cell-value",!W),se.toggleCss("ag-cell-inline-editing",!!d&&!d.popup),se.toggleCss("ag-cell-popup-editing",!!d&&!!d.popup),se.toggleCss("ag-cell-not-inline-editing",!d||!!d.popup)});const G=()=>{const{compDetails:se,value:le}=l;if(!se)return le?.toString?.()??le;if(se.componentFromFramework){const Fe=se.componentClass;return g.createElement(g.Suspense,{fallback:g.createElement(e8,{cellCtrl:e,parent:P})},ae?g.createElement(Fe,{...se.params,key:h}):g.createElement(Fe,{...se.params,key:h,ref:I}))}},fe=()=>{const se=()=>l==null?null:W?g.createElement("span",{role:"presentation",id:`cell-${r}`,className:re,ref:B},G()):G(),le=Fe=>QA(Fe,be,P.current,e,F);return d!=null?d.popup?g.createElement(g.Fragment,null,se(),le(d)):le(d):se()},he=()=>g.createElement("div",{ref:Z,style:m,role:D,"col-id":i},W?g.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:pe},fe()):fe());return e.isCellSpanning()?g.createElement("div",{ref:j,className:"ag-spanned-cell-wrapper",role:"presentation"},he()):he()},s8=g.memo(t8),o8=({rowCtrl:e,containerType:t})=>{const{context:s,gos:o,editSvc:n}=g.useContext(St),i=g.useContext(yv)==="default",r=g.useRef(),a=g.useRef(e.getDomOrder()),l=e.isFullWidth(),c=e.rowNode.displayed,[d,u]=g.useState(()=>c?e.rowNode.getRowIndexString():null),[h,p]=g.useState(()=>e.rowId),[m,C]=g.useState(()=>e.businessKey),[v,w]=g.useState(()=>e.rowStyles),b=g.useRef(null),[S,x]=g.useState(()=>null),[y,F]=g.useState(),[R,E]=g.useState(()=>c?e.getInitialRowTop(t):void 0),[D,P]=g.useState(()=>c?e.getInitialTransform(t):void 0),T=g.useRef(null),I=g.useRef(),N=g.useRef(),q=g.useRef(!1),[L,V]=g.useState(0);g.useEffect(()=>{if(q.current||!y||L>10)return;const Z=T.current?.firstChild;Z?(e.setupDetailRowAutoHeight(Z),q.current=!0):V(j=>j+1)},[y,L]);const H=g.useRef();H.current||(H.current=new gr(()=>T.current));const A=g.useRef(()=>{}),de=g.useCallback(Z=>(A.current=Z,()=>{A.current=()=>{}}),[]),M=fA(de,()=>b.current,[]),B=i?M:S,U=g.useCallback(Z=>{if(T.current=Z,r.current=Z?s.createBean(new ei):s.destroyBean(r.current),!Z){e.unsetComp(t);return}if(!e.isAlive()||s.isDestroyed())return;const j={setTop:E,setTransform:P,toggleCss:(ae,G)=>H.current.toggleCss(ae,G),setDomOrder:ae=>a.current=ae,setRowIndex:u,setRowId:p,setRowBusinessKey:C,setUserStyles:w,setCellCtrls:(ae,G)=>{const fe=b.current,he=ol(fe,ae,a.current);he!==fe&&(b.current=he,i?A.current():rr(G,()=>x(he)))},showFullWidth:ae=>{N.current=ae.params,F(ae)},getFullWidthCellRenderer:()=>I.current,getFullWidthCellRendererParams:()=>N.current,refreshFullWidth:ae=>{const G=ae();return N.current=G,_.current?(F(fe=>({...fe,params:G})),!0):!I.current||!I.current.refresh?!1:I.current.refresh(G)}};e.setComp(j,Z,t,r.current)},[]);g.useLayoutEffect(()=>vr(y,s,T.current,I),[y]);const W=g.useMemo(()=>{const Z={top:R,transform:D};return Object.assign(Z,v),Z},[R,D,v]),re=l&&y?.componentFromFramework,be=!l&&B!=null,Q=g.useMemo(()=>!!(y?.componentFromFramework&&si(y.componentClass)),[y]),_=g.useRef(!1);g.useEffect(()=>{_.current=Q&&!!y&&!!o.get("reactiveCustomComponents")},[Q,y]);const pe=()=>B?.map(Z=>g.createElement(s8,{cellCtrl:Z,editingCell:n?.isEditing(Z,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:Z.instanceId})),oe=()=>{const Z=y.componentClass;return Q?g.createElement(Z,{...y.params}):g.createElement(Z,{...y.params,ref:I})};return g.createElement("div",{ref:U,role:"row",style:W,"row-index":d,"row-id":h,"row-business-key":m},be?pe():re?oe():null)},Rp=g.memo(o8),n8=({name:e})=>{const{context:t,gos:s}=g.useContext(St),o=g.useMemo(()=>fr(e),[e]),n=g.useRef(null),i=g.useRef(null),r=g.useRef(null),a=g.useRef([]),l=g.useRef([]),[c,d]=g.useState(()=>[]),u=!!s.get("enableCellSpan")&&!!o.getSpannedRowCtrls,h=g.useRef([]),p=g.useRef([]),[m,C]=g.useState(()=>[]),v=g.useRef(!1),w=g.useRef(),b=g.useMemo(()=>Yt("ag-viewport",Um(e)),[e]),S=g.useMemo(()=>Yt(Fa(e)),[e]),x=g.useMemo(()=>Yt("ag-spanning-container",z2(e)),[e]),y=o.type==="center"||u,F=y?n:i;xo(" AG Row Container "+e+" ",F);const R=g.useCallback(()=>{const L=!y||n.current!=null,V=i.current!=null,H=!u||r.current!=null;return L&&V&&H},[]),E=g.useCallback(()=>n.current==null&&i.current==null&&r.current==null,[]),D=g.useCallback(()=>{if(E()&&(w.current=t.destroyBean(w.current)),!t.isDestroyed()&&R()){const L=A=>{const de=ol(l.current,a.current,v.current);de!==l.current&&(l.current=de,rr(A,()=>d(de)))},V=A=>{const de=ol(p.current,h.current,v.current);de!==p.current&&(p.current=de,rr(A,()=>C(de)))},H={setHorizontalScroll:A=>{n.current&&(n.current.scrollLeft=A)},setViewportHeight:A=>{n.current&&(n.current.style.height=A)},setRowCtrls:({rowCtrls:A,useFlushSync:de})=>{const M=!!de&&a.current.length>0&&A.length>0;a.current=A,L(M)},setSpannedRowCtrls:(A,de)=>{const M=!!de&&h.current.length>0&&A.length>0;h.current=A,V(M)},setDomOrder:A=>{v.current!=A&&(v.current=A,L(!1))},setContainerWidth:A=>{i.current&&(i.current.style.width=A)},setOffsetTop:A=>{i.current&&(i.current.style.transform=`translateY(${A})`)}};w.current=t.createBean(new Z2(e)),w.current.setComp(H,i.current,r.current??void 0,n.current)}},[R,E]),P=g.useCallback(L=>{i.current=L,D()},[D]),T=g.useCallback(L=>{r.current=L,D()},[D]),I=g.useCallback(L=>{n.current=L,D()},[D]),N=()=>g.createElement("div",{className:S,ref:P,role:y?"presentation":"rowgroup"},c.map(L=>g.createElement(Rp,{rowCtrl:L,containerType:o.type,key:L.instanceId})));if(!y)return N();const q=()=>g.createElement("div",{className:x,ref:T,role:"presentation"},m.map(L=>g.createElement(Rp,{rowCtrl:L,containerType:o.type,key:L.instanceId})));return g.createElement("div",{className:b,ref:I,role:"rowgroup"},N(),u?q():null)},i8=g.memo(n8),r8=()=>{const e=g.useContext(St),{context:t,overlays:s}=e,[o,n]=g.useState(""),[i,r]=g.useState(0),[a,l]=g.useState(0),[c,d]=g.useState("0px"),[u,h]=g.useState("0px"),[p,m]=g.useState("100%"),[C,v]=g.useState("0px"),[w,b]=g.useState("0px"),[S,x]=g.useState("100%"),[y,F]=g.useState(!0),[R,E]=g.useState(!0),[D,P]=g.useState(null),[T,I]=g.useState(""),[N,q]=g.useState(null),[L,V]=g.useState("ag-layout-normal"),H=g.useRef();H.current||(H.current=new gr(()=>A.current));const A=g.useRef(null),de=g.useRef(null),M=g.useRef(null),B=g.useRef(null),U=g.useRef(null),W=g.useRef(null),re=g.useRef(null),be=g.useRef([]),Q=g.useRef([]);xo(" AG Grid Body ",A),xo(" AG Pinned Top ",de),xo(" AG Sticky Top ",M),xo(" AG Middle ",W),xo(" AG Pinned Bottom ",re);const _=g.useCallback(Ee=>{if(A.current=Ee,!Ee||t.isDestroyed()){be.current=t.destroyBeans(be.current);for(const Ge of Q.current)Ge();Q.current=[];return}const _e=(Ge,K)=>{Ge.appendChild(K),Q.current.push(()=>K.remove())},je=Ge=>{const K=t.createBean(new Ge);return be.current.push(K),K},Ae=(Ge,K,He)=>{_e(Ge,document.createComment(He)),_e(Ge,je(K).getGui())};Ae(Ee,nF," AG Fake Horizontal Scroll ");const Mt=s?.getOverlayWrapperCompClass();Mt&&Ae(Ee,Mt," AG Overlay Wrapper "),U.current&&Ae(U.current,rF," AG Fake Vertical Scroll ");const os={setRowAnimationCssOnBodyViewport:n,setColumnCount:Ge=>{A.current&&LS(A.current,Ge)},setRowCount:Ge=>{A.current&&kS(A.current,Ge)},setTopHeight:r,setBottomHeight:l,setStickyTopHeight:d,setStickyTopTop:h,setStickyTopWidth:m,setTopInvisible:F,setBottomInvisible:E,setColumnMovingCss:(Ge,K)=>H.current.toggleCss(Ge,K),updateLayoutClasses:V,setAlwaysVerticalScrollClass:P,setPinnedTopBottomOverflowY:I,setCellSelectableCss:(Ge,K)=>q(K?Ge:null),setBodyViewportWidth:Ge=>{W.current&&(W.current.style.width=Ge)},registerBodyViewportResizeListener:Ge=>{if(W.current){const K=_s(e,W.current,Ge);Q.current.push(()=>K())}},setStickyBottomHeight:v,setStickyBottomBottom:b,setStickyBottomWidth:x,setGridRootRole:Ge=>Ee.setAttribute("role",Ge)},It=t.createBean(new tF);be.current.push(It),It.setComp(os,Ee,W.current,de.current,re.current,M.current,B.current)},[]),pe=g.useMemo(()=>Yt("ag-root","ag-unselectable",L),[L]),oe=g.useMemo(()=>Yt("ag-body-viewport",o,L,D,N),[o,L,D,N]),Z=g.useMemo(()=>Yt("ag-body",L),[L]),j=g.useMemo(()=>Yt("ag-floating-top",y?"ag-invisible":null,N),[N,y]),ae=g.useMemo(()=>Yt("ag-sticky-top",N),[N]),G=g.useMemo(()=>Yt("ag-sticky-bottom",C==="0px"?"ag-invisible":null,N),[N,C]),fe=g.useMemo(()=>Yt("ag-floating-bottom",R?"ag-invisible":null,N),[N,R]),he=g.useMemo(()=>({height:i,minHeight:i,overflowY:T}),[i,T]),se=g.useMemo(()=>({height:c,top:u,width:p}),[c,u,p]),le=g.useMemo(()=>({height:C,bottom:w,width:S}),[C,w,S]),Fe=g.useMemo(()=>({height:a,minHeight:a,overflowY:T}),[a,T]),Oe=Ee=>g.createElement(i8,{name:Ee,key:`${Ee}-container`}),ve=({section:Ee,children:_e,className:je,style:Ae})=>g.createElement("div",{ref:Ee,className:je,role:"presentation",style:Ae},_e.map(Oe));return g.createElement("div",{ref:_,className:pe},g.createElement($A,null),ve({section:de,className:j,style:he,children:["topLeft","topCenter","topRight","topFullWidth"]}),g.createElement("div",{className:Z,ref:U,role:"presentation"},ve({section:W,className:oe,children:["left","center","right","fullWidth"]})),ve({section:M,className:ae,style:se,children:["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"]}),ve({section:B,className:G,style:le,children:["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"]}),ve({section:re,className:fe,style:Fe,children:["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"]}))},a8=g.memo(r8),l8=(e,t)=>{const{children:s,eFocusableElement:o,onTabKeyDown:n,gridCtrl:i,forceFocusOutWhenTabGuardsAreEmpty:r,isEmpty:a}=e,{context:l}=g.useContext(St),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=w=>{const b=w==null?void 0:parseInt(w,10).toString();for(const S of[c,d])b===void 0?S.current?.removeAttribute("tabindex"):S.current?.setAttribute("tabindex",b)};g.useImperativeHandle(t,()=>({forceFocusOutOfContainer(w){u.current?.forceFocusOutOfContainer(w)}}));const p=g.useCallback(()=>{const w=c.current,b=d.current;if(!w&&!b||l.isDestroyed()){u.current=l.destroyBean(u.current);return}if(w&&b){const S={setTabIndex:h};u.current=l.createBean(new oC({comp:S,eTopGuard:w,eBottomGuard:b,eFocusableElement:o,onTabKeyDown:n,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:x=>i.focusInnerElement(x),isEmpty:a}))}},[]),m=g.useCallback(w=>{c.current=w,p()},[p]),C=g.useCallback(w=>{d.current=w,p()},[p]),v=w=>{const b=w==="top"?On.TAB_GUARD_TOP:On.TAB_GUARD_BOTTOM;return g.createElement("div",{className:`${On.TAB_GUARD} ${b}`,role:"presentation",ref:w==="top"?m:C})};return g.createElement(g.Fragment,null,v("top"),s,v("bottom"))},c8=g.forwardRef(l8),d8=g.memo(c8),u8=({context:e})=>{const[t,s]=g.useState(""),[o,n]=g.useState(""),[i,r]=g.useState(null),[a,l]=g.useState(null),[c,d]=g.useState(!1),[u,h]=g.useState(),p=g.useRef(),m=g.useRef(null),C=g.useRef(),[v,w]=g.useState(null),b=g.useRef(()=>{}),S=g.useRef(),x=g.useRef([]),y=g.useCallback(()=>{},[]);xo(" AG Grid ",m);const F=g.useCallback(I=>{if(m.current=I,p.current=I?e.createBean(new oE):e.destroyBean(p.current),!I||e.isDestroyed())return;const N=p.current;b.current=N.focusInnerElement.bind(N);const q={destroyGridUi:()=>{},setRtlClass:s,forceFocusOutOfContainer:L=>{if(!L&&S.current?.isDisplayed()){S.current.forceFocusOutOfContainer(L);return}C.current?.forceFocusOutOfContainer(L)},updateLayoutClasses:n,getFocusableContainers:()=>{const L=[],V=m.current?.querySelector(".ag-root");V&&L.push({getGui:()=>V});for(const H of x.current)H.isDisplayed()&&L.push(H);return L},setCursor:r,setUserSelect:l};N.setComp(q,I,I),d(!0)},[]);g.useEffect(()=>{const I=p.current,N=m.current;if(!u||!I||!v||!N||e.isDestroyed())return;const q=[],{watermarkSelector:L,paginationSelector:V,sideBarSelector:H,statusBarSelector:A,gridHeaderDropZonesSelector:de}=I.getOptionalSelectors(),M=[];if(de){const U=e.createBean(new de.component),W=U.getGui();N.insertAdjacentElement("afterbegin",W),M.push(W),q.push(U)}if(H){const U=e.createBean(new H.component),W=U.getGui(),re=v.querySelector(".ag-tab-guard-bottom");re&&(re.insertAdjacentElement("beforebegin",W),M.push(W)),q.push(U),x.current.push(U)}const B=U=>{const W=e.createBean(new U),re=W.getGui();return N.insertAdjacentElement("beforeend",re),M.push(re),q.push(W),W};if(A&&B(A.component),V){const U=B(V.component);S.current=U,x.current.push(U)}return L&&B(L.component),()=>{e.destroyBeans(q);for(const U of M)U.remove()}},[u,v,e]);const R=g.useMemo(()=>Yt("ag-root-wrapper",t,o),[t,o]),E=g.useMemo(()=>Yt("ag-root-wrapper-body","ag-focus-managed",o),[o]),D=g.useMemo(()=>({userSelect:a??"",WebkitUserSelect:a??"",cursor:i??""}),[a,i]),P=g.useCallback(I=>{C.current=I,h(I!==null)},[]),T=g.useCallback(()=>!p.current?.isFocusable(),[]);return g.createElement("div",{ref:F,className:R,style:D,role:"presentation"},g.createElement("div",{className:E,ref:w,role:"presentation"},c&&v&&!e.isDestroyed()&&g.createElement(St.Provider,{value:e.getBeans()},g.createElement(d8,{ref:P,eFocusableElement:v,onTabKeyDown:y,gridCtrl:p.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:T},g.createElement(a8,null)))))},h8=g.memo(u8),g8=class extends O{postConstruct(){if(this.beans.colAutosize){const e=this.queueResizeOperationsForTick.bind(this);this.addManagedEventListeners({rowExpansionStateChanged:e,expandOrCollapseAll:e,cellValueChanged:e,rowNodeDataChanged:e,rowDataUpdated:e})}}queueResizeOperationsForTick(){const e=this.beans.colAutosize;e.shouldQueueResizeOperations=!0,setTimeout(()=>{e.processResizeOperations()},0)}areHeaderCellsRendered(){return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().every(e=>e.getAllCtrls().every(t=>t.areCellsRendered()))}areCellsRendered(){return this.beans.rowRenderer.getAllRowCtrls().every(e=>e.isRowRendered()&&e.getAllCellCtrls().every(t=>!!t.eGui))}},Tv={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},p8={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,componentWrappingElement:void 0,...Tv},Mv=new Set(Object.keys(p8)),f8=new Set(Object.keys(Tv)),Iv=e=>{const t=g.useRef(),s=g.useRef(null),o=g.useRef(null),n=g.useRef([]),i=g.useRef([]),r=g.useRef(e),a=g.useRef(),l=g.useRef(),c=g.useRef(!1),[d,u]=g.useState(void 0),[,h]=g.useState(0),p=g.useCallback(w=>{if(s.current=w,!w){for(const T of n.current)T();n.current.length=0;return}const b=e.modules||[];o.current||(o.current=new LA(()=>h(T=>T+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),n.current.push(()=>{o.current?.destroy(),o.current=null}));const S=Ly(e.gridOptions,e,Object.keys(e).filter(T=>!Mv.has(T))),x=()=>{if(c.current){const T=()=>a.current?.shouldQueueUpdates()?void 0:i.current.shift();let I=T();for(;I;)I(),I=T()}},y=new w8(x);a.current=y;const F=new g8,R={providedBeanInstances:{frameworkCompWrapper:new C8(o.current,S),renderStatus:F},modules:b,frameworkOverrides:y,setThemeOnGridDiv:!0},E=T=>{u(T),T.createBean(F),n.current.push(()=>{T.destroy()}),T.getBean("ctrlsSvc").whenReady({addDestroyFunc:I=>{n.current.push(I)}},()=>{if(T.isDestroyed())return;const I=t.current;I&&e.passGridApi?.(I)})},D=T=>{T.getBean("ctrlsSvc").whenReady({addDestroyFunc:I=>{n.current.push(I)}},()=>{for(const I of i.current)I();i.current.length=0,c.current=!0})},P=new TT;S.gridId??(S.gridId=l.current),t.current=P.create(w,S,E,D,R),n.current.push(()=>{t.current=void 0}),t.current&&(l.current=t.current.getGridId())},[]),m=g.useMemo(()=>({height:"100%",...e.containerStyle||{}}),[e.containerStyle]),C=g.useCallback(w=>{c.current&&!a.current?.shouldQueueUpdates()?w():i.current.push(w)},[]);g.useEffect(()=>{const w=m8(r.current,e);r.current=e,C(()=>{t.current&&Oy(w,t.current)})},[e]);const v=!g.useSyncExternalStore||ba(e,"renderingMode")==="legacy"?"legacy":"default";return g.createElement("div",{style:m,className:e.className,ref:p},g.createElement(yv.Provider,{value:v},d&&!d.isDestroyed()?g.createElement(h8,{key:d.instanceId,context:d}):null,o.current?.getPortals()??null))};function m8(e,t){const s={};for(const o of Object.keys(t)){if(Mv.has(o)){f8.has(o)&&$(274,{prop:o});continue}const n=t[o];e[o]!==n&&(s[o]=n)}return s}var C8=class extends LT{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const s=this.gridOptions;if(ba(s,"reactiveCustomComponents")){const r=(a=>{switch(a){case"filter":return ba(s,"enableFilterHandlers")?xA:yA;case"floatingFilterComponent":return ba(s,"enableFilterHandlers")?EA:FA;case"dateComponent":return bA;case"dragAndDropImageComponent":return SA;case"loadingOverlayComponent":return PA;case"noRowsOverlayComponent":return MA;case"statusPanel":return IA;case"toolPanel":return kA;case"menuItem":return TA;case"cellRenderer":return wA;case"innerHeaderComponent":return DA}})(t.name);if(r)return new r(e,this.parent,t)}else switch(t.name){case"filter":case"floatingFilterComponent":case"dateComponent":case"dragAndDropImageComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":case"cellRenderer":rh();break}const n=!t.cellRenderer&&t.name!=="toolPanel";return new Ev(e,this.parent,t,n)}},v8=g.forwardRef((e,t)=>{const s=g.useContext(St),{registry:o,context:n,gos:i,rowModel:r}=s,[a,l]=g.useState(()=>new es),[c,d]=g.useState(()=>new es),[u,h]=g.useState(),[p,m]=g.useState(),C=g.useRef(),v=g.useRef(null),w=g.useRef(),b=g.useMemo(()=>hy(e.api.getGridId(),u?.rowModelType??"clientSide"),[e]),S=g.useMemo(()=>a.toString()+" ag-details-row",[a]),x=g.useMemo(()=>c.toString()+" ag-details-grid",[c]);t&&g.useImperativeHandle(t,()=>({refresh(){return C.current?.refresh()??!1}})),e.template&&$(230);const y=g.useCallback(R=>{if(v.current=R,!R||n.isDestroyed()){C.current=n.destroyBean(C.current),w.current?.();return}const E={toggleCss:(P,T)=>l(I=>I.setClass(P,T)),toggleDetailGridCss:(P,T)=>d(I=>I.setClass(P,T)),setDetailGrid:P=>h(P),setRowData:P=>m(P),getGui:()=>v.current},D=o.createDynamicBean("detailCellRendererCtrl",!0);if(D&&(n.createBean(D),D.init(E,e),C.current=D,i.get("detailRowAutoHeight"))){const P=()=>{if(v.current==null)return;const T=v.current.clientHeight;T!=null&&T>0&&setTimeout(()=>{e.node.setRowHeight(T),(tt(i)||Uo(i))&&r.onRowHeightChanged()},0)};w.current=_s(s,R,P),P()}},[]),F=g.useCallback(R=>{C.current?.registerDetailWithMaster(R)},[]);return g.createElement("div",{className:S,ref:y},u&&g.createElement(Iv,{className:x,...u,modules:b,rowData:p,passGridApi:F}))}),w8=class extends nC{constructor(e){super("react"),this.processQueuedUpdates=e,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:bp,agGroupRowRenderer:bp,agDetailCellRenderer:v8},this.wrapIncoming=(t,s)=>s==="ensureVisible"?gA(t):t()}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}getLockOnRefresh(){this.queueUpdates=!0}releaseLockOnRefresh(){this.queueUpdates=!1,this.processQueuedUpdates()}shouldQueueUpdates(){return this.queueUpdates}runWhenReadyAsync(){return hA()}},b8=class extends g.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=e=>{this.api=e;for(const t of this.apiListeners)t(e)}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return g.createElement(Iv,{...this.props,passGridApi:this.setGridApi})}},kv=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(kv||{}),Gt=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(Gt||{}),qn=(e=>(e.Item="item",e.Divider="divider",e.PlainText="plainText",e))(qn||{});const S8=ge("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),y8=ge("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"),x8=ge("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary"),R8="opacity-75 !cursor-not-allowed",F8="text-error",E8="my-1 border-t border-hover border-secondary",Ei=4,ah=({ariaLabel:e,className:t,size:s=24,onClose:o,...n})=>f.jsx(uo,{"aria-label":e,className:ie("text-secondary hover:enabled:text-accent-primary",t,"w-auto h-auto"),onClick:o,icon:f.jsx(z.IconX,{size:s}),...n}),Tt=({children:e,menu:t,renderOverlay:s,trigger:o=[Gt.Click],placement:n,disabled:i=!1,open:r,defaultOpen:a=!1,onOpenChange:l,closable:c=!1,onClose:d,className:u,listClassName:h,outsidePressIgnoreRef:p,outsideClosable:m=!0,allowedPlacements:C,anchorToMouse:v=!1,matchReferenceWidth:w=!0,maxDropdownHeight:b})=>{const[S,x]=g.useState(a),y=r!==void 0,F=y?!!r:S,R=g.useRef(null),E=g.useCallback(_=>{y||x(_),l?.(_)},[y,l]),D=g.useId(),P=n===void 0,T=_=>"clientWidth"in _?_.clientWidth:_.getBoundingClientRect?.()?.width??0,{refs:I,floatingStyles:N,context:q}=ke.useFloating({placement:n,open:F,onOpenChange:E,whileElementsMounted:ke.autoUpdate,middleware:[ke.offset({mainAxis:Ei,crossAxis:0}),P?ke.autoPlacement({alignment:"start",crossAxis:!0,padding:Ei,allowedPlacements:C}):ke.flip({padding:Ei}),ke.shift({padding:Ei}),ke.size({padding:Ei,apply({availableWidth:_,availableHeight:pe,elements:oe}){const Z=oe.floating,j=T(oe.reference);Z.style.setProperty("--fui-available-height",`${Math.floor(pe)}px`),Z.style.setProperty("--reference-width",w?`${Math.round(j)}px`:"0px"),w?Z.style.minWidth=`${Math.round(j)}px`:Z.style.removeProperty("min-width"),Z.style.maxWidth=`${Math.floor(_)}px`;const ae=Math.floor(pe);Z.style.maxHeight=`${b?Math.min(ae,b):ae}px`}})]}),L=ke.useClick(q,{enabled:o.includes(Gt.Click)&&!i}),V=ke.useHover(q,{enabled:o.includes(Gt.Hover)&&!i,move:!1,restMs:40,delay:{open:80,close:80}}),H=ke.useDismiss(q,{bubbles:!0,referencePress:!1,outsidePress:_=>{if(!m)return!1;const pe=_.target;return!(p?.current&&pe instanceof Node&&p.current.contains(pe))}}),A=ke.useRole(q,{role:"menu"}),{getReferenceProps:de,getFloatingProps:M}=ke.useInteractions([L,V,H,A]),B=g.useCallback((_,pe)=>{I.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:_,y:pe,top:pe,left:_,right:_,bottom:pe})})},[I]),U=g.useCallback(_=>{!o.includes(Gt.ContextMenu)||i||(_.preventDefault(),v&&(B(_.clientX,_.clientY),R.current=document.elementFromPoint(_.clientX,_.clientY)),E(!0))},[v,i,E,B,o]),W=g.useCallback(_=>{!v||i||(o.includes(Gt.ContextMenu)&&F&&E(!1),B(_.clientX,_.clientY),R.current=document.elementFromPoint(_.clientX,_.clientY))},[v,i,B,F,o,E]);g.useEffect(()=>{i&&F&&E(!1)},[i,F,E]);const re=g.useCallback(_=>pe=>{_.disabled||(_.onClick?.({key:_.key,domEvent:pe}),t?.onClick?.({key:_.key,domEvent:pe}),E(!1))},[t,E]),be=g.useMemo(()=>s?s():t?f.jsxs(f.Fragment,{children:[t.header&&f.jsx(f.Fragment,{children:typeof t.header=="function"?t.header():t.header}),f.jsx("div",{role:"none",className:"py-1","aria-label":"dropdown",children:t.items.map(_=>_.type===qn.Divider?f.jsx("div",{role:"separator",className:E8},_.key):_.type===qn.PlainText?f.jsx("div",{className:ie("px-3 py-2 text-secondary dial-caption",_.className),children:_.label},_.key):f.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!_.disabled,className:ge(x8,_.disabled&&R8,_.danger&&F8,_.className),disabled:_.disabled,onClick:re(_),children:[_.icon&&f.jsx("span",{className:ge(_.danger&&"text-error",_.disabled&&"text-secondary"),children:f.jsx(Ye,{icon:_.icon})}),f.jsx("span",{className:ge("flex-1 truncate text-left",_.danger&&"text-error",_.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:_.label})]},_.key))}),t.footer&&f.jsx(f.Fragment,{children:typeof t.footer=="function"?t.footer():t.footer})]}):null,[re,t,s]),Q=de({onContextMenu:U,onMouseDown:W});return g.useEffect(()=>{if(!F)return;const _=I.reference.current;let pe=null;if(_ instanceof Element?pe=_:R.current instanceof Element&&(pe=R.current),!pe)return;const oe=new IntersectionObserver(([Z])=>{Z.isIntersecting||E(!1)},{root:null,threshold:0});return oe.observe(pe),()=>oe.disconnect()},[F,I.reference,E]),f.jsxs(f.Fragment,{children:[f.jsx("span",{ref:I.setReference,className:ge(S8,i&&"!cursor-not-allowed opacity-75",u),"aria-haspopup":"menu","aria-expanded":F,"aria-controls":D,...Q,children:e}),F&&f.jsx(ke.FloatingPortal,{children:f.jsx(ke.FloatingFocusManager,{context:q,modal:!1,initialFocus:-1,returnFocus:!0,children:f.jsxs("div",{id:D,ref:I.setFloating,style:N,className:ge(y8,!w&&"w-max",h),...M(),children:[c&&f.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:f.jsx(ah,{ariaLabel:"Close dropdown",onClose:_=>{d?.(_),E(!1)}})}),be]})})})]})},D8="h-full w-full",Fp=".ag-checkbox-input",$c={accentColor:"var(--controls-bg-accent, #5C8DEA)",backgroundColor:"var(--bg-layer-3, #1D2439)",oddRowBackgroundColor:"var(--bg-layer-2, #161B2D)",selectedRowBackgroundColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderColor:"var(--bg-layer-4, #242C42)",rowBorder:"1px solid var(--stroke-tertiary, #0C101D)",rowHoverColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderRadius:3,browserColorScheme:"dark",chromeBackgroundColor:"var(--bg-layer-1, #0C101D)",foregroundColor:"var(--text-primary, ##EEF1F7)",headerFontSize:14,headerFontWeight:600,headerTextColor:"var(--text-secondary, #7F8792)",spacing:4,wrapperBorderRadius:3,fontSize:14,fontFamily:{googleFont:"var(--theme-font, var(--font-inter))"}},qc=40;var yo=(e=>(e.API="api",e.ROW_DATA_CHANGED="rowDataChanged",e.CHECKBOX_SELECTED="checkboxSelected",e))(yo||{});const P8=(e,t,s,o,n)=>{const i=typeof e=="string"?e.toLowerCase():e,r=typeof t=="string"?t.toLowerCase():t;return i===r?0:i?r?i>r?1:-1:n?1:-1:n?-1:1};var ji=(e=>(e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e))(ji||{});const Av="en-US",Lv={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},T8="text-primary",Kc=40,Ov={minWidth:Kc,width:Kc,maxWidth:Kc},M8={cellClass:"ag-grid-no-checkbox",...Ov},I8={...Ov};function k8(e,t){let s=null;return(...o)=>{s&&clearTimeout(s),s=setTimeout(()=>e(...o),t)}}uA({testIdAttribute:"dataQA"});Vf.registerModules([aA]);const lh=({columnDefs:e,rowData:t,additionalGridOptions:s,getContextMenuItems:o,className:n,ariaLabel:i="Data grid",wrapCustomCellRenderers:r=!0,disabledRowIds:a,selectedRowIds:l,selectionOnHover:c=!0,onSelectionChange:d,onGridApiChange:u,getRowId:h=R=>String(R.id??JSON.stringify(R)),alternateOddRowColors:p=!1,filterPlaceholder:m="Enter value",emptyStateIcon:C,emptyStateTitle:v="No results found",emptyStateDescription:w="Sorry, we couldn't find any results for your search.",loading:b=!1,wrapperBorder:S=!0,withoutHeaderBorders:x=!1,allowDisabledContextMenu:y=!1,selectionMode:F})=>{const[R,E]=g.useState(qc),[D,P]=g.useState(),T=g.useId(),I=g.useRef(new Set),N=g.useRef(void 0),q=g.useMemo(()=>({...$c,oddRowBackgroundColor:p?$c.oddRowBackgroundColor:$c.backgroundColor,wrapperBorder:S}),[p,S]),L=g.useCallback(j=>{j.api.sizeColumnsToFit(),E(qc)},[]),V=g.useCallback(j=>{if(j.data){const ae=h(j.data),G=a?.has(ae)??!1,fe=G&&!y,he=j.value==null?"":String(j.value),se=o?.(j.data)??[];return f.jsx(Tt,{trigger:[Gt.ContextMenu],menu:{items:se},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full",disabled:fe,children:f.jsx("span",{className:"block min-w-0 h-full max-w-full",children:f.jsx(ft,{text:he,className:"max-w-full h-full",hideTooltip:G})})})}},[o,a,h,y]),H=g.useCallback(j=>j===yo.API||j===yo.ROW_DATA_CHANGED,[]),A=g.useCallback(j=>{if(!D)return;const G=(j.selectedNodes||[]).map(he=>he.data),fe=new Set(G.map(h));I.current=fe,N.current=j.source,H(j.source)||d?.(fe,G)},[D,h,H,d]),de=g.useMemo(()=>k8(j=>A?.(j),100),[A]),M=g.useCallback(j=>{if(!j.data)return null;const ae=h(j.data),G=j.node.isSelected(),fe=a?.has(ae),he=`row-select-${ae}`;return f.jsx("div",{className:"h-6 w-6 flex items-center justify-center",children:f.jsx(ou,{className:"w-[18px] h-[18px]",inputId:he,checked:G,disabled:fe,name:"gridradiobutton",value:"selected",onChange:()=>{fe||(j.node.setSelected(!0,!0,yo.CHECKBOX_SELECTED),j.api.refreshCells({columns:[j.column?.getColId()]}))}})})},[h,a]),B=g.useCallback(j=>{const ae="dial-row-select",G="dial-row-select-visible";return j?ae:`${ae} ${G}`},[]),U=g.useMemo(()=>{if(F===ji.SINGLE)return{...M8,cellRenderer:M};if(F===ji.MULTIPLE)return{...I8,headerClass:()=>B(c),cellClass:j=>{const ae=j.data?h(j.data):null;let G=B(c);return ae&&a?.has(ae)&&(G+=" opacity-50 pointer-events-none"),G}}},[a,h,M,F,c,B]),W=g.useCallback(j=>{const ae=typeof r=="function"?r(j):!!r;if(!j.cellRenderer)return{...j,cellRenderer:V};if(!ae)return j;const G=j.cellRenderer;return{...j,cellRenderer:he=>{const se=he.data?o?.(he.data)??[]:[];let le=null;if(typeof G=="function"){const ve=G;le=f.jsx(ve,{...he})}else le=V(he);const Fe=he.data?h(he.data):null,Oe=Fe?a?.has(Fe):!1;return f.jsx(Tt,{trigger:[Gt.ContextMenu],menu:{items:se},anchorToMouse:!0,matchReferenceWidth:!0,className:ge("w-full h-full",Oe&&"!cursor-not-allowed opacity-75"),disabled:Oe&&!y,children:f.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:le})})}}},[a,o,h,V,r,y]),re=g.useMemo(()=>r?(e??[]).map(W):e??[],[e,r,r?W:null]),be=g.useMemo(()=>({minWidth:150,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:m,buttons:["reset"]},comparator:P8.bind(void 0)}),[m]),Q=j=>{const ae=document.querySelector(Fp);ae&&ae.setAttribute("aria-description",dd);const G=re.map(fe=>({...fe,sort:void 0}));j.api.updateGridOptions({columnDefs:G,rowData:t}),j.api.sizeColumnsToFit(),P(j.api),s?.onGridReady?.(j),u?.(j.api)};g.useEffect(()=>{D&&t&&D.setGridOption("rowData",t)},[D,t]);const _=g.useCallback(()=>f.jsx(dr,{title:v,description:w,containerClassName:"gap-3",titleClassName:"mt-2 !text-lg",icon:C||f.jsx(z.IconZoomCancel,{size:100,stroke:.5,className:"text-secondary"})}),[v,w,C]),pe=g.useMemo(()=>{if(F)return{mode:F===ji.SINGLE?"singleRow":"multiRow",isRowSelectable:j=>{const ae=j.data?h(j.data):null;return ae?!a?.has(ae):!0}}},[a,h,F]);g.useEffect(()=>{D&&t&&I.current.size&&I.current.forEach(j=>{const ae=D.getRowNode(j);ae&&!ae.isSelected()&&ae.setSelected(!0,!1,yo.API)})},[D,t]),g.useEffect(()=>{D&&l&&(D.deselectAll("all",yo.API),l.forEach(j=>{const ae=D.getRowNode(j);ae&&!ae.isSelected()&&ae.setSelected(!0,!1,yo.API)}))},[D,l]);const oe=g.useCallback(j=>j.data?h(j.data):"",[h]),Z=g.useCallback(()=>{document.querySelectorAll(`.ag-row ${Fp}`).forEach(j=>{j.setAttribute("aria-description",dd)})},[]);return g.useEffect(()=>{const j=H(N.current);if(D&&l?.size&&j){const ae=Array.from(l)[0];if(ae){const G=D.getRowNode(ae);G&&D.ensureNodeVisible(G)}}},[D,H,l]),f.jsx("div",{className:ge(D8,n,F&&"with-selection-column",x&&"dial-without-header-borders"),"aria-label":i,role:"region","aria-busy":b,children:f.jsx("div",{className:"ag-theme-balham-dark h-full overflow-x-auto",role:"table","aria-describedby":T,children:f.jsx(b8,{rowModelType:"clientSide",headerHeight:qc,rowHeight:R,cellSelection:!1,theme:rP.withPart(B3).withParams({...q}),autoSizeStrategy:{type:"fitGridWidth"},columnDefs:re,defaultColDef:be,selectionColumnDef:U,onGridSizeChanged:L,onGridReady:Q,loading:b,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:_,rowData:t,rowSelection:pe,onSelectionChanged:de,getRowId:oe,onRowDataUpdated:Z,onBodyScroll:Z,onFirstDataRendered:Z,...s})})})};var nl=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(nl||{}),il=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(il||{});const ha=({tab:e,active:t,invalid:s,className:o,horizontal:n,onClick:i})=>{const r=ie("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small-text hover:text-accent-primary",{"border-b-2 px-4":n,"border-l-2 px-3":!n}),a=ie(r,{"bg-layer-4":n,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&n&&!e.disabled,"border-l-accent-primary":t&&!n&&!e.disabled},o);return f.jsxs("button",{role:"tab",className:a,onClick:()=>i(e.id),disabled:e.disabled,children:[f.jsx(ft,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(s||e.invalid)&&f.jsx("div",{className:"text-error pl-1",children:f.jsx(z.IconExclamationCircle,{...J})}),e.warning&&f.jsx("div",{className:"text-warning pl-1",children:f.jsx(z.IconAlertTriangle,{...J})})]})},A8=12;var oo=(e=>(e.Undefined="undefined",e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop",e))(oo||{});const Ep=()=>typeof window<"u"&&window.innerWidth<640,Yc=()=>{if(typeof window>"u")return oo.Undefined;const e=window.innerWidth;return e>=1024?oo.Desktop:e<640?oo.Mobile:oo.Tablet},L8=()=>{const[e,t]=g.useState(()=>typeof window>"u"?oo.Desktop:Yc());return g.useEffect(()=>{t(Yc());const s=()=>t(Yc());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},Nv=({tabs:e,activeTab:t,onClick:s,orientation:o=nl.Horizontal,screenThreshold:n=il.Tablet,smallScreenContainerClassName:i,smallScreenDropdownItemClassName:r,desktopDropdownClassName:a,desktopTabClassName:l})=>{const[c,d]=g.useState(!1),[u,h]=g.useState(!1),[p,m]=g.useState(!1),C=L8(),v=C===oo.Mobile||n===il.Tablet&&C===oo.Tablet,w=o===nl.Horizontal,b=g.useRef(null),S=g.useRef(null),x=g.useRef(null),y=e.find(P=>P.id===t),F=g.useMemo(()=>ge("flex gap-2",w?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[w]),R=g.useCallback(()=>{const P=S.current;P&&m(P.scrollWidth>P.clientWidth)},[]),E=g.useCallback(()=>{const P=x.current,T=S.current;if(!P||!T)return;const I=P.getBoundingClientRect(),N=T.getBoundingClientRect();if(I.width===0||N.width===0)return;const q=A8;let L=T.scrollLeft;if(I.left<N.left+q)L-=N.left+q-I.left;else if(I.right>N.right-q)L+=I.right-(N.right-q);else return;const V=Math.max(0,T.scrollWidth-T.clientWidth);L=Math.max(0,Math.min(L,V)),L!==T.scrollLeft&&T.scrollTo({left:L,behavior:"smooth"})},[]),D=g.useCallback(P=>{s(P),P===t&&E()},[s,t,E]);return g.useEffect(()=>{R();const P=new ResizeObserver(()=>R()),T=S.current;return T&&P.observe(T),()=>P.disconnect()},[e,R]),g.useEffect(()=>{E()},[t,E]),v?f.jsx("div",{role:"tablist",className:ie("h-11 flex items-center bg-layer-3 px-4",i),children:f.jsx(Tt,{trigger:[Gt.Click],open:c,onOpenChange:d,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(P=>f.jsx(ha,{tab:P,active:P.id===t,onClick:T=>{D(T),d(!1)},className:ie("w-full rounded-none h-11 items-center px-6",r)},P.id)),children:f.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[f.jsx(ha,{tab:y,active:!0,onClick:D,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),f.jsx(Ye,{icon:f.jsx(z.IconChevronDown,{size:Ct.SM}),className:ge("text-primary transition-transform",c&&"rotate-180")})]})})}):f.jsxs("div",{ref:b,className:"flex w-full items-start",children:[f.jsx("div",{ref:S,role:"tablist",className:F,children:e.map(P=>f.jsx("div",{ref:t===P.id?x:void 0,className:"w-full",children:f.jsx(ha,{tab:P,active:t===P.id,onClick:D,horizontal:w,className:ie("w-full",l)})},P.id))}),p&&f.jsx("div",{className:"flex items-center ml-2",children:f.jsx(Tt,{trigger:[Gt.Click],open:u,onOpenChange:h,placement:"bottom-end",renderOverlay:()=>e.map(P=>f.jsx(ha,{tab:P,active:P.id===t,onClick:T=>{D(T),h(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},P.id)),children:f.jsx(ss,{iconBefore:f.jsx(z.IconDotsVertical,{size:Ht}),className:ie("w-8 h-8 flex items-center justify-center rounded border",u?"bg-layer-4 border-transparent":"border-primary",a)})})})]})},O8="w-full overflow-hidden",N8="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Hv="flex items-center gap-2 min-w-0 shrink-0 dial-small-text",H8="basis-[20%] flex-none",G8="flex-1 min-w-0",Dp="inline-flex items-center gap-1 min-w-0 transition-colors",B8="text-secondary hover:text-accent-primary",V8="text-primary cursor-default",Gv="flex-none inline-flex items-center leading-none text-secondary",z8="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",Bv=f.jsx(z.IconChevronRight,{size:Ct.SM,"aria-hidden":"true"}),Ii=({label:e,href:t,onClick:s,disabled:o,isLast:n,separator:i=Bv,className:r,iconBefore:a,labelClassName:l,onBeforeNavigate:c,...d})=>{const u=async v=>{if(c&&!n&&!await c()){v.preventDefault();return}s&&s(v)},h=ie(Hv,n?G8:H8,r),p=(!!t||!!s)&&!n&&!o,m=p?ie(Dp,B8):ie(Dp,V8,o?"pointer-events-none opacity-75":""),C=typeof e=="string"?f.jsx(ft,{className:ie("cursor-pointer",l),text:e,id:"breadcrumb-item-content"}):f.jsx("span",{className:ie("flex-1 min-w-0 truncate cursor-pointer max-w-[300px]",l),"aria-label":"breadcrumb-item-content",children:e});return f.jsxs("li",{...d,className:h,"aria-label":d["aria-label"]||"breadcrumb-item",children:[p?f.jsxs("a",{href:t,onClick:u,className:m,children:[a,C]}):f.jsxs("span",{className:m,"aria-current":n?"page":void 0,"aria-disabled":o?"true":void 0,children:[a,C]}),!n&&f.jsx("span",{className:Gv,"aria-label":"separator",children:i})]})},Vv=({pathItems:e,separator:t=Bv,ariaLabel:s="Breadcrumb",className:o,children:n,labelClassName:i,onBeforeNavigate:r})=>{const a=g.useMemo(()=>e?.length?e:g.Children.toArray(n).filter(g.isValidElement).map(d=>{const u=d.props,{labelClassName:h,isLast:p,separator:m,...C}=u;return C}),[e,n]),l=g.useCallback(async d=>{const u=parseInt(d.key,10),h=a[u];if(r&&!await r()){d.domEvent.preventDefault();return}h.onClick?h.onClick(d.domEvent):h.href&&(window.location.href=h.href)},[a,r]),c=g.useMemo(()=>{if(a.length===0)return null;if(a.length<=3)return a.map((C,v)=>g.createElement(Ii,{...C,key:`item-${v}`,isLast:v===a.length-1,separator:t,labelClassName:i,onBeforeNavigate:r}));const d=a.at(0),u=a.slice(1,-2),h=a.at(-2),p=a.at(-1);if(!d||!h||!p)return null;const m=u.map((C,v)=>({key:String(v+1),label:typeof C.label=="string"?C.label:`Item ${v+1}`,disabled:C.disabled}));return f.jsxs(f.Fragment,{children:[g.createElement(Ii,{...d,key:"item-0",separator:t,labelClassName:i,onBeforeNavigate:r}),f.jsxs("li",{className:ie(Hv),children:[f.jsx(Tt,{menu:{items:m,onClick:l},placement:"bottom-start",matchReferenceWidth:!1,children:f.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:z8,children:f.jsx(z.IconDots,{size:Ct.SM})})}),f.jsx("span",{className:Gv,children:t})]}),g.createElement(Ii,{...h,key:`item-${a.length-2}`,separator:t,labelClassName:i,onBeforeNavigate:r}),g.createElement(Ii,{...p,key:`item-${a.length-1}`,isLast:!0,separator:t,labelClassName:i,onBeforeNavigate:r})]})},[a,t,i,l,r]);return f.jsx("nav",{"aria-label":s,className:ie(O8,o),children:f.jsx("ol",{className:N8,children:c})})},ch=(e,t)=>({appearance:o,...n})=>f.jsx(ss,{...n,variant:e,appearance:o||t}),zv=(e,t)=>({variant:o,...n})=>f.jsx(ss,{...n,variant:o||t,appearance:e}),xs=ch(ze.Primary,Me.Solid),Fs=ch(ze.Neutral,Me.Outlined),Wv=ch(ze.Error,Me.Outlined),W8=zv(Me.Link,ze.Primary),_8=zv(Me.Ghost,ze.Primary),oi=(e,t)=>({appearance:o,...n})=>f.jsx(uo,{...n,variant:e,appearance:o||t}),j8=(e,t)=>({variant:o,...n})=>f.jsx(uo,{...n,variant:o||t,appearance:e}),U8=oi(ze.Primary,Me.Solid),$8=oi(ze.Neutral,Me.Outlined),_v=oi(ze.Error,Me.Outlined),q8=oi(ze.Secondary,Me.Ghost),K8=oi(ze.Tertiary,Me.Ghost),Y8=oi(ze.Success,Me.Ghost),X8=j8(Me.Ghost,ze.Primary),jv=({iconClassName:e,label:t,...s})=>t?f.jsx(Wv,{...s,label:t,appearance:Me.Ghost,iconBefore:f.jsx(z.IconTrashX,{...J,className:e||""})}):f.jsx(_v,{...s,appearance:Me.Ghost,icon:f.jsx(z.IconTrashX,{...J,className:e||""})}),Z8=({className:e="",value:t,onChange:s,error:o,containerClassName:n,resize:i=!1,labelProps:r,caption:a,id:l,...c})=>{const d=ie("dial-textarea dial-input px-3 py-2",c.invalid&&"dial-input-error",c.disabled&&"dial-input-disable",i?"resize":"resize-none",e);return f.jsxs("div",{className:ie("flex flex-col gap-y-2",n),children:[r&&f.jsx(_o,{...r,htmlFor:l}),f.jsx("textarea",{id:l,value:t||"",className:d,onChange:u=>s?.(u.currentTarget.value),...c}),f.jsx(ls,{text:o}),!o&&f.jsx(lr,{text:a})]})},dh=({label:e,switchId:t,isOn:s=!1,disabled:o,onChange:n,caption:i})=>{const r=ge("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",s?"flex-row-reverse":"flex-row",o?"pointer-events-none":"",o?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),a=g.useCallback(l=>{l.stopPropagation(),n?.(!s)},[n,s]);return f.jsxs("div",{className:"flex flex-row items-start",role:"switch",children:[f.jsx("input",{type:"checkbox",onChange:a,id:t,disabled:o,className:"invisible w-0 h-0",checked:s}),f.jsx("label",{htmlFor:t,className:r,"aria-describedby":i&&"caption",children:f.jsx("span",{className:ge("size-3 rounded-full",o?"bg-controls-disable-accent":"bg-controls-enable-primary")})}),(e||i)&&f.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[e&&f.jsx("span",{className:ge("dial-small-text py-[1px]",o?"text-secondary":"text-primary"),"aria-label":"switch-title",children:e}),i&&f.jsx("span",{id:"caption",className:"dial-tiny-text text-secondary",children:i})]})]})};var _t=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(_t||{});const Q8="z-[52] flex items-center justify-center bg-blackout md:p-4",Pp="divide-tertiary divide-y",J8="flex flex-row justify-between py-4 px-6 items-center",eL={[_t.Sm]:"dial-sm-popup",[_t.Md]:"dial-md-popup",[_t.Lg]:"dial-lg-popup"},Yo=({open:e=!1,header:t,portalId:s,className:o,overlayClassName:n,titleClassName:i,headerClassName:r,dividers:a=!0,dividerFooter:l=!0,children:c,footer:d,onClose:u,size:h=_t.Md,hideClose:p=!1,closeOnOutsideClick:m=!0,preventKeyboardOnOpen:C=!1})=>{const v=g.useRef(null),{refs:w,context:b}=ke.useFloating({open:e,onOpenChange:E=>{E||u?.(null)}}),S=ke.useRole(b,{role:"dialog"}),x=ke.useDismiss(b,{outsidePress:m}),{getFloatingProps:y}=ke.useInteractions([S,x]);if(!e)return null;const F=typeof t=="string"?"dial-popup-heading":void 0,R=E=>E?typeof E=="string"?f.jsx("h3",{id:F,className:ge("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",i),children:f.jsx(At,{tooltip:E,children:E})}):E:f.jsx("span",{});return f.jsx(ke.FloatingPortal,{id:s,children:f.jsx(ke.FloatingOverlay,{className:ge(Q8,n),children:f.jsx(ke.FloatingFocusManager,{context:b,initialFocus:C?v:void 0,children:f.jsxs("div",{ref:w.setFloating,...y(),role:"dialog","aria-modal":"true","aria-labelledby":F,className:ge("dial-popup",eL[h],a&&Pp,o),children:[C&&f.jsx("div",{ref:v,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),f.jsxs("div",{className:ie(J8,r),children:[R(t),!p&&f.jsx(ah,{ariaLabel:"Close dialog",onClose:E=>u?.(E)})]}),f.jsx("div",{className:"flex-grow overflow-auto","aria-label":"popup-description",children:c}),l&&!d&&f.jsx("div",{className:Pp}),d]})})})})};var Kn=(e=>(e.Info="info",e.Danger="danger",e))(Kn||{});const tL="flex justify-end gap-2 px-6 py-4",sL="text-secondary dial-small-150 px-6 py-4",oL="Cancel",nL="Ok",Xc={[Kn.Info]:{confirm:{variant:ze.Primary,appearance:Me.Solid},cancel:{variant:ze.Neutral,appearance:Me.Outlined}},[Kn.Danger]:{container:"dial-danger-popup",confirm:{variant:ze.Error,appearance:Me.Solid},cancel:{variant:ze.Neutral,appearance:Me.Outlined}}},Uv=({header:e,description:t,descriptionClassName:s,open:o=!1,confirmLabel:n=nL,cancelLabel:i=oL,isLoading:r=!1,disableConfirmButton:a=!1,className:l,confirmClassName:c,onClose:d,onConfirm:u,onCancel:h,children:p,dividers:m=!1,variant:C=Kn.Info,size:v=_t.Sm,footer:w})=>{const b=r?null:f.jsxs("div",{className:tL,children:[f.jsx(Fs,{label:i,onClick:()=>h?h():d?.()}),f.jsx(ss,{variant:Xc[C].confirm?.variant,appearance:Xc[C].confirm?.appearance,className:c,label:n,disabled:a,onClick:()=>u()})]}),S=g.useCallback(()=>r?f.jsx("div",{className:"px-6 py-4 h-[120px]",children:f.jsx(cr,{size:50})}):p??(t?f.jsx("div",{className:ge(sL,s),children:t}):null),[p,t,r,s]);return f.jsx(Yo,{open:o,header:e,className:ge(Xc[C].container,l),dividers:m,onClose:()=>d?.(),footer:w??b,size:v,children:S()})},Zc=8,iL=24,$v=({initialTags:e=[],label:t,required:s,elementId:o,placeholder:n,captionDescription:i,errorText:r,invalid:a,disabled:l,collapseTagOverflow:c=!1,readOnly:d=!1,containerClassName:u,tagClassName:h,onChange:p})=>{const m=g.useRef(null),C=g.useRef([]),v=g.useRef(null),[w,b]=g.useState(e),[S,x]=g.useState(""),[y,F]=g.useState(!1),[R,E]=g.useState(e.length),D=g.useCallback(H=>A=>{C.current[H]=A},[]),P=g.useCallback(()=>{if(!c)return;const H=m.current;if(!H)return;const A=H.offsetWidth;if(A===0)return;const de=v.current?.offsetWidth??0,B=A-(d?0:iL)-Zc;let U=0,W=0;for(let re=0;re<w.length;re++){const be=C.current[re];if(!be)continue;const Q=be.offsetWidth+Zc;if(U+Q>B)break;U+=Q,W++}if(W<w.length&&W>0)for(;U+de>B&&W>0;){W--;const re=C.current[W]?.offsetWidth??0;U-=re+Zc}E(W)},[c,d,w.length]),T=H=>{const A=H.trim().replace(/,$/,"");if(A&&!w.includes(A)){const de=[A,...w];b(de),p?.(de)}},I=H=>{(H.key===","||H.key==="Enter")&&(H.preventDefault(),T(S),x(""))},N=()=>{S.trim()&&(T(S),x(""))},q=H=>{const A=w.filter((de,M)=>M!==H);b(A),p?.(A)},L=()=>r?f.jsx(ls,{text:r}):i?f.jsx(lr,{text:i}):null;g.useEffect(()=>{if(c)return;const H=new ResizeObserver(()=>{if(m.current){const A=m.current.scrollHeight>m.current.clientHeight+10;F(A)}});return m.current&&H.observe(m.current),()=>H.disconnect()},[w,c]),g.useEffect(()=>{if(!c){E(w.length);return}E(w.length);const H=new ResizeObserver(()=>{P()}),A=m.current;return A&&H.observe(A),P(),()=>H.disconnect()},[c,P,w]),g.useEffect(()=>{b(e)},[JSON.stringify(e)]);const V=f.jsxs("div",{ref:m,className:ge("flex gap-2 items-center relative",c?"flex-nowrap overflow-hidden w-full min-w-0":ge("flex-wrap",y?"flex-col-reverse":"flex-row"),u),children:[(c?w.slice(0,R):w).map((H,A)=>f.jsx(xn,{tag:H,className:h,remove:!l&&!d?()=>q(A):void 0},H+A)),c&&R<w.length&&f.jsx(At,{tooltip:w.slice(R).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:f.jsx(xn,{tag:`+${w.length-R}`})}),!d&&f.jsx("input",{id:o,type:"text",value:S,onChange:H=>x(H.target.value),onKeyDown:I,onBlur:N,className:ge("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",c?"min-w-0":"min-w-[100px]"),placeholder:n??"",disabled:l}),c&&f.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[w.map((H,A)=>f.jsx("div",{ref:D(A),className:"inline-flex shrink-0",children:f.jsx(xn,{tag:H,className:h,remove:!l&&!d?()=>q(A):void 0})},`measure-${H}-${A}`)),f.jsx("div",{ref:v,className:"inline-flex shrink-0",children:f.jsx(xn,{tag:`+${w.length}`})})]})]});return d?V:f.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[f.jsx(_o,{label:t,required:s,htmlFor:o}),f.jsx("div",{className:ge("dial-input min-h-[38px] p-[6px]",a&&"dial-input-error",l&&"dial-input-disable"),children:V}),L()]})},qv=({selectedItems:e,placeholder:t,collapseTagOverflow:s=!1,listClassName:o,listElementClassName:n})=>e?.length?f.jsx($v,{readOnly:!0,initialTags:e,collapseTagOverflow:s,containerClassName:o,tagClassName:n}):t?f.jsx("span",{className:"text-secondary",children:t}):null,Qc=e=>xe.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},xe.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),Kv=({children:e,open:t,disabled:s=!1,selectedValue:o,valueClassName:n,inputClassName:i,onOpen:r,elementId:a,errorText:l,invalid:c,emptyValueText:d,placeholder:u,editable:h=!1,onValueChange:p,collapseTagOverflow:m=!1})=>{const C=Array.isArray(o)&&o.length>0,v=typeof o=="string"&&!!o.trim(),w=C||v?o:u?void 0:d,b=s?void 0:r,S=g.useCallback(R=>{p?.(R.target.value)},[p]),x=()=>f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:ge("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",i,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[f.jsx("input",{type:"text",className:ge("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",n),value:typeof o=="string"?o:"",placeholder:u||d,onChange:S,disabled:s,id:a,"aria-label":"input-popup-field"}),!s&&f.jsx("button",{type:"button",className:"flex-shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:r,"aria-label":"open-popup",children:f.jsx(Ye,{icon:f.jsx(Qc,{role:"img",width:Ht,height:Ht})})})]}),f.jsx(ls,{text:l})]}),y=()=>f.jsxs(f.Fragment,{children:[f.jsx("button",{type:"button",className:"w-full",onClick:b,"aria-label":"open-popup",id:a,children:f.jsxs("div",{className:ge("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between cursor-pointer",i,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[f.jsx(At,{tooltip:w==null?void 0:String(w),children:w||!u?f.jsx("span",{className:n,children:w}):f.jsx("span",{className:"text-secondary",children:u})}),!s&&f.jsx("div",{className:"flex-shrink-0",children:f.jsx(Ye,{icon:f.jsx(Qc,{role:"img",width:Ht,height:Ht})})})]})}),f.jsx(ls,{text:l})]}),F=()=>f.jsx("div",{className:"w-full",onClick:b,children:f.jsxs("div",{className:ge("dial-input px-3 py-2 flex flex-row items-center w-full justify-between cursor-pointer",s&&"dial-input-disable"),children:[f.jsx(qv,{placeholder:u,selectedItems:w,collapseTagOverflow:m}),!s&&f.jsx("div",{className:"ml-1",children:f.jsx(Ye,{icon:f.jsx(Qc,{role:"img",width:Ht,height:Ht})})})]})});return f.jsxs(f.Fragment,{children:[C?F():h?x():y(),t&&Yn.createPortal(e,document.body)]})},rL=({label:e,htmlFor:t,disabled:s,selectedValue:o,radioButtons:n,customInputValue:i,valueClassName:r,inputClassName:a,emptyValueText:l,onClose:c,header:d,portalId:u,onApply:h,onCancel:p,cancelButtonTitle:m="Cancel",applyButtonTitle:C="Apply",isValid:v,selectedRadioValue:w,onChangeRadioField:b,id:S,size:x=_t.Md})=>{const[y,F]=g.useState(!1),R=g.useCallback(()=>{s||F(!0)},[s]),E=g.useCallback(()=>{F(!1),c?.()},[c]),D=g.useCallback(()=>{p?.(),E()},[p,E]),P=g.useCallback(()=>{h(),E()},[h,E]);return f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(_o,{label:e,htmlFor:t}),f.jsx(Kv,{disabled:s,open:y,selectedValue:i??n.find(T=>T.id===o)?.name,valueClassName:r,inputClassName:ge(a,"py-2","px-3"),emptyValueText:l,onOpen:R,children:f.jsx(Yo,{open:y,onClose:D,header:d,portalId:u,size:x,footer:f.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[f.jsx(Fs,{label:m,onClick:D}),f.jsx(xs,{label:C,onClick:P,disabled:!v})]}),children:f.jsx("div",{className:"px-6 py-4",children:f.jsx(ka,{radioButtons:n,labelClassName:"dial-small-text",activeRadioButton:w,onChange:b,elementId:S,orientation:Lo.Column})})})})]})},aL="Create",lL="Cancel",cL="flex items-center justify-end gap-2 px-6 py-3",dL=({header:e,open:t=!1,submitLabel:s=aL,cancelLabel:o=lL,isLoading:n=!1,disableSubmitButton:i=!1,className:r,submitClassName:a,onClose:l,onSubmit:c,onCancel:d,children:u,dividers:h=!0,size:p=_t.Md,footer:m})=>{const C=n?null:f.jsxs("div",{className:cL,children:[f.jsx(Fs,{label:o,onClick:()=>d?d():l?.()}),f.jsx(xs,{className:a,label:s,disabled:i,onClick:()=>c()})]}),v=g.useCallback(()=>n?f.jsx("div",{className:"px-6 py-4 h-[120px]",children:f.jsx(cr,{size:50})}):u??null,[u,n]);return f.jsx(Yo,{open:t,header:e,className:r,dividers:h,onClose:()=>l?.(),footer:m??C,size:p,children:v()})},uL=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Yv=(e,t,s,o)=>{if((t==="number"||s!==void 0||o!==void 0)&&!uL.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(s!==void 0||o!==void 0){const i=e.currentTarget.value,r=e.currentTarget.selectionStart||0,a=i.slice(0,r)+e.key+i.slice(r),l=parseFloat(a);if(!isNaN(l)){if(s!==void 0&&l<+s){e.preventDefault();return}if(o!==void 0&&l>+o){e.preventDefault();return}}}}},hL="bg-layer-4 flex items-center justify-center enabled:text-secondary enabled:hover:text-accent-primary enabled:active:bg-controls-accent-primary-alpha-active enabled:hover:bg-accent-primary-alpha enabled:active:text-accent-primary",gL=({icon:e,onClick:t,disabled:s,size:o=Ft.Standard})=>f.jsx("div",{className:ge("border-l border-tertiary",o===Ft.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:f.jsx(uo,{className:ge(hL,o===Ft.Small&&"p-1"),icon:e,onClick:t,disabled:s,size:o})}),ni=({labelProps:e,error:t,caption:s,id:o,containerClassName:n,...i})=>f.jsxs("div",{className:ie("flex flex-col gap-y-2",n),children:[e&&f.jsx(_o,{...e,htmlFor:o}),f.jsx(Xv,{id:o,...i}),f.jsx(ls,{text:t}),!t&&f.jsx(lr,{text:s})]}),Xv=({invalid:e,disabled:t,prefix:s,className:o,postfix:n,iconBefore:i,iconAfter:r,wrapperClassName:a,type:l,inputRef:c,value:d,min:u,onChange:h,max:p,inputButtonProps:m,...C})=>{const v=g.useRef(null),w=ke.useMergeRefs([c,v]);g.useEffect(()=>{const F=v.current;if(!F)return;const R=E=>{E.preventDefault()};return F.addEventListener("wheel",R,{passive:!1}),()=>{F.removeEventListener("wheel",R)}},[]);const b=l==="number"||u!==void 0||p!==void 0,S=F=>{Yv(F,l,u,p)},x=F=>{const R=F.currentTarget.value;if(b&&R!==""){const E=parseFloat(R);if(isNaN(E)&&R!=="-"&&R!=="."||!isNaN(E)&&(u!==void 0&&E<+u||p!==void 0&&E>+p))return}h?.(R||void 0)},y=()=>f.jsxs("div",{className:ie("dial-input flex flex-row items-center gap-x-2 justify-between py-2",e&&"dial-input-error",t&&"dial-input-disable",!s&&"pl-3",!m&&"pr-3",a),"aria-label":"input-container",children:[s&&f.jsx("div",{className:"border-r border-tertiary",children:f.jsx(Xv,{wrapperClassName:"!rounded-r-none",className:"truncate",value:s,disabled:!0,id:`${s}_textBefore`})}),f.jsx(Ye,{icon:i}),f.jsx("input",{ref:w,type:l,autoComplete:l==="password"?"new-password":"off",value:d??"",className:ie("border-0 bg-transparent w-full truncate",o),onChange:x,onKeyDown:S,min:u,disabled:t,max:p,...C}),n&&f.jsxs("p",{className:"text-secondary dial-small-text",children:[" ",n]}),f.jsx(Ye,{icon:r}),m&&f.jsx(gL,{...m,disabled:t})]});return t&&l!=="password"?f.jsx(At,{tooltip:d,children:y()}):y()},pL=/^0+\.(\d+)?$/,fL=/^0+/,mL=({integer:e,onChange:t,min:s,max:o,onKeyDown:n,onPaste:i,...r})=>{const a=d=>!d||d==="-"?d:String(d)?.match(pL)?String(d)?.replace(fL,"0"):Number(d),l=d=>{if([".","-","+","e","E"].includes(d.key)){d.preventDefault();return}Yv(d,"number",s,o)},c=d=>{const u=d.clipboardData.getData("text"),h=u.replace(/\D/g,"");if(h!==u&&(d.preventDefault(),h)){const p=d.currentTarget,m=p.selectionStart??0,C=p.selectionEnd??0,v=p.value.slice(0,m)+h+p.value.slice(C);t?.(a(v))}};return f.jsx(ni,{type:"number",min:s,max:o,onChange:d=>t?.(a(d)),onKeyDown:e?l:n,onPaste:e?c:i,...r})},CL=({onClick:e})=>f.jsx(z.IconEyeOff,{...J,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),vL=({onClick:e})=>f.jsx(z.IconEye,{...J,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),wL=({...e})=>{const[t,s]=g.useState(!1),o=g.useCallback(n=>{s(n)},[]);return f.jsx(ni,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?f.jsx(CL,{onClick:()=>o(!1)}):f.jsx(vL,{onClick:()=>o(!0)})})},bL={[Ft.Small]:{className:"dial-tiny-text",wrapperClassName:"pl-2 py-0",containerClassName:"h-[24px]",iconSize:16,iconStroke:1},[Ft.Standard]:{className:"dial-small-text",wrapperClassName:"",containerClassName:"",iconSize:20,iconStroke:1.5}},uh=({size:e=Ft.Standard,placeholder:t="Search...",value:s,onChange:o,...n})=>{const[i,r]=g.useState(s||"");g.useEffect(()=>{r(s||"")},[s]);const a=g.useCallback(u=>{r(u||""),o?.(u||"")},[o]),l=bL[e],c=g.useCallback(()=>{a("")},[a]),d=g.useMemo(()=>{if(i)return{icon:f.jsx(z.IconX,{size:l.iconSize,"aria-label":"Clear search",role:"button"}),onClick:c,size:e}},[c,i,e,l.iconSize]);return f.jsx(ni,{placeholder:t,iconBefore:f.jsx(z.IconSearch,{size:l.iconSize,stroke:l.iconStroke}),value:i,onChange:a,inputButtonProps:d,containerClassName:l.containerClassName,className:l.className,wrapperClassName:l.wrapperClassName,...n})},SL="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",yL="w-full rounded flex flex-col",Jc="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small-text text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",xL="bg-accent-primary-alpha",RL="bg-accent-primary-alpha border-l border-accent-primary border-1",Tp="opacity-75",FL=352,EL=f.jsx(z.IconChevronDown,{size:Ct.SM}),Zv=({options:e,selectedValues:t,handleRemoveTag:s})=>f.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(o=>{const n=e.find(r=>r.value===o)?.label??o,i=e.find(r=>r.value===o)?.icon;return f.jsx(xn,{tag:n,remove:r=>s?.(r,o),iconBefore:i?f.jsx(Ye,{icon:i}):null,className:"max-w-full"},o)})});var rl=(e=>(e.Sm="sm",e.Md="md",e))(rl||{}),al=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(al||{});const Qv=({options:e,multiple:t=!1,elementId:s,value:o,defaultValue:n,variant:i=al.Primary,size:r=rl.Md,prefix:a,customSelectedValue:l,placeholder:c="Select...",searchable:d=!1,searchPlaceholder:u,selectAll:h=!1,invalid:p,selectAllLabel:m="Select all",emptyStateTitle:C="No options available",emptyStateDescription:v,emptyStateIcon:w,disabled:b=!1,className:S,listClassName:x,closable:y=!1,header:F,footer:R,onClose:E,onChange:D,inlineSearch:P=!1,dismissRef:T,onFooterClick:I,open:N,onOpenChange:q,onInlineQueryChange:L,customMultiSelectTagsRenderer:V})=>{const H=g.useId(),[A,de]=g.useState(!1),M=N!==void 0,B=M?!!N:A,U=g.useCallback(K=>{M||de(K),q?.(K)},[M,q]),[W,re]=g.useState(P&&l||""),be=g.useRef(null),Q=g.useCallback(K=>{K!==W&&(re(K||""),L?.(K||""))},[L,W]),_=o!==void 0,[pe,oe]=g.useState(n),Z=_?o:pe,j=g.useMemo(()=>t?Array.isArray(Z)?Z:[]:typeof Z=="string"?[Z]:[],[Z,t]),ae=g.useMemo(()=>{const K=W.trim().toLowerCase();return K?e.filter(He=>He.label.toLowerCase().includes(K)):e},[e,W]);g.useEffect(()=>{!B&&!P&&Q("")},[P,B,Q]),g.useEffect(()=>{P&&!B&&l&&Q(l||"")},[l,P,B,Q]);const G=g.useCallback(K=>{_||oe(K),D?.(K)},[_,D]),fe=g.useCallback(K=>{if(t){const He=new Set(j);He.has(K)?He.delete(K):He.add(K),G(Array.from(He));return}if(G(K),P){const He=e.find(ns=>ns.value===K);He&&(Q(He.label),L?.(He.label))}U(!1)},[t,G,P,U,j,e,Q,L]),he=g.useCallback((K,He)=>{if(K.stopPropagation(),!t){G("");return}const ns=j.filter(ii=>ii!==He);G(ns)},[t,j,G]),se=g.useMemo(()=>ae.filter(K=>!K.disabled),[ae]),le=g.useMemo(()=>se.filter(K=>j.includes(K.value)).length,[se,j]),Fe=K=>{P&&!t&&!K&&fe(W),U(K)},Oe=se.length>0&&le===se.length,ve=le>0&&!Oe,Ee=()=>{if(!(!t||se.length===0))if(Oe){const K=new Set(se.map(ns=>ns.value)),He=j.filter(ns=>!K.has(ns));G(He)}else{const K=new Set(j);se.forEach(He=>K.add(He.value)),G(Array.from(K))}},_e=j.length>0;g.useEffect(()=>{B&&P&&!t&&!b&&requestAnimationFrame(()=>{const K=be.current;if(!K)return;K.focus();const He=K.value?.length??0;K.setSelectionRange?.(He,He)})},[B,P,t,b]);const je=!t&&_e?j[0]:void 0,Ae=g.useMemo(()=>je?e.find(K=>K.value===je):void 0,[e,je]),Mt=g.useCallback(()=>!t||j.length===0?null:f.jsx(Zv,{options:e,selectedValues:j,handleRemoveTag:he}),[t,e,j,he]),os=g.useCallback(()=>t?_e?V?.(e,j,he)||Mt():f.jsx("span",{className:"text-secondary truncate",children:c}):Ae?f.jsxs(f.Fragment,{children:[Ae.icon&&f.jsx(Ye,{icon:Ae.icon}),f.jsx(ft,{text:a?`${a} ${Ae.label}`:Ae.label}),Ae?.description&&f.jsx("div",{className:"text-secondary dial-small-text",children:Ae.description})]}):l&&o?l:f.jsx("span",{className:"text-secondary truncate",children:c}),[_e,t,l,a,o,c,Mt,Ae,e,j,he,V]);g.useImperativeHandle(T,()=>({dismiss:()=>{U(!1)}}));const It=g.useCallback(()=>{Q(j.length===1?Ae?.label??W:"")},[W,j.length,Q,Ae?.label]),Ge=g.useCallback(()=>{b||(U(!B),P&&!t&&(It(),be.current?.focus()))},[b,P,B,t,It,U]);return f.jsx(Tt,{open:B,onOpenChange:Fe,disabled:b,closable:y,onClose:E,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:FL,listClassName:x,renderOverlay:()=>f.jsxs("div",{id:`list-${s||H}`,role:"listbox","aria-multiselectable":t||void 0,className:yL,children:[F&&f.jsx(f.Fragment,{children:typeof F=="function"?F():F}),(d||y)&&e.length>8&&f.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&f.jsx(uh,{placeholder:u,onChange:Q,value:W,id:`search-${s||H}`,containerClassName:"w-full"}),y&&f.jsx(ss,{"aria-label":"Close select",className:"shrink-0",iconBefore:f.jsx(z.IconX,{size:Ct.SM}),onClick:K=>{E?.(K),U(!1)}})]}),t&&h&&se.length>0&&f.jsx("div",{className:ge(Jc,"mt-2"),children:f.jsx(ud,{id:`${s||H}-selectAll`,label:m,checked:Oe,indeterminate:ve,onChange:Ee,ariaLabel:m})}),f.jsx("div",{className:ge("overflow-y-auto max-h-[352px]",P&&ae.length===0?"":"py-1"),children:ae.length===0?!P&&f.jsx("div",{className:"px-2 py-3",children:f.jsx(dr,{icon:w??f.jsx(z.IconClipboardX,{size:Ct.LG,stroke:.5}),title:C,description:v})}):ae.map(K=>{const He=j.includes(K.value);return t?f.jsxs("div",{role:"option","aria-selected":He,"aria-disabled":!!K.disabled,className:ge(Jc,He&&xL,K.disabled&&Tp,"w-full"),children:[f.jsx(ud,{id:`${s||H}-${K.value}`,label:f.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[K.icon&&f.jsx(Ye,{icon:K.icon}),f.jsx("span",{className:"truncate",children:K.label})]}),checked:He,disabled:K.disabled,onChange:()=>!K.disabled&&fe(K.value),ariaLabel:K.label}),K.description&&f.jsx("div",{className:"text-secondary dial-small-text",children:K.description})]},K.value):f.jsx("button",{role:"option",type:"button","aria-selected":He,"aria-disabled":!!K.disabled,disabled:K.disabled,className:ge(Jc,He&&RL,K.disabled&&Tp),onClick:()=>!K.disabled&&fe(K.value),children:f.jsxs("div",{className:"flex items-center gap-2 w-full",children:[K.icon&&f.jsx(Ye,{icon:K.icon}),f.jsx(ft,{text:K.label}),K.description&&f.jsx("div",{className:"text-secondary dial-small-text",children:K.description})]})},K.value)})}),R&&f.jsx("div",{onClick:K=>{I?.(K),I&&U(!1)},children:typeof R=="function"?R():R})]}),children:f.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":B,"aria-controls":`list-${s||H}`,className:ie(SL,b&&"opacity-75 !cursor-not-allowed",r===rl.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",p&&"dial-input-error",i===al.Secondary?"!bg-layer-4 !h-auto":"",S),onMouseDown:K=>{b||P&&!t&&(It(),K.preventDefault())},onClick:()=>{Ge()},onKeyDown:K=>{(K.key===" "||K.code==="Space")&&(K.preventDefault(),Ge())},children:[P&&!t?f.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:f.jsx("input",{id:`inline-${s||H}`,type:"text",placeholder:u??c,value:W||"",onChange:K=>Q(K.currentTarget.value.trimStart()),onFocus:()=>!b&&U(!0),onMouseDown:K=>{It(),K.stopPropagation()},onClick:K=>{K.stopPropagation()},onKeyDown:K=>{K.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:be,disabled:b,"aria-disabled":b,autoComplete:"off"})}):f.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:os()}),!P&&f.jsx(Ye,{icon:EL,className:ge("text-primary",B&&"rotate-180")})]})})},DL=({label:e,required:t,captionDescription:s,containerClassName:o,selectClassName:n,error:i,id:r,caption:a,readonly:l,value:c,defaultEmptyText:d,...u})=>{const h=g.useCallback(()=>{if(!c||Array.isArray(c)&&c.length===0)return d??"None";if(Array.isArray(c))return f.jsx(Zv,{options:u.options,selectedValues:c});{const p=u.options?.find(m=>m.value===c);return f.jsx("span",{"aria-readonly":!0,className:"text-primary",children:p?.label||c})}},[c,u.options,d]);return f.jsx(nu,{id:r,label:e,required:t,description:a,error:i,captionDescription:s,className:o,readonly:l,value:h(),defaultEmptyText:d,children:f.jsx(Qv,{className:n,value:c,elementId:r,invalid:!!i,...u})})};function Jv(e){let t=null;return()=>(t==null&&(t=e()),t)}function PL(e,t){return e.filter(s=>s!==t)}function TL(e,t){const s=new Set,o=i=>s.add(i);e.forEach(o),t.forEach(o);const n=[];return s.forEach(i=>n.push(i)),n}class ML{enter(t){const s=this.entered.length,o=n=>this.isNodeInDocument(n)&&(!n.contains||n.contains(t));return this.entered=TL(this.entered.filter(o),[t]),s===0&&this.entered.length>0}leave(t){const s=this.entered.length;return this.entered=PL(this.entered.filter(this.isNodeInDocument),t),s>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class IL{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const s={};Object.keys(this.config.exposeProperties).forEach(o=>{const n=this.config.exposeProperties[o];n!=null&&(s[o]={value:n(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,s)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,s){return s===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const hh="__NATIVE_FILE__",ew="__NATIVE_URL__",tw="__NATIVE_TEXT__",sw="__NATIVE_HTML__",Mp=Object.freeze(Object.defineProperty({__proto__:null,FILE:hh,HTML:sw,TEXT:tw,URL:ew},Symbol.toStringTag,{value:"Module"}));function ed(e,t,s){const o=t.reduce((n,i)=>n||e.getData(i),"");return o??s}const Zd={[hh]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[sw]:{exposeProperties:{html:(e,t)=>ed(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[ew]:{exposeProperties:{urls:(e,t)=>ed(e,t,"").split(`
|
|
67
67
|
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[tw]:{exposeProperties:{text:(e,t)=>ed(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function kL(e,t){const s=Zd[e];if(!s)throw new Error(`native type ${e} has no configuration`);const o=new IL(s);return o.loadDataTransfer(t),o}function td(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Zd).filter(s=>{const o=Zd[s];return o?.matchesTypes?o.matchesTypes.some(n=>t.indexOf(n)>-1):!1})[0]||null}const AL=Jv(()=>/firefox/i.test(navigator.userAgent)),ow=Jv(()=>!!window.safari);class Ip{interpolate(t){const{xs:s,ys:o,c1s:n,c2s:i,c3s:r}=this;let a=s.length-1;if(t===s[a])return o[a];let l=0,c=r.length-1,d;for(;l<=c;){d=Math.floor(.5*(l+c));const p=s[d];if(p<t)l=d+1;else if(p>t)c=d-1;else return o[d]}a=Math.max(0,c);const u=t-s[a],h=u*u;return o[a]+n[a]*u+i[a]*h+r[a]*u*h}constructor(t,s){const{length:o}=t,n=[];for(let p=0;p<o;p++)n.push(p);n.sort((p,m)=>t[p]<t[m]?-1:1);const i=[],r=[];let a,l;for(let p=0;p<o-1;p++)a=t[p+1]-t[p],l=s[p+1]-s[p],i.push(a),r.push(l/a);const c=[r[0]];for(let p=0;p<i.length-1;p++){const m=r[p],C=r[p+1];if(m*C<=0)c.push(0);else{a=i[p];const v=i[p+1],w=a+v;c.push(3*w/((w+v)/m+(w+a)/C))}}c.push(r[r.length-1]);const d=[],u=[];let h;for(let p=0;p<c.length-1;p++){h=r[p];const m=c[p],C=1/i[p],v=m+c[p+1]-h-h;d.push((h-m-v)*C),u.push(v*C*C)}this.xs=t,this.ys=s,this.c1s=c,this.c2s=d,this.c3s=u}}const LL=1;function nw(e){const t=e.nodeType===LL?e:e.parentElement;if(!t)return null;const{top:s,left:o}=t.getBoundingClientRect();return{x:o,y:s}}function ga(e){return{x:e.clientX,y:e.clientY}}function OL(e){var t;return e.nodeName==="IMG"&&(AL()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function NL(e,t,s,o){let n=e?t.width:s,i=e?t.height:o;return ow()&&e&&(i/=window.devicePixelRatio,n/=window.devicePixelRatio),{dragPreviewWidth:n,dragPreviewHeight:i}}function HL(e,t,s,o,n){const i=OL(t),a=nw(i?e:t),l={x:s.x-a.x,y:s.y-a.y},{offsetWidth:c,offsetHeight:d}=e,{anchorX:u,anchorY:h}=o,{dragPreviewWidth:p,dragPreviewHeight:m}=NL(i,t,c,d),C=()=>{let F=new Ip([0,.5,1],[l.y,l.y/d*m,l.y+m-d]).interpolate(h);return ow()&&i&&(F+=(window.devicePixelRatio-1)*m),F},v=()=>new Ip([0,.5,1],[l.x,l.x/c*p,l.x+p-c]).interpolate(u),{offsetX:w,offsetY:b}=n,S=w===0||w,x=b===0||b;return{x:S?w:v(),y:x?b:C()}}class GL{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,s){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=s}}function BL(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function kp(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable}))),o.forEach(function(n){BL(e,n,s[n])})}return e}class VL{profile(){var t,s;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var s;(s=this.window)===null||s===void 0||s.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,s,o){return this.sourcePreviewNodeOptions.set(t,o),this.sourcePreviewNodes.set(t,s),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,s,o){this.sourceNodes.set(t,s),this.sourceNodeOptions.set(t,o);const n=r=>this.handleDragStart(r,t),i=r=>this.handleSelectStart(r);return s.setAttribute("draggable","true"),s.addEventListener("dragstart",n),s.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),s.removeEventListener("dragstart",n),s.removeEventListener("selectstart",i),s.setAttribute("draggable","false")}}connectDropTarget(t,s){const o=r=>this.handleDragEnter(r,t),n=r=>this.handleDragOver(r,t),i=r=>this.handleDrop(r,t);return s.addEventListener("dragenter",o),s.addEventListener("dragover",n),s.addEventListener("drop",i),()=>{s.removeEventListener("dragenter",o),s.removeEventListener("dragover",n),s.removeEventListener("drop",i)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),s=this.sourceNodeOptions.get(t);return kp({dropEffect:this.altKeyPressed?"copy":"move"},s||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),s=this.sourcePreviewNodeOptions.get(t);return kp({anchorX:.5,anchorY:.5,captureDraggingState:!1},s||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Mp).some(s=>Mp[s]===t)}beginDragNativeItem(t,s){this.clearCurrentDragSourceNode(),this.currentNativeSource=kL(t,s),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const s=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var o;return(o=this.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},s)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,s){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(s))}handleDragEnter(t,s){this.dragEnterTargetIds.unshift(s)}handleDragOver(t,s){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(s)}handleDrop(t,s){this.dropTargetIds.unshift(s)}constructor(t,s,o){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=n=>{const i=this.sourceNodes.get(n);return i&&nw(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=n=>!!(n&&this.document&&this.document.body&&this.document.body.contains(n)),this.endDragIfSourceWasRemovedFromDOM=()=>{const n=this.currentDragSourceNode;n==null||this.isNodeInDocument(n)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=n=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(n||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=n=>{if(n.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const r=ga(n);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:a}=n,l=td(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const d=this.monitor.getSourceId(),u=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||u;if(h){const{anchorX:p,anchorY:m,offsetX:C,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),S=HL(u,h,r,{anchorX:p,anchorY:m},{offsetX:C,offsetY:v});a.setDragImage(h,S.x,S.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(n.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(n.target&&!n.target.hasAttribute||!n.target.hasAttribute("draggable")))return;n.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=n=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(n.dataTransfer)}if(!this.enterLeaveCounter.enter(n.target)||this.monitor.isDragging())return;const{dataTransfer:a}=n,l=td(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=n=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=n.altKey,i.length>0&&this.actions.hover(i,{clientOffset:ga(n)}),i.some(a=>this.monitor.canDropOnTarget(a))&&(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=n=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(n.dataTransfer)}},this.handleTopDragOver=n=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="none");return}this.altKeyPressed=n.altKey,this.lastClientOffset=ga(n),this.scheduleHover(i),(i||[]).some(a=>this.monitor.canDropOnTarget(a))?(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?n.preventDefault():(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=n=>{this.isDraggingNativeItem()&&n.preventDefault(),this.enterLeaveCounter.leave(n.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=n=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;n.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(n.dataTransfer)}else td(n.dataTransfer)&&n.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=n=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:ga(n)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=n=>{const i=n.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(n.preventDefault(),i.dragDrop()))},this.options=new GL(s,o),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new ML(this.isNodeInDocument)}}const zL=function(t,s,o){return new VL(t,s,o)},WL=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:s,emptyButtonLabel:o,acceptTypes:n,maxFilesCount:i,multiple:r,fileFormatError:a,fileCountError:l,fileSizeError:c,getIsFileFormatError:d,getIsFileSizeError:u})=>{const h=g.useRef(null),p=g.useRef(null),[m,C]=g.useState([]),[v,w]=g.useState(!1),[b,S]=g.useState(!1),x=g.useCallback(V=>{const H=V.target.files;if(H&&H.length>0){const A=Array.from(H),de=d?.(A),M=u?.(A);de?w(!0):M?S(!0):e(A)}},[d,u,e]),y=g.useCallback(V=>i&&V?.length>i,[i]),F=g.useMemo(()=>v||b||y(m),[v,b,y,m]),R=()=>{C([]),w(!1),S(!1)},E=g.useMemo(()=>v?f.jsx(ls,{text:a}):b?f.jsx(ls,{text:c}):y(m)?f.jsx(ls,{text:l}):null,[l,a,c,m,y,v,b]);g.useEffect(()=>{R()},[n]);const[{isOver:D,canDrop:P},T]=hf(()=>({accept:[hh],drop(V){const H=V.files;!d?.(H)&&!u?.(H)&&!y(H)&&e(H),R()},collect:V=>({isOver:V.isOver(),canDrop:V.canDrop()})}),[x]),I=V=>{(V.key==="Enter"||V.key==="Space")&&(V.preventDefault(),p.current?.click())},N=V=>{V?.preventDefault();const H=Array.from(V.dataTransfer?.items??[]);w(!!d?.(H)),S(!!u?.(H)),C(H)},q=V=>{V.target===V.currentTarget&&R()},L=ge("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!P&&!F&&"border-primary",P&&(D?"border-accent-primary":"border-hover"),F&&"border-error");return T(h),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:L,ref:h,onDragOver:N,onDragLeave:q,children:[f.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:I,className:"flex flex-col items-center cursor-pointer h-full w-full text-secondary dial-tiny-text justify-center",children:[t&&f.jsx("p",{className:"mb-1",children:t}),s&&f.jsx("p",{className:"mb-0.5",children:s}),o&&f.jsx(xs,{appearance:Me.Ghost,label:o,onClick:()=>p.current?.click()})]}),f.jsx("input",{multiple:r,id:"file",type:"file",ref:p,hidden:!0,accept:n,onChange:x})]}),f.jsx(f.Fragment,{children:E})]})},_L=({iconBefore:e,className:t,error:s,...o})=>{const n=o.invalid,i=()=>f.jsx("div",{className:"mr-2",children:n?f.jsx(z.IconExclamationCircle,{...J,className:"text-error"}):e});return f.jsx(ni,{...o,iconBefore:i(),containerClassName:"h-[40px] p-0",className:ge("rounded-r-none border-r-0",n&&"text-error",t)})},iw=e=>{const{files:t,iconBeforeInput:s,dynamicIcon:o,onChange:n,isInvalid:i,errorText:r,removeButtonAriaLabel:a,getIsMultiFilesSizeError:l,multiFilesSizeError:c}=e,d=(p,m)=>{p.stopPropagation(),n(t?.filter(C=>C.name!==m)||[])},u=p=>f.jsx(jv,{"aria-label":a,onClick:m=>d(m,p)}),h=p=>{n(p)};return!t||t.length===0?f.jsx(v0,{backend:zL,children:f.jsx(WL,{...e,onChange:h})}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex-1 min-h-0 border border-solid border-primary rounded p-2 overflow-y-auto",children:t&&t.length>0&&f.jsx("div",{className:"flex flex-col gap-y-1",children:t.map((p,m)=>f.jsx(_L,{id:p.name,value:p.name,iconAfter:u(p.name),iconBefore:s||o?.(p.name),invalid:i?.(p),error:r},p.name+m))})}),l?.(t)&&f.jsx(ls,{text:c})]})},jL=({onChange:e,fieldTitle:t,elementId:s,files:o,maxFilesCount:n,maxFileSize:i,maxMultiFilesSize:r,fileFormatError:a,fileCountError:l,fileSizeError:c,multiFilesSizeError:d,multiple:u=!0,acceptTypes:h,deleteAllButtonLabel:p,addButtonLabel:m,additionalActionButtons:C,...v})=>{const w=g.useRef(null),b=()=>w.current?.click(),S=()=>{e([])},x=g.useCallback(E=>E?.some(D=>!(h==="/"||h?.toLowerCase()?.includes(D?.type?.toLowerCase()))),[h]),y=g.useCallback(E=>{if(!i)return!1;const D=i*(1024*1024);return E?.some(P=>{const T=P.size;return!!T&&T>D})},[i]),F=g.useCallback(E=>{if(!r||!u)return!1;const D=r*1024*1024;return E.reduce((T,I)=>T+I.size,0)>D},[r,u]),R=g.useCallback(E=>{const D=E.target.files;if(D&&D.length>0){const P=Array.from(D),T=x(P),I=y(P);!T&&!I&&e([...o||[],...P])}},[x,y,e,o]);return f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[f.jsx(_o,{label:`${t}: ${u?o?.length||0:""}`,htmlFor:s}),u&&!!o?.length&&f.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[f.jsx(Fs,{label:p,iconBefore:f.jsx(z.IconTrashX,{...J}),onClick:S}),(n?n>o?.length:!0)&&f.jsx(xs,{appearance:Me.Ghost,iconBefore:f.jsx(z.IconPlus,{...J}),label:m,onClick:b}),C]})]}),o&&o.length>0&&f.jsx("input",{id:"file",type:"file",multiple:u,ref:w,hidden:!0,accept:h,onChange:R}),f.jsx(iw,{files:o,onChange:e,acceptTypes:h,maxFilesCount:n,multiple:u,fileFormatError:a,fileCountError:l,fileSizeError:c,multiFilesSizeError:d,getIsFileFormatError:x,getIsFileSizeError:y,getIsMultiFilesSizeError:F,...v})]})},UL=f.jsx(z.IconChevronDown,{size:Ct.SM}),$L=f.jsx(z.IconChevronUp,{size:Ct.SM}),Qd=({variant:e,appearance:t,items:s,...o})=>{const[n,i]=g.useState(!1),r=g.useMemo(()=>n?$L:UL,[n]);return f.jsx("div",{children:f.jsx(Tt,{menu:{items:s},onOpenChange:a=>i(a),children:f.jsx(ss,{...o,iconAfter:r,variant:e||ze.Primary,appearance:t||Me.Solid})})})},rw=e=>xe.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},xe.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.1812 1.2002H2.80615C2.43319 1.2002 2.07551 1.34835 1.81178 1.61208C1.54806 1.8758 1.3999 2.23348 1.3999 2.60645V5.48145C1.3999 5.85441 1.54806 6.21209 1.81178 6.47581C2.07551 6.73954 2.43319 6.8877 2.80615 6.8877H15.1812C15.5541 6.8877 15.9118 6.73954 16.1755 6.47581C16.4392 6.21209 16.5874 5.85441 16.5874 5.48145V2.60645C16.5874 2.23348 16.4392 1.8758 16.1755 1.61208C15.9118 1.34835 15.5541 1.2002 15.1812 1.2002ZM14.8999 5.2002H3.0874V2.8877H14.8999V5.2002ZM12 7.80017C12.3107 7.80017 12.5625 8.05201 12.5625 8.36267V11.7377H15.9375C16.2482 11.7377 16.5 11.9895 16.5 12.3002C16.5 12.6108 16.2482 12.8627 15.9375 12.8627H12.5625V16.2377C12.5625 16.5483 12.3107 16.8002 12 16.8002C11.6893 16.8002 11.4375 16.5483 11.4375 16.2377V12.8627H8.0625C7.75184 12.8627 7.5 12.6108 7.5 12.3002C7.5 11.9895 7.75184 11.7377 8.0625 11.7377H11.4375V8.36267C11.4375 8.05201 11.6893 7.80017 12 7.80017ZM2.41188 12.5883C2.14816 12.3246 2 11.9669 2 11.5939V9.00018H3.6875V11.3127H6.1001V13.0002H3.40625C3.03329 13.0002 2.6756 12.852 2.41188 12.5883Z",fill:"currentColor"})),aw=e=>xe.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},xe.createElement("path",{d:"M9.00049 7.7998C9.3108 7.80007 9.56279 8.05198 9.56299 8.3623V11.7373H12.938C13.2483 11.7376 13.5003 11.9895 13.5005 12.2998C13.5005 12.6103 13.2484 12.862 12.938 12.8623H9.56299V16.2373C9.56299 16.5478 9.31092 16.7995 9.00049 16.7998C8.68983 16.7998 8.43799 16.548 8.43799 16.2373V12.8623H5.06299C4.75233 12.8623 4.50049 12.6105 4.50049 12.2998C4.50069 11.9893 4.75245 11.7373 5.06299 11.7373H8.43799V8.3623C8.43819 8.05181 8.68995 7.7998 9.00049 7.7998ZM15.1812 1.2002C15.5541 1.2002 15.9116 1.34858 16.1753 1.6123C16.439 1.87603 16.5874 2.23348 16.5874 2.60645V5.48145C16.5874 5.85441 16.439 6.21186 16.1753 6.47559C15.9116 6.73931 15.5541 6.8877 15.1812 6.8877H2.80615C2.43319 6.8877 2.07573 6.73931 1.81201 6.47559C1.54829 6.21186 1.3999 5.85441 1.3999 5.48145V2.60645C1.3999 2.23348 1.54829 1.87603 1.81201 1.6123C2.07573 1.34858 2.43319 1.2002 2.80615 1.2002H15.1812ZM3.0874 2.8877V5.2002H14.8999V2.8877H3.0874Z",fill:"currentColor"})),gh=e=>xe.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},xe.createElement("path",{d:"M3.009 12.5527C2.77901 12.4216 2.5877 12.2321 2.45443 12.0034C2.32116 11.7746 2.25064 11.5147 2.25 11.25V3.75C2.25 2.925 2.925 2.25 3.75 2.25H11.25C11.8125 2.25 12.1185 2.53875 12.375 3M10.5 15.75H7.25025C6.98757 15.75 6.72747 15.6983 6.48479 15.5977C6.24211 15.4972 6.0216 15.3499 5.83586 15.1641C5.65012 14.9784 5.50278 14.7579 5.40226 14.5152C5.30174 14.2725 5.25 14.0124 5.25 13.7498V7.25025C5.25 6.71975 5.46074 6.21098 5.83586 5.83586C6.21098 5.46074 6.71975 5.25 7.25025 5.25H13.7498C14.0124 5.25 14.2725 5.30174 14.5152 5.40226C14.7579 5.50278 14.9784 5.65012 15.1641 5.83586C15.3499 6.0216 15.4972 6.24211 15.5977 6.48479C15.6983 6.72747 15.75 6.98757 15.75 7.25025V10.5M12.75 16.5L16.5 12.75M16.5 12.75V16.125M16.5 12.75H13.125",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ph=e=>xe.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},xe.createElement("path",{d:"M9.75 14.25H3.75C3.35218 14.25 2.97064 14.092 2.68934 13.8107C2.40804 13.5294 2.25 13.1478 2.25 12.75V4.5C2.25 4.10218 2.40804 3.72064 2.68934 3.43934C2.97064 3.15804 3.35218 3 3.75 3H6.75L9 5.25H14.25C14.6478 5.25 15.0294 5.40804 15.3107 5.68934C15.592 5.97064 15.75 6.35218 15.75 6.75V9.75M12 16.5L15.75 12.75M15.75 12.75V16.125M15.75 12.75H12.375",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),fh=e=>xe.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},xe.createElement("path",{d:"M4.5 15.75V14.25C4.5 13.4544 4.81607 12.6913 5.37868 12.1287C5.94129 11.5661 6.70435 11.25 7.5 11.25H9.75M15.75 12.75L12 16.5M12 16.5V13.125M12 16.5H15.375M6 5.25C6 6.04565 6.31607 6.80871 6.87868 7.37132C7.44129 7.93393 8.20435 8.25 9 8.25C9.79565 8.25 10.5587 7.93393 11.1213 7.37132C11.6839 6.80871 12 6.04565 12 5.25C12 4.45435 11.6839 3.69129 11.1213 3.12868C10.5587 2.56607 9.79565 2.25 9 2.25C8.20435 2.25 7.44129 2.56607 6.87868 3.12868C6.31607 3.69129 6 4.45435 6 5.25Z",stroke:"#7F8792",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));var Dn=(e=>(e.MyFiles="my_files",e.Shared="shared",e.Organization="organization",e.Review="review",e))(Dn||{}),Y=(e=>(e.AddSibling="addSibling",e.AddChild="addChild",e.Duplicate="duplicate",e.Copy="copy",e.Move="move",e.Download="download",e.Delete="delete",e.Rename="rename",e.Info="info",e.Unshare="unshare",e.RemoveAccess="removeAccess",e.ManagePermissions="managePermissions",e.Preview="preview",e.OpenInNewTab="openInNewTab",e))(Y||{}),lt=(e=>(e.Replace="replace",e.Duplicate="duplicate",e.Cancel="cancel",e))(lt||{}),Nt=(e=>(e.ReplaceAll="replaceAll",e.DuplicateAll="duplicateAll",e.DecideForEach="decideForEach",e))(Nt||{}),ct=(e=>(e.Copy="copy",e.Move="move",e))(ct||{}),Bn=(e=>(e.Tree="tree",e.Grid="grid",e))(Bn||{}),dt=(e=>(e.Name="name",e.UpdatedAt="updatedAt",e.Size="size",e.Author="author",e.Owner="owner",e.Path="path",e.Actions="__actions",e.Version="version",e))(dt||{});const qL="w-full h-full grid grid-rows-[auto_1fr] gap-5 p-6 overflow-hidden min-w-0 bg-layer-1",Ap="w-full text-secondary flex items-center gap-2",KL="flex min-h-0 min-w-0 h-full gap-4 overflow-hidden",YL="flex flex-col flex-1 min-h-0 min-w-0 h-full gap-4",XL="h-full rounded bg-layer-3 text-secondary min-w-0",ZL="flex-1 w-full rounded text-secondary overflow-auto min-h-0 min-w-0",QL="opacity-0 pointer-events-none group-hover/grid-row:opacity-100 group-hover/grid-row:pointer-events-auto",JL=280,e7="Files",no=20,t7="Files",sd=".dial_folder",s7=280,o7=460,od=44,n7=56,i7=800,r7=[dt.Name,dt.UpdatedAt,dt.Size,dt.Author,dt.Actions];var ye=(e=>(e.ITEM="item",e.FOLDER="folder",e))(ye||{}),mh=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(mh||{}),Xo=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(Xo||{});const Lp=({open:e,onClose:t,onReplace:s,onDuplicate:o,onDecideForEach:n,conflictingFiles:i,singleFileTitle:r="Replace Or Duplicate Item",multipleFilesTitle:a="Replace Or Duplicate Items",message:l,actionLabels:c,strategyLabels:d,confirmLabel:u="Confirm",cancelLabel:h="Cancel",nameColumnLabel:p="Name",actionColumnLabel:m="Action"})=>{const C=i.length===1,v=C?i[0]?.name:"",w=c?.[lt.Replace]??"Replace",b=c?.[lt.Duplicate]??"Duplicate",S=c?.[lt.Cancel]??"Cancel",x=d?.[Nt.ReplaceAll]??"Replace all",y=d?.[Nt.DuplicateAll]??"Duplicate all",F=d?.[Nt.DecideForEach]??"Decide for each",[R,E]=g.useState(lt.Replace),[D,P]=g.useState(Nt.ReplaceAll),[T,I]=g.useState(new Map(i.map(Q=>[Q.path,lt.Replace]))),[N,q]=g.useState(void 0),L=C?r:a,V=f.jsxs(f.Fragment,{children:["Item with the name ",f.jsxs("span",{className:"text-primary",children:['"',v,'"']})," ","already exists in this destination."]}),H=`${i.length} items with the same names already exist in this destination.`,A=l??(C?V:H),de=g.useMemo(()=>[{id:lt.Replace,name:w},{id:lt.Duplicate,name:b}],[w,b]),M=g.useMemo(()=>i.map(Q=>({id:Q.path,name:Q.name,path:Q.path,nodeType:Q.nodeType??ye.ITEM,action:T.get(Q.path)||lt.Replace})),[i,T]),B=g.useMemo(()=>[{field:"name",headerName:p,flex:1,minWidth:200,floatingFilter:!1,filter:!1,resizable:!1,cellRenderer:Q=>Q.data?.nodeType===ye.FOLDER?f.jsx(ml,{name:Q.data.name,iconSize:no}):f.jsx(fl,{name:Q.data.name,iconSize:no})},{field:"action",headerName:m,width:140,suppressSizeToFit:!0,sortable:!1,filter:!1,floatingFilter:!1,resizable:!1,cellRenderer:Q=>{if(!Q.data)return null;const _=[{key:lt.Replace,label:w,icon:f.jsx(z.IconCircleFilled,{size:10,className:"text-accent-tertiary"})},{key:lt.Duplicate,label:b,icon:f.jsx(z.IconCircleFilled,{size:10,className:"text-accent-secondary"})},{key:lt.Cancel,label:S,icon:f.jsx(z.IconCircleFilled,{size:10,className:"text-error"})}],pe=_.find(Z=>Z.key===Q.data.action),oe=N===Q.data.path;return f.jsx("div",{className:"flex items-center h-full",children:f.jsx(Tt,{trigger:[Gt.Click],open:oe,menu:{items:_,onClick:({key:Z})=>{I(j=>{const ae=new Map(j);return ae.set(Q.data.path,Z),ae}),q(void 0)}},placement:"bottom-start",matchReferenceWidth:!1,allowedPlacements:["bottom-start","top-start"],onOpenChange:Z=>{q(Z?Q.data.path:void 0)},children:f.jsxs("button",{type:"button",className:"flex items-center gap-2",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[pe?.icon,pe?.label??w]}),f.jsx(z.IconChevronDown,{size:Ct.SM,className:ge("text-secondary transition-transform",oe&&"rotate-180")})]})})})}}],[p,m,w,b,S,N]),U=g.useMemo(()=>[{id:Nt.ReplaceAll,name:x},{id:Nt.DuplicateAll,name:y},{id:Nt.DecideForEach,name:F,content:D===Nt.DecideForEach?f.jsx("div",{className:"mt-4",children:f.jsx(lh,{columnDefs:B,rowData:M,getRowId:Q=>Q.id,wrapCustomCellRenderers:!1,alternateOddRowColors:!1,additionalGridOptions:{domLayout:"autoHeight"}})}):void 0}],[x,y,F,D,B,M]),W=g.useCallback(()=>{E(lt.Replace),P(Nt.ReplaceAll),I(new Map(i.map(Q=>[Q.path,lt.Replace])))},[i]),re=g.useCallback(()=>{W(),t()},[W,t]),be=g.useCallback(()=>{if(W(),C)R===lt.Replace?s():o();else if(D===Nt.ReplaceAll)s();else if(D===Nt.DuplicateAll)o();else if(D===Nt.DecideForEach&&n){const Q=i.map(_=>({file:_,action:T.get(_.path)||lt.Replace}));n(Q)}},[W,C,R,s,o,D,n,i,T]);return f.jsx(Yo,{open:e,onClose:re,size:C?_t.Sm:_t.Md,className:ge([!C&&"w-[600px]"]),header:L,dividers:!1,preventKeyboardOnOpen:!0,footer:f.jsxs("div",{className:"flex justify-end gap-3 py-4 px-6 border-t border-tertiary",children:[f.jsx(Fs,{onClick:re,label:h}),f.jsx(xs,{onClick:be,label:u})]}),children:f.jsxs("div",{className:"px-6 py-4",children:[f.jsx("p",{className:"text-secondary mb-4 break-words",children:A}),C?f.jsx(ka,{elementId:"single-file-conflict",radioButtons:de,activeRadioButton:R,orientation:Lo.Column,onChange:Q=>E(Q)}):f.jsx(ka,{elementId:"multiple-files-conflict",radioButtons:U,activeRadioButton:D,orientation:Lo.Column,onChange:Q=>P(Q),formItemChildrenClassName:"gap-3"})]})})},a7=({getContextMenuItems:e,isRowDisabled:t,allowedFileTypes:s,maxSelectableFileSize:o,buttonClassName:n})=>{const i=g.useRef(e);g.useEffect(()=>{i.current=e},[e]);const r=g.useCallback(l=>{if(!l.data||t(l.data,s,o))return null;const d=l.data?i.current?.(l.data)??[]:[];return d.length?f.jsx(Tt,{placement:"bottom-start",allowedPlacements:["top-start","top-end","bottom-start"],menu:{items:d},className:ie("sticky right-0",n),children:f.jsx(Ye,{className:"text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary cursor-default",icon:f.jsx(z.IconDotsVertical,{...J})})}):null},[s,o,n,t]);return{actionsColumnDef:g.useMemo(()=>({colId:"__actions",headerName:"",width:44,minWidth:44,maxWidth:44,suppressSizeToFit:!0,sortable:!1,resizable:!1,filter:!1,floatingFilter:!1,cellRenderer:r}),[r])}},l7=({onRename:e})=>{const[t,s]=g.useState(Bn.Grid),o=g.useCallback(i=>{e(i),s(Bn.Grid)},[e]),n=g.useCallback(i=>{e(i),s(Bn.Tree)},[e]);return{renameTriggerView:t,onGridRename:o,onTreeRename:n}};function c7(e,t){const s=g.useRef(null),[o,n]=g.useState(!1);return g.useEffect(()=>{if(!s.current)return;const i=new ResizeObserver(([r])=>{const a=r.contentRect.width;n(a<e)});return i.observe(t?.current||s?.current),()=>i.disconnect()},[e,t]),{containerRef:s,isBelowBreakpoint:o}}const Vs=(e,t)=>{if(!(!e||!e.length||!t))for(const s of e){if(s.path===t)return s;const o=Vs(s.items,t);if(o)return o}},nd=(e,t)=>{if(!e?.length)return;if(!t)return e[0];const s=Vs(e,t);if(s&&s.nodeType===ye.FOLDER)return s;const o=t.split("/").filter(Boolean);if(o.length<=1)return e[0];const n="/"+o.slice(0,o.length-1).join("/");return Vs(e,n)??e[0]},Vn=e=>(e??"").toLowerCase(),d7=e=>Vn(e).replace(/^\./,""),u7=e=>{if(!e)return[];const t=[],s=o=>{const n=o.items??[];for(const i of n)t.push(i),i.nodeType===ye.FOLDER&&s(i)};return s(e),t},lw=e=>(e.name??e.path.split("/").pop()??"").startsWith("."),ar=e=>{if(!e)return"0 bytes";const t=1024,s=t*1024;return e>=s?`${(e/s).toFixed(1)} MB`:e>=t?`${(e/t).toFixed(0)} KB`:`${e} bytes`},h7=(e,t="en-US",s={year:"numeric",month:"short",day:"2-digit"})=>{if(!e)return"";try{return new Intl.DateTimeFormat(t,s).format(new Date(e))}catch{return e}};function cw(e,t,s){if(!e||e.includes("*/*"))return!0;const o=t.toLowerCase(),n=s&&s.includes(".")?`.${s.split(".").at(-1).toLowerCase()}`:void 0;return e.some(i=>{const r=i.toLowerCase();if(r.startsWith("."))return n===r;if(r.endsWith("/*")){const a=r.slice(0,-1);return o.startsWith(a)}return o===r})}const g7=e=>e?e.map(t=>t.startsWith("text/")?t:t.includes("/")?`.${t.split("/")[1]}`:t).join(", "):"",Pl=e=>{if(!e)return;const t=e.flags.replace(/[gy]/g,"");return new RegExp(e.source,t)};function Ch(e,t,s){if(t&&Pl(t)?.test(e.name))return s??`This ${e.isFolder?"folder":"file"} contains forbidden characters in its name. Please rename it.`}const p7=(e,t,s,o,n)=>{if(e.nodeType===ye.FOLDER)return;const i=!e.contentLength||s==null||e.contentLength<=s;if(!(!e.contentType||cw(t,e.contentType,e.name)))return o??(t?.length?`Unsupported file type. Supported types: ${g7(t)}.`:"Unsupported file type.");if(!i)return n??`File is too large. Maximum size: ${ar(s)}.`},f7=e=>{const[t,s]=g.useState(e?.showHiddenFiles??!1),o=!!e?.onShowHiddenFilesChange,n=o?e.showHiddenFiles??!1:t,i=g.useCallback(a=>{o?e?.onShowHiddenFilesChange?.(a):s(a)},[o,e]),r=g.useCallback(()=>{const a=!n;o?e?.onShowHiddenFilesChange?.(a):s(a)},[n,o,e]);return{areHiddenFilesVisible:n,toggleHiddenFilesVisibility:r,setAreHiddenFilesVisible:i}},m7=e=>{const[t,s]=g.useState(e?.collapsed??!1),o=!!e?.onCollapseChange,n=o?e.collapsed??!1:t,i=g.useCallback(a=>{o?e?.onCollapseChange?.(a):s(a)},[o,e]),r=g.useCallback(()=>{const a=!n;o?e?.onCollapseChange?.(a):s(a)},[n,o,e]);return{isTreeCollapsed:n,toggleTreeCollapse:r,setIsTreeCollapsed:i}},Op=(e,t,s)=>{if(!t.has(e))return e;const o=s===ye.FOLDER?(n,i)=>`${n} (${i})`:(n,i)=>{const r=n.lastIndexOf("."),a=r>0,l=a?n.slice(0,r):n,c=a?n.slice(r):"";return`${l} (${i})${c}`};for(let n=1;;n++){const i=o(e,n);if(!t.has(i))return i}},id=e=>e.name,dw=({getDestinationFiles:e,onResolve:t})=>{const[s,o]=g.useState([]),[n,i]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(!1),c=g.useCallback(S=>{l.current=!0,o(S),i(!0)},[]),d=g.useCallback(()=>{l.current=!1,i(!1),o([]),a(null)},[]),u=g.useCallback((S,x)=>{const y=e(S),F=new Set(y.map(id)),R=x.filter(E=>F.has(E.name));return{hasConflicts:R.length>0,conflicts:R}},[e]),h=g.useCallback((S,x,y,F)=>{const R=e(S),E=new Set(R.map(id));return x.map(D=>{const P=D.name,T=E.has(P),I=y&&T?P:Op(P,E,D.nodeType);return(!y||!T)&&E.add(I),{sourceUrl:D.path,destinationUrl:`${S}/${I}`,overwrite:y&&T,nodeType:D.nodeType??ye.ITEM,...F??{}}})},[e]),p=g.useCallback((S,x,y,F)=>{const R=e(S),E=new Set(R.map(id));return x.filter(P=>y.get(P.path)!==lt.Cancel).map(P=>{const T=y.get(P.path),I=E.has(P.name),N=T===lt.Replace&&I,q=N?P.name:Op(P.name,E,P.nodeType);return N||E.add(q),{sourceUrl:P.path,destinationUrl:`${S}/${q}`,overwrite:N,nodeType:P.nodeType??ye.ITEM,...F??{}}})},[e]),m=g.useCallback((S,x,y)=>{const F=u(S,x);return F.hasConflicts&&(a({files:x,destinationFolder:S,metadata:y}),c(F.conflicts)),F},[u,c]),C=g.useCallback(()=>{if(!r)return;const{files:S,destinationFolder:x,metadata:y}=r,F=h(x,S,!0,y);t?.(F,x),d()},[r,h,t,d]),v=g.useCallback(()=>{if(!r)return;const{files:S,destinationFolder:x,metadata:y}=r,F=h(x,S,!1,y);t?.(F,x),d()},[r,h,t,d]),w=g.useCallback(()=>{if(!r)return;const{files:S,destinationFolder:x,metadata:y}=r,F=p(x,S,new Map(s.map(R=>[R.path,lt.Cancel])),y);t?.(F,x),d()},[d,s,t,r,p]),b=g.useCallback(S=>{if(!r)return;const{files:x,destinationFolder:y,metadata:F}=r,R=new Map(S.map(D=>[D.file.path,D.action])),E=p(y,x,R,F);t?.(E,y),d()},[r,p,t,d]);return{conflictingFiles:s,conflictResolutionOpen:n,hasActiveConflictRef:l,checkForConflicts:u,startConflictResolution:m,resolveConflictsWithStrategy:h,resolveConflictsWithDecisions:p,openConflictResolution:c,closeConflictResolution:d,handleReplaceAll:C,handleDuplicateAll:v,handleCancelAll:w,handleDecideForEach:b}},C7=({getDestinationFiles:e,onCopyFiles:t,onMoveToFiles:s,onCopySuccess:o,onMoveSuccess:n,onDuplicateSuccess:i,getCopyHeader:r,getMoveHeader:a})=>{const[l,c]=g.useState(!1),[d,u]=g.useState([]),[h,p]=g.useState([]),[m,C]=g.useState(ct.Copy),[v,w]=g.useState(),[b,S]=g.useState(null),{conflictingFiles:x,conflictResolutionOpen:y,hasActiveConflictRef:F,startConflictResolution:R,resolveConflictsWithStrategy:E,closeConflictResolution:D,openConflictResolution:P,handleReplaceAll:T,handleDuplicateAll:I,handleCancelAll:N,handleDecideForEach:q}=dw({getDestinationFiles:e,onResolve:(oe,Z)=>{oe?.length&&(b?.type===ct.Copy?(t?.(oe,Z),o?.()):b?.type===ct.Move&&b.sourceFolder&&(s?.(oe,b.sourceFolder,Z),n?.()))}}),L=g.useCallback(()=>{u([]),p([]),S(null),w(void 0)},[]),V=g.useCallback(oe=>{const Z=R(oe,d,{type:ct.Copy});if(S({type:ct.Copy}),!Z.hasConflicts){const j=E(oe,d,!1);t?.(j,oe),o?.(),L()}},[d,R,E,t,o,L]),H=g.useCallback((oe,Z)=>{const j=Z||(b?.sourceFolder??"/");if(!R(oe,h,{type:ct.Move,sourceFolderPath:j}).hasConflicts){const G=E(oe,h,!0);s?.(G,j,oe),n?.(),L()}},[h,R,E,s,n,L,b]),A=g.useCallback(()=>{T(),L()},[T,L]),de=g.useCallback(()=>{I(),L()},[I,L]),M=g.useCallback(()=>{N(),L()},[N,L]),B=g.useCallback(oe=>{q(oe),L()},[q,L]),U=g.useCallback(oe=>{const Z=oe.at(0)?.parentPath??"/",j=E(Z,oe,!1);t?.(j,Z),i?.()},[t,i,E]),W=g.useCallback(oe=>{C(oe),c(!0)},[]),re=g.useCallback(()=>{c(!1),F.current||L()},[L,F]),[be,Q]=g.useState(),_=g.useCallback(oe=>{u(oe);const Z=oe[0]?.parentPath??oe[0]?.folderId;w(Z),r&&oe.length>0?Q(r(oe.length,oe[0]?.name)):Q(void 0)},[r]),pe=g.useCallback(oe=>{p(oe);const Z=oe[0]?.parentPath??oe[0]?.folderId;w(Z),S({type:ct.Move,sourceFolder:Z}),a&&oe.length>0?Q(a(oe.length,oe[0]?.name)):Q(void 0)},[a]);return{handleDuplicate:U,handleCloseDestinationFolderPopup:re,handleOpenDestinationFolderPopup:W,handleCopyTo:V,handleMoveTo:H,openDestinationFolderPopup:l,destinationFolderMode:m,destinationFolderTitle:be,handleSetCopiedFiles:_,handleSetMovedFiles:pe,clearState:L,conflictingFiles:x,conflictResolutionOpen:y,openConflictResolution:P,closeConflictResolution:D,handleConflictReplace:A,handleConflictCancel:M,handleConflictDuplicate:de,handleConflictDecideForEach:B,sourceFolder:v}},v7=({path:e,defaultPath:t,onPathChange:s,onSelectionClear:o})=>{const n=e!==void 0,[i,r]=g.useState(t),a=n?e:i,l=g.useCallback(d=>{n||r(d),s?.(d)},[n,s]),c=g.useCallback(d=>{l(d),o?.()},[l,o]);return{currentPath:a,setCurrentPath:l,handlePathChange:c}},w7=({onDeleteFiles:e,onDeleteSuccess:t})=>{const[s,o]=g.useState(!1),[n,i]=g.useState([]),[r,a]=g.useState(""),l=g.useCallback((u,h)=>{i(u),a(h),o(!0)},[]),c=g.useCallback(()=>{o(!1),i([])},[]),d=g.useCallback(()=>{if(e&&n.length>0){const u=n.map(h=>({sourceUrl:h.path,nodeType:h.nodeType}));e(u,r),t?.()}c()},[n,e,t,c,r]);return{deleteConfirmationOpen:s,itemsToDelete:n,openDeleteConfirmation:l,closeDeleteConfirmation:c,confirmDelete:d}},b7=({onDownloadFiles:e,customDownloadItemsAction:t,onDownloadSuccess:s})=>({handleDownloadFiles:g.useCallback(n=>{t&&n.length>0?t(n):e&&n.length>0&&(e(n),s?.())},[e,s,t])}),S7=e=>"dataTransfer"in e&&e.dataTransfer!==null,y7=({onUploadFiles:e,onValidateUpload:t,maxFileSize:s,allowedFileTypes:o,validationMessages:n={},onUploadArchive:i,uploadEnabled:r=!0,currentFolder:a}={})=>{const[l,c]=g.useState(!1),[d,u]=g.useState(!1),[h,p]=g.useState(),m=g.useRef(null),C=g.useRef(""),v=g.useRef([]),w=g.useMemo(()=>!!a?.permissions?.includes(Xo.WRITE),[a]),[b,S]=g.useState(new Map),[x,y]=g.useState(null),F=g.useCallback(G=>!o||o.includes("*/*")?G:G.filter(({fileContent:fe,name:he})=>cw(o,fe.type,he)),[o]),R=g.useCallback(()=>{S(new Map),y(null)},[]),{conflictingFiles:E,conflictResolutionOpen:D,hasActiveConflictRef:P,startConflictResolution:T,closeConflictResolution:I,openConflictResolution:N,handleReplaceAll:q,handleDuplicateAll:L,handleCancelAll:V,handleDecideForEach:H}=dw({getDestinationFiles:()=>v.current,onResolve:(G,fe)=>{if(!r||!w){R();return}if(!x)return;const he=G.map(se=>{const le=b.get(se.sourceUrl);if(!le)return;const Fe=se.destinationUrl.split("/").pop();return{fileContent:le.fileContent,name:Fe}}).filter(Boolean);if(he[0]?.fileContent?.type==="application/zip"){const{fileContent:se,name:le}=he[0];i?.(se,le,fe)}else he.length>0&&e?.(he,fe);R()}});g.useEffect(()=>{r&&w||(c(!1),u(!1),p(void 0),I(),R())},[r,I,R,w]),g.useEffect(()=>{if(!r||!w)return;let G=0;const fe=Fe=>{S7(Fe)&&Fe.dataTransfer.types.includes(t7)&&(G++,u(!0))},he=()=>{G--,G===0&&u(!1)},se=()=>{G=0,u(!1)},le=Fe=>{Fe.preventDefault()};return window.addEventListener("dragenter",fe),window.addEventListener("dragleave",he),window.addEventListener("drop",se),window.addEventListener("dragover",le),()=>{window.removeEventListener("dragenter",fe),window.removeEventListener("dragleave",he),window.removeEventListener("drop",se),window.removeEventListener("dragover",le)}},[r,w]);const A=g.useCallback(G=>s?G.filter(fe=>fe.fileContent.size>s).map(fe=>fe.name):[],[s]),de=g.useCallback((G,fe)=>G.map(he=>({id:he.name,name:he.name,folderId:fe,path:he.name,nodeType:ye.ITEM,parentPath:fe,contentLength:he.fileContent.size})),[]),M=g.useCallback(async(G,fe,he)=>{if(!r||!w)return!1;p(void 0),v.current=he;const se=A(G);if(se.length>0){const ve=s?(s/1048576).toFixed(2):0,Ee=n.oversizedFiles||`Files exceed maximum size (${ve}MB): ${se.join(", ")}`;return p(Ee),!1}if(t)try{const ve=await t(G,he,fe);if(!ve.valid)return p(ve.message||n.validationFailed||"Validation failed"),!1}catch{return p(n.validationError||"Validation error occurred"),!1}const le=new Map(G.map(ve=>[ve.name,ve]));S(le);const Fe=de(G,fe);return y({destinationFolder:fe}),T(fe,Fe,{destinationFolder:fe}).hasConflicts?!1:(e?.(G,fe),R(),!0)},[r,e,t,A,s,n,de,T,R,w]),B=g.useCallback(()=>{q(),R()},[q,R]),U=g.useCallback(()=>{L(),R()},[L,R]),W=g.useCallback(()=>{V(),R()},[V,R]),re=g.useCallback(G=>{H(G),R()},[H,R]),be=g.useCallback(()=>{I(),P.current||R()},[I,P,R]),Q=g.useCallback(G=>{!r||!w||(G.preventDefault(),G.stopPropagation(),G.dataTransfer.types.includes("Files")&&c(!0))},[r,w]),_=g.useCallback(G=>{if(!r||!w)return;G.preventDefault(),G.stopPropagation();const fe=G.currentTarget.getBoundingClientRect(),he=G.clientX,se=G.clientY;(he<=fe.left||he>=fe.right||se<=fe.top||se>=fe.bottom)&&c(!1)},[r,w]),pe=g.useCallback(G=>{!r||!w||(G.preventDefault(),G.stopPropagation(),G.dataTransfer.types.includes("Files")&&(G.dataTransfer.dropEffect="copy"))},[r,w]),oe=g.useCallback(async(G,fe,he)=>{if(!r||!w||(G.preventDefault(),G.stopPropagation(),c(!1),!G.dataTransfer.types.includes("Files")))return;const se=Array.from(G.dataTransfer.items||[]),le=[];let Fe=!1;if(se.length>0&&se.forEach(Ee=>{if(Ee.kind==="file"){if(Ee.webkitGetAsEntry?.()?.isDirectory){Fe=!0;return}const je=Ee.getAsFile?.();je&&le.push(je)}}),le.length===0&&G.dataTransfer.files?.length&&le.push(...Array.from(G.dataTransfer.files)),le.length===0){Fe&&p(n.foldersNotSupported||"Folder upload is not supported");return}const Oe=le.map(Ee=>({fileContent:Ee,name:Ee.name})),ve=F(Oe);if(ve.length===0){p(n.unsupportedFiles||"Selected files are not supported");return}await M(ve,fe,he)},[r,F,M,n,w]);g.useEffect(()=>{let G=m.current;G||(G=document.createElement("input"),G.type="file",G.multiple=!0,G.style.display="none",document.body.appendChild(G),m.current=G),o&&o.length>0?G.accept=o.join(","):G.removeAttribute("accept");const fe=async()=>{if(!r||!w){G&&(G.value="");return}if(!G?.files?.length)return;const se=Array.from(G.files).map(Fe=>({fileContent:Fe,name:Fe.name})),le=F(se);if(le.length===0){p(n.unsupportedFiles||"Selected files are not supported"),G.value="";return}await M(le,C.current,v.current),G.value=""};return G.addEventListener("change",fe),()=>{G&&(G.removeEventListener("change",fe),m.current===G&&(document.body.removeChild(G),m.current=null))}},[r,o,F,M,n,w]);const Z=g.useCallback((G,fe)=>{!r||!w||(C.current=G,v.current=fe,m.current&&m.current.click())},[r,w]),j=g.useCallback((G,fe)=>{if(!i||!r||!w)return;const he=document.createElement("input");he.type="file",he.accept=".zip,application/zip",he.multiple=!1,he.style.display="none";const se=()=>{const le=he.files?.[0];if(!le){document.body.removeChild(he);return}const Fe=le.name.replace(/\.zip$/i,""),Oe={id:Fe,name:Fe,folderId:G,path:`${G}/${Fe}`,nodeType:ye.FOLDER,parentPath:G,contentLength:le.size,contentType:le.type};if(v.current=fe,y({destinationFolder:G}),S(new Map([[Oe.path,{fileContent:le,name:Fe}]])),T(G,[Oe],{destinationFolder:G}).hasConflicts){document.body.removeChild(he);return}try{i(le,Fe,G)}finally{document.body.removeChild(he)}};he.addEventListener("change",se),document.body.appendChild(he),he.click()},[i,r,w,T]),ae=g.useCallback(()=>{p(void 0)},[]);return{isDragging:l,isDraggingOverWindow:d,uploadError:h,handleDragEnter:Q,handleDragLeave:_,handleDragOver:pe,handleDrop:oe,clearError:ae,handleUpload:M,openFileDialog:Z,openArchiveDialog:j,fileInputRef:m,uploadConflictingFiles:E,uploadConflictResolutionOpen:D,hasActiveUploadConflictRef:P,openUploadConflictResolution:N,closeUploadConflictResolution:be,handleUploadConflictReplace:B,handleUploadConflictDuplicate:U,handleUploadConflictCancel:W,handleUploadConflictDecideForEach:re}},uw=g.createContext(void 0),hw={hiddenItemWarning:`${as.Warning}__A dot at the start of the name will make the item hidden`},x7={emptyName:"Name cannot be empty",duplicateName:"An item with this name already exists",hiddenItemWarning:hw.hiddenItemWarning};function R7(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function F7(e,t){const s=R7(e),o=s.lastIndexOf("/");return o===-1?t:s.slice(0,o+1)+t}function E7(e){const t=e.lastIndexOf(".");return t===-1||t===0?e:e.substring(0,t)}function Np(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.substring(t)}const D7=({items:e,onRenameValidate:t,validationMessages:s,onMoveToFiles:o})=>{const[n,i]=g.useState(),r=g.useMemo(()=>({...x7,...s}),[s]),a=g.useMemo(()=>n?.path,[n]),l=g.useCallback(p=>{const m=Vs(e,p);m&&i(m)},[e]),c=g.useCallback(()=>{i(void 0)},[]),d=g.useCallback(p=>{if(!n||!o){i(void 0);return}const m=n.nodeType===ye.ITEM;let C=p.trim();if(m){const S=Np(n.name);S&&!C.endsWith(S)&&(C=C+S)}if(C===n.name){i(void 0);return}const v=F7(n.path,C),w=n.parentPath;if(!w){i(void 0);return}const b={sourceUrl:n.path,destinationUrl:v,nodeType:n.nodeType};o([b],w,w),i(void 0)},[n,o]),u=g.useCallback((p,m)=>{const C=p.trim();if(!C)return r.emptyName;if(C.startsWith("."))return r.hiddenItemWarning;const v=m.nodeType===ye.ITEM;let w=C;if(v){const S=Np(m.name);S&&!w.endsWith(S)&&(w=w+S)}const b=m.parentPath;if(b){const S=Vs(e,b);if(S&&new Set((S.items??[]).filter(y=>y.path!==m.path).map(y=>y.name.toLowerCase())).has(w.toLowerCase()))return r.duplicateName}if(t){const S=t(w,m);if(S)return S}return null},[t,r,e]),h=g.useCallback(p=>p.nodeType===ye.ITEM?E7(p.name):p.name,[]);return{renamedPath:a,renamedItem:n,renameHandler:l,renameSaveHandler:d,renameCancelHandler:c,renameValidateHandler:u,getDisplayName:h}},gw=e=>{const[t,s]=g.useState(e?.expandedPaths??new Set),o=g.useMemo(()=>!!e?.onExpandedPathsChange,[e?.onExpandedPathsChange]),n=g.useMemo(()=>o?e?.expandedPaths??new Set:t,[o,e?.expandedPaths,t]);g.useEffect(()=>{o&&e?.expandedPaths&&s(new Set(e.expandedPaths))},[o,e?.expandedPaths]);const i=g.useCallback(d=>{o?e?.onExpandedPathsChange?.(d):s(d)},[o,e]),r=g.useCallback(d=>{const u=new Set(n);u.has(d)?u.delete(d):u.add(d),i(u)},[n,i]),a=g.useCallback(()=>{i(new Set)},[i]),l=g.useCallback(d=>{const u=new Set(n);u.add(d),i(u)},[n,i]),c=g.useCallback(d=>{const u=new Set(n);u.delete(d),i(u)},[n,i]);return{expandedPaths:n,setExpandedPaths:i,togglePath:r,collapseAll:a,expandPath:l,collapsePath:c,isControlled:o}},P7=({newActions:e,currentFolder:t,onUploadFiles:s,onCreateFolder:o,onUploadArchive:n,onCreateNewItem:i,isNewButtonDisabled:r})=>{const a=g.useMemo(()=>{const d=[];return e&&(e.newFolder&&d.push({key:"new-folder",label:e.newFolder.label,icon:e?.newFolder?.icon!==void 0?e?.newFolder?.icon:f.jsx(z.IconFolder,{...J,className:"text-secondary"}),onClick:()=>{o&&o()}}),e.newItem&&d.push({key:"new-item",label:e.newItem.label,icon:e?.newItem?.icon!==void 0?e?.newItem?.icon:f.jsx(z.IconPlus,{...J,className:"text-secondary"}),onClick:()=>{i&&i()}}),e.uploadFiles&&d.push({key:"upload-file",label:e.uploadFiles.label,icon:e?.uploadFiles?.icon!==void 0?e?.uploadFiles?.icon:f.jsx(z.IconFile,{...J,className:"text-secondary"}),onClick:()=>{s&&s()}}),e.uploadArchive&&d.push({key:"upload-archive",label:e.uploadArchive.label,icon:e?.uploadArchive?.icon!==void 0?e?.uploadArchive?.icon:f.jsx(z.IconFileZip,{...J,className:"text-secondary"}),onClick:()=>{n&&n()}})),d},[e,o,s,n,i]),l=g.useMemo(()=>a?.length>0,[a]),c=g.useMemo(()=>!t?.permissions?.includes(Xo.WRITE)||!!r,[t,r]);return{newActions:a,isNewButtonVisible:l,isNewButtonDisabled:c}},T7={emptyName:"Folder name cannot be empty",duplicateName:"A folder with this name already exists",hiddenItemWarning:hw.hiddenItemWarning},M7=({currentFolder:e,onCreateFolder:t,onValidateFolderName:s,validationMessages:o})=>{const[n,i]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(e?.path),c=g.useMemo(()=>({...T7,...o}),[o]);g.useEffect(()=>{const m=e?.path;l.current!==m&&n&&(i(!1),a(null)),l.current=m},[e?.path,n]);const d=g.useCallback(()=>{if(n)return;const m=`__new_folder_${Date.now()}`;a(m),i(!0)},[n]),u=g.useCallback(()=>{i(!1),a(null)},[]),h=g.useCallback(m=>{const C=m.trim();if(!C)return c.emptyName;if(C.startsWith("."))return c.hiddenItemWarning;if(e&&new Set((e.items??[]).filter(w=>w.nodeType===ye.FOLDER).map(w=>w.name.toLowerCase())).has(C.toLowerCase()))return c.duplicateName;if(s&&e){const v=s(C,e);if(v)return v}return null},[e,s,c]),p=g.useCallback(async m=>{const C=m.trim();if(!C)return;const w=`${e?.path??"/"}/${C}`,b=`${w}/${sd}`,x={fileContent:new File([],sd,{type:"text/plain"}),name:sd};t&&await t(x,w,b),u()},[e,t,u]);return{isCreatingFolder:n,newFolderTempId:r,startFolderCreation:d,cancelFolderCreation:u,saveFolderCreation:p,validateFolderName:h}},I7=({additionalButtons:e,expandedPathsLength:t,collapseAll:s})=>{const o=t===0;return{additionalButtons:g.useMemo(()=>{const i=ie(["hover:text-accent-primary",o&&"controls-secondary-disable hover:controls-secondary-disable disabled:hover:cursor-default"]);return f.jsxs(f.Fragment,{children:[e,f.jsx(uo,{disabled:o,className:i,size:Ft.Small,onClick:s,icon:f.jsx(z.IconCopyMinus,{size:Ct.LG,stroke:1.5}),"aria-label":"collapse-all"})]})},[e,o,s])}},k7=({onGetInfo:e})=>{const[t,s]=g.useState(!1),[o,n]=g.useState(void 0),i=g.useCallback(async a=>{n(a),s(!0),e&&await e(a)},[e]),r=g.useCallback(()=>{s(!1),n(void 0)},[]);return{isMetadataPopupOpen:t,selectedFileForMetadata:o,openMetadataPopup:i,closeMetadataPopup:r}};function A7(e){const t=[];function s(o){for(const n of o)t.push(n),n.items&&s(n.items)}return s(e),t}function Hp(e,t){const s=Vn(t);return e.filter(o=>Vn(o.name).includes(s))}function L7({onSearchFiles:e,clearSearchResults:t,currentPath:s,searchResults:o=[],searchInProgress:n=!1,navigationPanelValue:i,onNavigationPanelSearchChange:r,allItems:a=[],activeTab:l}){const[c,d]=g.useState(""),u=g.useRef(!1),h=g.useRef(!1),p=g.useRef([]),m=g.useRef(s),C=g.useRef(l);g.useEffect(()=>{i!=null&&d(String(i))},[i]);const v=String(i??c??"").trim(),w=h.current&&(n||o.length>0||v!==""),b=g.useCallback(F=>{const R=F.trim();if(!R){h.current=!1,u.current=!1;return}h.current=!0,e&&s&&!u.current&&(u.current=!0,e(s,R))},[e,s]),S=g.useCallback(()=>{u.current=!1,h.current=!1,p.current=[],d(""),r?.(""),t?.()},[t,r]),x=g.useCallback(F=>{const R=String(F??"");d(R),r?.(R),R.trim()?b(R):S()},[r,b,S]);g.useEffect(()=>{(m.current!==s||C.current!==l)&&(m.current=s,C.current=l,u.current=!1,h.current=!1,p.current=[],d(""),r?.(""),t?.())},[s,l,r,t]),g.useEffect(()=>{n||(p.current=o)},[o,n]);const y=g.useMemo(()=>{if(e){const R=n?p.current:o;return!v||R.length===0?R:Hp(R,v)}if(!v||!a.length)return[];const F=A7(a);return Hp(F,v)},[e,o,n,v,a]);return{isSearchMode:w,searchValue:c,effectiveSearchValue:v,setSearchValue:d,handleSearchChange:x,handleSearchActivate:b,handleSearchClear:S,searchResultsRows:y}}function O7({selectedPaths:e,defaultSelectedPaths:t,onSelectedPathsChange:s}){const o=e!==void 0,[n,i]=g.useState(()=>t??new Set),r=g.useMemo(()=>o?e:n,[o,e,n]),a=g.useCallback(c=>{const d=new Set(c);s?.(d),o||i(d)},[o,s]),l=g.useCallback(()=>{a(new Set)},[a]);return{selectedPaths:r,setSelectedPaths:a,clearSelection:l,isControlled:o}}const pw=':;,=/{}%&\\"',vh=`(\r
|
|
68
68
|
|
|
|
69
|
-
|\r| )|[\0-]`,N7=`[${pw.replace(/\\/g,"\\\\")}]`,fw=new RegExp(`${N7}|${vh}`),H7=new RegExp(vh),mw=({managerLabel:e,children:t,className:s,items:o=[],rootItem:n,path:i,defaultPath:r,filesLoading:a,selectedPaths:l,defaultSelectedPaths:c,onSelectedPathsChange:d,showHiddenFiles:u,onShowHiddenFilesChange:h,treeOptions:p,showNavigationPanel:m=!0,navigationPanelOptions:C,deleteConfirmationOptions:v,gridOptions:w,toolbarOptions:b,bulkActionsToolbarOptions:S,destinationFolderPopupOptions:x,conflictResolutionPopupOptions:y,onPathChange:F,onTableFileClick:R,handleSelectionClick:E,onGridApiChange:D,onCopyFiles:P,onMoveToFiles:T,onDeleteFiles:I,onDownloadFiles:N,onRenameValidate:q,onAddSibling:L,onAddChild:V,renameValidationMessages:H,forbiddenSymbolsRegExp:A=fw,forbiddenSymbolsTooltip:de,onUploadFiles:M,onValidateUpload:B,uploadEnabled:U,uploadValidationMessages:W,maxFileSize:re,onUploadArchive:be,onCreateFolder:Q,onCreateFolderValidate:_,folderCreationValidationMessages:pe,fileMetadataPopupOptions:oe,onGetInfo:Z,onUnshareFiles:j,onRemoveFilesAccess:ae,actionsRef:G,sharedByMePaths:fe,onSearchFiles:he,searchResults:se,searchInProgress:le,clearSearchResults:Fe,allowedFileTypes:Oe,maxSelectableFileSize:ve,getDisabledTooltip:Ee,fileTooLargeTooltip:_e,unsupportedFileTypeTooltip:je,emptyStateIcon:Ae,emptyStateTitle:Mt,emptyStateDescription:os,sharedWithMeIds:It,onFolderPopupPathChange:Ge,onManagePermissions:K,onPreview:He,onOpenInNewTab:ns,previewExtensions:ii,isRenameFileAvailable:Tl,isDuplicateFolderAvailable:Ml,customUploadFileAction:mo,customCreateNewItemAction:ri,customDuplicateAction:Zo,customDeleteItemsAction:wr,customDownloadItemsAction:Qo,customBreakpointRef:br,gridClassName:Sr,nonClickableTableColumns:yr,hideSearchPathItemName:Il,showHiddenFileSwitcherInDestinationPopup:kl,autoSelectUploadedItems:$s=!1})=>{const{selectedPaths:Ds,clearSelection:Ps,setSelectedPaths:Co}=O7({selectedPaths:l,defaultSelectedPaths:c,onSelectedPathsChange:d}),qs=g.useRef(null),Al=g.useCallback((De,Ne,Ve)=>{if($s){const is=Ne.lastIndexOf("/"),oc=is>=0?Ne.slice(is+1):Ne,Ie=is>=0?Ne.slice(0,is):"";qs.current={fileNames:new Set([oc]),destinationFolder:Ie}}Q?.(De,Ne,Ve)},[Q,$s]),Ll=g.useCallback((De,Ne)=>{$s&&(qs.current={fileNames:new Set(De.map(Ve=>Ve.name)),destinationFolder:Ne}),M?.(De,Ne)},[M,$s]),Ol=g.useCallback((De,Ne,Ve)=>{$s&&(qs.current={fileNames:new Set([Ne]),destinationFolder:Ve}),be?.(De,Ne,Ve)},[be,$s]),Nl=g.useMemo(()=>{const De=new Map;return Ds.forEach(Ne=>{const Ve=Vs(o,Ne);Ve&&De.set(Ne,Ve)}),De},[Ds,o]);g.useEffect(()=>{if(Ds.size===0)return;let De=!1;for(const Ne of Ds)if(!Vs(o,Ne)){De=!0;break}if(De){const Ne=new Set;for(const Ve of Ds)Vs(o,Ve)&&Ne.add(Ve);Co(Ne)}},[o,Ds,Co]);const{currentPath:st,setCurrentPath:Hl,handlePathChange:vt}=v7({path:i,defaultPath:r,onPathChange:F,onSelectionClear:Ps}),ai=g.useMemo(()=>{const{showFiles:De=!0,showFolders:Ne=!0,...Ve}=w||{};return{showFiles:De,showFolders:Ne,...Ve}},[w]),li=ai.showFiles,ci=ai.showFolders,[Jo,en]=g.useState(),Gl=x?.destinationFolderPath??Jo,tn=g.useCallback(De=>{x?.setDestinationFolderPath?x.setDestinationFolderPath(De):en(De)},[x]),{areHiddenFilesVisible:Ts,toggleHiddenFilesVisibility:xr}=f7({showHiddenFiles:u,onShowHiddenFilesChange:h}),{isTreeCollapsed:Rr,toggleTreeCollapse:Fr,setIsTreeCollapsed:sn}=m7({collapsed:p?.collapsed,onCollapseChange:p?.onCollapseChange}),{renamedPath:Bl,renamedItem:on,renameHandler:Vl,renameSaveHandler:zl,renameCancelHandler:Wl,renameValidateHandler:_l,getDisplayName:jl}=D7({items:o,onRenameValidate:q,validationMessages:H,onMoveToFiles:T}),{isSearchMode:di,searchValue:Er,effectiveSearchValue:nn,setSearchValue:Ul,handleSearchChange:ui,handleSearchClear:yt,searchResultsRows:Dr}=L7({onSearchFiles:he,clearSearchResults:Fe,currentPath:st,searchResults:se,searchInProgress:le,navigationPanelValue:C?.value,onNavigationPanelSearchChange:C?.onSearchChange,allItems:o,activeTab:b?.activeTab}),rt=g.useMemo(()=>nd(o,st)??o[0],[o,st]),{handleCopyTo:Pr,handleMoveTo:Tr,handleDuplicate:Mr,handleOpenDestinationFolderPopup:Ir,handleCloseDestinationFolderPopup:rn,openDestinationFolderPopup:an,handleSetCopiedFiles:ln,handleSetMovedFiles:$l,destinationFolderMode:kr,destinationFolderTitle:hi,conflictingFiles:ql,conflictResolutionOpen:Kl,closeConflictResolution:Yl,handleConflictReplace:Xl,handleConflictDuplicate:Zl,handleConflictCancel:Ar,handleConflictDecideForEach:Lr,sourceFolder:Or}=C7({getDestinationFiles:De=>nd(o,De)?.items??[],onCopyFiles:P,onMoveToFiles:T,onCopySuccess:Ps,onMoveSuccess:Ps,onDuplicateSuccess:Ps,getCopyHeader:x?.getCopyHeader,getMoveHeader:x?.getMoveHeader});g.useEffect(()=>{an||tn(void 0)},[an,tn]);const{deleteConfirmationOpen:cn,itemsToDelete:Ks,openDeleteConfirmation:Ql,closeDeleteConfirmation:xt,confirmDelete:Jl}=w7({onDeleteFiles:I,onDeleteSuccess:Ps}),{handleDownloadFiles:gi}=b7({onDownloadFiles:N,customDownloadItemsAction:Qo,onDownloadSuccess:Ps}),{isDragging:dn,isDraggingOverWindow:vo,uploadError:Nr,handleDragEnter:Hr,handleDragLeave:Gr,handleDragOver:Br,handleDrop:pi,clearError:ec,openFileDialog:Vr,fileInputRef:zr,openArchiveDialog:un,uploadConflictingFiles:tc,uploadConflictResolutionOpen:sc,closeUploadConflictResolution:fi,handleUploadConflictReplace:Wr,handleUploadConflictDuplicate:_r,handleUploadConflictCancel:jr,handleUploadConflictDecideForEach:Ur}=y7({onUploadFiles:Ll,onValidateUpload:B,maxFileSize:re,onUploadArchive:Ol,allowedFileTypes:Oe,validationMessages:W,uploadEnabled:U,currentFolder:rt}),$r=g.useCallback(De=>{yt();const Ne=st??"",Ve=rt?.items??[];pi(De,Ne,Ve)},[st,rt,pi,yt]),qr=g.useCallback(()=>{yt();const De=st??"",Ne=rt?.items??[];Vr(De,Ne)},[st,rt,Vr,yt]),X=g.useCallback(()=>{yt();const De=st??"",Ne=rt?.items??[];un(De,Ne)},[st,rt,un,yt]),Ue=g.useCallback(()=>{yt(),mo?.(st,rt)},[mo,st,rt,yt]),Ze=g.useCallback(()=>{yt(),ri?.(st,rt)},[ri,st,rt,yt]),$t=g.useCallback(De=>{Zo?.(De)},[Zo]),{isCreatingFolder:gs,newFolderTempId:hn,startFolderCreation:Sh,cancelFolderCreation:Fw,saveFolderCreation:Ew,validateFolderName:Dw}=M7({currentFolder:rt,onCreateFolder:Al,onValidateFolderName:_,validationMessages:pe}),yh=g.useCallback(()=>{yt(),Sh()},[yt,Sh]),{newActions:Pw,isNewButtonVisible:Tw,isNewButtonDisabled:Mw}=P7({newActions:b?.newActions,currentFolder:rt,onUploadFiles:mo?Ue:qr,onUploadArchive:X,onCreateFolder:yh,onCreateNewItem:Ze,isNewButtonDisabled:b?.isNewButtonDisabled}),Iw=g.useMemo(()=>{if(di){let Ie=Dr;li||(Ie=Ie.filter($e=>$e.nodeType!==ye.ITEM)),ci||(Ie=Ie.filter($e=>$e.nodeType!==ye.FOLDER)),Ts||(Ie=Ie.filter($e=>!$e.path.split("/").filter(Boolean).some(Ci=>Ci.startsWith("."))));const mi=Ie.map($e=>({...$e,id:$e.id??$e.path,name:$e.name??$e.path.split("/").pop()??"",updatedAt:$e.updatedAt,size:$e.contentLength,contentLength:$e.contentLength,author:$e.author,path:$e.path,nodeType:$e.nodeType,extension:$e.extension,isTemporary:!1,owner:$e.owner,folderId:$e.folderId}));return gs&&hn&&mi.unshift({id:hn,name:"",updatedAt:void 0,author:void 0,path:st??"/",nodeType:ye.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),mi}const De=Vn(nn).trim(),Ne=rt?.items??[];let Ve=De?u7(rt):Ne;li||(Ve=Ve.filter(Ie=>Ie.nodeType!==ye.ITEM)),ci||(Ve=Ve.filter(Ie=>Ie.nodeType!==ye.FOLDER)),Ts||(Ve=Ve.filter(Ie=>De?!Ie.path.split("/").filter(Boolean).some($e=>$e.startsWith(".")):!lw(Ie)));const is=Ve.map(Ie=>({...Ie,id:Ie.id??Ie.path,name:Ie.name??Ie.path.split("/").pop()??"",updatedAt:Ie.updatedAt,size:Ie.contentLength,author:Ie.author,path:Ie.path,nodeType:Ie.nodeType,extension:Ie.extension,isTemporary:!1,owner:Ie.owner,contentType:Ie.contentType,contentLength:Ie.contentLength,folderId:Ie.folderId}));if(gs&&hn&&!De&&is.unshift({id:hn,name:"",updatedAt:void 0,author:void 0,path:st??"/",nodeType:ye.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),!De)return is;const oc=De.split(/\s+/).filter(Boolean);return is.filter(Ie=>{if(Ie.isTemporary)return!0;const mi=Vn(Ie.name),$e=Vn(Ie.author),Fh=d7(Ie.extension);return oc.every(Ci=>mi.includes(Ci)||$e.includes(Ci)||Fh.includes(Ci))})},[di,Dr,rt,nn,Ts,gs,hn,li,ci,st]);g.useEffect(()=>{const De=qs.current;if(!De)return;if((st??"")!==De.destinationFolder){qs.current=null;return}const Ne=nd(o,De.destinationFolder);if(!Ne?.items)return;const Ve=new Set;for(const is of Ne.items)De.fileNames.has(is.name)&&Ve.add(is.path);Ve.size>0&&(Co(Ve),qs.current=null)},[o,st,Co]);const kw=g.useCallback(De=>{vt(De.path)},[vt]),Aw=g.useCallback(De=>{vt(De)},[vt]),Lw=g.useCallback(De=>{De.nodeType===ye.FOLDER?vt(De.path):R?.(De)},[vt,R]),{expandedPaths:xh,setExpandedPaths:Ow,collapseAll:Nw}=gw({expandedPaths:p?.expandedPaths,onExpandedPathsChange:p?.onExpandedPathsChange}),{additionalButtons:Hw}=I7({collapseAll:Nw,expandedPathsLength:xh.size,additionalButtons:p?.additionalButtons}),{isMetadataPopupOpen:Gw,selectedFileForMetadata:Bw,openMetadataPopup:Vw,closeMetadataPopup:Rh}=k7({onGetInfo:Z}),zw=g.useCallback(()=>{Rh(),oe?.clearMetadata?.()},[Rh,oe]),Ww=g.useMemo(()=>{if(A)return Pl(A)},[A]),_w={managerLabel:e,className:s,items:o,allowedFileTypes:Oe,maxSelectableFileSize:ve,rootItem:n,filesLoading:a,treeOptions:{...p,expandedPaths:xh,onExpandedPathsChange:Ow,additionalButtons:Hw},showNavigationPanel:m,navigationPanelOptions:C,gridOptions:ai,toolbarOptions:b,bulkActionsToolbarOptions:S,deleteConfirmationOptions:v,destinationFolderPopupOptions:{...x,destinationFolderPath:Gl,setDestinationFolderPath:tn,header:hi,onCreateFolder:Q,onCreateFolderValidate:_,folderCreationValidationMessages:pe,sourceFolder:Or},currentPath:st,setCurrentPath:Hl,searchValue:Er,effectiveSearchValue:nn,setSearchValue:Ul,areHiddenFilesVisible:Ts,toggleHiddenFilesVisibility:xr,isTreeCollapsed:Rr,toggleTreeCollapse:Fr,setIsTreeCollapsed:sn,selectedPaths:Ds,selectedFiles:Nl,setSelectedPaths:Co,clearSelection:Ps,currentFolder:rt,gridRows:Iw,handleCopyTo:Pr,handleMoveTo:Tr,handleDuplicate:Zo?$t:Mr,handleSetCopiedFiles:ln,handleSetMovedFiles:$l,openDestinationFolderPopup:an,handleCloseDestinationFolderPopup:rn,handleOpenDestinationFolderPopup:Ir,destinationFolderMode:kr,handleAddSibling:L,handleAddChild:V,handleDownloadFiles:gi,renamedPath:Bl,renamedItem:on,forbiddenSymbolsRegExp:Ww,forbiddenSymbolsTooltip:de,onRename:Vl,onRenameSave:zl,onRenameCancel:Wl,onRenameValidate:_l,getDisplayName:jl,openDeleteConfirmation:wr||Ql,closeDeleteConfirmation:xt,confirmDelete:Jl,deleteConfirmationOpen:cn,itemsToDelete:Ks,handlePathChange:vt,handleTreeItemClick:kw,handleBreadcrumbItemClick:Aw,handleSearchChange:ui,handleTableRowClick:Lw,onTableFileClick:R,handleSelectionClick:E,onGridApiChange:D,isDragging:dn,uploadError:Nr,handleDragEnter:Hr,handleDragLeave:Gr,handleDragOver:Br,handleDrop:$r,clearUploadError:ec,onUploadFiles:M,onValidateUpload:B,maxFileSize:re,isDraggingOverWindow:vo,openFileDialog:qr,fileInputRef:zr,newActions:Pw,isNewButtonVisible:Tw,isNewButtonDisabled:Mw,isCreatingFolder:gs,newFolderTempId:hn,startFolderCreation:yh,cancelFolderCreation:Fw,saveFolderCreation:Ew,validateFolderName:Dw,conflictResolutionPopupOptions:y,conflictingFiles:ql,conflictResolutionOpen:Kl,closeConflictResolution:Yl,handleConflictReplace:Xl,handleConflictDuplicate:Zl,handleConflictCancel:Ar,handleConflictDecideForEach:Lr,uploadConflictingFiles:tc,uploadConflictResolutionOpen:sc,closeUploadConflictResolution:fi,handleUploadConflictReplace:Wr,handleUploadConflictDuplicate:_r,handleUploadConflictCancel:jr,handleUploadConflictDecideForEach:Ur,fileMetadataPopupOptions:oe,isMetadataPopupOpen:Gw,selectedFileForMetadata:Bw,openMetadataPopup:Vw,closeMetadataPopup:zw,onGetInfo:Z,onUnshareFiles:j,onRemoveFilesAccess:ae,actionsRef:G,sharedByMePaths:fe,onSearchFiles:he,searchInProgress:le,searchResults:se,clearSearchResults:Fe,isSearchMode:di,emptyStateIcon:Ae,emptyStateTitle:Mt,emptyStateDescription:os,gridClassName:Sr,sharedWithMeIds:It,onFolderPopupPathChange:Ge,onManagePermissions:K,onPreview:He,onOpenInNewTab:ns,previewExtensions:ii,isRenameFileAvailable:Tl,isDuplicateFolderAvailable:Ml,customUploadFileAction:mo,customBreakpointRef:br,nonClickableTableColumns:yr,hideSearchPathItemName:Il,getDisabledTooltip:Ee,fileTooLargeTooltip:_e,unsupportedFileTypeTooltip:je,showHiddenFileSwitcherInDestinationPopup:kl};return f.jsx(uw.Provider,{value:_w,children:t})},G7=({disabledGridRowIds:e,gridRows:t,getDisabledTooltip:s,getRowDisabledTooltip:o,allowedFileTypes:n,maxSelectableFileSize:i})=>{const[r,a]=g.useState(null),[l,c]=g.useState(null);g.useEffect(()=>{const h=()=>{a(null),c(null)};return window.addEventListener("scroll",h,!0),()=>window.removeEventListener("scroll",h,!0)},[]),g.useEffect(()=>{const h=C=>{const w=C.target.closest(".ag-row");if(!w){a(S=>S&&null);return}const b=new DOMParser().parseFromString(w.getAttribute("row-id")||"","text/html").documentElement.textContent;b&&e.has(b)?a(S=>S!==b?(c(w.getBoundingClientRect()),b):S):a(S=>S&&null)},p=()=>{a(null),c(null)},m=document.querySelector('[aria-label="File Manager Grid View"]');if(m)return m.addEventListener("mousemove",h),m.addEventListener("mouseleave",p),()=>{m.removeEventListener("mousemove",h),m.removeEventListener("mouseleave",p)}},[e]);const d=g.useMemo(()=>{if(r)return t.find(h=>h.path===r)},[r,t]),u=g.useMemo(()=>{if(d)return s&&d.folderId?s(d):o(d,n,i)},[d,s,o,n,i]);return f.jsx(f.Fragment,{children:u&&l&&Yn.createPortal(f.jsxs(eu,{open:!0,placement:"top",children:[f.jsx(su,{asChild:!0,children:f.jsx("div",{className:ge("fixed z-[-1]",u&&"pointer-events-none"),style:{top:l.top,left:l.left,width:l.width,height:l.height}})}),f.jsx(tu,{className:"max-w-[300px] rounded border border-ui-outline-primary bg-ui-popover px-3 py-1.5 text-center text-primary shadow-md fill-ui-popover",children:u})]}),document.body)})},wh=()=>{const[e,t]=g.useState(Ep());return g.useEffect(()=>{const s=()=>t(Ep());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},Cw=({onClose:e,onConfirm:t,onFolderPopupPathChange:s,setDestinationFolderPath:o,open:n,copyLabel:i="Copy",moveLabel:r="Move",addFolderLabel:a="Add folder",mode:l=ct.Copy,hiddenFilesSwitcherLabel:c="Show hidden files",showHiddenFileSwitcher:d=!0,onUploadFiles:u,onValidateUpload:h,maxFileSize:p,header:m,sourceFolder:C,disabledPathTooltip:v="Unavailable for the original path. Please select another folder",path:w,collapsedFileTree:b=!1,alertProps:S,...x})=>{const[y,F]=g.useState(!1),[R,E]=g.useState(!1),D=g.useRef(null),P=wh(),T=g.useCallback(V=>{F(V)},[]),I=g.useMemo(()=>{const V=[{key:"add-folder",label:a,icon:f.jsx(z.IconFolderPlus,{...J,className:"text-secondary"}),onClick:()=>{D.current?.createFolder(),E(!1)}}];return d&&V.push({key:"show-hidden-files",label:c,icon:f.jsx(z.IconEye,{...J,className:"text-secondary"}),onClick:()=>{F(H=>!H),E(!1)}}),V},[a,c,d]),N=g.useCallback(V=>{V&&(s?.(V),o?.(V))},[s,o]),q=l===ct.Copy?"Copy to":"Move to",L=g.useMemo(()=>!w||!C?!1:C===w,[w,C]);return f.jsx(Yo,{open:n,onClose:()=>{e()},size:_t.Lg,dividerFooter:!0,dividers:!1,className:"md:!h-[800px] !bg-layer-2",footer:f.jsxs("div",{className:"flex justify-between items-center gap-2 py-4 px-4 md:px-6",children:[f.jsx("div",{className:"flex items-center gap-4 min-w-0",children:P?f.jsx(Tt,{menu:{items:I},open:R,onOpenChange:E,children:f.jsx(ss,{className:"h-9 w-9 shrink-0","aria-label":"More options",iconBefore:f.jsx(z.IconDotsVertical,{...J,className:"text-secondary"})})}):f.jsxs(f.Fragment,{children:[f.jsx(xs,{label:a,appearance:Me.Ghost,iconBefore:f.jsx(z.IconFolderPlus,{...J}),onClick:()=>{D.current?.createFolder()}}),d&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"w-px h-[26px] bg-controls-disable-accent my-2"}),f.jsx("div",{className:"inline-flex items-center cursor-pointer",children:f.jsx(dh,{label:c,isOn:y,onChange:T,switchId:"hidden-files-switch"})})]})]})}),f.jsxs("div",{className:"flex space-x-4 items-center",children:[f.jsx(Fs,{onClick:e,label:"Cancel"}),L?f.jsx(At,{tooltip:v,children:f.jsx(xs,{onClick:t,label:l==="copy"?i:r,disabled:L,"aria-disabled":L})}):f.jsx(xs,{onClick:t,label:l==="copy"?i:r})]})]}),header:m??q,children:f.jsxs("div",{className:"bg-layer-2 h-full flex flex-col",children:[S&&f.jsx("div",{className:"px-4 pt-4",children:f.jsx(Qp,{...S})}),f.jsx("div",{className:"flex-1 min-h-0",children:f.jsx(Rw,{...x,gridClassName:"size-full",className:ie(x.className,"bg-layer-2 h-full flex pt-0"),actionsRef:D,path:w,showHiddenFiles:y,onShowHiddenFilesChange:T,treeOptions:{...x.treeOptions,collapsed:b,expandedPaths:new Set([x.rootItem?.path||"/"]),header:x.treeOptions?.header},gridOptions:{...x.gridOptions,selectionMode:void 0},navigationPanelOptions:{elementId:"file-manager-destination-search",...x.navigationPanelOptions},onUploadFiles:u,onValidateUpload:h,onPathChange:N,maxFileSize:p})})]})})},B7=12,V7=8;var Eo=(e=>(e.Normal="normal",e.Reverse="reverse",e))(Eo||{});function z7({actions:e,direction:t=Eo.Normal,moreButtonWidth:s=Ht,actionsGap:o=8,containerPadding:n=8,dependencies:i=[]}){const r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(null),d=g.useRef([]),[u,h]=g.useState(e.length);g.useLayoutEffect(()=>{if(!a.current)return;const C=Array.from(a.current.children);d.current=C.map(v=>Math.ceil(v.getBoundingClientRect().width))},[e,...i]),g.useEffect(()=>{if(!r.current)return;let C=null;const v=()=>{C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const b=r.current,S=l.current?.offsetWidth??0,x=c.current?.offsetWidth??0,y=S+x,R=b.getBoundingClientRect().width-y-s-o*2-n*2,E=d.current;let D=0,P=0;if(t===Eo.Reverse)for(let T=E.length-1;T>=0&&(D+=E[T]+o,!(D>R));T--)P++;else for(const T of E){if(D+=T+o,D>R)break;P++}h(P)})},w=new ResizeObserver(v);return w.observe(r.current),v(),()=>{C&&cancelAnimationFrame(C),w.disconnect()}},[e.length,t,...i]);const p=t===Eo.Reverse?e.slice(0,e.length-u):e.slice(u);return{visibleActions:t===Eo.Reverse?e.slice(e.length-u):e.slice(0,u),hiddenActions:p,refs:{containerRef:r,measureRef:a,leftSectionRef:l,rightSectionRef:c}}}const W7=({getSelectionLabel:e,onClearSelection:t,actions:s,selectedCount:o})=>{const n=wh(),{refs:{containerRef:i,leftSectionRef:r,measureRef:a},visibleActions:l,hiddenActions:c}=z7({actions:s,direction:Eo.Reverse,dependencies:[n],actionsGap:B7,containerPadding:V7}),d=e(o);return f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:a,className:"absolute top-0 left-0 invisible pointer-events-none overflow-hidden whitespace-nowrap flex gap-3",children:s.map(({key:u,icon:h,title:p})=>f.jsx(Fs,{iconBefore:h,label:p,hideTitleOnMobile:!0},u))}),f.jsxs("div",{ref:i,className:"rounded bg-layer-0 p-2 flex justify-between items-center w-full",role:"toolbar","aria-label":"File bulk actions",children:[f.jsx("div",{ref:r,children:f.jsx(xs,{label:d,onClick:t,textClassName:"text-accent-primary whitespace-nowrap",appearance:Me.Ghost,iconBefore:f.jsx(z.IconX,{...J,className:"text-accent-primary"})})}),f.jsxs("div",{className:"flex flex-1 w-full gap-3 items-center justify-end",children:[c.length>0&&f.jsx(Tt,{menu:{items:c},allowedPlacements:["bottom","bottom-start"],children:f.jsx(ss,{className:"h-[38px]",iconBefore:f.jsx(z.IconDotsVertical,{...J,className:"text-secondary hover:text-accent-primary"})})}),l.map(({key:u,icon:h,tooltip:p,title:m,onClick:C,disabled:v})=>f.jsx(Fs,{className:"!p-[9px]",iconBefore:h,label:m,hideTitleOnMobile:!0,disabled:v,tooltipProps:{tooltip:p},onClick:w=>C?.({key:u,domEvent:w})},u))]})]})]})},_7=({open:e,itemsToDelete:t,onClose:s,onConfirm:o,cancelLabel:n="Cancel",confirmLabel:i="Delete",titleRenderer:r,contentRenderer:a})=>{const l=t.map(p=>p.name),d=r?.(l)||"Confirm Deleting Items",u=f.jsxs("div",{className:"px-6 py-3 dial-small-text",children:[f.jsx("p",{className:"text-secondary mb-3",children:t.length===1?f.jsxs(f.Fragment,{children:["Do you want to delete file or folder"," ",f.jsxs("span",{className:"text-primary break-all",children:['"',t[0].name,'"']}),"?"]}):f.jsxs(f.Fragment,{children:["Do you want to delete the following"," ",f.jsx("span",{className:"text-primary",children:t.length})," items?"]})}),t.length>1&&f.jsx(f.Fragment,{children:t.length<=10?f.jsx("ul",{className:"space-y-1 text-primary list-none",children:t.map(p=>f.jsx("li",{className:"truncate",children:p.name},p.path))}):f.jsxs(f.Fragment,{children:[f.jsx("ul",{className:"space-y-1 text-primary list-none mb-2",children:t.slice(0,10).map(p=>f.jsx("li",{className:"truncate",children:p.name},p.path))}),f.jsxs("p",{className:"text-secondary italic",children:["... and ",t.length-10," more"]})]})})]}),h=a?.(l)||u;return f.jsx(Uv,{open:e,header:d,confirmLabel:i,cancelLabel:n,variant:Kn.Danger,onClose:s,onConfirm:o,children:h})},Gp=e=>e.split("/").map(t=>t.trim()).filter(Boolean),j7="w-full flex items-center justify-between gap-4",U7="min-w-0 h-[38px] flex-1 overflow-hidden bg-layer-3 px-3 flex items-center rounded",$7="w-[260px]",q7=({ariaLabel:e="Breadcrumb",labelClassName:t,onItemClick:s,path:o,makeHref:n,rootItemPath:i,rootItemLabel:r,breadcrumbsHiddenPathPart:a,className:l,breadcrumbClassName:c,searchable:d=!0,value:u,elementId:h="file-manager-search",disabled:p,invalid:m,onSearchChange:C,searchClassName:v,searchContainerClassName:w,isCompactView:b=!1})=>{const S=g.useMemo(()=>{if(!o)return;let D=Gp(o);const P=[...D];let T=0;if(a){const N=Gp(a);if(N.length){const q=D.findIndex((L,V)=>N.every((H,A)=>D[V+A]===H));q!==-1&&(T=N.length,D=[...D.slice(0,q),...D.slice(q+N.length)])}}if(!D.length)return[{label:"/"}];const I=D.map((N,q)=>{const L=q<D.length-T?q:q+T,V=P.slice(0,L+1),H=typeof n=="function"?n(V,L):void 0;return{label:N,href:H,onClick:s?A=>{A.preventDefault(),s(H)}:void 0}});if(i&&r){const N=i.split("/").filter(Boolean),q=o.split("/").filter(Boolean);if(N.every((V,H)=>q[H]===V)&&I.length>0){const V=I.slice(N.length);return[{label:r,href:i,onClick:s?H=>{H.preventDefault(),s(i)}:void 0},...V]}}return I},[o,a,i,r,n,s]),[x,y]=g.useState(!1),F=g.useCallback(()=>{if(b&&!x){y(!0);const D=document.getElementById(h);D&&D.focus()}},[h,x,b]),R=g.useCallback(()=>{(!u||String(u).trim()==="")&&C?.("")},[u,C]),E=g.useCallback(()=>b&&x?f.jsx(Fs,{className:"!p-[9px]",iconBefore:f.jsx(z.IconArrowLeft,{...J}),onClick:()=>{y(!1),C?.("")}}):f.jsx("div",{className:U7,children:f.jsx(Vv,{pathItems:S,ariaLabel:e,labelClassName:t,className:c})}),[e,c,S,x,b,t,C]);return f.jsxs("div",{className:ie(j7,{"gap-3":b},l),"aria-label":"navigation-panel",children:[E(),d&&f.jsx("div",{className:ie($7,{"w-[40px]":b&&!x,"w-full":b&&x}),role:"search","aria-label":"Search",onClick:F,children:f.jsx(uh,{id:h,value:u??"",onChange:C,disabled:p,onBlur:R,invalid:m,className:v,wrapperClassName:b&&!x?"pl-2.5":"",containerClassName:w})})]})},K7=({tabs:e,activeTab:t,onTabChange:s,areHiddenFilesVisible:o,onToggleHiddenFiles:n,isNewButtonVisible:i,isNewButtonDisabled:r,newButtonVariant:a=ze.Primary,newButtonDropdownItems:l=[],newButtonLabel:c="New",hiddenFilesSwitcherLabel:d="Hidden files",showHiddenFilesLabel:u="Show hidden files",hideHiddenFilesLabel:h="Hide hidden files",showHiddenFilesToggle:p=!0,disabledNewButtonTooltip:m})=>{const C=wh(),v=g.useMemo(()=>[{key:"hidden-files-switch",label:o?h:u,icon:o?f.jsx(z.IconEyeOff,{...J,className:"text-secondary"}):f.jsx(z.IconEye,{...J,className:"text-secondary"}),onClick:()=>n?.(!o)}],[o,h,u,n]),w=()=>e&&t&&s?f.jsx(Nv,{tabs:e,activeTab:t,onClick:x=>s(x),screenThreshold:il.Tablet,smallScreenContainerClassName:"w-fit bg-transparent h-[38px] overflow-hidden",smallScreenDropdownItemClassName:"px-3 h-[38px]"}):null,b=()=>f.jsxs(f.Fragment,{children:[p&&f.jsxs(f.Fragment,{children:[f.jsx(dh,{switchId:"hidden-files-switch",label:d,isOn:o,onChange:n}),f.jsx("div",{className:"h-6 border-l border-primary"})]}),i&&f.jsx(At,{tooltip:r&&m?m:void 0,children:f.jsx(Qd,{label:c,variant:a,items:l,disabled:r})})]}),S=()=>f.jsxs(f.Fragment,{children:[f.jsx(Tt,{menu:{items:v},allowedPlacements:["bottom","bottom-start"],children:f.jsx(ss,{className:"h-[38px]",iconBefore:f.jsx(z.IconDotsVertical,{...J,className:"text-secondary hover:text-accent-primary"})})}),i?f.jsx(At,{tooltip:r&&m?m:void 0,children:f.jsx(Qd,{label:c,variant:a,items:l,disabled:r})}):null]});return f.jsxs("div",{className:"flex w-full justify-between gap-4 items-center overflow-x-auto",children:[f.jsx("div",{className:"flex-1 min-w-0",children:w()}),f.jsx("div",{className:"flex gap-4 flex-shrink-0 items-center",children:C?S():b()})]})},Y7=100,Di=16,fs="text-secondary",pa="text-primary min-w-0",X7="text-primary break-words min-w-0",Pi="bg-layer-2",Z7=({open:e,onClose:t,fileMetadata:s,loading:o=!1,header:n="Information",nameLabel:i="Name:",pathLabel:r="Path:",modifiedDateLabel:a="Modified Date:",sizeLabel:l="Size:",authorLabel:c="Author:",dateLocale:d="en-US",dateOptions:u})=>f.jsx(Yo,{open:e,onClose:t,size:_t.Sm,header:n,dividers:!1,children:f.jsx("div",{className:"px-6 py-4",children:f.jsx("div",{className:"grid gap-x-4 gap-y-4 items-center dial-small-text",style:{gridTemplateColumns:`${Y7}px 1fr`},children:o?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:fs,children:i}),f.jsx(Sn,{variant:Zt.Text,width:"100%",height:Di,className:Pi}),f.jsx("div",{className:fs,children:a}),f.jsx(Sn,{variant:Zt.Text,width:"90%",height:Di,className:Pi}),f.jsx("div",{className:fs,children:l}),f.jsx(Sn,{variant:Zt.Text,width:"60%",height:Di,className:Pi}),f.jsx("div",{className:fs,children:c}),f.jsx(Sn,{variant:Zt.Text,width:"80%",height:Di,className:Pi}),f.jsx("div",{className:fs,children:r}),f.jsx(Sn,{variant:Zt.Text,width:"70%",height:Di,className:Pi})]}):s?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:fs,children:i}),f.jsx("div",{className:pa,children:f.jsx(ft,{text:s.name})}),f.jsx("div",{className:fs,children:a}),f.jsx("div",{className:pa,children:f.jsx(ft,{text:h7(s.updatedAt,d,u)})}),f.jsx("div",{className:fs,children:l}),f.jsx("div",{className:pa,children:f.jsx(ft,{text:ar(s.contentLength)})}),f.jsx("div",{className:fs,children:c}),f.jsx("div",{className:pa,children:f.jsx(ft,{text:s.author||"—"})}),f.jsx("div",{className:fs,children:r}),f.jsx("div",{className:X7,children:decodeURIComponent(s.path)})]}):null})})}),Q7={size:10,stroke:2},J7=26;var jt=(e=>(e.File="file",e.Folder="folder",e))(jt||{});const e9=({name:e,type:t,shared:s=!1,loading:o=!1,sharedIndicatorClassName:n,sharedIndicatorTooltip:i,fileExtension:r,...a})=>{const l=c=>f.jsxs("span",{className:"inline-flex relative text-secondary",role:"img",children:[c,s&&f.jsx("span",{className:"absolute -bottom-0.5 -left-0.5",children:f.jsx($i,{className:n,sharedIndicatorTooltip:i})})]});if(o)return l(f.jsx(cr,{}));if(t===jt.File){const c=r||(e.includes(".")?e.split(".").pop():void 0);return f.jsx(uu,{...a,extension:c??"",className:"text-secondary",indicator:s?f.jsx($i,{className:n,sharedIndicatorTooltip:i}):null,label:"File type icon"})}return t===jt.Folder?l(f.jsx(Ye,{icon:f.jsx(z.IconFolder,{className:a.className,size:a.size??J.size,stroke:a.stroke??J.stroke}),className:"inline-block align-middle"})):null},t9=({name:e,type:t,elementId:s,loading:o=!1,shared:n=!1,iconClassName:i,iconIndicator:r,iconLabel:a,iconSize:l,iconStroke:c,inputInvalid:d,inputInvalidMessage:u,inputContainerClassName:h,inputIconAfter:p,inputRef:m,onChange:C,sharedIndicatorClassName:v,sharedIndicatorTooltip:w,fileExtension:b})=>{const S=()=>{const x=u?.startsWith(`${as.Warning}__`);if(!d&&!x)return null;const y=u?.replace(`${as.Warning}__`,"");return f.jsx(At,{tooltip:y,children:p||(x?f.jsx(z.IconAlertTriangleFilled,{...J,className:"text-warning-icon","aria-label":"warning"}):f.jsx(z.IconAlertCircleFilled,{...J,className:"text-error","aria-label":"alert"}))})};return f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx(e9,{name:e,type:t,label:a,className:i,indicator:r,size:l,stroke:c,loading:o,shared:n,fileExtension:b,sharedIndicatorClassName:v,sharedIndicatorTooltip:w}),f.jsx(ni,{containerClassName:ie("!h-6 py-[1px] pl-[7px] pr-[7px]",h),id:s,value:e,onChange:C,invalid:d,iconAfter:S(),inputRef:m})]})};function vw({value:e,isEditing:t,restoreOnCancel:s=!0,onValidate:o,onSave:n,onCancel:i}){const[r,a]=g.useState(e),[l,c]=g.useState(!1),[d,u]=g.useState(""),h=g.useRef(null),p=g.useCallback((b=!1,S="")=>{c(b),u(S)},[]),m=g.useCallback(b=>{if(!o)return p(),!0;const S=o(b);return S?S.startsWith(`${as.Warning}__`)?(p(!1,S),!0):(p(!0,S),!1):(p(),!0)},[o,p]),C=g.useCallback(b=>{const S=b??"";a(S),m(S)},[m]),v=g.useCallback(()=>{m(r)?n?.(r):h.current?.focus()},[m,n,r]),w=g.useCallback(()=>{s&&a(e),p(),i?.()},[e,i,s,p]);return g.useEffect(()=>{t&&(a(e),p(),requestAnimationFrame(()=>{h.current?.focus(),h.current?.select()}))},[t,e,p]),g.useEffect(()=>{const b=h.current;if(!t||!b)return;const S=x=>{x.key==="Enter"?(x.preventDefault(),h.current?.blur()):x.key==="Escape"&&(x.preventDefault(),w())};return b.addEventListener("keydown",S),()=>b.removeEventListener("keydown",S)},[t,v,w]),g.useEffect(()=>{if(!t)return;const b=h.current;if(!b)return;const S=x=>{const y=x.relatedTarget;y&&b.contains(y)||(m(r)?v():b.focus())};return b.addEventListener("blur",S),()=>{b.removeEventListener("blur",S)}},[t,r,m,v]),{inputRef:h,value:r,onChange:C,invalid:l,invalidMessage:d}}const ll=({name:e,type:t,elementId:s,editing:o=!1,loading:n=!1,shared:i=!1,iconSize:r=Ht,validate:a,onSave:l,fileExtension:c,onCancel:d,inputContainerClassName:u,sharedIndicatorClassName:h,sharedIndicatorTooltip:p,hideTooltip:m=!1,forbiddenSymbolsRegExp:C,forbiddenSymbolsTooltip:v,...w})=>{const{value:b,invalid:S,invalidMessage:x,onChange:y,inputRef:F}=vw({value:e,isEditing:o,onValidate:a,onCancel:d,onSave:l});if(!o){const R=Ch({name:e,isFolder:t===jt.Folder},C,v),E=!!R;return t===jt.Folder?f.jsx(ml,{name:e,loading:n,shared:i,iconSize:r,className:"max-w-[428px] truncate",sharedIndicatorClassName:h,hideTooltip:m,isInvalidName:E,tooltipContent:R}):f.jsx(fl,{className:"max-w-[428px]",...w,name:e,shared:i,iconSize:r,sharedIndicatorClassName:h,hideTooltip:m,isInvalidName:E,tooltipContent:R})}return f.jsx(t9,{type:t,name:b,elementId:s,inputInvalid:S,inputInvalidMessage:x,inputRef:F,onChange:y,iconSize:r,fileExtension:c,inputContainerClassName:u,sharedIndicatorTooltip:p,sharedIndicatorClassName:h})},s9=({items:e,showFiles:t=!1,expandedPaths:s,loadingPaths:o=new Set,loadedPaths:n=new Set,sharedByMePaths:i=new Set,selectedPath:r,emptyStateTitle:a="No Folders",emptyStateDescription:l,emptyStateIcon:c,areHiddenFilesVisible:d=!1,renamedPath:u,rootItemLabel:h,rootItemPath:p,onItemClick:m,getContextMenuItems:C,onRenameSave:v,onRenameCancel:w,onRenameValidate:b,onExpandedPathsChange:S,forbiddenSymbolsRegExp:x,forbiddenSymbolsTooltip:y})=>{const{expandedPaths:F,togglePath:R}=gw({expandedPaths:s??new Set,onExpandedPathsChange:S}),E=P=>{m?.(P),R(P.path)},D=(P,T)=>P.map(I=>{const{path:N,nodeType:q,name:L,items:V}=I,H=q===ye.FOLDER;if(!d&&lw(I))return null;if(!H&&!t)return;const A=Array.isArray(V)&&V.length>0&&V.some(Z=>Z.nodeType===ye.FOLDER||t),de=F.has(N),M=r===N,B=o.has(N),U=u===N,W=n.has(N),re=i.has(N),be=p&&h&&N===p&&H,Q=b&&(Z=>b(Z,I)),_=M?"bg-accent-primary-alpha border-l-2 border-l-accent-primary rounded":"border-l-2 border-l-transparent",pe=be?[]:C?.(I)??[],oe=x?Ch({name:I.name,isFolder:H},x,y):void 0;return f.jsx("div",{className:"cursor-pointer text-secondary",children:f.jsxs("div",{className:"flex flex-col w-full","aria-label":"folder",children:[f.jsx(Tt,{trigger:[Gt.ContextMenu],className:"w-full",anchorToMouse:!0,menu:{items:pe},children:f.jsxs("div",{style:{paddingLeft:`${T*J7}px`},className:ie("py-1 gap-[2px] dial-small-text flex justify-between hover:bg-accent-primary-alpha rounded group/item w-full mb-[2px] relative",_),"aria-selected":M,children:[!U&&f.jsx("div",{className:"absolute size-full left-0 top-0 z-0",onClick:()=>E(I)}),f.jsx("div",{className:"relative flex flex-row truncate items-center w-fit h-6 gap-x-1 pl-1",onClick:()=>!U&&E(I),children:f.jsxs(f.Fragment,{children:[H&&f.jsx(z.IconCaretRightFilled,{...Q7,className:ge("flex-shrink-0",de&&"rotate-90 transition-all",W&&!A&&"text-transparent")}),f.jsx(ll,{elementId:`${N}-tree-item`,name:be?h:L,type:H?jt.Folder:jt.File,loading:B,shared:re,sharedIndicatorClassName:ie("group-hover/item:bg-accent-primary-alpha",M&&"bg-accent-primary-alpha"),iconSize:no,forbiddenSymbolsRegExp:x,forbiddenSymbolsTooltip:oe,...!be&&{editing:U,onSave:v,onCancel:w,validate:Q}})]})}),pe.length>0&&!U&&!be&&f.jsx("div",{className:"flex-1 flex justify-end",children:f.jsx(Tt,{placement:"bottom-start",allowedPlacements:["top-start","top-end"],menu:{items:pe},className:"sticky right-0",children:f.jsx(Ye,{className:"invisible group-hover/item:visible text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary",icon:f.jsx(z.IconDotsVertical,{...J})})})})]})}),de&&V&&D(V,T+1)]})},`${N}-children`)});return f.jsx("div",{className:"flex-1 w-full h-full overflow-y-auto","aria-label":"folders-tree",children:e.length>0?D(e,0):f.jsx(dr,{title:a,description:l,icon:c})})},o9=({selectedFiles:e,actionLabels:t,onDuplicate:s,onCopy:o,onMove:n,onDownload:i,onUnshare:r,onRemoveAccess:a,onDelete:l,getCurrentFolderPath:c,sharedWithMeIds:d,sharedByMePaths:u,onClearSelection:h,forbiddenSymbolsRegExp:p})=>g.useMemo(()=>{const m=[],C=Array.from(e.values());if(!C.length||!t)return m;const v=Pl(p),w=v?C.some(b=>v.test(b.name)):!1;if(t[Y.Move]&&!w&&m.push({key:Y.Move,label:t[Y.Move],title:t[Y.Move],icon:f.jsx(ph,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>n(C)}),t[Y.Copy]&&!w&&m.push({key:Y.Copy,label:t[Y.Copy],title:t[Y.Copy],icon:f.jsx(gh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>o(C)}),t[Y.Duplicate]&&!w&&m.push({key:Y.Duplicate,label:t[Y.Duplicate],title:t[Y.Duplicate],icon:f.jsx(z.IconCopy,{...J,className:"text-secondary"}),onClick:()=>s(C)}),t[Y.Delete]){const b=C.some(S=>S.permissions&&!S.permissions.includes(Xo.WRITE));m.push({key:Y.Delete,label:t[Y.Delete],title:t[Y.Delete],icon:f.jsx(z.IconTrashX,{...J,className:"text-secondary"}),disabled:b,tooltip:b?"Selected items contain item which can not be deleted":void 0,onClick:()=>{const S=c();l(C,S)}})}if(t[Y.Download]&&!w&&m.push({key:Y.Download,label:t[Y.Download],title:t[Y.Download],icon:f.jsx(z.IconDownload,{...J,className:"text-secondary"}),onClick:()=>i(C)}),t[Y.Unshare]&&r){const b=C.some(S=>!d?.includes(S.path));m.push({key:Y.Unshare,label:t[Y.Unshare],title:t[Y.Unshare],disabled:b,icon:f.jsx(fh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>{r(C),h()}})}if(t[Y.RemoveAccess]&&a){const b=C.some(S=>!u?.has(S.path));m.push({key:Y.RemoveAccess,label:t[Y.RemoveAccess],title:t[Y.RemoveAccess],disabled:b,icon:f.jsx(z.IconUserX,{size:J.size,className:"text-secondary"}),onClick:()=>{a(C),h()}})}return m},[e,t,r,a,n,o,s,c,l,i,d,h,u,p]);function bh(e){if(!e)return null;if(e instanceof Date)return isFinite(e.getTime())?e:null;if(typeof e=="number"){const t=new Date(e);return isFinite(t.getTime())?t:null}if(typeof e=="string"){const t=e.trim();if(/^-?\d+$/.test(t)){const o=Number(t);return bh(o)}const s=new Date(t);return isFinite(s.getTime())?s:null}return null}const ww=({value:e,locale:t=Av,options:s=Lv,emptyPlaceholder:o,className:n,hideTooltip:i=!1})=>{const r=bh(e),a=g.useMemo(()=>r?new Intl.DateTimeFormat(t,s).format(r):o,[r,o,t,s]),l=r?r.toISOString():void 0;return f.jsx(ft,{text:l?f.jsx("time",{dateTime:l,children:a}):f.jsx("span",{children:a}),className:ge(T8,n),hideTooltip:i})},n9=({id:e,name:t,nodeType:s,size:o,updatedAt:n,dateLocale:i,dateOptions:r,shared:a,sharedIndicatorClassName:l,hideTooltip:c=!1,forbiddenSymbolsRegExp:d,forbiddenSymbolsTooltip:u})=>f.jsx("div",{className:"flex",children:f.jsx("div",{className:"flex flex-1 min-w-0",children:f.jsx(ll,{type:s===ye.FOLDER?jt.Folder:jt.File,name:t,elementId:e,shared:a,iconSize:no,sharedIndicatorClassName:l,hideTooltip:c,forbiddenSymbolsRegExp:d,forbiddenSymbolsTooltip:u,details:f.jsxs("div",{className:"flex items-center gap-1 dial-tiny-text text-secondary",children:[f.jsx("span",{children:s===ye.ITEM?ar(o):""}),n&&o&&f.jsx(z.IconCircleFilled,{size:2,className:"text-secondary"}),n?f.jsx("span",{children:f.jsx(ww,{value:n,locale:i?.toString(),options:r,className:"dial-tiny-text text-secondary",hideTooltip:c})}):null]})})})}),bw=e=>(t,s,o)=>({colId:dt.Name,field:"name",headerName:e,flex:1,minWidth:200,cellRenderer:n=>{const i=n.data.nodeType,{saveFolderCreation:r,validateFolderName:a,cancelFolderCreation:l,newFolderTempId:c,sharedByMePaths:d,selectedPaths:u,disabledRowIds:h}=n.context,p=d?.has(n.data.path),m=u?.has(n.data.path),C=h?.has(n.data.path)??!1,v=ie(["group-hover/grid-row:bg-accent-primary-alpha",m&&"bg-accent-primary-alpha"]);if(n.data?.isTemporary&&n.data.id===c)return f.jsx(ll,{name:"",type:jt.Folder,elementId:`new-folder-${n.data.id}`,editing:!0,shared:p,sharedIndicatorClassName:v,iconSize:no,validate:a,onSave:r,onCancel:l,inputContainerClassName:ie(["!h-9",o&&i===ye.ITEM&&"!h-10"])});const{renameTriggerView:w,renamedPath:b,renamedItem:S,getDisplayName:x,onRenameValidate:y,onRenameSave:F,onRenameCancel:R}=n.context;if(w===Bn.Grid&&b===n.data?.path&&S&&n.data){const P=x(S);return f.jsx(ll,{name:P,type:i===ye.FOLDER?jt.Folder:jt.File,fileExtension:S.name.split(".").pop(),elementId:`rename-${n.data.id}`,editing:!0,shared:p,sharedIndicatorClassName:v,iconSize:no,validate:T=>y(T,S),onSave:F,onCancel:R,inputContainerClassName:ie(["!h-9",o&&i===ye.ITEM&&"!h-10"]),forbiddenSymbolsRegExp:n.context.forbiddenSymbolsRegExp})}if(o)return f.jsx(n9,{id:n.data.id,name:n.data.name,nodeType:i,size:n.data.size,shared:p,sharedIndicatorClassName:v,updatedAt:n.data.updatedAt,dateLocale:t,dateOptions:s,hideTooltip:C,forbiddenSymbolsRegExp:n.context.forbiddenSymbolsRegExp,forbiddenSymbolsTooltip:n.context.forbiddenSymbolsTooltip});const D=Ch({name:n.data.name,isFolder:i===ye.FOLDER},n.context.forbiddenSymbolsRegExp,n.context.forbiddenSymbolsTooltip);return i===ye.FOLDER?f.jsx(ml,{name:n.data.name,shared:p,sharedIndicatorClassName:v,iconSize:no,hideTooltip:C,isInvalidName:!!D,tooltipContent:D}):f.jsx(fl,{name:n.data.name,shared:p,sharedIndicatorClassName:v,iconSize:no,hideTooltip:C,isInvalidName:!!D,tooltipContent:D})}}),Sw=e=>(t,s)=>({colId:dt.UpdatedAt,field:"updatedAt",headerName:e,width:168,suppressSizeToFit:!0,cellRenderer:o=>{const n=o.context?.disabledRowIds?.has(o.data?.path)??!1;return f.jsx(ww,{...o,hideTooltip:n})},cellRendererParams:{locale:t,options:s},filterValueGetter:o=>{const n=o.data[o.colDef.field||""],i=bh(n);return i?new Intl.DateTimeFormat(t||Av,s||Lv).format(i):""}}),yw=e=>({colId:dt.Size,field:"size",headerName:e,width:120,suppressSizeToFit:!0,cellRenderer:t=>t.data.nodeType===ye.ITEM?ar(t.data.contentLength):"",filterValueGetter:t=>t.data.nodeType===ye.ITEM?ar(t.data.contentLength):""}),i9=e=>{const t=e.event;if(!(t?.target??null)?.closest("input")||!t)return!1;switch(t.key){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":return!0;default:return!1}};function r9({userColumnDefs:e,filterable:t,dateLocale:s,dateOptions:o,effectiveVisibleColumns:n,isCompactView:i,hasActions:r,actionsColumnDef:a,rootItemLabel:l,rootItemPath:c}){const d=g.useMemo(()=>[bw("Name")(s,o,i),{colId:dt.Path,field:"path",headerName:"Path",flex:1,minWidth:200,cellRenderer:h=>{const p=h.context?.disabledRowIds?.has(h.data.path)??!1;let m=h.data.path;if(h.context?.hideSearchPathItemName&&(h.data.parentPath?m=h.data.parentPath:m=m.replace(/\/[^/]+\/?$/,"")||"/"),!c||!l)return f.jsx(ft,{text:m,hideTooltip:p});const C=m.replace(c,l);return f.jsx(ft,{text:C,hideTooltip:p})}},Sw("Modified Date")(s,o),yw("Size"),{colId:dt.Author,field:"author",headerName:"Author",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.author},{colId:dt.Owner,field:"owner",headerName:"Owner",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.owner}],[s,o,i,l,c]);return{columnDefs:g.useMemo(()=>{const h=e?.map(C=>typeof C=="function"?C(s,o,i):C);let p=h??d;h||(p=p.filter(C=>C.colId&&n.includes(C.colId))),r&&(i&&(p=p.slice(0,1)),p.push(a));const m=C=>C.colId===dt.Name;return p.map(C=>{const v={...C,filter:t?C.filter:!1,floatingFilter:t?C.floatingFilter:!1};return m(C)&&!C.suppressKeyboardEvent&&(v.suppressKeyboardEvent=i9),v})},[a,s,o,d,n,t,r,i,e])}}const xw=()=>{const e=g.useContext(uw);if(!e)throw new Error("useFileManagerContext must be used within <FileManagerProvider>");return e},a9=({actionLabels:e,onDuplicate:t,onCopy:s,onMove:o,onDownload:n,onRename:i,onDelete:r,onInfo:a,onUnshare:l,onRemoveAccess:c,sharedWithMeIds:d,sharedByMePaths:u,onAddSibling:h,onAddChild:p,onManagePermissions:m,onPreview:C,onOpenInNewTab:v,previewExtensions:w,isRenameFileAvailable:b=!0,isDuplicateFolderAvailable:S=!0,forbiddenSymbolsRegExp:x})=>g.useMemo(()=>y=>{const F=[];if(!e)return F;const R=Pl(x)?.test(y.name);e[Y.AddSibling]&&typeof h=="function"&&y.nodeType===ye.FOLDER&&F.push({key:"addSibling",label:e[Y.AddSibling],icon:f.jsx(aw,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>h(y)}),e[Y.AddChild]&&typeof p=="function"&&y.nodeType===ye.FOLDER&&!R&&F.push({key:"addChild",label:e[Y.AddChild],icon:f.jsx(rw,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>p(y)},{key:"divider",type:qn.Divider}),e[Y.OpenInNewTab]&&typeof v=="function"&&y.nodeType===ye.ITEM&&!R&&F.push({key:Y.OpenInNewTab,label:e[Y.OpenInNewTab],icon:f.jsx(z.IconExternalLink,{...J,className:"text-secondary"}),onClick:()=>v?.(y)});const E=y.nodeType===ye.ITEM||y.nodeType===ye.FOLDER&&S;e[Y.Duplicate]&&E&&!R&&F.push({key:Y.Duplicate,label:e[Y.Duplicate],icon:f.jsx(z.IconCopy,{...J,className:"text-secondary"}),onClick:()=>t(y)}),e[Y.Copy]&&!R&&F.push({key:Y.Copy,label:e[Y.Copy],icon:f.jsx(gh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>s(y)}),e[Y.Move]&&!R&&F.push({key:Y.Move,label:e[Y.Move],icon:f.jsx(ph,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>o(y)}),e[Y.Download]&&!R&&F.push({key:Y.Download,label:e[Y.Download],icon:f.jsx(z.IconDownload,{...J,className:"text-secondary"}),onClick:()=>n(y)}),e[Y.ManagePermissions]&&typeof m=="function"&&y.nodeType===ye.FOLDER&&!R&&F.push({key:Y.ManagePermissions,label:e[Y.ManagePermissions],icon:f.jsx(z.IconExternalLink,{...J,className:"text-secondary"}),onClick:()=>m?.(y.path)});const D=y.name.split("."),P=D.length>1?D[D.length-1]:"",T=P&&w?.includes(`.${P}`);e[Y.Preview]&&typeof C=="function"&&y.nodeType===ye.ITEM&&T&&!R&&F.push({key:Y.Preview,label:e[Y.Preview],icon:f.jsx(z.IconEye,{...J,className:"text-secondary"}),onClick:()=>C?.(y.path)});const I=!y.permissions||y.permissions.includes(Xo.WRITE);e[Y.Delete]&&I&&F.push({key:Y.Delete,label:e[Y.Delete],icon:f.jsx(z.IconTrashX,{...J,className:"text-secondary"}),onClick:()=>r(y,y.parentPath??"")});const N=y.nodeType===ye.FOLDER||y.nodeType===ye.ITEM&&b;return e[Y.Rename]&&N&&F.push({key:Y.Rename,label:e[Y.Rename],icon:f.jsx(z.IconPencilMinus,{...J,className:"text-secondary"}),onClick:()=>i(y.path)}),e[Y.Info]&&y.nodeType===ye.ITEM&&!R&&F.push({key:Y.Info,label:e[Y.Info],icon:f.jsx(z.IconInfoCircle,{...J,className:"text-secondary"}),onClick:()=>a(y)}),e[Y.Unshare]&&d?.includes(y.path)&&F.push({key:Y.Unshare,label:e[Y.Unshare],icon:f.jsx(fh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>l(y)}),e[Y.RemoveAccess]&&u?.has(y.path)&&c&&F.push({key:Y.RemoveAccess,label:e[Y.RemoveAccess],icon:f.jsx(z.IconUserX,{size:J.size,className:"text-secondary"}),onClick:()=>c(y)}),F},[e,h,p,t,s,o,n,r,i,a,l,c,d,u,m,C,v,w,b,S,x]),Rw=e=>f.jsx(mw,{...e,children:f.jsx(l9,{})}),l9=()=>{const{managerLabel:e,className:t,items:s,rootItem:o,filesLoading:n,treeOptions:i,showNavigationPanel:r,navigationPanelOptions:a,gridOptions:l,toolbarOptions:c,bulkActionsToolbarOptions:d,deleteConfirmationOptions:u,destinationFolderPopupOptions:h,conflictResolutionPopupOptions:p,compactViewWidthBreakpoint:m=i7,customBreakpointRef:C,sharedByMePaths:v,allowedFileTypes:w,maxSelectableFileSize:b,areHiddenFilesVisible:S,toggleHiddenFilesVisibility:x,isTreeCollapsed:y,toggleTreeCollapse:F,currentPath:R,gridRows:E,selectedPaths:D,selectedFiles:P,clearSelection:T,setSelectedPaths:I,effectiveSearchValue:N,handleBreadcrumbItemClick:q,handleSearchChange:L,handleTreeItemClick:V,handleTableRowClick:H,handleSelectionClick:A,onGridApiChange:de,handleOpenDestinationFolderPopup:M,handleCloseDestinationFolderPopup:B,openDestinationFolderPopup:U,destinationFolderMode:W,handleSetCopiedFiles:re,handleSetMovedFiles:be,handleDuplicate:Q,handleCopyTo:_,handleMoveTo:pe,handleAddSibling:oe,handleAddChild:Z,handleDownloadFiles:j,openDeleteConfirmation:ae,closeDeleteConfirmation:G,confirmDelete:fe,deleteConfirmationOpen:he,itemsToDelete:se,renamedPath:le,renamedItem:Fe,onRename:Oe,onRenameSave:ve,onRenameCancel:Ee,onRenameValidate:_e,forbiddenSymbolsRegExp:je,forbiddenSymbolsTooltip:Ae,getDisplayName:Mt,isDragging:os,isDraggingOverWindow:It,handleDragEnter:Ge,handleDragLeave:K,handleDragOver:He,handleDrop:ns,onUploadFiles:ii,onValidateUpload:Tl,maxFileSize:Ml,newActions:mo,isNewButtonVisible:ri,isNewButtonDisabled:Zo,newFolderTempId:wr,cancelFolderCreation:Qo,saveFolderCreation:br,validateFolderName:Sr,startFolderCreation:yr,conflictingFiles:Il,conflictResolutionOpen:kl,handleConflictReplace:$s,handleConflictDuplicate:Ds,handleConflictCancel:Ps,handleConflictDecideForEach:Co,uploadConflictingFiles:qs,uploadConflictResolutionOpen:Al,handleUploadConflictReplace:Ll,handleUploadConflictDuplicate:Ol,handleUploadConflictCancel:Nl,handleUploadConflictDecideForEach:st,openMetadataPopup:Hl,fileMetadataPopupOptions:vt,isMetadataPopupOpen:ai,selectedFileForMetadata:li,closeMetadataPopup:ci,onUnshareFiles:Jo,onRemoveFilesAccess:en,actionsRef:Gl,searchInProgress:tn,isSearchMode:Ts,emptyStateIcon:xr,emptyStateTitle:Rr="You don't have any files",emptyStateDescription:Fr="Upload or drag and drop files",sharedWithMeIds:sn,onFolderPopupPathChange:Bl,onManagePermissions:on,onPreview:Vl,onOpenInNewTab:zl,previewExtensions:Wl,isRenameFileAvailable:_l,isDuplicateFolderAvailable:jl,getDisabledTooltip:di,fileTooLargeTooltip:Er,unsupportedFileTypeTooltip:nn,gridClassName:Ul,nonClickableTableColumns:ui,hideSearchPathItemName:yt,showHiddenFileSwitcherInDestinationPopup:Dr}=xw(),{width:rt=JL,header:Pr=e7,containerClassName:Tr=XL,additionalButtons:Mr,...Ir}=i??{},[rn,an]=g.useState(rt),{renameTriggerView:ln,onGridRename:$l,onTreeRename:kr}=l7({onRename:Oe}),hi=g.useRef(null),ql=X=>{hi.current===null&&(hi.current=requestAnimationFrame(()=>{an(X),hi.current=null}))},{columnDefs:Kl,filterable:Yl=!0,dateLocale:Xl,dateOptions:Zl,selectionMode:Ar,wrapCustomCellRenderers:Lr,visibleColumns:Or=r7,allowDisabledContextMenu:cn=!1,...Ks}=l??{},{containerRef:Ql,isBelowBreakpoint:xt}=c7(m,C),Jl=g.useMemo(()=>Ts?[dt.Name,dt.Path,dt.Actions]:Or,[Ts,Or]),gi=g.useCallback((X,Ue,Ze)=>p7(X,Ue,Ze,nn,Er),[Er,nn]),dn=g.useCallback((X,Ue,Ze)=>!!gi(X,Ue,Ze),[gi]),vo=g.useMemo(()=>{const X=new Set;for(const Ue of E)dn(Ue,w,b)&&X.add(Ue.path);return X},[w,b,E,dn]),Nr=g.useCallback(X=>{const Ue=[],Ze=[],$t=!X.parentPath,gs=je?.test(X.name);return i?.actionLabels&&(i.actionLabels[Y.AddSibling]&&typeof oe=="function"&&X.nodeType===ye.FOLDER&&!$t&&Ue.push({key:"addSibling",label:i.actionLabels[Y.AddSibling],icon:f.jsx(aw,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>oe([X])}),i.actionLabels[Y.AddChild]&&typeof Z=="function"&&X.nodeType===ye.FOLDER&&!gs&&Ue.push({key:"addChild",label:i.actionLabels[Y.AddChild],icon:f.jsx(rw,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>Z([X])}),i.actionLabels[Y.Duplicate]&&!$t&&!gs&&Ze.push({key:"duplicate",label:i.actionLabels[Y.Duplicate],icon:f.jsx(z.IconCopy,{...J,className:"text-secondary"}),onClick:()=>Q([X])}),i.actionLabels[Y.Copy]&&!$t&&!gs&&Ze.push({key:ct.Copy,label:i.actionLabels[Y.Copy],icon:f.jsx(gh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>{re([X]),M(ct.Copy)}}),i.actionLabels[Y.Move]&&!$t&&!gs&&Ze.push({key:ct.Move,label:i.actionLabels[Y.Move],icon:f.jsx(ph,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>{be([X]),M(ct.Move)}}),i.actionLabels[Y.Download]&&!$t&&!gs&&Ze.push({key:"download",label:i.actionLabels[Y.Download],icon:f.jsx(z.IconDownload,{...J,className:"text-secondary"}),onClick:()=>j([X])}),i.actionLabels[Y.Rename]&&!$t&&Ze.push({key:"rename",label:i.actionLabels[Y.Rename],icon:f.jsx(z.IconPencilMinus,{...J,className:"text-secondary"}),onClick:()=>kr(X.path)}),i.actionLabels[Y.Unshare]&&sn?.includes(X.path)&&!$t&&Ze.push({key:"unshare",label:i.actionLabels[Y.Unshare],icon:f.jsx(fh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>Jo?.([X])}),i.actionLabels[Y.RemoveAccess]&&v?.has(X.path)&&!$t&&Ze.push({key:Y.RemoveAccess,label:i.actionLabels[Y.RemoveAccess],icon:f.jsx(z.IconUserX,{size:J.size,className:"text-secondary"}),onClick:()=>en?.([X])}),i.actionLabels[Y.ManagePermissions]&&typeof on=="function"&&X.nodeType===ye.FOLDER&&!$t&&Ze.push({key:Y.ManagePermissions,label:i.actionLabels[Y.ManagePermissions],icon:f.jsx(z.IconExternalLink,{...J,className:"text-secondary"}),onClick:()=>on?.(X.path)}),i.actionLabels[Y.Delete]&&X.permissions?.includes(Xo.WRITE)&&!$t&&Ze.push({key:"delete",label:i.actionLabels[Y.Delete],icon:f.jsx(z.IconTrashX,{...J,className:"text-secondary"}),onClick:()=>ae([X],X.parentPath??"")})),Ue.length?Ze.length===0?Ue:Ue.length===0?Ze:[...Ue,{key:"divider",type:qn.Divider},...Ze]:Ze},[i?.actionLabels,oe,je,Z,on,Q,re,M,be,j,kr,Jo,en,sn,v,ae]),Hr=g.useMemo(()=>{const X=new Set;return P.forEach((Ue,Ze)=>X.add(Ze)),X},[P]),Gr=g.useCallback((X,Ue)=>{I(X),A?.(Ue)},[A,I]),Br=o9({selectedFiles:P,actionLabels:d?.actionLabels,onDuplicate:Q,onCopy:X=>{re(X),M(ct.Copy)},onMove:X=>{be(X),M(ct.Move)},onDownload:j,onDelete:ae,onUnshare:Jo,onRemoveAccess:en,getCurrentFolderPath:()=>R??"/",sharedWithMeIds:sn,sharedByMePaths:v,onClearSelection:T,forbiddenSymbolsRegExp:je}),pi=g.useCallback(X=>{c?.onTabChange?.(X),Qo()},[c,Qo]),ec=g.useCallback(()=>c&&D.size===0?f.jsxs("div",{className:Ap,role:"toolbar","aria-label":"File Manager Toolbar",children:[e,f.jsx(K7,{...c,onTabChange:pi,areHiddenFilesVisible:S,onToggleHiddenFiles:x,isNewButtonVisible:ri,isNewButtonDisabled:Zo,newButtonDropdownItems:mo})]}):D.size>0&&d?f.jsx("div",{className:Ap,role:"toolbar","aria-label":"File Manager Toolbar",children:f.jsx(W7,{...d,selectedCount:D.size,onClearSelection:T,actions:Br})}):null,[pi,d,D,T,Br,S,x,c,ri,Zo,mo,e]);g.useImperativeHandle(Gl,()=>({createFolder:yr}),[yr]);const Vr=g.useCallback(()=>xt?null:f.jsx("aside",{role:"region","aria-label":"File Manager Tree Navigation",className:"min-h-0 min-w-0 h-full flex-none",children:f.jsx(pf,{defaultWidth:rn,width:rn,onResizeStop:an,onResize:ql,minWidth:s7,maxWidth:o7,enabled:!y,children:f.jsx(Jp,{width:rn,title:Pr,containerClassName:Tr,titleClassName:"dial-body-text text-primary",additionalButtons:Mr,isOpened:!y,onToggle:F,children:f.jsx(s9,{...Ir,items:s,rootItemPath:o?.path,rootItemLabel:o?.label,selectedPath:R,sharedByMePaths:v,forbiddenSymbolsRegExp:je,forbiddenSymbolsTooltip:Ae,onItemClick:V,areHiddenFilesVisible:S,getContextMenuItems:Nr,renamedPath:ln===Bn.Tree?le:void 0,onRenameSave:ve,onRenameCancel:Ee,onRenameValidate:_e})})})}),[xt,rn,y,Pr,Tr,Mr,F,Ir,s,o?.path,o?.label,R,v,je,Ae,V,S,Nr,ln,le,ve,Ee,_e]),zr=a9({actionLabels:l?.actionLabels,onDuplicate:X=>Q([X]),onCopy:X=>{re([X]),M(ct.Copy)},onMove:X=>{be([X]),M(ct.Move)},onDownload:X=>j([X]),onRename:$l,onDelete:(X,Ue)=>ae([X],Ue),onInfo:X=>Hl(X),onUnshare:X=>Jo?.([X]),onRemoveAccess:X=>en?.([X]),sharedWithMeIds:sn,sharedByMePaths:v,onAddChild:X=>Z?.([X]),onAddSibling:X=>oe?.([X]),onManagePermissions:X=>on?.(X),onPreview:X=>Vl?.(X),onOpenInNewTab:X=>zl?.(X),previewExtensions:Wl,isRenameFileAvailable:_l,isDuplicateFolderAvailable:jl,forbiddenSymbolsRegExp:je}),un=g.useCallback(X=>{const Ue=Vs(s,X.path);return Ue?zr(Ue):[]},[s,zr]),tc=g.useCallback((X,Ue,Ze)=>cn?!1:dn(X,Ue,Ze),[cn,dn]),{actionsColumnDef:sc}=a7({getContextMenuItems:un,isRowDisabled:tc,allowedFileTypes:w,buttonClassName:xt?"":QL}),{columnDefs:fi}=r9({userColumnDefs:Kl,filterable:Yl,dateLocale:Xl,dateOptions:Zl,effectiveVisibleColumns:Jl,isCompactView:xt,hasActions:!!l?.actionLabels,actionsColumnDef:sc,rootItemLabel:o?.label,rootItemPath:o?.path}),Wr=g.useCallback(X=>{X.colDef.colId==="ag-Grid-SelectionColumn"||X.colDef.colId===dt.Actions||le&&X.data?.path===le||X.data?.isTemporary||ui&&ui.includes(X.colDef.colId)||X.data&&H(X.data)},[le,H,ui]),_r=g.useCallback(()=>f.jsx(dr,{title:Rr,description:Fr,descriptionClassName:"text-sm",containerClassName:"gap-3 size-full bg-layer-2 border rounded-[4px] border-primary",titleClassName:"mt-2 !text-lg",icon:xr||f.jsx(z.IconFileDescription,{size:100,stroke:.5,className:"text-secondary"})}),[Fr,xr,Rr]),jr=g.useMemo(()=>X=>X.path,[]),Ur=g.useMemo(()=>ge("min-h-[248px] overflow-auto md:min-h-[266px]",os?"border border-dashed border-accent-primary":"",It&&!os?"border border-dashed border-primary":""),[os,It]),$r=g.useMemo(()=>({...Ks.additionalGridOptions,onCellClicked:Wr,headerHeight:od,rowHeight:od,rowClass:"group/grid-row",defaultColDef:{...Ks.additionalGridOptions?.defaultColDef,floatingFilter:a?.searchable?!1:Ks.additionalGridOptions?.defaultColDef?.floatingFilter},...xt?{getRowHeight:X=>X.data?.nodeType===ye.FOLDER?od:n7}:{},context:{cancelFolderCreation:Qo,saveFolderCreation:br,getDisplayName:Mt,onRenameCancel:Ee,onRenameSave:ve,onRenameValidate:_e,renameTriggerView:ln,validateFolderName:Sr,renamedItem:Fe,renamedPath:le,newFolderTempId:wr,sharedByMePaths:v,selectedPaths:D,disabledRowIds:vo,forbiddenSymbolsRegExp:je,forbiddenSymbolsTooltip:Ae,hideSearchPathItemName:yt}}),[Ks.additionalGridOptions,Wr,a?.searchable,xt,Qo,br,Mt,Ee,ve,_e,ln,Sr,Fe,le,wr,v,D,vo,je,Ae,yt]),qr=g.useMemo(()=>E.length===0&&!Ts&&!n?_r():f.jsx(lh,{columnDefs:fi,rowData:E,getRowId:jr,loading:n||tn,getContextMenuItems:un,withoutHeaderBorders:xt,selectionOnHover:!xt,onGridApiChange:de,className:Ur,...Ks,selectionMode:Ar,wrapCustomCellRenderers:Lr,additionalGridOptions:$r,selectedRowIds:Hr,onSelectionChange:Gr,wrapperBorder:!os&&!It,disabledRowIds:vo,allowDisabledContextMenu:cn}),[E,Ts,n,_r,fi,jr,tn,un,xt,de,Ur,Ks,Ar,Lr,$r,Hr,Gr,os,It,vo,cn]);return f.jsx("section",{ref:Ql,className:"size-full",children:f.jsxs("div",{className:ie(qL,{"gap-3 pt-4":d&&D.size>0,"gap-4 p-3 pt-4":xt,"gap-2 pt-2":xt&&d&&D.size>0},t),children:[ec(),f.jsxs("div",{className:ie(KL,Ul),children:[Vr(),f.jsxs("div",{className:ie(YL,{"gap-3":xt}),children:[r&&f.jsx(q7,{...a??{},makeHref:X=>X.join("/"),path:R,onItemClick:q,rootItemPath:o?.path,rootItemLabel:o?.label,value:N,onSearchChange:L,isCompactView:xt,labelClassName:"dial-tiny-text"}),f.jsxs("section",{role:"region","aria-label":"File Manager Grid View",className:ie(ZL,"relative"),onDragEnter:Ge,onDragLeave:K,onDragOver:He,onDrop:ns,children:[qr,f.jsx(G7,{disabledGridRowIds:vo,gridRows:E,getDisabledTooltip:di,getRowDisabledTooltip:gi,allowedFileTypes:w,maxSelectableFileSize:b})]})]})]}),f.jsx(_7,{...u,open:he,itemsToDelete:se,onClose:G,onConfirm:fe}),f.jsx(Cw,{...h,open:U,onClose:B,onConfirm:()=>{const X=h?.destinationFolderPath??"/";W===ct.Copy?_(X):pe(X),B()},mode:W,items:s,rootItem:o,gridOptions:{columnDefs:fi.filter(X=>X.colId!==dt.Actions),loading:n},onUploadFiles:ii,onValidateUpload:Tl,maxFileSize:Ml,path:h?.destinationFolderPath??h?.sourceFolder??R,onPathChange:X=>{h?.setDestinationFolderPath?.(X)},sourceFolder:h?.sourceFolder??R,treeOptions:{header:i?.header},onFolderPopupPathChange:Bl,showHiddenFileSwitcher:Dr}),f.jsx(Lp,{...p,open:kl,onClose:Ps,onReplace:$s,onDuplicate:Ds,onDecideForEach:Co,conflictingFiles:Il}),f.jsx(Lp,{...p,open:Al,onClose:Nl,onReplace:Ll,onDuplicate:Ol,onDecideForEach:st,conflictingFiles:qs}),f.jsx(Z7,{open:ai,onClose:ci,fileMetadata:vt?.fileMetadata??li,loading:vt?.loading,header:vt?.header,nameLabel:vt?.nameLabel,pathLabel:vt?.pathLabel,modifiedDateLabel:vt?.modifiedDateLabel,sizeLabel:vt?.sizeLabel,authorLabel:vt?.authorLabel,dateLocale:l?.dateLocale,dateOptions:l?.dateOptions})]})})},c9=(e,t=Dn.MyFiles)=>{const s=Object.values(Dn).includes(t)?t:Dn.MyFiles,[o,n]=g.useState(s),i=a=>{n(a)},r=g.useMemo(()=>{if(e)return Object.values(Dn).map(a=>({id:a,label:e?.[a]||a.replace("_"," ")}))},[e]);return{activeTab:o,handleTabChange:i,tabs:r}},d9="application/octet-stream";function u9(e,t){if(!e||e.length===0)return[];const s=e.find(l=>l.parentPath===""&&l.nodeType==="FOLDER");if(!s)return[];const o=s.path||s.url||"",n=rd(o,!0),i=e.filter(l=>l!==s).map(l=>{const c=l.path||l.url||"",d=h9(l.nodeType),u=d===ye.FOLDER,h=rd(c,u);let p;return l.parentPath===null||l.parentPath===void 0?p=n:l.parentPath===""?p="":p=rd(l.parentPath,!0),{...l,originalPath:c,path:h,parentPath:p,nodeType:d}}),r=new Map;i.forEach(l=>{const c={...l,id:l.originalPath,name:l.name,path:l.path,parentPath:l.parentPath,nodeType:l.nodeType,resourceType:g9(l.resourceType),folderId:t,updatedAt:l.updatedAt?new Date(l.updatedAt).toISOString():new Date().toISOString(),items:l.nodeType===ye.FOLDER?[]:void 0};l.nodeType===ye.ITEM&&(c.extension=p9(l.name),c.contentType=l.contentType||d9,c.contentLength=l.contentLength||0),r.set(l.path,c)});const a=[];return r.forEach(l=>{if(l.parentPath===n)a.push(l);else{const c=l.path.lastIndexOf(l.name||""),d=l.path.slice(0,c),u=r.get(d);u&&u.nodeType===ye.FOLDER?(u.items=u.items||[],u.items.push(l)):a.push(l)}}),a}function rd(e,t){try{let s=decodeURIComponent(e);return t?s.endsWith("/")||(s+="/"):s.endsWith("/")&&(s=s.slice(0,-1)),s}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function h9(e){return e.toUpperCase()==="FOLDER"?ye.FOLDER:ye.ITEM}function g9(e){if(!e)return;const t=e.toUpperCase();return Object.values(mh).find(o=>o.toUpperCase()===t)}function p9(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function f9(e,t="Prompts",s="prompts/public/",o="root"){const n=u9(e,o);return[{id:o,name:t,path:s,parentPath:"",nodeType:ye.FOLDER,folderId:o,items:n}]}exports.AlertVariant=as;exports.BASE_ICON_PROPS=J;exports.BASE_ICON_SIZE=Ht;exports.ButtonAppearance=Me;exports.ButtonVariant=ze;exports.ConfirmationPopupVariant=Kn;exports.DIAL_ICON_SIZE=Ct;exports.DialAlert=Qp;exports.DialAutocompleteInputValue=qv;exports.DialBreadcrumb=Vv;exports.DialBreadcrumbItem=Ii;exports.DialButton=ss;exports.DialButtonDropdown=Qd;exports.DialCaptionText=lr;exports.DialCheckbox=ud;exports.DialCloseButton=ah;exports.DialCollapsibleSidebar=Jp;exports.DialConditionalResizableContainer=pf;exports.DialConfirmationPopup=Uv;exports.DialDestinationFolderPopup=Cw;exports.DialDraggableItem=J0;exports.DialDropdown=Tt;exports.DialEllipsisTooltip=ft;exports.DialErrorButton=Wv;exports.DialErrorIconButton=_v;exports.DialErrorText=ls;exports.DialFileIcon=uu;exports.DialFileManager=Rw;exports.DialFileManagerActions=Y;exports.DialFileManagerTabs=Dn;exports.DialFileName=fl;exports.DialFileNodeType=ye;exports.DialFilePermission=Xo;exports.DialFileResourceType=mh;exports.DialFolderName=ml;exports.DialFormItem=nu;exports.DialFormPopup=dL;exports.DialGhostButton=_8;exports.DialGhostIconButton=X8;exports.DialGrid=lh;exports.DialIcon=Ye;exports.DialIconButton=uo;exports.DialInput=ni;exports.DialInputPopup=Kv;exports.DialItemType=jt;exports.DialLabel=_o;exports.DialLabelledText=X1;exports.DialLinkButton=W8;exports.DialLoadFileArea=iw;exports.DialLoadFileAreaField=jL;exports.DialLoader=cr;exports.DialNeutralButton=Fs;exports.DialNeutralIconButton=$8;exports.DialNoDataContent=dr;exports.DialNumberInput=mL;exports.DialPasswordInput=wL;exports.DialPopup=Yo;exports.DialPrimaryButton=xs;exports.DialPrimaryIconButton=U8;exports.DialRadioButton=ou;exports.DialRadioGroup=ka;exports.DialRadioGroupPopupField=rL;exports.DialRemoveButton=jv;exports.DialResizableContainer=gf;exports.DialSearch=uh;exports.DialSecondaryIconButton=q8;exports.DialSelect=Qv;exports.DialSelectField=DL;exports.DialSharedEntityIndicator=$i;exports.DialSkeleton=Sn;exports.DialSkeletonAvatarShape=Aa;exports.DialSkeletonAvatarSize=Ai;exports.DialSkeletonVariant=Zt;exports.DialSteps=j1;exports.DialSuccessIconButton=Y8;exports.DialSwitch=dh;exports.DialTabs=Nv;exports.DialTag=xn;exports.DialTagInput=$v;exports.DialTertiaryIconButton=K8;exports.DialTextarea=Z8;exports.DialTooltip=At;exports.DropdownItemType=qn;exports.DropdownTrigger=Gt;exports.DropdownType=kv;exports.ElementSize=Ft;exports.FileManagerColumnKey=dt;exports.FileManagerProvider=mw;exports.FlexibleActionsDirection=Eo;exports.FormItemOrientation=Ui;exports.GridSelectionMode=ji;exports.NAME_COLUMN=bw;exports.NOT_ALLOWED_SPACES=vh;exports.NOT_ALLOWED_SPACES_REGEXP=H7;exports.NOT_ALLOWED_SYMBOLS=pw;exports.NOT_ALLOWED_SYMBOLS_REGEXP=fw;exports.PopupSize=_t;exports.RadioGroupOrientation=Lo;exports.ResizableContainerSide=qi;exports.SIZE_COLUMN=yw;exports.SelectSize=rl;exports.SelectVariant=al;exports.StepStatus=Bt;exports.TabOrientation=nl;exports.TagVariant=cl;exports.UPDATED_AT_COLUMN=Sw;exports.mergeClasses=ie;exports.useDialFileManagerTabs=c9;exports.useEditableItem=vw;exports.useFileManagerContext=xw;exports.wrapInRootFolder=f9;
|
|
69
|
+
|\r| )|[\0-]`,N7=`[${pw.replace(/\\/g,"\\\\")}]`,fw=new RegExp(`${N7}|${vh}`),H7=new RegExp(vh),mw=({managerLabel:e,children:t,className:s,items:o=[],rootItem:n,path:i,defaultPath:r,filesLoading:a,selectedPaths:l,defaultSelectedPaths:c,onSelectedPathsChange:d,showHiddenFiles:u,onShowHiddenFilesChange:h,treeOptions:p,showNavigationPanel:m=!0,navigationPanelOptions:C,deleteConfirmationOptions:v,gridOptions:w,toolbarOptions:b,bulkActionsToolbarOptions:S,destinationFolderPopupOptions:x,conflictResolutionPopupOptions:y,onPathChange:F,onTableFileClick:R,handleSelectionClick:E,onGridApiChange:D,onCopyFiles:P,onMoveToFiles:T,onDeleteFiles:I,onDownloadFiles:N,onRenameValidate:q,onAddSibling:L,onAddChild:V,renameValidationMessages:H,forbiddenSymbolsRegExp:A=fw,forbiddenSymbolsTooltip:de,onUploadFiles:M,onValidateUpload:B,uploadEnabled:U,uploadValidationMessages:W,maxFileSize:re,onUploadArchive:be,onCreateFolder:Q,onCreateFolderValidate:_,folderCreationValidationMessages:pe,fileMetadataPopupOptions:oe,onGetInfo:Z,onUnshareFiles:j,onRemoveFilesAccess:ae,actionsRef:G,sharedByMePaths:fe,onSearchFiles:he,searchResults:se,searchInProgress:le,clearSearchResults:Fe,allowedFileTypes:Oe,maxSelectableFileSize:ve,getDisabledTooltip:Ee,fileTooLargeTooltip:_e,unsupportedFileTypeTooltip:je,emptyStateIcon:Ae,emptyStateTitle:Mt,emptyStateDescription:os,sharedWithMeIds:It,onFolderPopupPathChange:Ge,onManagePermissions:K,onPreview:He,onOpenInNewTab:ns,previewExtensions:ii,isRenameFileAvailable:Tl,isDuplicateFolderAvailable:Ml,customUploadFileAction:mo,customCreateNewItemAction:ri,customDuplicateAction:Zo,customDeleteItemsAction:wr,customDownloadItemsAction:Qo,customBreakpointRef:br,gridClassName:Sr,nonClickableTableColumns:yr,hideSearchPathItemName:Il,showHiddenFileSwitcherInDestinationPopup:kl,autoSelectUploadedItems:$s=!1})=>{const{selectedPaths:Ds,clearSelection:Ps,setSelectedPaths:Co}=O7({selectedPaths:l,defaultSelectedPaths:c,onSelectedPathsChange:d}),qs=g.useRef(null),Al=g.useCallback((De,Ne,Ve)=>{if($s){const is=Ne.lastIndexOf("/"),oc=is>=0?Ne.slice(is+1):Ne,Ie=is>=0?Ne.slice(0,is):"";qs.current={fileNames:new Set([oc]),destinationFolder:Ie}}Q?.(De,Ne,Ve)},[Q,$s]),Ll=g.useCallback((De,Ne)=>{$s&&(qs.current={fileNames:new Set(De.map(Ve=>Ve.name)),destinationFolder:Ne}),M?.(De,Ne)},[M,$s]),Ol=g.useCallback((De,Ne,Ve)=>{$s&&(qs.current={fileNames:new Set([Ne]),destinationFolder:Ve}),be?.(De,Ne,Ve)},[be,$s]),Nl=g.useMemo(()=>{const De=new Map;return Ds.forEach(Ne=>{const Ve=Vs(o,Ne);Ve&&De.set(Ne,Ve)}),De},[Ds,o]);g.useEffect(()=>{if(Ds.size===0)return;let De=!1;for(const Ne of Ds)if(!Vs(o,Ne)){De=!0;break}if(De){const Ne=new Set;for(const Ve of Ds)Vs(o,Ve)&&Ne.add(Ve);Co(Ne)}},[o,Ds,Co]);const{currentPath:st,setCurrentPath:Hl,handlePathChange:vt}=v7({path:i,defaultPath:r,onPathChange:F,onSelectionClear:Ps}),ai=g.useMemo(()=>{const{showFiles:De=!0,showFolders:Ne=!0,...Ve}=w||{};return{showFiles:De,showFolders:Ne,...Ve}},[w]),li=ai.showFiles,ci=ai.showFolders,[Jo,en]=g.useState(),Gl=x?.destinationFolderPath??Jo,tn=g.useCallback(De=>{x?.setDestinationFolderPath?x.setDestinationFolderPath(De):en(De)},[x]),{areHiddenFilesVisible:Ts,toggleHiddenFilesVisibility:xr}=f7({showHiddenFiles:u,onShowHiddenFilesChange:h}),{isTreeCollapsed:Rr,toggleTreeCollapse:Fr,setIsTreeCollapsed:sn}=m7({collapsed:p?.collapsed,onCollapseChange:p?.onCollapseChange}),{renamedPath:Bl,renamedItem:on,renameHandler:Vl,renameSaveHandler:zl,renameCancelHandler:Wl,renameValidateHandler:_l,getDisplayName:jl}=D7({items:o,onRenameValidate:q,validationMessages:H,onMoveToFiles:T}),{isSearchMode:di,searchValue:Er,effectiveSearchValue:nn,setSearchValue:Ul,handleSearchChange:ui,handleSearchClear:yt,searchResultsRows:Dr}=L7({onSearchFiles:he,clearSearchResults:Fe,currentPath:st,searchResults:se,searchInProgress:le,navigationPanelValue:C?.value,onNavigationPanelSearchChange:C?.onSearchChange,allItems:o,activeTab:b?.activeTab}),rt=g.useMemo(()=>nd(o,st)??o[0],[o,st]),{handleCopyTo:Pr,handleMoveTo:Tr,handleDuplicate:Mr,handleOpenDestinationFolderPopup:Ir,handleCloseDestinationFolderPopup:rn,openDestinationFolderPopup:an,handleSetCopiedFiles:ln,handleSetMovedFiles:$l,destinationFolderMode:kr,destinationFolderTitle:hi,conflictingFiles:ql,conflictResolutionOpen:Kl,closeConflictResolution:Yl,handleConflictReplace:Xl,handleConflictDuplicate:Zl,handleConflictCancel:Ar,handleConflictDecideForEach:Lr,sourceFolder:Or}=C7({getDestinationFiles:De=>nd(o,De)?.items??[],onCopyFiles:P,onMoveToFiles:T,onCopySuccess:Ps,onMoveSuccess:Ps,onDuplicateSuccess:Ps,getCopyHeader:x?.getCopyHeader,getMoveHeader:x?.getMoveHeader});g.useEffect(()=>{an||tn(void 0)},[an,tn]);const{deleteConfirmationOpen:cn,itemsToDelete:Ks,openDeleteConfirmation:Ql,closeDeleteConfirmation:xt,confirmDelete:Jl}=w7({onDeleteFiles:I,onDeleteSuccess:Ps}),{handleDownloadFiles:gi}=b7({onDownloadFiles:N,customDownloadItemsAction:Qo,onDownloadSuccess:Ps}),{isDragging:dn,isDraggingOverWindow:vo,uploadError:Nr,handleDragEnter:Hr,handleDragLeave:Gr,handleDragOver:Br,handleDrop:pi,clearError:ec,openFileDialog:Vr,fileInputRef:zr,openArchiveDialog:un,uploadConflictingFiles:tc,uploadConflictResolutionOpen:sc,closeUploadConflictResolution:fi,handleUploadConflictReplace:Wr,handleUploadConflictDuplicate:_r,handleUploadConflictCancel:jr,handleUploadConflictDecideForEach:Ur}=y7({onUploadFiles:Ll,onValidateUpload:B,maxFileSize:re,onUploadArchive:Ol,allowedFileTypes:Oe,validationMessages:W,uploadEnabled:U,currentFolder:rt}),$r=g.useCallback(De=>{yt();const Ne=st??"",Ve=rt?.items??[];pi(De,Ne,Ve)},[st,rt,pi,yt]),qr=g.useCallback(()=>{yt();const De=st??"",Ne=rt?.items??[];Vr(De,Ne)},[st,rt,Vr,yt]),X=g.useCallback(()=>{yt();const De=st??"",Ne=rt?.items??[];un(De,Ne)},[st,rt,un,yt]),Ue=g.useCallback(()=>{yt(),mo?.(st,rt)},[mo,st,rt,yt]),Ze=g.useCallback(()=>{yt(),ri?.(st,rt)},[ri,st,rt,yt]),$t=g.useCallback(De=>{Zo?.(De)},[Zo]),{isCreatingFolder:gs,newFolderTempId:hn,startFolderCreation:Sh,cancelFolderCreation:Fw,saveFolderCreation:Ew,validateFolderName:Dw}=M7({currentFolder:rt,onCreateFolder:Al,onValidateFolderName:_,validationMessages:pe}),yh=g.useCallback(()=>{yt(),Sh()},[yt,Sh]),{newActions:Pw,isNewButtonVisible:Tw,isNewButtonDisabled:Mw}=P7({newActions:b?.newActions,currentFolder:rt,onUploadFiles:mo?Ue:qr,onUploadArchive:X,onCreateFolder:yh,onCreateNewItem:Ze,isNewButtonDisabled:b?.isNewButtonDisabled}),Iw=g.useMemo(()=>{if(di){let Ie=Dr;li||(Ie=Ie.filter($e=>$e.nodeType!==ye.ITEM)),ci||(Ie=Ie.filter($e=>$e.nodeType!==ye.FOLDER)),Ts||(Ie=Ie.filter($e=>!$e.path.split("/").filter(Boolean).some(Ci=>Ci.startsWith("."))));const mi=Ie.map($e=>({...$e,id:$e.id??$e.path,name:$e.name??$e.path.split("/").pop()??"",updatedAt:$e.updatedAt,size:$e.contentLength,contentLength:$e.contentLength,author:$e.author,path:$e.path,nodeType:$e.nodeType,extension:$e.extension,isTemporary:!1,owner:$e.owner,folderId:$e.folderId}));return gs&&hn&&mi.unshift({id:hn,name:"",updatedAt:void 0,author:void 0,path:st??"/",nodeType:ye.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),mi}const De=Vn(nn).trim(),Ne=rt?.items??[];let Ve=De?u7(rt):Ne;li||(Ve=Ve.filter(Ie=>Ie.nodeType!==ye.ITEM)),ci||(Ve=Ve.filter(Ie=>Ie.nodeType!==ye.FOLDER)),Ts||(Ve=Ve.filter(Ie=>De?!Ie.path.split("/").filter(Boolean).some($e=>$e.startsWith(".")):!lw(Ie)));const is=Ve.map(Ie=>({...Ie,id:Ie.id??Ie.path,name:Ie.name??Ie.path.split("/").pop()??"",updatedAt:Ie.updatedAt,size:Ie.contentLength,author:Ie.author,path:Ie.path,nodeType:Ie.nodeType,extension:Ie.extension,isTemporary:!1,owner:Ie.owner,contentType:Ie.contentType,contentLength:Ie.contentLength,folderId:Ie.folderId}));if(gs&&hn&&!De&&is.unshift({id:hn,name:"",updatedAt:void 0,author:void 0,path:st??"/",nodeType:ye.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),!De)return is;const oc=De.split(/\s+/).filter(Boolean);return is.filter(Ie=>{if(Ie.isTemporary)return!0;const mi=Vn(Ie.name),$e=Vn(Ie.author),Fh=d7(Ie.extension);return oc.every(Ci=>mi.includes(Ci)||$e.includes(Ci)||Fh.includes(Ci))})},[di,Dr,rt,nn,Ts,gs,hn,li,ci,st]);g.useEffect(()=>{const De=qs.current;if(!De)return;if((st??"")!==De.destinationFolder){qs.current=null;return}const Ne=nd(o,De.destinationFolder);if(!Ne?.items)return;const Ve=new Set;for(const is of Ne.items)De.fileNames.has(is.name)&&Ve.add(is.path);Ve.size>0&&(Co(Ve),qs.current=null)},[o,st,Co]);const kw=g.useCallback(De=>{vt(De.path)},[vt]),Aw=g.useCallback(De=>{vt(De)},[vt]),Lw=g.useCallback(De=>{De.nodeType===ye.FOLDER?vt(De.path):R?.(De)},[vt,R]),{expandedPaths:xh,setExpandedPaths:Ow,collapseAll:Nw}=gw({expandedPaths:p?.expandedPaths,onExpandedPathsChange:p?.onExpandedPathsChange}),{additionalButtons:Hw}=I7({collapseAll:Nw,expandedPathsLength:xh.size,additionalButtons:p?.additionalButtons}),{isMetadataPopupOpen:Gw,selectedFileForMetadata:Bw,openMetadataPopup:Vw,closeMetadataPopup:Rh}=k7({onGetInfo:Z}),zw=g.useCallback(()=>{Rh(),oe?.clearMetadata?.()},[Rh,oe]),Ww=g.useMemo(()=>{if(A)return Pl(A)},[A]),_w={managerLabel:e,className:s,items:o,allowedFileTypes:Oe,maxSelectableFileSize:ve,rootItem:n,filesLoading:a,treeOptions:{...p,expandedPaths:xh,onExpandedPathsChange:Ow,additionalButtons:Hw},showNavigationPanel:m,navigationPanelOptions:C,gridOptions:ai,toolbarOptions:b,bulkActionsToolbarOptions:S,deleteConfirmationOptions:v,destinationFolderPopupOptions:{...x,destinationFolderPath:Gl,setDestinationFolderPath:tn,header:hi,onCreateFolder:Q,onCreateFolderValidate:_,folderCreationValidationMessages:pe,sourceFolder:Or},currentPath:st,setCurrentPath:Hl,searchValue:Er,effectiveSearchValue:nn,setSearchValue:Ul,areHiddenFilesVisible:Ts,toggleHiddenFilesVisibility:xr,isTreeCollapsed:Rr,toggleTreeCollapse:Fr,setIsTreeCollapsed:sn,selectedPaths:Ds,selectedFiles:Nl,setSelectedPaths:Co,clearSelection:Ps,currentFolder:rt,gridRows:Iw,handleCopyTo:Pr,handleMoveTo:Tr,handleDuplicate:Zo?$t:Mr,handleSetCopiedFiles:ln,handleSetMovedFiles:$l,openDestinationFolderPopup:an,handleCloseDestinationFolderPopup:rn,handleOpenDestinationFolderPopup:Ir,destinationFolderMode:kr,handleAddSibling:L,handleAddChild:V,handleDownloadFiles:gi,renamedPath:Bl,renamedItem:on,forbiddenSymbolsRegExp:Ww,forbiddenSymbolsTooltip:de,onRename:Vl,onRenameSave:zl,onRenameCancel:Wl,onRenameValidate:_l,getDisplayName:jl,openDeleteConfirmation:wr||Ql,closeDeleteConfirmation:xt,confirmDelete:Jl,deleteConfirmationOpen:cn,itemsToDelete:Ks,handlePathChange:vt,handleTreeItemClick:kw,handleBreadcrumbItemClick:Aw,handleSearchChange:ui,handleTableRowClick:Lw,onTableFileClick:R,handleSelectionClick:E,onGridApiChange:D,isDragging:dn,uploadError:Nr,handleDragEnter:Hr,handleDragLeave:Gr,handleDragOver:Br,handleDrop:$r,clearUploadError:ec,onUploadFiles:M,onValidateUpload:B,maxFileSize:re,isDraggingOverWindow:vo,openFileDialog:qr,fileInputRef:zr,newActions:Pw,isNewButtonVisible:Tw,isNewButtonDisabled:Mw,isCreatingFolder:gs,newFolderTempId:hn,startFolderCreation:yh,cancelFolderCreation:Fw,saveFolderCreation:Ew,validateFolderName:Dw,conflictResolutionPopupOptions:y,conflictingFiles:ql,conflictResolutionOpen:Kl,closeConflictResolution:Yl,handleConflictReplace:Xl,handleConflictDuplicate:Zl,handleConflictCancel:Ar,handleConflictDecideForEach:Lr,uploadConflictingFiles:tc,uploadConflictResolutionOpen:sc,closeUploadConflictResolution:fi,handleUploadConflictReplace:Wr,handleUploadConflictDuplicate:_r,handleUploadConflictCancel:jr,handleUploadConflictDecideForEach:Ur,fileMetadataPopupOptions:oe,isMetadataPopupOpen:Gw,selectedFileForMetadata:Bw,openMetadataPopup:Vw,closeMetadataPopup:zw,onGetInfo:Z,onUnshareFiles:j,onRemoveFilesAccess:ae,actionsRef:G,sharedByMePaths:fe,onSearchFiles:he,searchInProgress:le,searchResults:se,clearSearchResults:Fe,isSearchMode:di,emptyStateIcon:Ae,emptyStateTitle:Mt,emptyStateDescription:os,gridClassName:Sr,sharedWithMeIds:It,onFolderPopupPathChange:Ge,onManagePermissions:K,onPreview:He,onOpenInNewTab:ns,previewExtensions:ii,isRenameFileAvailable:Tl,isDuplicateFolderAvailable:Ml,customUploadFileAction:mo,customBreakpointRef:br,nonClickableTableColumns:yr,hideSearchPathItemName:Il,getDisabledTooltip:Ee,fileTooLargeTooltip:_e,unsupportedFileTypeTooltip:je,showHiddenFileSwitcherInDestinationPopup:kl};return f.jsx(uw.Provider,{value:_w,children:t})},G7=({disabledGridRowIds:e,gridRows:t,getDisabledTooltip:s,getRowDisabledTooltip:o,allowedFileTypes:n,maxSelectableFileSize:i})=>{const[r,a]=g.useState(null),[l,c]=g.useState(null);g.useEffect(()=>{const h=()=>{a(null),c(null)};return window.addEventListener("scroll",h,!0),()=>window.removeEventListener("scroll",h,!0)},[]),g.useEffect(()=>{const h=C=>{const w=C.target.closest(".ag-row");if(!w){a(S=>S&&null);return}const b=new DOMParser().parseFromString(w.getAttribute("row-id")||"","text/html").documentElement.textContent;b&&e.has(b)?a(S=>S!==b?(c(w.getBoundingClientRect()),b):S):a(S=>S&&null)},p=()=>{a(null),c(null)},m=document.querySelector('[aria-label="File Manager Grid View"]');if(m)return m.addEventListener("mousemove",h),m.addEventListener("mouseleave",p),()=>{m.removeEventListener("mousemove",h),m.removeEventListener("mouseleave",p)}},[e]);const d=g.useMemo(()=>{if(r)return t.find(h=>h.path===r)},[r,t]),u=g.useMemo(()=>{if(d)return s&&d.folderId?s(d):o(d,n,i)},[d,s,o,n,i]);return f.jsx(f.Fragment,{children:u&&l&&Yn.createPortal(f.jsxs(eu,{open:!0,placement:"top",children:[f.jsx(su,{asChild:!0,children:f.jsx("div",{className:ge("fixed z-[-1]",u&&"pointer-events-none"),style:{top:l.top,left:l.left,width:l.width,height:l.height}})}),f.jsx(tu,{className:"max-w-[300px] rounded border border-ui-outline-primary bg-ui-popover px-3 py-1.5 text-center text-primary shadow-md fill-ui-popover",children:u})]}),document.body)})},wh=()=>{const[e,t]=g.useState(Ep());return g.useEffect(()=>{const s=()=>t(Ep());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},Cw=({onClose:e,onConfirm:t,onFolderPopupPathChange:s,setDestinationFolderPath:o,open:n,copyLabel:i="Copy",moveLabel:r="Move",addFolderLabel:a="Add folder",mode:l=ct.Copy,hiddenFilesSwitcherLabel:c="Show hidden files",showHiddenFileSwitcher:d=!0,onUploadFiles:u,onValidateUpload:h,maxFileSize:p,header:m,sourceFolder:C,disabledPathTooltip:v="Unavailable for the original path. Please select another folder",path:w,collapsedFileTree:b=!1,alertProps:S,...x})=>{const[y,F]=g.useState(!1),[R,E]=g.useState(!1),D=g.useRef(null),P=wh(),T=g.useCallback(V=>{F(V)},[]),I=g.useMemo(()=>{const V=[{key:"add-folder",label:a,icon:f.jsx(z.IconFolderPlus,{...J,className:"text-secondary"}),onClick:()=>{D.current?.createFolder(),E(!1)}}];return d&&V.push({key:"show-hidden-files",label:c,icon:f.jsx(z.IconEye,{...J,className:"text-secondary"}),onClick:()=>{F(H=>!H),E(!1)}}),V},[a,c,d]),N=g.useCallback(V=>{V&&(s?.(V),o?.(V))},[s,o]),q=l===ct.Copy?"Copy to":"Move to",L=g.useMemo(()=>!w||!C?!1:C===w,[w,C]);return f.jsx(Yo,{open:n,onClose:()=>{e()},size:_t.Lg,dividerFooter:!0,dividers:!1,className:"md:!h-[800px] !bg-layer-2",footer:f.jsxs("div",{className:"flex justify-between items-center gap-2 py-4 px-4 md:px-6",children:[f.jsx("div",{className:"flex items-center gap-4 min-w-0",children:P?f.jsx(Tt,{menu:{items:I},open:R,onOpenChange:E,children:f.jsx(ss,{className:"h-9 w-9 shrink-0","aria-label":"More options",iconBefore:f.jsx(z.IconDotsVertical,{...J,className:"text-secondary"})})}):f.jsxs(f.Fragment,{children:[f.jsx(xs,{label:a,appearance:Me.Ghost,iconBefore:f.jsx(z.IconFolderPlus,{...J}),onClick:()=>{D.current?.createFolder()}}),d&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"w-px h-[26px] bg-controls-disable-accent my-2"}),f.jsx("div",{className:"inline-flex items-center cursor-pointer",children:f.jsx(dh,{label:c,isOn:y,onChange:T,switchId:"hidden-files-switch"})})]})]})}),f.jsxs("div",{className:"flex space-x-4 items-center",children:[f.jsx(Fs,{onClick:e,label:"Cancel"}),L?f.jsx(At,{tooltip:v,children:f.jsx(xs,{onClick:t,label:l==="copy"?i:r,disabled:L,"aria-disabled":L})}):f.jsx(xs,{onClick:t,label:l==="copy"?i:r})]})]}),header:m??q,children:f.jsxs("div",{className:"bg-layer-2 h-full flex flex-col",children:[S&&f.jsx("div",{className:"px-6 mb-4 pt-4",children:f.jsx(Qp,{...S})}),f.jsx("div",{className:"flex-1 min-h-0",children:f.jsx(Rw,{...x,gridClassName:"size-full",className:ie(x.className,"bg-layer-2 h-full flex pt-0"),actionsRef:D,path:w,showHiddenFiles:y,onShowHiddenFilesChange:T,treeOptions:{...x.treeOptions,collapsed:b,expandedPaths:new Set([x.rootItem?.path||"/"]),header:x.treeOptions?.header},gridOptions:{...x.gridOptions,selectionMode:void 0},navigationPanelOptions:{elementId:"file-manager-destination-search",...x.navigationPanelOptions},onUploadFiles:u,onValidateUpload:h,onPathChange:N,maxFileSize:p})})]})})},B7=12,V7=8;var Eo=(e=>(e.Normal="normal",e.Reverse="reverse",e))(Eo||{});function z7({actions:e,direction:t=Eo.Normal,moreButtonWidth:s=Ht,actionsGap:o=8,containerPadding:n=8,dependencies:i=[]}){const r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(null),d=g.useRef([]),[u,h]=g.useState(e.length);g.useLayoutEffect(()=>{if(!a.current)return;const C=Array.from(a.current.children);d.current=C.map(v=>Math.ceil(v.getBoundingClientRect().width))},[e,...i]),g.useEffect(()=>{if(!r.current)return;let C=null;const v=()=>{C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const b=r.current,S=l.current?.offsetWidth??0,x=c.current?.offsetWidth??0,y=S+x,R=b.getBoundingClientRect().width-y-s-o*2-n*2,E=d.current;let D=0,P=0;if(t===Eo.Reverse)for(let T=E.length-1;T>=0&&(D+=E[T]+o,!(D>R));T--)P++;else for(const T of E){if(D+=T+o,D>R)break;P++}h(P)})},w=new ResizeObserver(v);return w.observe(r.current),v(),()=>{C&&cancelAnimationFrame(C),w.disconnect()}},[e.length,t,...i]);const p=t===Eo.Reverse?e.slice(0,e.length-u):e.slice(u);return{visibleActions:t===Eo.Reverse?e.slice(e.length-u):e.slice(0,u),hiddenActions:p,refs:{containerRef:r,measureRef:a,leftSectionRef:l,rightSectionRef:c}}}const W7=({getSelectionLabel:e,onClearSelection:t,actions:s,selectedCount:o})=>{const n=wh(),{refs:{containerRef:i,leftSectionRef:r,measureRef:a},visibleActions:l,hiddenActions:c}=z7({actions:s,direction:Eo.Reverse,dependencies:[n],actionsGap:B7,containerPadding:V7}),d=e(o);return f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:a,className:"absolute top-0 left-0 invisible pointer-events-none overflow-hidden whitespace-nowrap flex gap-3",children:s.map(({key:u,icon:h,title:p})=>f.jsx(Fs,{iconBefore:h,label:p,hideTitleOnMobile:!0},u))}),f.jsxs("div",{ref:i,className:"rounded bg-layer-0 p-2 flex justify-between items-center w-full",role:"toolbar","aria-label":"File bulk actions",children:[f.jsx("div",{ref:r,children:f.jsx(xs,{label:d,onClick:t,textClassName:"text-accent-primary whitespace-nowrap",appearance:Me.Ghost,iconBefore:f.jsx(z.IconX,{...J,className:"text-accent-primary"})})}),f.jsxs("div",{className:"flex flex-1 w-full gap-3 items-center justify-end",children:[c.length>0&&f.jsx(Tt,{menu:{items:c},allowedPlacements:["bottom","bottom-start"],children:f.jsx(ss,{className:"h-[38px]",iconBefore:f.jsx(z.IconDotsVertical,{...J,className:"text-secondary hover:text-accent-primary"})})}),l.map(({key:u,icon:h,tooltip:p,title:m,onClick:C,disabled:v})=>f.jsx(Fs,{className:"!p-[9px]",iconBefore:h,label:m,hideTitleOnMobile:!0,disabled:v,tooltipProps:{tooltip:p},onClick:w=>C?.({key:u,domEvent:w})},u))]})]})]})},_7=({open:e,itemsToDelete:t,onClose:s,onConfirm:o,cancelLabel:n="Cancel",confirmLabel:i="Delete",titleRenderer:r,contentRenderer:a})=>{const l=t.map(p=>p.name),d=r?.(l)||"Confirm Deleting Items",u=f.jsxs("div",{className:"px-6 py-3 dial-small-text",children:[f.jsx("p",{className:"text-secondary mb-3",children:t.length===1?f.jsxs(f.Fragment,{children:["Do you want to delete file or folder"," ",f.jsxs("span",{className:"text-primary break-all",children:['"',t[0].name,'"']}),"?"]}):f.jsxs(f.Fragment,{children:["Do you want to delete the following"," ",f.jsx("span",{className:"text-primary",children:t.length})," items?"]})}),t.length>1&&f.jsx(f.Fragment,{children:t.length<=10?f.jsx("ul",{className:"space-y-1 text-primary list-none",children:t.map(p=>f.jsx("li",{className:"truncate",children:p.name},p.path))}):f.jsxs(f.Fragment,{children:[f.jsx("ul",{className:"space-y-1 text-primary list-none mb-2",children:t.slice(0,10).map(p=>f.jsx("li",{className:"truncate",children:p.name},p.path))}),f.jsxs("p",{className:"text-secondary italic",children:["... and ",t.length-10," more"]})]})})]}),h=a?.(l)||u;return f.jsx(Uv,{open:e,header:d,confirmLabel:i,cancelLabel:n,variant:Kn.Danger,onClose:s,onConfirm:o,children:h})},Gp=e=>e.split("/").map(t=>t.trim()).filter(Boolean),j7="w-full flex items-center justify-between gap-4",U7="min-w-0 h-[38px] flex-1 overflow-hidden bg-layer-3 px-3 flex items-center rounded",$7="w-[260px]",q7=({ariaLabel:e="Breadcrumb",labelClassName:t,onItemClick:s,path:o,makeHref:n,rootItemPath:i,rootItemLabel:r,breadcrumbsHiddenPathPart:a,className:l,breadcrumbClassName:c,searchable:d=!0,value:u,elementId:h="file-manager-search",disabled:p,invalid:m,onSearchChange:C,searchClassName:v,searchContainerClassName:w,isCompactView:b=!1})=>{const S=g.useMemo(()=>{if(!o)return;let D=Gp(o);const P=[...D];let T=0;if(a){const N=Gp(a);if(N.length){const q=D.findIndex((L,V)=>N.every((H,A)=>D[V+A]===H));q!==-1&&(T=N.length,D=[...D.slice(0,q),...D.slice(q+N.length)])}}if(!D.length)return[{label:"/"}];const I=D.map((N,q)=>{const L=q<D.length-T?q:q+T,V=P.slice(0,L+1),H=typeof n=="function"?n(V,L):void 0;return{label:N,href:H,onClick:s?A=>{A.preventDefault(),s(H)}:void 0}});if(i&&r){const N=i.split("/").filter(Boolean),q=o.split("/").filter(Boolean);if(N.every((V,H)=>q[H]===V)&&I.length>0){const V=I.slice(N.length);return[{label:r,href:i,onClick:s?H=>{H.preventDefault(),s(i)}:void 0},...V]}}return I},[o,a,i,r,n,s]),[x,y]=g.useState(!1),F=g.useCallback(()=>{if(b&&!x){y(!0);const D=document.getElementById(h);D&&D.focus()}},[h,x,b]),R=g.useCallback(()=>{(!u||String(u).trim()==="")&&C?.("")},[u,C]),E=g.useCallback(()=>b&&x?f.jsx(Fs,{className:"!p-[9px]",iconBefore:f.jsx(z.IconArrowLeft,{...J}),onClick:()=>{y(!1),C?.("")}}):f.jsx("div",{className:U7,children:f.jsx(Vv,{pathItems:S,ariaLabel:e,labelClassName:t,className:c})}),[e,c,S,x,b,t,C]);return f.jsxs("div",{className:ie(j7,{"gap-3":b},l),"aria-label":"navigation-panel",children:[E(),d&&f.jsx("div",{className:ie($7,{"w-[40px]":b&&!x,"w-full":b&&x}),role:"search","aria-label":"Search",onClick:F,children:f.jsx(uh,{id:h,value:u??"",onChange:C,disabled:p,onBlur:R,invalid:m,className:v,wrapperClassName:b&&!x?"pl-2.5":"",containerClassName:w})})]})},K7=({tabs:e,activeTab:t,onTabChange:s,areHiddenFilesVisible:o,onToggleHiddenFiles:n,isNewButtonVisible:i,isNewButtonDisabled:r,newButtonVariant:a=ze.Primary,newButtonDropdownItems:l=[],newButtonLabel:c="New",hiddenFilesSwitcherLabel:d="Hidden files",showHiddenFilesLabel:u="Show hidden files",hideHiddenFilesLabel:h="Hide hidden files",showHiddenFilesToggle:p=!0,disabledNewButtonTooltip:m})=>{const C=wh(),v=g.useMemo(()=>[{key:"hidden-files-switch",label:o?h:u,icon:o?f.jsx(z.IconEyeOff,{...J,className:"text-secondary"}):f.jsx(z.IconEye,{...J,className:"text-secondary"}),onClick:()=>n?.(!o)}],[o,h,u,n]),w=()=>e&&t&&s?f.jsx(Nv,{tabs:e,activeTab:t,onClick:x=>s(x),screenThreshold:il.Tablet,smallScreenContainerClassName:"w-fit bg-transparent h-[38px] overflow-hidden",smallScreenDropdownItemClassName:"px-3 h-[38px]"}):null,b=()=>f.jsxs(f.Fragment,{children:[p&&f.jsxs(f.Fragment,{children:[f.jsx(dh,{switchId:"hidden-files-switch",label:d,isOn:o,onChange:n}),f.jsx("div",{className:"h-6 border-l border-primary"})]}),i&&f.jsx(At,{tooltip:r&&m?m:void 0,children:f.jsx(Qd,{label:c,variant:a,items:l,disabled:r})})]}),S=()=>f.jsxs(f.Fragment,{children:[f.jsx(Tt,{menu:{items:v},allowedPlacements:["bottom","bottom-start"],children:f.jsx(ss,{className:"h-[38px]",iconBefore:f.jsx(z.IconDotsVertical,{...J,className:"text-secondary hover:text-accent-primary"})})}),i?f.jsx(At,{tooltip:r&&m?m:void 0,children:f.jsx(Qd,{label:c,variant:a,items:l,disabled:r})}):null]});return f.jsxs("div",{className:"flex w-full justify-between gap-4 items-center overflow-x-auto",children:[f.jsx("div",{className:"flex-1 min-w-0",children:w()}),f.jsx("div",{className:"flex gap-4 flex-shrink-0 items-center",children:C?S():b()})]})},Y7=100,Di=16,fs="text-secondary",pa="text-primary min-w-0",X7="text-primary break-words min-w-0",Pi="bg-layer-2",Z7=({open:e,onClose:t,fileMetadata:s,loading:o=!1,header:n="Information",nameLabel:i="Name:",pathLabel:r="Path:",modifiedDateLabel:a="Modified Date:",sizeLabel:l="Size:",authorLabel:c="Author:",dateLocale:d="en-US",dateOptions:u})=>f.jsx(Yo,{open:e,onClose:t,size:_t.Sm,header:n,dividers:!1,children:f.jsx("div",{className:"px-6 py-4",children:f.jsx("div",{className:"grid gap-x-4 gap-y-4 items-center dial-small-text",style:{gridTemplateColumns:`${Y7}px 1fr`},children:o?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:fs,children:i}),f.jsx(Sn,{variant:Zt.Text,width:"100%",height:Di,className:Pi}),f.jsx("div",{className:fs,children:a}),f.jsx(Sn,{variant:Zt.Text,width:"90%",height:Di,className:Pi}),f.jsx("div",{className:fs,children:l}),f.jsx(Sn,{variant:Zt.Text,width:"60%",height:Di,className:Pi}),f.jsx("div",{className:fs,children:c}),f.jsx(Sn,{variant:Zt.Text,width:"80%",height:Di,className:Pi}),f.jsx("div",{className:fs,children:r}),f.jsx(Sn,{variant:Zt.Text,width:"70%",height:Di,className:Pi})]}):s?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:fs,children:i}),f.jsx("div",{className:pa,children:f.jsx(ft,{text:s.name})}),f.jsx("div",{className:fs,children:a}),f.jsx("div",{className:pa,children:f.jsx(ft,{text:h7(s.updatedAt,d,u)})}),f.jsx("div",{className:fs,children:l}),f.jsx("div",{className:pa,children:f.jsx(ft,{text:ar(s.contentLength)})}),f.jsx("div",{className:fs,children:c}),f.jsx("div",{className:pa,children:f.jsx(ft,{text:s.author||"—"})}),f.jsx("div",{className:fs,children:r}),f.jsx("div",{className:X7,children:decodeURIComponent(s.path)})]}):null})})}),Q7={size:10,stroke:2},J7=26;var jt=(e=>(e.File="file",e.Folder="folder",e))(jt||{});const e9=({name:e,type:t,shared:s=!1,loading:o=!1,sharedIndicatorClassName:n,sharedIndicatorTooltip:i,fileExtension:r,...a})=>{const l=c=>f.jsxs("span",{className:"inline-flex relative text-secondary",role:"img",children:[c,s&&f.jsx("span",{className:"absolute -bottom-0.5 -left-0.5",children:f.jsx($i,{className:n,sharedIndicatorTooltip:i})})]});if(o)return l(f.jsx(cr,{}));if(t===jt.File){const c=r||(e.includes(".")?e.split(".").pop():void 0);return f.jsx(uu,{...a,extension:c??"",className:"text-secondary",indicator:s?f.jsx($i,{className:n,sharedIndicatorTooltip:i}):null,label:"File type icon"})}return t===jt.Folder?l(f.jsx(Ye,{icon:f.jsx(z.IconFolder,{className:a.className,size:a.size??J.size,stroke:a.stroke??J.stroke}),className:"inline-block align-middle"})):null},t9=({name:e,type:t,elementId:s,loading:o=!1,shared:n=!1,iconClassName:i,iconIndicator:r,iconLabel:a,iconSize:l,iconStroke:c,inputInvalid:d,inputInvalidMessage:u,inputContainerClassName:h,inputIconAfter:p,inputRef:m,onChange:C,sharedIndicatorClassName:v,sharedIndicatorTooltip:w,fileExtension:b})=>{const S=()=>{const x=u?.startsWith(`${as.Warning}__`);if(!d&&!x)return null;const y=u?.replace(`${as.Warning}__`,"");return f.jsx(At,{tooltip:y,children:p||(x?f.jsx(z.IconAlertTriangleFilled,{...J,className:"text-warning-icon","aria-label":"warning"}):f.jsx(z.IconAlertCircleFilled,{...J,className:"text-error","aria-label":"alert"}))})};return f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx(e9,{name:e,type:t,label:a,className:i,indicator:r,size:l,stroke:c,loading:o,shared:n,fileExtension:b,sharedIndicatorClassName:v,sharedIndicatorTooltip:w}),f.jsx(ni,{containerClassName:ie("!h-6 py-[1px] pl-[7px] pr-[7px]",h),id:s,value:e,onChange:C,invalid:d,iconAfter:S(),inputRef:m})]})};function vw({value:e,isEditing:t,restoreOnCancel:s=!0,onValidate:o,onSave:n,onCancel:i}){const[r,a]=g.useState(e),[l,c]=g.useState(!1),[d,u]=g.useState(""),h=g.useRef(null),p=g.useCallback((b=!1,S="")=>{c(b),u(S)},[]),m=g.useCallback(b=>{if(!o)return p(),!0;const S=o(b);return S?S.startsWith(`${as.Warning}__`)?(p(!1,S),!0):(p(!0,S),!1):(p(),!0)},[o,p]),C=g.useCallback(b=>{const S=b??"";a(S),m(S)},[m]),v=g.useCallback(()=>{m(r)?n?.(r):h.current?.focus()},[m,n,r]),w=g.useCallback(()=>{s&&a(e),p(),i?.()},[e,i,s,p]);return g.useEffect(()=>{t&&(a(e),p(),requestAnimationFrame(()=>{h.current?.focus(),h.current?.select()}))},[t,e,p]),g.useEffect(()=>{const b=h.current;if(!t||!b)return;const S=x=>{x.key==="Enter"?(x.preventDefault(),h.current?.blur()):x.key==="Escape"&&(x.preventDefault(),w())};return b.addEventListener("keydown",S),()=>b.removeEventListener("keydown",S)},[t,v,w]),g.useEffect(()=>{if(!t)return;const b=h.current;if(!b)return;const S=x=>{const y=x.relatedTarget;y&&b.contains(y)||(m(r)?v():b.focus())};return b.addEventListener("blur",S),()=>{b.removeEventListener("blur",S)}},[t,r,m,v]),{inputRef:h,value:r,onChange:C,invalid:l,invalidMessage:d}}const ll=({name:e,type:t,elementId:s,editing:o=!1,loading:n=!1,shared:i=!1,iconSize:r=Ht,validate:a,onSave:l,fileExtension:c,onCancel:d,inputContainerClassName:u,sharedIndicatorClassName:h,sharedIndicatorTooltip:p,hideTooltip:m=!1,forbiddenSymbolsRegExp:C,forbiddenSymbolsTooltip:v,...w})=>{const{value:b,invalid:S,invalidMessage:x,onChange:y,inputRef:F}=vw({value:e,isEditing:o,onValidate:a,onCancel:d,onSave:l});if(!o){const R=Ch({name:e,isFolder:t===jt.Folder},C,v),E=!!R;return t===jt.Folder?f.jsx(ml,{name:e,loading:n,shared:i,iconSize:r,className:"max-w-[428px] truncate",sharedIndicatorClassName:h,hideTooltip:m,isInvalidName:E,tooltipContent:R}):f.jsx(fl,{className:"max-w-[428px]",...w,name:e,shared:i,iconSize:r,sharedIndicatorClassName:h,hideTooltip:m,isInvalidName:E,tooltipContent:R})}return f.jsx(t9,{type:t,name:b,elementId:s,inputInvalid:S,inputInvalidMessage:x,inputRef:F,onChange:y,iconSize:r,fileExtension:c,inputContainerClassName:u,sharedIndicatorTooltip:p,sharedIndicatorClassName:h})},s9=({items:e,showFiles:t=!1,expandedPaths:s,loadingPaths:o=new Set,loadedPaths:n=new Set,sharedByMePaths:i=new Set,selectedPath:r,emptyStateTitle:a="No Folders",emptyStateDescription:l,emptyStateIcon:c,areHiddenFilesVisible:d=!1,renamedPath:u,rootItemLabel:h,rootItemPath:p,onItemClick:m,getContextMenuItems:C,onRenameSave:v,onRenameCancel:w,onRenameValidate:b,onExpandedPathsChange:S,forbiddenSymbolsRegExp:x,forbiddenSymbolsTooltip:y})=>{const{expandedPaths:F,togglePath:R}=gw({expandedPaths:s??new Set,onExpandedPathsChange:S}),E=P=>{m?.(P),R(P.path)},D=(P,T)=>P.map(I=>{const{path:N,nodeType:q,name:L,items:V}=I,H=q===ye.FOLDER;if(!d&&lw(I))return null;if(!H&&!t)return;const A=Array.isArray(V)&&V.length>0&&V.some(Z=>Z.nodeType===ye.FOLDER||t),de=F.has(N),M=r===N,B=o.has(N),U=u===N,W=n.has(N),re=i.has(N),be=p&&h&&N===p&&H,Q=b&&(Z=>b(Z,I)),_=M?"bg-accent-primary-alpha border-l-2 border-l-accent-primary rounded":"border-l-2 border-l-transparent",pe=be?[]:C?.(I)??[],oe=x?Ch({name:I.name,isFolder:H},x,y):void 0;return f.jsx("div",{className:"cursor-pointer text-secondary",children:f.jsxs("div",{className:"flex flex-col w-full","aria-label":"folder",children:[f.jsx(Tt,{trigger:[Gt.ContextMenu],className:"w-full",anchorToMouse:!0,menu:{items:pe},children:f.jsxs("div",{style:{paddingLeft:`${T*J7}px`},className:ie("py-1 gap-[2px] dial-small-text flex justify-between hover:bg-accent-primary-alpha rounded group/item w-full mb-[2px] relative",_),"aria-selected":M,children:[!U&&f.jsx("div",{className:"absolute size-full left-0 top-0 z-0",onClick:()=>E(I)}),f.jsx("div",{className:"relative flex flex-row truncate items-center w-fit h-6 gap-x-1 pl-1",onClick:()=>!U&&E(I),children:f.jsxs(f.Fragment,{children:[H&&f.jsx(z.IconCaretRightFilled,{...Q7,className:ge("flex-shrink-0",de&&"rotate-90 transition-all",W&&!A&&"text-transparent")}),f.jsx(ll,{elementId:`${N}-tree-item`,name:be?h:L,type:H?jt.Folder:jt.File,loading:B,shared:re,sharedIndicatorClassName:ie("group-hover/item:bg-accent-primary-alpha",M&&"bg-accent-primary-alpha"),iconSize:no,forbiddenSymbolsRegExp:x,forbiddenSymbolsTooltip:oe,...!be&&{editing:U,onSave:v,onCancel:w,validate:Q}})]})}),pe.length>0&&!U&&!be&&f.jsx("div",{className:"flex-1 flex justify-end",children:f.jsx(Tt,{placement:"bottom-start",allowedPlacements:["top-start","top-end"],menu:{items:pe},className:"sticky right-0",children:f.jsx(Ye,{className:"invisible group-hover/item:visible text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary",icon:f.jsx(z.IconDotsVertical,{...J})})})})]})}),de&&V&&D(V,T+1)]})},`${N}-children`)});return f.jsx("div",{className:"flex-1 w-full h-full overflow-y-auto","aria-label":"folders-tree",children:e.length>0?D(e,0):f.jsx(dr,{title:a,description:l,icon:c})})},o9=({selectedFiles:e,actionLabels:t,onDuplicate:s,onCopy:o,onMove:n,onDownload:i,onUnshare:r,onRemoveAccess:a,onDelete:l,getCurrentFolderPath:c,sharedWithMeIds:d,sharedByMePaths:u,onClearSelection:h,forbiddenSymbolsRegExp:p})=>g.useMemo(()=>{const m=[],C=Array.from(e.values());if(!C.length||!t)return m;const v=Pl(p),w=v?C.some(b=>v.test(b.name)):!1;if(t[Y.Move]&&!w&&m.push({key:Y.Move,label:t[Y.Move],title:t[Y.Move],icon:f.jsx(ph,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>n(C)}),t[Y.Copy]&&!w&&m.push({key:Y.Copy,label:t[Y.Copy],title:t[Y.Copy],icon:f.jsx(gh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>o(C)}),t[Y.Duplicate]&&!w&&m.push({key:Y.Duplicate,label:t[Y.Duplicate],title:t[Y.Duplicate],icon:f.jsx(z.IconCopy,{...J,className:"text-secondary"}),onClick:()=>s(C)}),t[Y.Delete]){const b=C.some(S=>S.permissions&&!S.permissions.includes(Xo.WRITE));m.push({key:Y.Delete,label:t[Y.Delete],title:t[Y.Delete],icon:f.jsx(z.IconTrashX,{...J,className:"text-secondary"}),disabled:b,tooltip:b?"Selected items contain item which can not be deleted":void 0,onClick:()=>{const S=c();l(C,S)}})}if(t[Y.Download]&&!w&&m.push({key:Y.Download,label:t[Y.Download],title:t[Y.Download],icon:f.jsx(z.IconDownload,{...J,className:"text-secondary"}),onClick:()=>i(C)}),t[Y.Unshare]&&r){const b=C.some(S=>!d?.includes(S.path));m.push({key:Y.Unshare,label:t[Y.Unshare],title:t[Y.Unshare],disabled:b,icon:f.jsx(fh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>{r(C),h()}})}if(t[Y.RemoveAccess]&&a){const b=C.some(S=>!u?.has(S.path));m.push({key:Y.RemoveAccess,label:t[Y.RemoveAccess],title:t[Y.RemoveAccess],disabled:b,icon:f.jsx(z.IconUserX,{size:J.size,className:"text-secondary"}),onClick:()=>{a(C),h()}})}return m},[e,t,r,a,n,o,s,c,l,i,d,h,u,p]);function bh(e){if(!e)return null;if(e instanceof Date)return isFinite(e.getTime())?e:null;if(typeof e=="number"){const t=new Date(e);return isFinite(t.getTime())?t:null}if(typeof e=="string"){const t=e.trim();if(/^-?\d+$/.test(t)){const o=Number(t);return bh(o)}const s=new Date(t);return isFinite(s.getTime())?s:null}return null}const ww=({value:e,locale:t=Av,options:s=Lv,emptyPlaceholder:o,className:n,hideTooltip:i=!1})=>{const r=bh(e),a=g.useMemo(()=>r?new Intl.DateTimeFormat(t,s).format(r):o,[r,o,t,s]),l=r?r.toISOString():void 0;return f.jsx(ft,{text:l?f.jsx("time",{dateTime:l,children:a}):f.jsx("span",{children:a}),className:ge(T8,n),hideTooltip:i})},n9=({id:e,name:t,nodeType:s,size:o,updatedAt:n,dateLocale:i,dateOptions:r,shared:a,sharedIndicatorClassName:l,hideTooltip:c=!1,forbiddenSymbolsRegExp:d,forbiddenSymbolsTooltip:u})=>f.jsx("div",{className:"flex",children:f.jsx("div",{className:"flex flex-1 min-w-0",children:f.jsx(ll,{type:s===ye.FOLDER?jt.Folder:jt.File,name:t,elementId:e,shared:a,iconSize:no,sharedIndicatorClassName:l,hideTooltip:c,forbiddenSymbolsRegExp:d,forbiddenSymbolsTooltip:u,details:f.jsxs("div",{className:"flex items-center gap-1 dial-tiny-text text-secondary",children:[f.jsx("span",{children:s===ye.ITEM?ar(o):""}),n&&o&&f.jsx(z.IconCircleFilled,{size:2,className:"text-secondary"}),n?f.jsx("span",{children:f.jsx(ww,{value:n,locale:i?.toString(),options:r,className:"dial-tiny-text text-secondary",hideTooltip:c})}):null]})})})}),bw=e=>(t,s,o)=>({colId:dt.Name,field:"name",headerName:e,flex:1,minWidth:200,cellRenderer:n=>{const i=n.data.nodeType,{saveFolderCreation:r,validateFolderName:a,cancelFolderCreation:l,newFolderTempId:c,sharedByMePaths:d,selectedPaths:u,disabledRowIds:h}=n.context,p=d?.has(n.data.path),m=u?.has(n.data.path),C=h?.has(n.data.path)??!1,v=ie(["group-hover/grid-row:bg-accent-primary-alpha",m&&"bg-accent-primary-alpha"]);if(n.data?.isTemporary&&n.data.id===c)return f.jsx(ll,{name:"",type:jt.Folder,elementId:`new-folder-${n.data.id}`,editing:!0,shared:p,sharedIndicatorClassName:v,iconSize:no,validate:a,onSave:r,onCancel:l,inputContainerClassName:ie(["!h-9",o&&i===ye.ITEM&&"!h-10"])});const{renameTriggerView:w,renamedPath:b,renamedItem:S,getDisplayName:x,onRenameValidate:y,onRenameSave:F,onRenameCancel:R}=n.context;if(w===Bn.Grid&&b===n.data?.path&&S&&n.data){const P=x(S);return f.jsx(ll,{name:P,type:i===ye.FOLDER?jt.Folder:jt.File,fileExtension:S.name.split(".").pop(),elementId:`rename-${n.data.id}`,editing:!0,shared:p,sharedIndicatorClassName:v,iconSize:no,validate:T=>y(T,S),onSave:F,onCancel:R,inputContainerClassName:ie(["!h-9",o&&i===ye.ITEM&&"!h-10"]),forbiddenSymbolsRegExp:n.context.forbiddenSymbolsRegExp})}if(o)return f.jsx(n9,{id:n.data.id,name:n.data.name,nodeType:i,size:n.data.size,shared:p,sharedIndicatorClassName:v,updatedAt:n.data.updatedAt,dateLocale:t,dateOptions:s,hideTooltip:C,forbiddenSymbolsRegExp:n.context.forbiddenSymbolsRegExp,forbiddenSymbolsTooltip:n.context.forbiddenSymbolsTooltip});const D=Ch({name:n.data.name,isFolder:i===ye.FOLDER},n.context.forbiddenSymbolsRegExp,n.context.forbiddenSymbolsTooltip);return i===ye.FOLDER?f.jsx(ml,{name:n.data.name,shared:p,sharedIndicatorClassName:v,iconSize:no,hideTooltip:C,isInvalidName:!!D,tooltipContent:D}):f.jsx(fl,{name:n.data.name,shared:p,sharedIndicatorClassName:v,iconSize:no,hideTooltip:C,isInvalidName:!!D,tooltipContent:D})}}),Sw=e=>(t,s)=>({colId:dt.UpdatedAt,field:"updatedAt",headerName:e,width:168,suppressSizeToFit:!0,cellRenderer:o=>{const n=o.context?.disabledRowIds?.has(o.data?.path)??!1;return f.jsx(ww,{...o,hideTooltip:n})},cellRendererParams:{locale:t,options:s},filterValueGetter:o=>{const n=o.data[o.colDef.field||""],i=bh(n);return i?new Intl.DateTimeFormat(t||Av,s||Lv).format(i):""}}),yw=e=>({colId:dt.Size,field:"size",headerName:e,width:120,suppressSizeToFit:!0,cellRenderer:t=>t.data.nodeType===ye.ITEM?ar(t.data.contentLength):"",filterValueGetter:t=>t.data.nodeType===ye.ITEM?ar(t.data.contentLength):""}),i9=e=>{const t=e.event;if(!(t?.target??null)?.closest("input")||!t)return!1;switch(t.key){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":return!0;default:return!1}};function r9({userColumnDefs:e,filterable:t,dateLocale:s,dateOptions:o,effectiveVisibleColumns:n,isCompactView:i,hasActions:r,actionsColumnDef:a,rootItemLabel:l,rootItemPath:c}){const d=g.useMemo(()=>[bw("Name")(s,o,i),{colId:dt.Path,field:"path",headerName:"Path",flex:1,minWidth:200,cellRenderer:h=>{const p=h.context?.disabledRowIds?.has(h.data.path)??!1;let m=h.data.path;if(h.context?.hideSearchPathItemName&&(h.data.parentPath?m=h.data.parentPath:m=m.replace(/\/[^/]+\/?$/,"")||"/"),!c||!l)return f.jsx(ft,{text:m,hideTooltip:p});const C=m.replace(c,l);return f.jsx(ft,{text:C,hideTooltip:p})}},Sw("Modified Date")(s,o),yw("Size"),{colId:dt.Author,field:"author",headerName:"Author",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.author},{colId:dt.Owner,field:"owner",headerName:"Owner",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.owner}],[s,o,i,l,c]);return{columnDefs:g.useMemo(()=>{const h=e?.map(C=>typeof C=="function"?C(s,o,i):C);let p=h??d;h||(p=p.filter(C=>C.colId&&n.includes(C.colId))),r&&(i&&(p=p.slice(0,1)),p.push(a));const m=C=>C.colId===dt.Name;return p.map(C=>{const v={...C,filter:t?C.filter:!1,floatingFilter:t?C.floatingFilter:!1};return m(C)&&!C.suppressKeyboardEvent&&(v.suppressKeyboardEvent=i9),v})},[a,s,o,d,n,t,r,i,e])}}const xw=()=>{const e=g.useContext(uw);if(!e)throw new Error("useFileManagerContext must be used within <FileManagerProvider>");return e},a9=({actionLabels:e,onDuplicate:t,onCopy:s,onMove:o,onDownload:n,onRename:i,onDelete:r,onInfo:a,onUnshare:l,onRemoveAccess:c,sharedWithMeIds:d,sharedByMePaths:u,onAddSibling:h,onAddChild:p,onManagePermissions:m,onPreview:C,onOpenInNewTab:v,previewExtensions:w,isRenameFileAvailable:b=!0,isDuplicateFolderAvailable:S=!0,forbiddenSymbolsRegExp:x})=>g.useMemo(()=>y=>{const F=[];if(!e)return F;const R=Pl(x)?.test(y.name);e[Y.AddSibling]&&typeof h=="function"&&y.nodeType===ye.FOLDER&&F.push({key:"addSibling",label:e[Y.AddSibling],icon:f.jsx(aw,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>h(y)}),e[Y.AddChild]&&typeof p=="function"&&y.nodeType===ye.FOLDER&&!R&&F.push({key:"addChild",label:e[Y.AddChild],icon:f.jsx(rw,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>p(y)},{key:"divider",type:qn.Divider}),e[Y.OpenInNewTab]&&typeof v=="function"&&y.nodeType===ye.ITEM&&!R&&F.push({key:Y.OpenInNewTab,label:e[Y.OpenInNewTab],icon:f.jsx(z.IconExternalLink,{...J,className:"text-secondary"}),onClick:()=>v?.(y)});const E=y.nodeType===ye.ITEM||y.nodeType===ye.FOLDER&&S;e[Y.Duplicate]&&E&&!R&&F.push({key:Y.Duplicate,label:e[Y.Duplicate],icon:f.jsx(z.IconCopy,{...J,className:"text-secondary"}),onClick:()=>t(y)}),e[Y.Copy]&&!R&&F.push({key:Y.Copy,label:e[Y.Copy],icon:f.jsx(gh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>s(y)}),e[Y.Move]&&!R&&F.push({key:Y.Move,label:e[Y.Move],icon:f.jsx(ph,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>o(y)}),e[Y.Download]&&!R&&F.push({key:Y.Download,label:e[Y.Download],icon:f.jsx(z.IconDownload,{...J,className:"text-secondary"}),onClick:()=>n(y)}),e[Y.ManagePermissions]&&typeof m=="function"&&y.nodeType===ye.FOLDER&&!R&&F.push({key:Y.ManagePermissions,label:e[Y.ManagePermissions],icon:f.jsx(z.IconExternalLink,{...J,className:"text-secondary"}),onClick:()=>m?.(y.path)});const D=y.name.split("."),P=D.length>1?D[D.length-1]:"",T=P&&w?.includes(`.${P}`);e[Y.Preview]&&typeof C=="function"&&y.nodeType===ye.ITEM&&T&&!R&&F.push({key:Y.Preview,label:e[Y.Preview],icon:f.jsx(z.IconEye,{...J,className:"text-secondary"}),onClick:()=>C?.(y.path)});const I=!y.permissions||y.permissions.includes(Xo.WRITE);e[Y.Delete]&&I&&F.push({key:Y.Delete,label:e[Y.Delete],icon:f.jsx(z.IconTrashX,{...J,className:"text-secondary"}),onClick:()=>r(y,y.parentPath??"")});const N=y.nodeType===ye.FOLDER||y.nodeType===ye.ITEM&&b;return e[Y.Rename]&&N&&F.push({key:Y.Rename,label:e[Y.Rename],icon:f.jsx(z.IconPencilMinus,{...J,className:"text-secondary"}),onClick:()=>i(y.path)}),e[Y.Info]&&y.nodeType===ye.ITEM&&!R&&F.push({key:Y.Info,label:e[Y.Info],icon:f.jsx(z.IconInfoCircle,{...J,className:"text-secondary"}),onClick:()=>a(y)}),e[Y.Unshare]&&d?.includes(y.path)&&F.push({key:Y.Unshare,label:e[Y.Unshare],icon:f.jsx(fh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>l(y)}),e[Y.RemoveAccess]&&u?.has(y.path)&&c&&F.push({key:Y.RemoveAccess,label:e[Y.RemoveAccess],icon:f.jsx(z.IconUserX,{size:J.size,className:"text-secondary"}),onClick:()=>c(y)}),F},[e,h,p,t,s,o,n,r,i,a,l,c,d,u,m,C,v,w,b,S,x]),Rw=e=>f.jsx(mw,{...e,children:f.jsx(l9,{})}),l9=()=>{const{managerLabel:e,className:t,items:s,rootItem:o,filesLoading:n,treeOptions:i,showNavigationPanel:r,navigationPanelOptions:a,gridOptions:l,toolbarOptions:c,bulkActionsToolbarOptions:d,deleteConfirmationOptions:u,destinationFolderPopupOptions:h,conflictResolutionPopupOptions:p,compactViewWidthBreakpoint:m=i7,customBreakpointRef:C,sharedByMePaths:v,allowedFileTypes:w,maxSelectableFileSize:b,areHiddenFilesVisible:S,toggleHiddenFilesVisibility:x,isTreeCollapsed:y,toggleTreeCollapse:F,currentPath:R,gridRows:E,selectedPaths:D,selectedFiles:P,clearSelection:T,setSelectedPaths:I,effectiveSearchValue:N,handleBreadcrumbItemClick:q,handleSearchChange:L,handleTreeItemClick:V,handleTableRowClick:H,handleSelectionClick:A,onGridApiChange:de,handleOpenDestinationFolderPopup:M,handleCloseDestinationFolderPopup:B,openDestinationFolderPopup:U,destinationFolderMode:W,handleSetCopiedFiles:re,handleSetMovedFiles:be,handleDuplicate:Q,handleCopyTo:_,handleMoveTo:pe,handleAddSibling:oe,handleAddChild:Z,handleDownloadFiles:j,openDeleteConfirmation:ae,closeDeleteConfirmation:G,confirmDelete:fe,deleteConfirmationOpen:he,itemsToDelete:se,renamedPath:le,renamedItem:Fe,onRename:Oe,onRenameSave:ve,onRenameCancel:Ee,onRenameValidate:_e,forbiddenSymbolsRegExp:je,forbiddenSymbolsTooltip:Ae,getDisplayName:Mt,isDragging:os,isDraggingOverWindow:It,handleDragEnter:Ge,handleDragLeave:K,handleDragOver:He,handleDrop:ns,onUploadFiles:ii,onValidateUpload:Tl,maxFileSize:Ml,newActions:mo,isNewButtonVisible:ri,isNewButtonDisabled:Zo,newFolderTempId:wr,cancelFolderCreation:Qo,saveFolderCreation:br,validateFolderName:Sr,startFolderCreation:yr,conflictingFiles:Il,conflictResolutionOpen:kl,handleConflictReplace:$s,handleConflictDuplicate:Ds,handleConflictCancel:Ps,handleConflictDecideForEach:Co,uploadConflictingFiles:qs,uploadConflictResolutionOpen:Al,handleUploadConflictReplace:Ll,handleUploadConflictDuplicate:Ol,handleUploadConflictCancel:Nl,handleUploadConflictDecideForEach:st,openMetadataPopup:Hl,fileMetadataPopupOptions:vt,isMetadataPopupOpen:ai,selectedFileForMetadata:li,closeMetadataPopup:ci,onUnshareFiles:Jo,onRemoveFilesAccess:en,actionsRef:Gl,searchInProgress:tn,isSearchMode:Ts,emptyStateIcon:xr,emptyStateTitle:Rr="You don't have any files",emptyStateDescription:Fr="Upload or drag and drop files",sharedWithMeIds:sn,onFolderPopupPathChange:Bl,onManagePermissions:on,onPreview:Vl,onOpenInNewTab:zl,previewExtensions:Wl,isRenameFileAvailable:_l,isDuplicateFolderAvailable:jl,getDisabledTooltip:di,fileTooLargeTooltip:Er,unsupportedFileTypeTooltip:nn,gridClassName:Ul,nonClickableTableColumns:ui,hideSearchPathItemName:yt,showHiddenFileSwitcherInDestinationPopup:Dr}=xw(),{width:rt=JL,header:Pr=e7,containerClassName:Tr=XL,additionalButtons:Mr,...Ir}=i??{},[rn,an]=g.useState(rt),{renameTriggerView:ln,onGridRename:$l,onTreeRename:kr}=l7({onRename:Oe}),hi=g.useRef(null),ql=X=>{hi.current===null&&(hi.current=requestAnimationFrame(()=>{an(X),hi.current=null}))},{columnDefs:Kl,filterable:Yl=!0,dateLocale:Xl,dateOptions:Zl,selectionMode:Ar,wrapCustomCellRenderers:Lr,visibleColumns:Or=r7,allowDisabledContextMenu:cn=!1,...Ks}=l??{},{containerRef:Ql,isBelowBreakpoint:xt}=c7(m,C),Jl=g.useMemo(()=>Ts?[dt.Name,dt.Path,dt.Actions]:Or,[Ts,Or]),gi=g.useCallback((X,Ue,Ze)=>p7(X,Ue,Ze,nn,Er),[Er,nn]),dn=g.useCallback((X,Ue,Ze)=>!!gi(X,Ue,Ze),[gi]),vo=g.useMemo(()=>{const X=new Set;for(const Ue of E)dn(Ue,w,b)&&X.add(Ue.path);return X},[w,b,E,dn]),Nr=g.useCallback(X=>{const Ue=[],Ze=[],$t=!X.parentPath,gs=je?.test(X.name);return i?.actionLabels&&(i.actionLabels[Y.AddSibling]&&typeof oe=="function"&&X.nodeType===ye.FOLDER&&!$t&&Ue.push({key:"addSibling",label:i.actionLabels[Y.AddSibling],icon:f.jsx(aw,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>oe([X])}),i.actionLabels[Y.AddChild]&&typeof Z=="function"&&X.nodeType===ye.FOLDER&&!gs&&Ue.push({key:"addChild",label:i.actionLabels[Y.AddChild],icon:f.jsx(rw,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>Z([X])}),i.actionLabels[Y.Duplicate]&&!$t&&!gs&&Ze.push({key:"duplicate",label:i.actionLabels[Y.Duplicate],icon:f.jsx(z.IconCopy,{...J,className:"text-secondary"}),onClick:()=>Q([X])}),i.actionLabels[Y.Copy]&&!$t&&!gs&&Ze.push({key:ct.Copy,label:i.actionLabels[Y.Copy],icon:f.jsx(gh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>{re([X]),M(ct.Copy)}}),i.actionLabels[Y.Move]&&!$t&&!gs&&Ze.push({key:ct.Move,label:i.actionLabels[Y.Move],icon:f.jsx(ph,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>{be([X]),M(ct.Move)}}),i.actionLabels[Y.Download]&&!$t&&!gs&&Ze.push({key:"download",label:i.actionLabels[Y.Download],icon:f.jsx(z.IconDownload,{...J,className:"text-secondary"}),onClick:()=>j([X])}),i.actionLabels[Y.Rename]&&!$t&&Ze.push({key:"rename",label:i.actionLabels[Y.Rename],icon:f.jsx(z.IconPencilMinus,{...J,className:"text-secondary"}),onClick:()=>kr(X.path)}),i.actionLabels[Y.Unshare]&&sn?.includes(X.path)&&!$t&&Ze.push({key:"unshare",label:i.actionLabels[Y.Unshare],icon:f.jsx(fh,{width:J.size,height:J.size,className:"text-secondary"}),onClick:()=>Jo?.([X])}),i.actionLabels[Y.RemoveAccess]&&v?.has(X.path)&&!$t&&Ze.push({key:Y.RemoveAccess,label:i.actionLabels[Y.RemoveAccess],icon:f.jsx(z.IconUserX,{size:J.size,className:"text-secondary"}),onClick:()=>en?.([X])}),i.actionLabels[Y.ManagePermissions]&&typeof on=="function"&&X.nodeType===ye.FOLDER&&!$t&&Ze.push({key:Y.ManagePermissions,label:i.actionLabels[Y.ManagePermissions],icon:f.jsx(z.IconExternalLink,{...J,className:"text-secondary"}),onClick:()=>on?.(X.path)}),i.actionLabels[Y.Delete]&&X.permissions?.includes(Xo.WRITE)&&!$t&&Ze.push({key:"delete",label:i.actionLabels[Y.Delete],icon:f.jsx(z.IconTrashX,{...J,className:"text-secondary"}),onClick:()=>ae([X],X.parentPath??"")})),Ue.length?Ze.length===0?Ue:Ue.length===0?Ze:[...Ue,{key:"divider",type:qn.Divider},...Ze]:Ze},[i?.actionLabels,oe,je,Z,on,Q,re,M,be,j,kr,Jo,en,sn,v,ae]),Hr=g.useMemo(()=>{const X=new Set;return P.forEach((Ue,Ze)=>X.add(Ze)),X},[P]),Gr=g.useCallback((X,Ue)=>{I(X),A?.(Ue)},[A,I]),Br=o9({selectedFiles:P,actionLabels:d?.actionLabels,onDuplicate:Q,onCopy:X=>{re(X),M(ct.Copy)},onMove:X=>{be(X),M(ct.Move)},onDownload:j,onDelete:ae,onUnshare:Jo,onRemoveAccess:en,getCurrentFolderPath:()=>R??"/",sharedWithMeIds:sn,sharedByMePaths:v,onClearSelection:T,forbiddenSymbolsRegExp:je}),pi=g.useCallback(X=>{c?.onTabChange?.(X),Qo()},[c,Qo]),ec=g.useCallback(()=>c&&D.size===0?f.jsxs("div",{className:Ap,role:"toolbar","aria-label":"File Manager Toolbar",children:[e,f.jsx(K7,{...c,onTabChange:pi,areHiddenFilesVisible:S,onToggleHiddenFiles:x,isNewButtonVisible:ri,isNewButtonDisabled:Zo,newButtonDropdownItems:mo})]}):D.size>0&&d?f.jsx("div",{className:Ap,role:"toolbar","aria-label":"File Manager Toolbar",children:f.jsx(W7,{...d,selectedCount:D.size,onClearSelection:T,actions:Br})}):null,[pi,d,D,T,Br,S,x,c,ri,Zo,mo,e]);g.useImperativeHandle(Gl,()=>({createFolder:yr}),[yr]);const Vr=g.useCallback(()=>xt?null:f.jsx("aside",{role:"region","aria-label":"File Manager Tree Navigation",className:"min-h-0 min-w-0 h-full flex-none",children:f.jsx(pf,{defaultWidth:rn,width:rn,onResizeStop:an,onResize:ql,minWidth:s7,maxWidth:o7,enabled:!y,children:f.jsx(Jp,{width:rn,title:Pr,containerClassName:Tr,titleClassName:"dial-body-text text-primary",additionalButtons:Mr,isOpened:!y,onToggle:F,children:f.jsx(s9,{...Ir,items:s,rootItemPath:o?.path,rootItemLabel:o?.label,selectedPath:R,sharedByMePaths:v,forbiddenSymbolsRegExp:je,forbiddenSymbolsTooltip:Ae,onItemClick:V,areHiddenFilesVisible:S,getContextMenuItems:Nr,renamedPath:ln===Bn.Tree?le:void 0,onRenameSave:ve,onRenameCancel:Ee,onRenameValidate:_e})})})}),[xt,rn,y,Pr,Tr,Mr,F,Ir,s,o?.path,o?.label,R,v,je,Ae,V,S,Nr,ln,le,ve,Ee,_e]),zr=a9({actionLabels:l?.actionLabels,onDuplicate:X=>Q([X]),onCopy:X=>{re([X]),M(ct.Copy)},onMove:X=>{be([X]),M(ct.Move)},onDownload:X=>j([X]),onRename:$l,onDelete:(X,Ue)=>ae([X],Ue),onInfo:X=>Hl(X),onUnshare:X=>Jo?.([X]),onRemoveAccess:X=>en?.([X]),sharedWithMeIds:sn,sharedByMePaths:v,onAddChild:X=>Z?.([X]),onAddSibling:X=>oe?.([X]),onManagePermissions:X=>on?.(X),onPreview:X=>Vl?.(X),onOpenInNewTab:X=>zl?.(X),previewExtensions:Wl,isRenameFileAvailable:_l,isDuplicateFolderAvailable:jl,forbiddenSymbolsRegExp:je}),un=g.useCallback(X=>{const Ue=Vs(s,X.path);return Ue?zr(Ue):[]},[s,zr]),tc=g.useCallback((X,Ue,Ze)=>cn?!1:dn(X,Ue,Ze),[cn,dn]),{actionsColumnDef:sc}=a7({getContextMenuItems:un,isRowDisabled:tc,allowedFileTypes:w,buttonClassName:xt?"":QL}),{columnDefs:fi}=r9({userColumnDefs:Kl,filterable:Yl,dateLocale:Xl,dateOptions:Zl,effectiveVisibleColumns:Jl,isCompactView:xt,hasActions:!!l?.actionLabels,actionsColumnDef:sc,rootItemLabel:o?.label,rootItemPath:o?.path}),Wr=g.useCallback(X=>{X.colDef.colId==="ag-Grid-SelectionColumn"||X.colDef.colId===dt.Actions||le&&X.data?.path===le||X.data?.isTemporary||ui&&ui.includes(X.colDef.colId)||X.data&&H(X.data)},[le,H,ui]),_r=g.useCallback(()=>f.jsx(dr,{title:Rr,description:Fr,descriptionClassName:"text-sm",containerClassName:"gap-3 size-full bg-layer-2 border rounded-[4px] border-primary",titleClassName:"mt-2 !text-lg",icon:xr||f.jsx(z.IconFileDescription,{size:100,stroke:.5,className:"text-secondary"})}),[Fr,xr,Rr]),jr=g.useMemo(()=>X=>X.path,[]),Ur=g.useMemo(()=>ge("min-h-[248px] overflow-auto md:min-h-[266px]",os?"border border-dashed border-accent-primary":"",It&&!os?"border border-dashed border-primary":""),[os,It]),$r=g.useMemo(()=>({...Ks.additionalGridOptions,onCellClicked:Wr,headerHeight:od,rowHeight:od,rowClass:"group/grid-row",defaultColDef:{...Ks.additionalGridOptions?.defaultColDef,floatingFilter:a?.searchable?!1:Ks.additionalGridOptions?.defaultColDef?.floatingFilter},...xt?{getRowHeight:X=>X.data?.nodeType===ye.FOLDER?od:n7}:{},context:{cancelFolderCreation:Qo,saveFolderCreation:br,getDisplayName:Mt,onRenameCancel:Ee,onRenameSave:ve,onRenameValidate:_e,renameTriggerView:ln,validateFolderName:Sr,renamedItem:Fe,renamedPath:le,newFolderTempId:wr,sharedByMePaths:v,selectedPaths:D,disabledRowIds:vo,forbiddenSymbolsRegExp:je,forbiddenSymbolsTooltip:Ae,hideSearchPathItemName:yt}}),[Ks.additionalGridOptions,Wr,a?.searchable,xt,Qo,br,Mt,Ee,ve,_e,ln,Sr,Fe,le,wr,v,D,vo,je,Ae,yt]),qr=g.useMemo(()=>E.length===0&&!Ts&&!n?_r():f.jsx(lh,{columnDefs:fi,rowData:E,getRowId:jr,loading:n||tn,getContextMenuItems:un,withoutHeaderBorders:xt,selectionOnHover:!xt,onGridApiChange:de,className:Ur,...Ks,selectionMode:Ar,wrapCustomCellRenderers:Lr,additionalGridOptions:$r,selectedRowIds:Hr,onSelectionChange:Gr,wrapperBorder:!os&&!It,disabledRowIds:vo,allowDisabledContextMenu:cn}),[E,Ts,n,_r,fi,jr,tn,un,xt,de,Ur,Ks,Ar,Lr,$r,Hr,Gr,os,It,vo,cn]);return f.jsx("section",{ref:Ql,className:"size-full",children:f.jsxs("div",{className:ie(qL,{"gap-3 pt-4":d&&D.size>0,"gap-4 p-3 pt-4":xt,"gap-2 pt-2":xt&&d&&D.size>0},t),children:[ec(),f.jsxs("div",{className:ie(KL,Ul),children:[Vr(),f.jsxs("div",{className:ie(YL,{"gap-3":xt}),children:[r&&f.jsx(q7,{...a??{},makeHref:X=>X.join("/"),path:R,onItemClick:q,rootItemPath:o?.path,rootItemLabel:o?.label,value:N,onSearchChange:L,isCompactView:xt,labelClassName:"dial-tiny-text"}),f.jsxs("section",{role:"region","aria-label":"File Manager Grid View",className:ie(ZL,"relative"),onDragEnter:Ge,onDragLeave:K,onDragOver:He,onDrop:ns,children:[qr,f.jsx(G7,{disabledGridRowIds:vo,gridRows:E,getDisabledTooltip:di,getRowDisabledTooltip:gi,allowedFileTypes:w,maxSelectableFileSize:b})]})]})]}),f.jsx(_7,{...u,open:he,itemsToDelete:se,onClose:G,onConfirm:fe}),f.jsx(Cw,{...h,open:U,onClose:B,onConfirm:()=>{const X=h?.destinationFolderPath??"/";W===ct.Copy?_(X):pe(X),B()},mode:W,items:s,rootItem:o,gridOptions:{columnDefs:fi.filter(X=>X.colId!==dt.Actions),loading:n},onUploadFiles:ii,onValidateUpload:Tl,maxFileSize:Ml,path:h?.destinationFolderPath??h?.sourceFolder??R,onPathChange:X=>{h?.setDestinationFolderPath?.(X)},sourceFolder:h?.sourceFolder??R,treeOptions:{header:i?.header},onFolderPopupPathChange:Bl,showHiddenFileSwitcher:Dr}),f.jsx(Lp,{...p,open:kl,onClose:Ps,onReplace:$s,onDuplicate:Ds,onDecideForEach:Co,conflictingFiles:Il}),f.jsx(Lp,{...p,open:Al,onClose:Nl,onReplace:Ll,onDuplicate:Ol,onDecideForEach:st,conflictingFiles:qs}),f.jsx(Z7,{open:ai,onClose:ci,fileMetadata:vt?.fileMetadata??li,loading:vt?.loading,header:vt?.header,nameLabel:vt?.nameLabel,pathLabel:vt?.pathLabel,modifiedDateLabel:vt?.modifiedDateLabel,sizeLabel:vt?.sizeLabel,authorLabel:vt?.authorLabel,dateLocale:l?.dateLocale,dateOptions:l?.dateOptions})]})})},c9=(e,t=Dn.MyFiles)=>{const s=Object.values(Dn).includes(t)?t:Dn.MyFiles,[o,n]=g.useState(s),i=a=>{n(a)},r=g.useMemo(()=>{if(e)return Object.values(Dn).map(a=>({id:a,label:e?.[a]||a.replace("_"," ")}))},[e]);return{activeTab:o,handleTabChange:i,tabs:r}},d9="application/octet-stream";function u9(e,t){if(!e||e.length===0)return[];const s=e.find(l=>l.parentPath===""&&l.nodeType==="FOLDER");if(!s)return[];const o=s.path||s.url||"",n=rd(o,!0),i=e.filter(l=>l!==s).map(l=>{const c=l.path||l.url||"",d=h9(l.nodeType),u=d===ye.FOLDER,h=rd(c,u);let p;return l.parentPath===null||l.parentPath===void 0?p=n:l.parentPath===""?p="":p=rd(l.parentPath,!0),{...l,originalPath:c,path:h,parentPath:p,nodeType:d}}),r=new Map;i.forEach(l=>{const c={...l,id:l.originalPath,name:l.name,path:l.path,parentPath:l.parentPath,nodeType:l.nodeType,resourceType:g9(l.resourceType),folderId:t,updatedAt:l.updatedAt?new Date(l.updatedAt).toISOString():new Date().toISOString(),items:l.nodeType===ye.FOLDER?[]:void 0};l.nodeType===ye.ITEM&&(c.extension=p9(l.name),c.contentType=l.contentType||d9,c.contentLength=l.contentLength||0),r.set(l.path,c)});const a=[];return r.forEach(l=>{if(l.parentPath===n)a.push(l);else{const c=l.path.lastIndexOf(l.name||""),d=l.path.slice(0,c),u=r.get(d);u&&u.nodeType===ye.FOLDER?(u.items=u.items||[],u.items.push(l)):a.push(l)}}),a}function rd(e,t){try{let s=decodeURIComponent(e);return t?s.endsWith("/")||(s+="/"):s.endsWith("/")&&(s=s.slice(0,-1)),s}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function h9(e){return e.toUpperCase()==="FOLDER"?ye.FOLDER:ye.ITEM}function g9(e){if(!e)return;const t=e.toUpperCase();return Object.values(mh).find(o=>o.toUpperCase()===t)}function p9(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function f9(e,t="Prompts",s="prompts/public/",o="root"){const n=u9(e,o);return[{id:o,name:t,path:s,parentPath:"",nodeType:ye.FOLDER,folderId:o,items:n}]}exports.AlertVariant=as;exports.BASE_ICON_PROPS=J;exports.BASE_ICON_SIZE=Ht;exports.ButtonAppearance=Me;exports.ButtonVariant=ze;exports.ConfirmationPopupVariant=Kn;exports.DIAL_ICON_SIZE=Ct;exports.DialAlert=Qp;exports.DialAutocompleteInputValue=qv;exports.DialBreadcrumb=Vv;exports.DialBreadcrumbItem=Ii;exports.DialButton=ss;exports.DialButtonDropdown=Qd;exports.DialCaptionText=lr;exports.DialCheckbox=ud;exports.DialCloseButton=ah;exports.DialCollapsibleSidebar=Jp;exports.DialConditionalResizableContainer=pf;exports.DialConfirmationPopup=Uv;exports.DialDestinationFolderPopup=Cw;exports.DialDraggableItem=J0;exports.DialDropdown=Tt;exports.DialEllipsisTooltip=ft;exports.DialErrorButton=Wv;exports.DialErrorIconButton=_v;exports.DialErrorText=ls;exports.DialFileIcon=uu;exports.DialFileManager=Rw;exports.DialFileManagerActions=Y;exports.DialFileManagerTabs=Dn;exports.DialFileName=fl;exports.DialFileNodeType=ye;exports.DialFilePermission=Xo;exports.DialFileResourceType=mh;exports.DialFolderName=ml;exports.DialFormItem=nu;exports.DialFormPopup=dL;exports.DialGhostButton=_8;exports.DialGhostIconButton=X8;exports.DialGrid=lh;exports.DialIcon=Ye;exports.DialIconButton=uo;exports.DialInput=ni;exports.DialInputPopup=Kv;exports.DialItemType=jt;exports.DialLabel=_o;exports.DialLabelledText=X1;exports.DialLinkButton=W8;exports.DialLoadFileArea=iw;exports.DialLoadFileAreaField=jL;exports.DialLoader=cr;exports.DialNeutralButton=Fs;exports.DialNeutralIconButton=$8;exports.DialNoDataContent=dr;exports.DialNumberInput=mL;exports.DialPasswordInput=wL;exports.DialPopup=Yo;exports.DialPrimaryButton=xs;exports.DialPrimaryIconButton=U8;exports.DialRadioButton=ou;exports.DialRadioGroup=ka;exports.DialRadioGroupPopupField=rL;exports.DialRemoveButton=jv;exports.DialResizableContainer=gf;exports.DialSearch=uh;exports.DialSecondaryIconButton=q8;exports.DialSelect=Qv;exports.DialSelectField=DL;exports.DialSharedEntityIndicator=$i;exports.DialSkeleton=Sn;exports.DialSkeletonAvatarShape=Aa;exports.DialSkeletonAvatarSize=Ai;exports.DialSkeletonVariant=Zt;exports.DialSteps=j1;exports.DialSuccessIconButton=Y8;exports.DialSwitch=dh;exports.DialTabs=Nv;exports.DialTag=xn;exports.DialTagInput=$v;exports.DialTertiaryIconButton=K8;exports.DialTextarea=Z8;exports.DialTooltip=At;exports.DropdownItemType=qn;exports.DropdownTrigger=Gt;exports.DropdownType=kv;exports.ElementSize=Ft;exports.FileManagerColumnKey=dt;exports.FileManagerProvider=mw;exports.FlexibleActionsDirection=Eo;exports.FormItemOrientation=Ui;exports.GridSelectionMode=ji;exports.NAME_COLUMN=bw;exports.NOT_ALLOWED_SPACES=vh;exports.NOT_ALLOWED_SPACES_REGEXP=H7;exports.NOT_ALLOWED_SYMBOLS=pw;exports.NOT_ALLOWED_SYMBOLS_REGEXP=fw;exports.PopupSize=_t;exports.RadioGroupOrientation=Lo;exports.ResizableContainerSide=qi;exports.SIZE_COLUMN=yw;exports.SelectSize=rl;exports.SelectVariant=al;exports.StepStatus=Bt;exports.TabOrientation=nl;exports.TagVariant=cl;exports.UPDATED_AT_COLUMN=Sw;exports.mergeClasses=ie;exports.useDialFileManagerTabs=c9;exports.useEditableItem=vw;exports.useFileManagerContext=xw;exports.wrapInRootFolder=f9;
|
package/dist/dial-ui-kit.es.js
CHANGED
|
@@ -51611,7 +51611,7 @@ const tO = ':;,=/{}%&\\"', jw = `(\r
|
|
|
51611
51611
|
] }),
|
|
51612
51612
|
header: f ?? Y,
|
|
51613
51613
|
children: /* @__PURE__ */ p.jsxs("div", { className: "bg-layer-2 h-full flex flex-col", children: [
|
|
51614
|
-
b && /* @__PURE__ */ p.jsx("div", { className: "px-4 pt-4", children: /* @__PURE__ */ p.jsx(n0, { ...b }) }),
|
|
51614
|
+
b && /* @__PURE__ */ p.jsx("div", { className: "px-6 mb-4 pt-4", children: /* @__PURE__ */ p.jsx(n0, { ...b }) }),
|
|
51615
51615
|
/* @__PURE__ */ p.jsx("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ p.jsx(
|
|
51616
51616
|
OO,
|
|
51617
51617
|
{
|