@genesislcap/design-system-configurator 15.95.0 → 15.95.1

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.
@@ -9449,7 +9449,7 @@
9449
9449
  <div class="ag-status-bar-left" part="status-bar-left" ${(0,s.ref)("leftEl")}></div>
9450
9450
  <div class="ag-status-bar-right" part="status-bar-right" ${(0,s.ref)("rightEl")}></div>
9451
9451
  </div>
9452
- `,Sr=xr(),zr={[m.k7.labelValue]:ur,[m.k7.loadMore]:vr,[m.k7.reload]:mr,[m.k7.rowCount]:fr};class kr extends((0,o.S)(g.FoundationElement)){constructor(){super(...arguments),this.gridHost=null,this.gridApi=null,this.statusBarConfig=null,this.panels=new Map,this.warnedPanelTypes=new Set}gridHostChanged(){this.syncPanels()}gridApiChanged(){this.syncPanels()}statusBarConfigChanged(){this.syncPanels()}leftElChanged(){this.syncPanels()}rightElChanged(){this.syncPanels()}syncPanels(){var e;if(!this.leftEl||!this.rightEl)return;this.releasePanels();const a=this.gridHost,t=this.resolveApi();if(!(null==a?void 0:a.withStatusBar)||!t)return;const r=br({withStatusBar:a.withStatusBar,statusBarConfig:null!==(e=this.statusBarConfig)&&void 0!==e?e:a.statusBarConfig,isServerSide:a.isServerSide,isInfiniteRowModel:a.isInfiniteRowModel,gridProDatasource:a.gridProDatasource});for(const e of r)this.mountPanel(e,t)}getStatusPanel(e){return this.panels.get(e)}releasePanels(){var e,a,t,r,i;for(const r of this.panels.values())null===(e=r.destroy)||void 0===e||e.call(r),null===(t=null===(a=r.getGui)||void 0===a?void 0:a.call(r))||void 0===t||t.remove();this.panels.clear(),null===(r=this.leftEl)||void 0===r||r.replaceChildren(),null===(i=this.rightEl)||void 0===i||i.replaceChildren()}connectedCallback(){super.connectedCallback(),this.panels.size||this.syncPanels()}disconnectedCallback(){super.disconnectedCallback(),this.shouldRunDisconnect?this.releasePanels():queueMicrotask(()=>{this.isConnected||this.releasePanels()})}resolveApi(){var e,a,t;return null!==(t=null!==(e=this.gridApi)&&void 0!==e?e:null===(a=this.gridHost)||void 0===a?void 0:a.gridApi)&&void 0!==t?t:null}mountPanel(e,a){var t,r;const i=zr[e.statusPanel];if(!i)return void(this.warnedPanelTypes.has(e.statusPanel)||(this.warnedPanelTypes.add(e.statusPanel),U.warn(`Grid Pro status bar: no panel for type '${e.statusPanel}', skipping it`)));const o=new i,n=Object.assign(Object.assign({api:a,context:{}},e.statusPanelParams),null===(r=null===(t=this.gridHost)||void 0===t?void 0:t.getStatusPanelState)||void 0===r?void 0:r.call(t,e.statusPanel));o.init(n);const l=o.getGui();("right"===e.align?this.rightEl:this.leftEl).appendChild(l),this.panels.set(e.statusPanel,o)}}(0,r.Cg)([s.observable],kr.prototype,"gridHost",void 0),(0,r.Cg)([s.observable],kr.prototype,"gridApi",void 0),(0,r.Cg)([s.observable],kr.prototype,"statusBarConfig",void 0),(0,r.Cg)([s.observable],kr.prototype,"leftEl",void 0),(0,r.Cg)([s.observable],kr.prototype,"rightEl",void 0);const Rr=kr.compose({baseName:"grid-pro-status-bar",template:xr(),styles:Cr});class Ar{init(e){const a=this.eGui=document.createElement("div"),t=e.value;a.classList.add("custom-tooltip"),a.style["background-color"]="#f14376",a.style.border="1px inside",a.style["border-color"]="#2e3339",a.style["border-radius"]="4px",a.style.padding="5px",a.style["box-shadow"]="0px 4px 10px 0px rgba(0, 0, 0, 0.25);",a.innerHTML=`<span style='color: #000000; font-size: 10px'>${t}</span>`}getGui(){return this.eGui}}var Dr=t(50103);function Er(e){return{colId:e.field||e.colId||"",hide:e.hide||!1,width:e.width||null,pinned:e.pinned||null,sort:e.sort||null,sortIndex:e.sortIndex||null,aggFunc:e.aggFunc||null,rowGroup:e.rowGroup||!1,rowGroupIndex:e.rowGroupIndex||null,pivot:e.pivot||!1,pivotIndex:e.pivotIndex||null,flex:e.flex||null}}const Mr=Object.keys(Er({}));function Or(e){return Array.isArray(e)?e.map(e=>{const a={},t=a;for(const a of Mr){const r=e[a];void 0!==r&&(t[a]=r)}return a}):[]}function Tr(e){return e.map(Er)}function Ir(e,a){const t=Or(a),r={},i=[],o="field",n="colId",l=e=>Array.isArray(e.children),s=e=>{var a;return null!==(a=e[o])&&void 0!==a?a:e[n]},g=new Map;t.forEach(e=>{null!=e[n]&&g.set(e[n],e)});const d=e=>{if(l(e))return Object.assign(Object.assign({},e),{children:e.children.map(d)});const a=s(e),t=null!=a?g.get(a):void 0;return t?Object.assign(Object.assign({},e),t):Object.assign({},e)};return t.forEach(a=>{const t=a[n];if(null==t)return;const g=e.find(e=>!l(e)&&(e[o]===t||null!=e[n]&&e[n]===t));if(g){const e=s(g),t=Object.assign(Object.assign({},g),a);null!=e&&(r[e]=t),i.push(t)}}),e.forEach(e=>{if(l(e))return void i.push(d(e));const a=s(e);if(null==a||!r.hasOwnProperty(a)){const t=Object.assign({},e);null!=a&&(r[a]=t),i.push(t)}}),i}(0,i.N)(rt,it,Et,Tt,v,we,Ze,kr),d.syG.registerModules([d.n76,d.Q90,d.x6L,d.YN8,d.YzW,d.Lt,d.I95,d.O4V,d.H18,d.lvV,d.mfG,d.Iws,d.nSw,d.FUS,d.Ss0,d.tkg,d.ZDV,d.ZyC,d.XG7,d.VZy,d.$I9,d.dGu,d.AJG,d.c5B,d.BG,d.KIB,d.Sko,d.ZuP,d.Vc,qe]);const Lr="gridReady";const Nr=new WeakSet,Fr=e=>{var a;return null!==(a=e.valueFormatted)&&void 0!==a?a:e.value};function Pr(e,a){if(!1===e.tooltip||Nr.has(e.tooltip))return;const t=function(e){const{tooltip:a,tooltipField:t,tooltipValueGetter:r}=e;if("function"==typeof a)return a;if(!0===a)return Fr;if("string"==typeof a)return()=>a;if(t)return e=>{return null==e.data?null==r?void 0:r(e):(a=e.data,t.split(".").reduce((e,a)=>null==e?void 0:e[a],a));var a};return r}(e),r=e.tooltipComponentSelector,i=e=>{const t=null==e?void 0:e[m.h1];return(null==t?void 0:t.column)===a?t:void 0},o=e=>{const a=i(e.data);return a?a.message:null==t?void 0:t(e)};Nr.add(o),e.tooltip=o,e.tooltipComponentSelector=e=>i(e.data)?{component:Ar}:null==r?void 0:r(e)}class Gr extends((0,o.S)(g.FoundationElement)){getColumnDragBridge(){return this.columnDragBridge}rowDataChanged(e,a){this.initialised&&this.gridApi&&this.gridApi.setGridOption("rowData",a)}gridSlotChanged(){this.gridSlot&&!this.initialised&&this.agGridOptions&&this.initGrid()}withStatusBarChanged(){this.applyStatusBarMode()}get usesAgStatusBar(){return"ag"===this.statusBarMode}get usesCommunityStatusBar(){return"community"===this.statusBarMode}get statusBar(){const e=this.statusBarRef;if(e)return e instanceof kr?e:void(this.warnedUnregisteredStatusBar||(this.warnedUnregisteredStatusBar=!0,U.warn(`Grid Pro: <${e.localName}> is not registered, so the status bar is not shown. Register the design system status bar element (e.g. rapidGridProStatusBar) with the grid.`)))}contextMenuItemsChanged(){this.syncContextMenuSuppression()}enableColumnSelectionChanged(){this.syncColumnSelectionHostLayout()}getfilterModel(){return(0,r.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(e){return(0,r.sH)(this,void 0,void 0,function*(){this.persistFilterModelKey?yield this.statePersistence.saveFilterModel(this.persistFilterModelKey,e):this._filterConfig=e})}constructor(){super(),this.gridErrorItems=[],this.disposed=!1,this.debouncedSaveColumnState=p()(this.saveColumnState.bind(this),400),this.debouncedSaveFilterModel=p()(this.cacheFilterConfig.bind(this),400),this.debouncedNotifyDatasourceVisibleColumns=p()(this.notifyDatasourceVisibleColumns.bind(this),400),this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.enableCellFlashing=!1,this.enableRowFlashing=!1,this.columnDragBridge={},this.columnComponentName="grid-pro-column",this.themeMode="dark",this.statusBarConfig=m.o2,this.withStatusBar=!1,this.statusBarMode="pending",this.statusPanelState={},this.warnedUnregisteredStatusBar=!1,this.warnedGridOptionsStatusBar=!1,this.gridCreatedWithMenuSuppressed=!1,this.enableColumnSelection=!1,this.applyingDatasourceGridOptions=!1,this.rehydrationAttempted=!1,this.rootEventsListeners=[],this.datasourceEventHandlers=[],this.gridEventsQueue=[],this.registeredGridEvents=new Set,this.gridEventListeners=new Map,this.boundGlobalEventListener=this.globalEventListener.bind(this),this.boundContextMenuListener=(e,a)=>{"cellContextMenu"===e&&this.showContextMenu(a)},this._filterConfig=void 0,this.handleLuminanceChange=e=>{const a=l.baseLayerLuminance.getValueFor(e.target);this.themeMode=a===l.StandardLuminance.DarkMode?"dark":"light"},this.luminanceObserver={handleChange:e=>this.handleLuminanceChange(e)},this.agAttributes={},this.agPropertiesMap=Ga.reduce((e,a)=>(e[a.toLowerCase()]=a,e[(0,Dr.w)(a)]=a,e),{});const e=this.hideDatasourceError.bind(this);this.rootEventsListeners.push([tt.dataInit,e],[Fa.datasourceErrorClose,e],[Qa.error,this.handleBaseDatasourceError.bind(this)],[Qa.connected,e]),this.datasourceEventHandlers=[[Da.initialize,this.handleInitialize.bind(this)],[Da.dataLoaded,this.handleDataLoaded.bind(this)],[Da.dataChanged,this.handleDataChanged.bind(this)],[Da.schemaUpdated,this.handleSchemaUpdated.bind(this)],[Da.dataCleared,this.handleDataCleared.bind(this)],[Da.loadingStarted,this.handleLoadingStarted.bind(this)],[Da.loadingFinished,this.handleLoadingFinished.bind(this)],[Da.noDataAvailable,this.handleNoDataAvailable.bind(this)],[Da.filtersRestored,this.handleFiltersRestored.bind(this)],[Da.moreDataAvailable,this.handleMoreDataAvailable.bind(this)],[Da.error,this.handleDatasourceError.bind(this)],[Da.destroy,this.handleDatasourceDestroy.bind(this)],[Da.cacheFilterConfig,this.cacheFilterConfig.bind(this)],[Da.refreshServerSide,this.handleRefreshServerSide.bind(this)],[Da.setServerSideDatasource,this.handleSetServerSideDatasource.bind(this)],[Da.addGridCssClass,this.handleAddGridCssClass.bind(this)],[Da.removeGridCssClass,this.handleRemoveGridCssClass.bind(this)],[Da.applyServerSideTransaction,this.handleApplyServerSideTransaction.bind(this)],[Da.setInfiniteDatasource,this.handleSetInfiniteDatasource.bind(this)],[Da.refreshInfiniteCache,this.handleRefreshInfiniteCache.bind(this)]]}addEventListener(e,a,t){super.addEventListener(e,a,t),this.gridApi?this.addGridEventListener(e):this.gridEventsQueue.includes(e)||this.gridEventsQueue.push(e)}addGridEventListener(e){if(this.registeredGridEvents.has(e))return;this.registeredGridEvents.add(e);const a=a=>{this.$emit(e,a)};this.gridEventListeners.set(e,a),this.gridApi.addEventListener(e,a)}handleError(e,a){this.gridErrorItems=[...this.gridErrorItems,{detail:a.detail,type:e}]}handleBaseDatasourceError(e){const a={detail:{message:e.detail.message},type:Pa.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:a.detail,type:a.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(e=>e.type!==Pa.datasource),this.removeAttribute("ds-disconnected")}connectedCallback(){var e;super.connectedCallback(),this.syncColumnSelectionHostLayout(),this.syncStatusBarHostLayout(),this.disposed=!1;const a=null!==(e=this.provider)&&void 0!==e?e:this;this.luminanceSubscription=l.baseLayerLuminance.subscribe(this.luminanceObserver,a),this.gridAutosizingEnabled&&(this.visibilityObserverCleanup=(0,n.j)(this,e=>{e&&this.debouncedColumnAutosize()})),this.rehydrationAttempted=!1,this.shouldRunConnect&&(this.rootEventsListeners.forEach(([e,a])=>{this.addEventListener(e,a)}),Ga.forEach(e=>{const a=function(e,a){let t=Object.getPrototypeOf(e);for(;t&&t!==HTMLElement.prototype;){const e=Object.getOwnPropertyDescriptor(t,a);if(e)return e;t=Object.getPrototypeOf(t)}}(this,e);Object.defineProperty(this,e,{get:null==a?void 0:a.get,set:t=>{var r,i;const o=null===(r=null==a?void 0:a.get)||void 0===r?void 0:r.call(this);null===(i=null==a?void 0:a.set)||void 0===i||i.call(this,t),this.agAttributeChangedCallback((0,Dr.w)(e),o,t)},enumerable:!0,configurable:!0})}),this.toggleDatasourceEventListeners(!0))}disconnectedCallback(){var e,a;null===(e=this.closeContextMenu)||void 0===e||e.call(this),this.closeContextMenu=void 0,this.disposed=!0,this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel();const t=null!==(a=this.provider)&&void 0!==a?a:this;l.baseLayerLuminance.unsubscribe(this.luminanceObserver,t),this.luminanceSubscription&&(this.luminanceSubscription.unsubscribe(),this.luminanceSubscription=void 0),this.visibilityObserverCleanup&&(this.visibilityObserverCleanup(),this.visibilityObserverCleanup=void 0),super.disconnectedCallback(),this.rehydrationAttempted=!1;const r=this.shouldRunDisconnect;this.rootEventsListeners.forEach(([e,a])=>{this.removeEventListener(e,a)}),r?this.performDisconnectCleanup():queueMicrotask(()=>{this.isConnected||this.performDisconnectCleanup()})}syncColumnSelectionHostLayout(){this.classList.toggle("has-column-selection",this.enableColumnSelection)}syncStatusBarHostLayout(){this.classList.toggle("has-status-bar",!!this.withStatusBar&&this.usesCommunityStatusBar)}applyStatusBarMode(){var e,a,t;const r=this.gridApi;r&&!(null===(e=r.isDestroyed)||void 0===e?void 0:e.call(r))&&(this.statusBarMode=(null===(a=r.isModuleRegistered)||void 0===a?void 0:a.call(r,"StatusBarModule"))?"ag":"community",this.usesAgStatusBar?r.setGridOption("statusBar",this.buildAgStatusBar(null===(t=r.getGridOption)||void 0===t?void 0:t.call(r,"rowModelType"))):this.withStatusBar&&this.userStatusBar&&!this.warnedGridOptionsStatusBar&&(this.warnedGridOptionsStatusBar=!0,U.warn("Grid Pro: gridOptions.statusBar is ignored because the AG Grid Enterprise StatusBarModule is not registered. Use statusBarConfig instead."))),this.syncStatusBarHostLayout()}buildAgStatusBar(e){var a,t;if(!this.withStatusBar)return this.userStatusBar;const r=null!==(t=null===(a=this.userStatusBar)||void 0===a?void 0:a.statusPanels)&&void 0!==t?t:[],i=wr({withStatusBar:this.withStatusBar,statusBarConfig:this.statusBarConfig,isServerSide:this.isServerSide||"serverSide"===e,isInfiniteRowModel:this.isInfiniteRowModel||"infinite"===e,gridProDatasource:this.gridProDatasource},r);return Object.assign(Object.assign({},this.userStatusBar),{statusPanels:i})}performDisconnectCleanup(){this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.initialised=!1,this.resetGridOptionsState(),this.destroyGridInstance(),this.toggleDatasourceEventListeners(!1),this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel(),this.registeredGridEvents.clear(),this.gridEventsQueue=[]}destroyGridInstance(){var e;this.gridApi&&this.gridEventListeners.forEach((e,a)=>{this.gridApi.removeEventListener(a,e)}),this.gridEventListeners.clear(),null===(e=this.statusBar)||void 0===e||e.releasePanels(),delete this.statusPanelState[m.k7.loadMore],this.gridApi?this.gridApi.destroy():this.agGrid&&this.agGrid.destroy(),this.gridSlot&&this.gridSlot.replaceChildren(),this.gridApi=void 0,this.agGrid=void 0}toggleDatasourceEventListeners(e){const a=e?"addEventListener":"removeEventListener";this.datasourceEventHandlers.forEach(([e,t])=>{super[a](e,t)})}handleInitialize(e){const{options:a,keepColDefsOnClearRowData:t}=e.detail;t&&(this.columnState=this.gridApi.getColumnState()),this.applyingDatasourceGridOptions=!0;try{this.gridOptions=Object.assign(Object.assign(Object.assign({},this.userProvidedGridOptions),a),t?{columnDefs:this.gridApi.getColumnDefs()}:{}),this.initGrid()}finally{this.applyingDatasourceGridOptions=!1}}handleDataLoaded(e){const{data:a}=e.detail;this.gridApi&&this.gridApi.setGridOption("rowData",a)}handleDataChanged(e){const{changes:a}=e.detail;if(!this.gridApi||!this.isClientSideRowModel)return;const t=this.gridApi.applyTransaction(a);this.flashAddedCells(null==t?void 0:t.add)}get isClientSideRowModel(){var e,a,t;return"clientSide"===(null!==(t=null===(a=null===(e=this.gridApi)||void 0===e?void 0:e.getGridOption)||void 0===a?void 0:a.call(e,"rowModelType"))&&void 0!==t?t:"clientSide")}flashAddedCells(e){this.enableRowFlashing&&(null==e?void 0:e.length)&&this.gridApi.flashCells({rowNodes:e})}handleSchemaUpdated(e){return(0,r.sH)(this,void 0,void 0,function*(){this.gridApi?yield this.processSchemaUpdate(e.detail):this.pendingSchemaUpdate=e.detail})}processSchemaUpdate(e){return(0,r.sH)(this,arguments,void 0,function*({schema:e}){this.applyCommunityFilterFallbacks(e);const a=this.gridApi.getColumnDefs();if(a&&a.length>0)return void this.enrichPresetColumnDefs(e);const t=yield this.mergeAllColumnDefsAndStates(e,!0);this.gridApi.setGridOption("columnDefs",t),this.restoreCachedFilterConfig()})}enrichPresetColumnDefs(e){const a=this.gridApi.getGridOption("columnDefs");if(!(null==a?void 0:a.length))return;const t=Gt(a,e,{fillUnsetFilters:!this.isClientSideRowModel});if(t===a)return;const r=this.gridApi.getColumnState(),i=JSON.stringify(this.gridApi.getFilterModel());this.gridApi.setGridOption("columnDefs",t),this.gridApi.applyColumnState({state:r,applyOrder:!0}),JSON.stringify(this.gridApi.getFilterModel())!==i&&this.restoreCachedFilterConfig()}applyCommunityFilterFallbacks(e){const a=this.gridApi.isModuleRegistered("SetFilterModule"),t=this.gridApi.isModuleRegistered("MultiFilterModule");e.forEach(e=>{var r,i,o,n,l;if("agSetColumnFilter"===e.filter&&!a)return U.debug(`SetFilterModule is not registered; column '${e.field}' falls back to the enum filter`),e.filter=Se.enumFilter,void(null!==(r=e.floatingFilterComponent)&&void 0!==r||(e.floatingFilterComponent=Se.enumFloatingFilter));if("agMultiColumnFilter"!==e.filter)return;const s=null===(o=null===(i=e.filterParams)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.find(e=>"agSetColumnFilter"===e.filter);t?!a&&s&&(U.debug(`SetFilterModule is not registered; the set sub-filter of column '${e.field}' falls back to the enum filter`),s.filter=Se.enumFilter):(null===(n=null==s?void 0:s.filterParams)||void 0===n?void 0:n.values)?(U.debug(`MultiFilterModule is not registered; enum column '${e.field}' falls back to the enum filter`),e.filter=Se.enumFilter,e.filterParams=Object.assign({},s.filterParams),null!==(l=e.floatingFilterComponent)&&void 0!==l||(e.floatingFilterComponent=Se.enumFloatingFilter)):(U.warn("MultiFilterModule is not registered, falling back to text filter"),e.filter="agTextColumnFilter")})}handleDataCleared(e){const{includeSchema:a}=e.detail;this.gridApi&&(a&&this.gridApi.setGridOption("columnDefs",[]),this.isClientSideRowModel&&this.gridApi.setGridOption("rowData",[]),this.gridApi.refreshCells({force:!0}))}handleLoadingStarted(){this.gridApi&&this.gridApi.setGridOption("loading",!0)}handleLoadingFinished(){this.gridApi&&(this.gridApi.setGridOption("loading",!1),this.gridApi.hideOverlay())}handleNoDataAvailable(){this.gridApi&&(this.gridApi.setGridOption("loading",!1),this.gridApi.showNoRowsOverlay())}handleFiltersRestored(){this.restoreCachedFilterConfig()}handleMoreDataAvailable(e){const{hasMoreData:a,sourceRef:t}=e.detail;this.updateStatusPanel(m.k7.loadMore,{moreRows:a,sourceRef:t})}updateStatusPanel(e,a){var t;this.usesAgStatusBar||(this.statusPanelState[e]=Object.assign(Object.assign({},this.statusPanelState[e]),a));const r=this.getStatusPanel(e);return null===(t=null==r?void 0:r.updateParams)||void 0===t||t.call(r,a),r}getStatusPanelState(e){return this.statusPanelState[e]}handleDatasourceError(){this.setAttribute("ds-disconnected","ds-disconnected")}handleDatasourceDestroy(){this.clearLocalGridOptions()}handleRefreshServerSide(e){const{purge:a}=e.detail;this.gridApi&&this.gridApi.refreshServerSide({purge:a})}handleSetServerSideDatasource(e){const{datasource:a}=e.detail;this.gridApi&&this.gridApi.setGridOption("serverSideDatasource",a)}handleAddGridCssClass(e){var a;const{className:t}=e.detail,r=(null===(a=this.gridSlot)||void 0===a?void 0:a.parentElement)||this;r&&r.classList.add(t)}handleRemoveGridCssClass(e){var a;const{className:t}=e.detail,r=(null===(a=this.gridSlot)||void 0===a?void 0:a.parentElement)||this;r&&r.classList.remove(t)}handleApplyServerSideTransaction(e){var a,t;const{transaction:r,async:i,callback:o}=e.detail;if(this.gridApi)if(i)this.gridApi.applyServerSideTransactionAsync(r,e=>{var a,t;this.flashAddedCells([...null!==(a=null==e?void 0:e.add)&&void 0!==a?a:[],...null!==(t=null==e?void 0:e.update)&&void 0!==t?t:[]]),null==o||o(e)});else{const e=this.gridApi.applyServerSideTransaction(r);this.flashAddedCells([...null!==(a=null==e?void 0:e.add)&&void 0!==a?a:[],...null!==(t=null==e?void 0:e.update)&&void 0!==t?t:[]]),o&&o(e)}}handleSetInfiniteDatasource(e){const{datasource:a}=e.detail;this.gridApi&&this.gridApi.setGridOption("datasource",a)}handleRefreshInfiniteCache(e){var a;this.gridApi&&((null===(a=e.detail)||void 0===a?void 0:a.purge)?this.gridApi.purgeInfiniteCache():this.gridApi.refreshInfiniteCache())}combineAllGridComponents(e){const a={[m.IX.action]:H,[m.IX.actionsMenu]:q.cN,[m.IX.boolean]:Q,[m.IX.editable]:J,[m.IX.icon]:le,[m.IX.statusPill]:ce,[m.IX.select]:he,[m.IX.selectEditor]:f,[m.IX.numberEditor]:C,[m.IX.multiselectEditor]:k,[m.IX.dateEditor]:I,[m.IX.stringEditor]:P,[Se.enumFilter]:De,[Se.enumFloatingFilter]:Oe,[m.k7.labelValue]:ur,[m.k7.loadMore]:vr,[m.k7.reload]:mr,[m.k7.rowCount]:fr};return Object.assign(Object.assign(Object.assign({},a),e),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var e,a,t,r,i,o;try{if(!this.initialised||!this.gridApi)return[];if("single"===(o=null===(e=this.gridOptions)||void 0===e?void 0:e.rowSelection)||"multiple"===o||"object"==typeof o&&("singleRow"===(null==o?void 0:o.mode)||"multiRow"===(null==o?void 0:o.mode)))return this.gridApi.getSelectedRows&&this.gridApi.getSelectedRows().length>0?this.gridApi.getSelectedRows():[];if((null===(a=this.gridApi)||void 0===a?void 0:a.getCellRanges)&&this.gridApi.getCellRanges().length>0)return this.getCellRangeRowData();if(!(null===(t=this.gridOptions)||void 0===t?void 0:t.cellSelection)&&!(null===(r=this.gridOptions)||void 0===r?void 0:r.enableRangeSelection)){const e=null===(i=this.gridApi)||void 0===i?void 0:i.getFocusedCell();if(e){const a=this.gridApi.getDisplayedRowAtIndex(e.rowIndex);if(null==a?void 0:a.data)return[a.data]}}return[]}catch(e){return U.error("Grid Pro: Error getting selected rows:",e),[]}}getCellRangeRowData(){var e;if(!(null===(e=this.gridApi)||void 0===e?void 0:e.getCellRanges))return[];const a=this.gridApi.getCellRanges();if(0===a.length)return[];const t=[];return a.forEach(e=>{const a=e.startRow.rowIndex,r=e.endRow.rowIndex;for(let e=a;e<=r;e+=1){const a=this.gridApi.getDisplayedRowAtIndex(e);(null==a?void 0:a.data)&&!t.some(e=>e===a.data)&&t.push(a.data)}}),t}hasSelectedRows(){return this.getSelectedRows().length>0}getStatusPanel(e){var a,t,r;return this.usesAgStatusBar?null===(t=null===(a=this.gridApi)||void 0===a?void 0:a.getStatusPanel)||void 0===t?void 0:t.call(a,e):null===(r=this.statusBar)||void 0===r?void 0:r.getStatusPanel(e)}updateLabelValueStatusBar(e){if(!this.gridApi)return void U.warn("Grid Pro: Cannot update label-value status bar - grid API not available");const a=this.updateStatusPanel(m.k7.labelValue,Object.assign({},e));a&&"function"==typeof a.updateParams||U.warn("Grid Pro: Label-value status bar component not found or updateParams method not available")}debouncedColumnAutosize(){this.gridAutosizingEnabled&&(this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.debounced=setTimeout(()=>{var e;null===(e=this.gridApi)||void 0===e||e.sizeColumnsToFit()},Na))}removeConfigWidthsToAutosize(e){return e.map(e=>Object.assign(Object.assign({},e),{width:null}))}saveColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()){let e=this.gridApi.getColumnState();e=Or(e),e=this.gridAutosizingEnabled?this.removeConfigWidthsToAutosize(e):e;const a=0===e.filter(e=>{if(e.hide)return!1;const a=this.gridApi.getColumn(e.colId);return Boolean(a.getColDef().headerName)}).length;if(0===e.length||JSON.stringify(e)===JSON.stringify(this.columnState)||a)return;yield this.statePersistence.saveColumnState(this.persistColumnStateKey,e),this.columnState=e}})}getSavedColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){return this.columnState=[],this.statePersistanceEnabled()&&(this.columnState=yield this.statePersistence.getColumnState(this.persistColumnStateKey)),this.columnState})}restoreColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){var e;this.rehydrationAttempted=!0;const a=Or(yield this.getSavedColumnState());a&&a.length>0&&(null===(e=this.gridApi)||void 0===e||e.applyColumnState({state:a,applyOrder:!0}))})}cacheFilterConfig(){var e;this.setFilterModel((null===(e=this.gridApi)||void 0===e?void 0:e.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,r.sH)(this,void 0,void 0,function*(){var e,a;const t=yield this.getfilterModel();void 0!==t&&(null===(e=this.gridApi)||void 0===e||e.setFilterModel(t),null===(a=this.gridApi)||void 0===a||a.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof Et}get gridParams(){return{globalListener:this.boundGlobalEventListener,globalSyncListener:this.boundContextMenuListener,modules:[qe,d.Vc,d.ZuP]}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")||this.querySelector("grid-pro-infinite-datasource")}get isInfiniteRowModel(){return this.gridProDatasource instanceof Tt}notifyDatasourceVisibleColumns(){var e,a,t,r;const i=this.gridProDatasource;if(!i)return;const o=Ce(null===(a=null===(e=this.gridApi)||void 0===e?void 0:e.getAllDisplayedColumns)||void 0===a?void 0:a.call(e),null===(r=null===(t=this.gridApi)||void 0===t?void 0:t.getColumnDefs)||void 0===r?void 0:r.call(t));o.length&&i.setVisibleColumns(o)}set gridOptions(e){!this.applyingDatasourceGridOptions&&e&&(this.userProvidedGridOptions=Object.assign({},e));const a=()=>{!this.disposed&&this.isConnected&&(this.debouncedSaveColumnState(),this.debouncedColumnAutosize())},t=()=>{!this.disposed&&this.isConnected&&this.debouncedNotifyDatasourceVisibleColumns()};Array.from(this.attributes).forEach(e=>{const a=this.agPropertiesMap[e.name];a&&(this.agAttributes[a]=e.value)});const{columnDefs:i,components:o,defaultColDef:n,getRowId:l,onGridReady:s,onFilterChanged:g,onFirstDataRendered:d,statusBar:c}=e,u=(0,r.Tt)(e,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered","statusBar"]);this.userStatusBar=c;const p=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.gridOptionsConfig),{defaultColDef:Object.assign({enableCellChangeFlash:this.enableCellFlashing,filter:!0,resizable:!0,sortable:!0},n),components:this.combineAllGridComponents(o),headerHeight:this.headerHeight,rowHeight:this.rowHeight,animateRows:!1,suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:e=>(0,r.sH)(this,void 0,void 0,function*(){var a,t,r;if(this.gridApi=e.api,!!this.contextMenuItems!==this.gridCreatedWithMenuSuppressed&&this.syncContextMenuSuppression(),this.applyStatusBarMode(),this.gridEventsQueue.length&&this.gridEventsQueue.forEach(e=>{this.addGridEventListener(e)}),this.pendingSchemaUpdate){const e=this.pendingSchemaUpdate;this.pendingSchemaUpdate=void 0;try{yield this.processSchemaUpdate(e)}catch(e){U.error("Grid Pro: failed to apply the pending schema update on grid ready:",e)}}this.rowData&&this.gridApi.setGridOption("rowData",this.rowData),s&&s(e),(null===(a=this.gridProDatasource)||void 0===a?void 0:a.keepColDefsOnClearRowData)&&(null===(t=this.columnState)||void 0===t?void 0:t.length)>0&&this.gridApi.applyColumnState({state:this.columnState,applyOrder:!0}),this.$emit(Lr,{event:e,gridId:this.id}),this.$emit(m.mr,{event:e,gridId:this.id}),this.notifyDatasourceVisibleColumns(),null===(r=this.gridProDatasource)||void 0===r||r.$emit(Da.ready),this.restoreColumnState(),this.restoreCachedFilterConfig(),this.debouncedColumnAutosize()}),onFirstDataRendered:e=>{this.notifyDatasourceVisibleColumns(),d&&d(e)},onColumnPinned:a,onColumnResized:a,onColumnMoved:a,onColumnVisible:()=>{a(),t()},onDisplayedColumnsChanged:()=>{a(),t()},onFilterChanged:e=>{!this.disposed&&this.isConnected&&(this.debouncedSaveFilterModel(),g&&g(e))},onGridSizeChanged:a,onSortChanged:a}),u),c&&!this.withStatusBar?{statusBar:c}:{});this.gridProDatasource?(p.columnDefs=i,p.getRowId=l,this.setupStatusBar(p),this.setLocalGridOptions(p)):this.mergeAllColumnDefsAndStates(i).then(e=>{!this.disposed&&this.isConnected&&(p.columnDefs=e,p.getRowId=l,this.setupStatusBar(p),this.setLocalGridOptions(p),this.initGrid())})}setLocalGridOptions(e){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),Ya(e,this.agAttributes)),this.agGridOptions.context=Object.assign(Object.assign({},this.agGridOptions.context),{[Ye]:this.columnDragBridge}),null==this.agGridOptions.allowDragFromColumnsToolPanel&&(this.agGridOptions.allowDragFromColumnsToolPanel=!0)}clearLocalGridOptions(){this.agGridOptions=void 0}resetGridOptionsState(){this.userProvidedGridOptions=void 0,this.agGridOptions=void 0}initGrid(){s.DOM.queueUpdate(()=>{!this.disposed&&this.isConnected&&this.gridSlot&&(this.initialised&&(this.destroyGridInstance(),this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild)),this.gridCreatedWithMenuSuppressed=!!this.contextMenuItems,this.agGrid=(0,d.Dvw)(this.gridSlot,this.gridCreatedWithMenuSuppressed?Object.assign(Object.assign({},this.agGridOptions),{suppressContextMenu:!0}):this.agGridOptions,this.gridParams),this.initialised=!0)})}mergeAllColumnDefsAndStates(e){return(0,r.sH)(this,arguments,void 0,function*(e,a=!1){var t;const r=e||[];r.forEach(e=>{if(this.headerCaseType&&e.field&&!e.headerName){const a=c[this.headerCaseType];a?e.headerName=a(e.field):U.warn(`Invalid header-case-type attribute value: ${this.headerCaseType}. Please use one of the following: camelCase, capitalCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase.`)}});const i=Array.from(this.querySelectorAll(this.columnComponentName)).map(e=>e.definition).map(e=>{var a;if(this.enableCellFlashing&&void 0===e.enableCellChangeFlash&&(e.enableCellChangeFlash=!0),Ft(e.filter)){if(!(null!=e.filterParams&&"values"in e.filterParams)){const a=Pt(r.find(a=>a.field===e.field));a&&(e.filterParams=Object.assign(Object.assign({},e.filterParams),{values:a}))}e.filter===Se.enumFilter&&(null!==(a=e.floatingFilterComponent)&&void 0!==a||(e.floatingFilterComponent=Se.enumFloatingFilter))}e.editable&&(e.cellRenderer||e.cellRendererSelector||(e.cellRendererSelector=a=>{var t;if((null===(t=a.data)||void 0===t?void 0:t[m.A7])===e.field)return{component:m.IX.editable}}),Pr(e,e.field),e.cellClassRules||(e.cellClassRules={error:e=>{var a,t;return(null===(t=null===(a=e.data)||void 0===a?void 0:a[m.h1])||void 0===t?void 0:t.column)===e.colDef.field}}));const t=r.find(a=>e.field===a.field);return Object.assign(Object.assign({},t),e)}),o=i.map(e=>e.field),n=[...i,...this.onlyTemplateColDefs?[]:r.filter(e=>!o.includes(e.field))];if(this.gridProDatasource&&a){const e=yield this.getSavedColumnState();if((null==e?void 0:e.length)>0)return Ir(n,e);if((null===(t=this.gridProDatasource.deferredColumnStates)||void 0===t?void 0:t.length)>0)return Ir(n,this.gridProDatasource.deferredColumnStates)}return n})}setupStatusBar(e){var a;this.usesAgStatusBar&&this.withStatusBar?e.statusBar=this.buildAgStatusBar(e.rowModelType):null===(a=this.statusBar)||void 0===a||a.syncPanels()}get observedAttributes(){const e=Ga.map(e=>e.toLowerCase()),a=Ga.map(e=>(0,Dr.w)(e));return e.concat(a)}agAttributeChangedCallback(e,a,t){var r;if(a===t)return;const i=this.agPropertiesMap[e];i&&(this.agAttributes[i]=t,this.initialised&&(null===(r=this.gridApi)||void 0===r||r.setGridOption(i,t),"suppressContextMenu"===i&&this.contextMenuItems&&this.syncContextMenuSuppression()))}syncContextMenuSuppression(){var e,a,t,r;const i=null!==(t=null!==(e=this.agAttributes.suppressContextMenu)&&void 0!==e?e:null===(a=this.agGridOptions)||void 0===a?void 0:a.suppressContextMenu)&&void 0!==t&&t;null===(r=this.gridApi)||void 0===r||r.setGridOption("suppressContextMenu",!!this.contextMenuItems||i)}showContextMenu(e){var a,t,r,i,o;const n=null===(a=this.contextMenuItems)||void 0===a?void 0:a.call(this,e);if(!(null==n?void 0:n.length))return;const l=e.event instanceof MouseEvent?e.event:null,s=null==l?void 0:l.composedPath()[0],g=s instanceof Element?s:null;let d=null!==(t=null==l?void 0:l.clientX)&&void 0!==t?t:0,c=null!==(r=null==l?void 0:l.clientY)&&void 0!==r?r:0;const u=null==g?void 0:g.closest(".ag-cell");if(0===d&&0===c&&u){const e=u.getBoundingClientRect();d=e.left,c=e.bottom}null===(i=this.closeContextMenu)||void 0===i||i.call(this);const[p="foundation"]=this.tagName.toLowerCase().split("-");this.closeContextMenu=la({prefix:p,x:d,y:c,items:n,container:null!==(o=this.shadowRoot)&&void 0!==o?o:void 0,themeSource:g}),this.closeContextMenu&&(null==l?void 0:l.cancelable)&&l.preventDefault()}globalEventListener(e,a){const t=e.toLowerCase(),r=new Event(t);r.agGridDetails=a,this.dispatchEvent(r);const i="on"+t;"function"==typeof this[i]&&this[i](r)}}(0,r.Cg)([s.observable],Gr.prototype,"gridApi",void 0),(0,r.Cg)([s.observable],Gr.prototype,"gridErrorItems",void 0),(0,r.Cg)([cr],Gr.prototype,"statePersistence",void 0),(0,r.Cg)([(0,s.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],Gr.prototype,"autoCellRendererByType",void 0),(0,r.Cg)([(0,s.attr)({attribute:"only-template-col-defs",mode:"boolean"})],Gr.prototype,"onlyTemplateColDefs",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"grid-autosizing"})],Gr.prototype,"gridAutosizingEnabled",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],Gr.prototype,"enableCellFlashing",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-row-flashing"})],Gr.prototype,"enableRowFlashing",void 0),(0,r.Cg)([(0,s.attr)({attribute:"persist-column-state-key"})],Gr.prototype,"persistColumnStateKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"persist-filter-model-key"})],Gr.prototype,"persistFilterModelKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"header-case-type"})],Gr.prototype,"headerCaseType",void 0),(0,r.Cg)([s.observable],Gr.prototype,"rowData",void 0),(0,r.Cg)([s.attr],Gr.prototype,"columnComponentName",void 0),(0,r.Cg)([s.observable],Gr.prototype,"eventsAndCallbacks",void 0),(0,r.Cg)([s.attr],Gr.prototype,"headerHeight",void 0),(0,r.Cg)([s.attr],Gr.prototype,"rowHeight",void 0),(0,r.Cg)([s.observable],Gr.prototype,"classNames",void 0),(0,r.Cg)([s.observable],Gr.prototype,"agGrid",void 0),(0,r.Cg)([s.observable],Gr.prototype,"gridSlot",void 0),(0,r.Cg)([s.observable],Gr.prototype,"themeMode",void 0),(0,r.Cg)([s.observable],Gr.prototype,"gridComponents",void 0),(0,r.Cg)([s.observable],Gr.prototype,"statusBarConfig",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"with-status-bar"})],Gr.prototype,"withStatusBar",void 0),(0,r.Cg)([s.observable],Gr.prototype,"statusBarMode",void 0),(0,r.Cg)([s.observable],Gr.prototype,"contextMenuItems",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-column-selection"})],Gr.prototype,"enableColumnSelection",void 0),(0,r.Cg)([s.observable],Gr.prototype,"customErrorHandlerTemplate",void 0),(0,r.Cg)([m.lz],Gr.prototype,"gridOptionsConfig",void 0),(0,r.Cg)([s.observable],Gr.prototype,"provider",void 0);const Br=Gr.compose(Object.assign({baseName:"grid-pro",template:sr,styles:s.css`
9452
+ `,Sr=xr(),zr={[m.k7.labelValue]:ur,[m.k7.loadMore]:vr,[m.k7.reload]:mr,[m.k7.rowCount]:fr};class kr extends((0,o.S)(g.FoundationElement)){constructor(){super(...arguments),this.gridHost=null,this.gridApi=null,this.statusBarConfig=null,this.panels=new Map,this.warnedPanelTypes=new Set}gridHostChanged(){this.syncPanels()}gridApiChanged(){this.syncPanels()}statusBarConfigChanged(){this.syncPanels()}leftElChanged(){this.syncPanels()}rightElChanged(){this.syncPanels()}syncPanels(){var e;if(!this.leftEl||!this.rightEl)return;this.releasePanels();const a=this.gridHost,t=this.resolveApi();if(!(null==a?void 0:a.withStatusBar)||!t)return;const r=br({withStatusBar:a.withStatusBar,statusBarConfig:null!==(e=this.statusBarConfig)&&void 0!==e?e:a.statusBarConfig,isServerSide:a.isServerSide,isInfiniteRowModel:a.isInfiniteRowModel,gridProDatasource:a.gridProDatasource});for(const e of r)this.mountPanel(e,t)}getStatusPanel(e){return this.panels.get(e)}releasePanels(){var e,a,t,r,i;for(const r of this.panels.values())null===(e=r.destroy)||void 0===e||e.call(r),null===(t=null===(a=r.getGui)||void 0===a?void 0:a.call(r))||void 0===t||t.remove();this.panels.clear(),null===(r=this.leftEl)||void 0===r||r.replaceChildren(),null===(i=this.rightEl)||void 0===i||i.replaceChildren()}connectedCallback(){super.connectedCallback(),this.panels.size||this.syncPanels()}disconnectedCallback(){super.disconnectedCallback(),this.shouldRunDisconnect?this.releasePanels():queueMicrotask(()=>{this.isConnected||this.releasePanels()})}resolveApi(){var e,a,t;return null!==(t=null!==(e=this.gridApi)&&void 0!==e?e:null===(a=this.gridHost)||void 0===a?void 0:a.gridApi)&&void 0!==t?t:null}mountPanel(e,a){var t,r;const i=zr[e.statusPanel];if(!i)return void(this.warnedPanelTypes.has(e.statusPanel)||(this.warnedPanelTypes.add(e.statusPanel),U.warn(`Grid Pro status bar: no panel for type '${e.statusPanel}', skipping it`)));const o=new i,n=Object.assign(Object.assign({api:a,context:{}},e.statusPanelParams),null===(r=null===(t=this.gridHost)||void 0===t?void 0:t.getStatusPanelState)||void 0===r?void 0:r.call(t,e.statusPanel));o.init(n);const l=o.getGui();("right"===e.align?this.rightEl:this.leftEl).appendChild(l),this.panels.set(e.statusPanel,o)}}(0,r.Cg)([s.observable],kr.prototype,"gridHost",void 0),(0,r.Cg)([s.observable],kr.prototype,"gridApi",void 0),(0,r.Cg)([s.observable],kr.prototype,"statusBarConfig",void 0),(0,r.Cg)([s.observable],kr.prototype,"leftEl",void 0),(0,r.Cg)([s.observable],kr.prototype,"rightEl",void 0);const Rr=kr.compose({baseName:"grid-pro-status-bar",template:xr(),styles:Cr});class Ar{init(e){const a=this.eGui=document.createElement("div"),t=e.value;a.classList.add("custom-tooltip"),a.style["background-color"]="#f14376",a.style.border="1px inside",a.style["border-color"]="#2e3339",a.style["border-radius"]="4px",a.style.padding="5px",a.style["box-shadow"]="0px 4px 10px 0px rgba(0, 0, 0, 0.25);",a.innerHTML=`<span style='color: #000000; font-size: 10px'>${t}</span>`}getGui(){return this.eGui}}var Dr=t(50103);function Er(e){return{colId:e.field||e.colId||"",hide:e.hide||!1,width:e.width||null,pinned:e.pinned||null,sort:e.sort||null,sortIndex:e.sortIndex||null,aggFunc:e.aggFunc||null,rowGroup:e.rowGroup||!1,rowGroupIndex:e.rowGroupIndex||null,pivot:e.pivot||!1,pivotIndex:e.pivotIndex||null,flex:e.flex||null}}const Mr=Object.keys(Er({}));function Or(e){return Array.isArray(e)?e.map(e=>{const a={},t=a;for(const a of Mr){const r=e[a];void 0!==r&&(t[a]=r)}return a}):[]}function Tr(e){return e.map(Er)}function Ir(e,a){const t=Or(a),r={},i=[],o="field",n="colId",l=e=>Array.isArray(e.children),s=e=>{var a;return null!==(a=e[o])&&void 0!==a?a:e[n]},g=new Map;t.forEach(e=>{null!=e[n]&&g.set(e[n],e)});const d=e=>{if(l(e))return Object.assign(Object.assign({},e),{children:e.children.map(d)});const a=s(e),t=null!=a?g.get(a):void 0;return t?Object.assign(Object.assign({},e),t):Object.assign({},e)};return t.forEach(a=>{const t=a[n];if(null==t)return;const g=e.find(e=>!l(e)&&(e[o]===t||null!=e[n]&&e[n]===t));if(g){const e=s(g),t=Object.assign(Object.assign({},g),a);null!=e&&(r[e]=t),i.push(t)}}),e.forEach(e=>{if(l(e))return void i.push(d(e));const a=s(e);if(null==a||!r.hasOwnProperty(a)){const t=Object.assign({},e);null!=a&&(r[a]=t),i.push(t)}}),i}(0,i.N)(rt,it,Et,Tt,v,we,Ze,kr),d.syG.registerModules([d.n76,d.Q90,d.x6L,d.YN8,d.YzW,d.Lt,d.I95,d.O4V,d.H18,d.lvV,d.mfG,d.Iws,d.nSw,d.FUS,d.Ss0,d.tkg,d.ZDV,d.ZyC,d.XG7,d.VZy,d.$I9,d.dGu,d.AJG,d.c5B,d.BG,d.KIB,d.Sko,d.ZuP,d.Vc,qe]);const Lr="gridReady";const Nr=new WeakSet,Fr=e=>{var a;return null!==(a=e.valueFormatted)&&void 0!==a?a:e.value};function Pr(e,a){if(!1===e.tooltip||Nr.has(e.tooltip))return;const t=function(e){const{tooltip:a,tooltipField:t,tooltipValueGetter:r}=e;if("function"==typeof a)return a;if(!0===a)return Fr;if("string"==typeof a)return()=>a;if(t)return e=>{return null==e.data?null==r?void 0:r(e):(a=e.data,t.split(".").reduce((e,a)=>null==e?void 0:e[a],a));var a};return r}(e),r=e.tooltipComponentSelector,i=e=>{const t=null==e?void 0:e[m.h1];return(null==t?void 0:t.column)===a?t:void 0},o=e=>{const a=i(e.data);return a?a.message:null==t?void 0:t(e)};Nr.add(o),e.tooltip=o,e.tooltipComponentSelector=e=>i(e.data)?{component:Ar}:null==r?void 0:r(e)}class Gr extends((0,o.S)(g.FoundationElement)){getColumnDragBridge(){return this.columnDragBridge}rowDataChanged(e,a){this.initialised&&this.gridApi&&this.gridApi.setGridOption("rowData",a)}gridSlotChanged(){this.gridSlot&&!this.initialised&&this.agGridOptions&&this.initGrid()}withStatusBarChanged(){this.applyStatusBarMode()}get usesAgStatusBar(){return"ag"===this.statusBarMode}get usesCommunityStatusBar(){return"community"===this.statusBarMode}get statusBar(){const e=this.statusBarRef;if(e)return e instanceof kr?e:void(this.warnedUnregisteredStatusBar||(this.warnedUnregisteredStatusBar=!0,U.warn(`Grid Pro: <${e.localName}> is not registered, so the status bar is not shown. Register the design system status bar element (e.g. rapidGridProStatusBar) with the grid.`)))}contextMenuItemsChanged(){this.syncContextMenuSuppression()}enableColumnSelectionChanged(){this.syncColumnSelectionHostLayout()}getfilterModel(){return(0,r.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(e){return(0,r.sH)(this,void 0,void 0,function*(){this.persistFilterModelKey?yield this.statePersistence.saveFilterModel(this.persistFilterModelKey,e):this._filterConfig=e})}constructor(){super(),this.gridErrorItems=[],this.disposed=!1,this.debouncedSaveColumnState=p()(this.saveColumnState.bind(this),400),this.debouncedSaveFilterModel=p()(this.cacheFilterConfig.bind(this),400),this.debouncedNotifyDatasourceVisibleColumns=p()(this.notifyDatasourceVisibleColumns.bind(this),400),this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.enableCellFlashing=!1,this.enableRowFlashing=!1,this.columnDragBridge={},this.columnComponentName="grid-pro-column",this.themeMode="dark",this.statusBarConfig=m.o2,this.withStatusBar=!1,this.statusBarMode="pending",this.statusPanelState={},this.warnedUnregisteredStatusBar=!1,this.warnedGridOptionsStatusBar=!1,this.gridCreatedWithMenuSuppressed=!1,this.enableColumnSelection=!1,this.applyingDatasourceGridOptions=!1,this.rehydrationAttempted=!1,this.rootEventsListeners=[],this.datasourceEventHandlers=[],this.gridEventsQueue=[],this.registeredGridEvents=new Set,this.gridEventListeners=new Map,this.boundGlobalEventListener=this.globalEventListener.bind(this),this.boundContextMenuListener=(e,a)=>{"cellContextMenu"===e&&this.showContextMenu(a)},this._filterConfig=void 0,this.handleLuminanceChange=e=>{const a=l.baseLayerLuminance.getValueFor(e.target);this.themeMode=a===l.StandardLuminance.DarkMode?"dark":"light"},this.luminanceObserver={handleChange:e=>this.handleLuminanceChange(e)},this.agAttributes={},this.agPropertiesMap=Ga.reduce((e,a)=>(e[a.toLowerCase()]=a,e[(0,Dr.w)(a)]=a,e),{});const e=this.hideDatasourceError.bind(this);this.rootEventsListeners.push([tt.dataInit,e],[Fa.datasourceErrorClose,e],[Qa.error,this.handleBaseDatasourceError.bind(this)],[Qa.connected,e]),this.datasourceEventHandlers=[[Da.initialize,this.handleInitialize.bind(this)],[Da.dataLoaded,this.handleDataLoaded.bind(this)],[Da.dataChanged,this.handleDataChanged.bind(this)],[Da.schemaUpdated,this.handleSchemaUpdated.bind(this)],[Da.dataCleared,this.handleDataCleared.bind(this)],[Da.loadingStarted,this.handleLoadingStarted.bind(this)],[Da.loadingFinished,this.handleLoadingFinished.bind(this)],[Da.noDataAvailable,this.handleNoDataAvailable.bind(this)],[Da.filtersRestored,this.handleFiltersRestored.bind(this)],[Da.moreDataAvailable,this.handleMoreDataAvailable.bind(this)],[Da.error,this.handleDatasourceError.bind(this)],[Da.destroy,this.handleDatasourceDestroy.bind(this)],[Da.cacheFilterConfig,this.cacheFilterConfig.bind(this)],[Da.refreshServerSide,this.handleRefreshServerSide.bind(this)],[Da.setServerSideDatasource,this.handleSetServerSideDatasource.bind(this)],[Da.addGridCssClass,this.handleAddGridCssClass.bind(this)],[Da.removeGridCssClass,this.handleRemoveGridCssClass.bind(this)],[Da.applyServerSideTransaction,this.handleApplyServerSideTransaction.bind(this)],[Da.setInfiniteDatasource,this.handleSetInfiniteDatasource.bind(this)],[Da.refreshInfiniteCache,this.handleRefreshInfiniteCache.bind(this)]]}addEventListener(e,a,t){super.addEventListener(e,a,t),this.gridApi?this.addGridEventListener(e):this.gridEventsQueue.includes(e)||this.gridEventsQueue.push(e)}addGridEventListener(e){if(this.registeredGridEvents.has(e))return;this.registeredGridEvents.add(e);const a=a=>{this.$emit(e,a)};this.gridEventListeners.set(e,a),this.gridApi.addEventListener(e,a)}handleError(e,a){this.gridErrorItems=[...this.gridErrorItems,{detail:a.detail,type:e}]}handleBaseDatasourceError(e){const a={detail:{message:e.detail.message},type:Pa.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:a.detail,type:a.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(e=>e.type!==Pa.datasource),this.removeAttribute("ds-disconnected")}connectedCallback(){var e;super.connectedCallback(),this.syncColumnSelectionHostLayout(),this.syncStatusBarHostLayout(),this.disposed=!1;const a=null!==(e=this.provider)&&void 0!==e?e:this;this.luminanceSubscription=l.baseLayerLuminance.subscribe(this.luminanceObserver,a),this.gridAutosizingEnabled&&(this.visibilityObserverCleanup=(0,n.j)(this,e=>{e&&this.debouncedColumnAutosize()})),this.rehydrationAttempted=!1,this.shouldRunConnect&&(this.rootEventsListeners.forEach(([e,a])=>{this.addEventListener(e,a)}),Ga.forEach(e=>{const a=function(e,a){let t=Object.getPrototypeOf(e);for(;t&&t!==HTMLElement.prototype;){const e=Object.getOwnPropertyDescriptor(t,a);if(e)return e;t=Object.getPrototypeOf(t)}}(this,e);Object.defineProperty(this,e,{get:null==a?void 0:a.get,set:t=>{var r,i;const o=null===(r=null==a?void 0:a.get)||void 0===r?void 0:r.call(this);null===(i=null==a?void 0:a.set)||void 0===i||i.call(this,t),this.agAttributeChangedCallback((0,Dr.w)(e),o,t)},enumerable:!0,configurable:!0})}),this.toggleDatasourceEventListeners(!0))}disconnectedCallback(){var e,a;null===(e=this.closeContextMenu)||void 0===e||e.call(this),this.closeContextMenu=void 0,this.debouncedSaveColumnState.flush(),this.disposed=!0,this.debouncedSaveFilterModel.cancel();const t=null!==(a=this.provider)&&void 0!==a?a:this;l.baseLayerLuminance.unsubscribe(this.luminanceObserver,t),this.luminanceSubscription&&(this.luminanceSubscription.unsubscribe(),this.luminanceSubscription=void 0),this.visibilityObserverCleanup&&(this.visibilityObserverCleanup(),this.visibilityObserverCleanup=void 0),super.disconnectedCallback(),this.rehydrationAttempted=!1;const r=this.shouldRunDisconnect;this.rootEventsListeners.forEach(([e,a])=>{this.removeEventListener(e,a)}),r?this.performDisconnectCleanup():queueMicrotask(()=>{this.isConnected||this.performDisconnectCleanup()})}syncColumnSelectionHostLayout(){this.classList.toggle("has-column-selection",this.enableColumnSelection)}syncStatusBarHostLayout(){this.classList.toggle("has-status-bar",!!this.withStatusBar&&this.usesCommunityStatusBar)}applyStatusBarMode(){var e,a,t;const r=this.gridApi;r&&!(null===(e=r.isDestroyed)||void 0===e?void 0:e.call(r))&&(this.statusBarMode=(null===(a=r.isModuleRegistered)||void 0===a?void 0:a.call(r,"StatusBarModule"))?"ag":"community",this.usesAgStatusBar?r.setGridOption("statusBar",this.buildAgStatusBar(null===(t=r.getGridOption)||void 0===t?void 0:t.call(r,"rowModelType"))):this.withStatusBar&&this.userStatusBar&&!this.warnedGridOptionsStatusBar&&(this.warnedGridOptionsStatusBar=!0,U.warn("Grid Pro: gridOptions.statusBar is ignored because the AG Grid Enterprise StatusBarModule is not registered. Use statusBarConfig instead."))),this.syncStatusBarHostLayout()}buildAgStatusBar(e){var a,t;if(!this.withStatusBar)return this.userStatusBar;const r=null!==(t=null===(a=this.userStatusBar)||void 0===a?void 0:a.statusPanels)&&void 0!==t?t:[],i=wr({withStatusBar:this.withStatusBar,statusBarConfig:this.statusBarConfig,isServerSide:this.isServerSide||"serverSide"===e,isInfiniteRowModel:this.isInfiniteRowModel||"infinite"===e,gridProDatasource:this.gridProDatasource},r);return Object.assign(Object.assign({},this.userStatusBar),{statusPanels:i})}performDisconnectCleanup(){this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.initialised=!1,this.resetGridOptionsState(),this.destroyGridInstance(),this.toggleDatasourceEventListeners(!1),this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel(),this.registeredGridEvents.clear(),this.gridEventsQueue=[]}destroyGridInstance(){var e;this.gridApi&&this.gridEventListeners.forEach((e,a)=>{this.gridApi.removeEventListener(a,e)}),this.gridEventListeners.clear(),null===(e=this.statusBar)||void 0===e||e.releasePanels(),delete this.statusPanelState[m.k7.loadMore],this.gridApi?this.gridApi.destroy():this.agGrid&&this.agGrid.destroy(),this.gridSlot&&this.gridSlot.replaceChildren(),this.gridApi=void 0,this.agGrid=void 0}toggleDatasourceEventListeners(e){const a=e?"addEventListener":"removeEventListener";this.datasourceEventHandlers.forEach(([e,t])=>{super[a](e,t)})}handleInitialize(e){const{options:a,keepColDefsOnClearRowData:t}=e.detail;t&&(this.columnState=this.gridApi.getColumnState()),this.applyingDatasourceGridOptions=!0;try{this.gridOptions=Object.assign(Object.assign(Object.assign({},this.userProvidedGridOptions),a),t?{columnDefs:this.gridApi.getColumnDefs()}:{}),this.initGrid()}finally{this.applyingDatasourceGridOptions=!1}}handleDataLoaded(e){const{data:a}=e.detail;this.gridApi&&this.gridApi.setGridOption("rowData",a)}handleDataChanged(e){const{changes:a}=e.detail;if(!this.gridApi||!this.isClientSideRowModel)return;const t=this.gridApi.applyTransaction(a);this.flashAddedCells(null==t?void 0:t.add)}get isClientSideRowModel(){var e,a,t;return"clientSide"===(null!==(t=null===(a=null===(e=this.gridApi)||void 0===e?void 0:e.getGridOption)||void 0===a?void 0:a.call(e,"rowModelType"))&&void 0!==t?t:"clientSide")}flashAddedCells(e){this.enableRowFlashing&&(null==e?void 0:e.length)&&this.gridApi.flashCells({rowNodes:e})}handleSchemaUpdated(e){return(0,r.sH)(this,void 0,void 0,function*(){this.gridApi?yield this.processSchemaUpdate(e.detail):this.pendingSchemaUpdate=e.detail})}processSchemaUpdate(e){return(0,r.sH)(this,arguments,void 0,function*({schema:e}){this.applyCommunityFilterFallbacks(e);const a=this.gridApi.getColumnDefs();if(a&&a.length>0)return void this.enrichPresetColumnDefs(e);const t=yield this.mergeAllColumnDefsAndStates(e,!0);this.gridApi.setGridOption("columnDefs",t),this.restoreCachedFilterConfig()})}enrichPresetColumnDefs(e){const a=this.gridApi.getGridOption("columnDefs");if(!(null==a?void 0:a.length))return;const t=Gt(a,e,{fillUnsetFilters:!this.isClientSideRowModel});if(t===a)return;const r=this.gridApi.getColumnState(),i=JSON.stringify(this.gridApi.getFilterModel());this.gridApi.setGridOption("columnDefs",t),this.gridApi.applyColumnState({state:r,applyOrder:!0}),JSON.stringify(this.gridApi.getFilterModel())!==i&&this.restoreCachedFilterConfig()}applyCommunityFilterFallbacks(e){const a=this.gridApi.isModuleRegistered("SetFilterModule"),t=this.gridApi.isModuleRegistered("MultiFilterModule");e.forEach(e=>{var r,i,o,n,l;if("agSetColumnFilter"===e.filter&&!a)return U.debug(`SetFilterModule is not registered; column '${e.field}' falls back to the enum filter`),e.filter=Se.enumFilter,void(null!==(r=e.floatingFilterComponent)&&void 0!==r||(e.floatingFilterComponent=Se.enumFloatingFilter));if("agMultiColumnFilter"!==e.filter)return;const s=null===(o=null===(i=e.filterParams)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.find(e=>"agSetColumnFilter"===e.filter);t?!a&&s&&(U.debug(`SetFilterModule is not registered; the set sub-filter of column '${e.field}' falls back to the enum filter`),s.filter=Se.enumFilter):(null===(n=null==s?void 0:s.filterParams)||void 0===n?void 0:n.values)?(U.debug(`MultiFilterModule is not registered; enum column '${e.field}' falls back to the enum filter`),e.filter=Se.enumFilter,e.filterParams=Object.assign({},s.filterParams),null!==(l=e.floatingFilterComponent)&&void 0!==l||(e.floatingFilterComponent=Se.enumFloatingFilter)):(U.warn("MultiFilterModule is not registered, falling back to text filter"),e.filter="agTextColumnFilter")})}handleDataCleared(e){const{includeSchema:a}=e.detail;this.gridApi&&(a&&this.gridApi.setGridOption("columnDefs",[]),this.isClientSideRowModel&&this.gridApi.setGridOption("rowData",[]),this.gridApi.refreshCells({force:!0}))}handleLoadingStarted(){this.gridApi&&this.gridApi.setGridOption("loading",!0)}handleLoadingFinished(){this.gridApi&&(this.gridApi.setGridOption("loading",!1),this.gridApi.hideOverlay())}handleNoDataAvailable(){this.gridApi&&(this.gridApi.setGridOption("loading",!1),this.gridApi.showNoRowsOverlay())}handleFiltersRestored(){this.restoreCachedFilterConfig()}handleMoreDataAvailable(e){const{hasMoreData:a,sourceRef:t}=e.detail;this.updateStatusPanel(m.k7.loadMore,{moreRows:a,sourceRef:t})}updateStatusPanel(e,a){var t;this.usesAgStatusBar||(this.statusPanelState[e]=Object.assign(Object.assign({},this.statusPanelState[e]),a));const r=this.getStatusPanel(e);return null===(t=null==r?void 0:r.updateParams)||void 0===t||t.call(r,a),r}getStatusPanelState(e){return this.statusPanelState[e]}handleDatasourceError(){this.setAttribute("ds-disconnected","ds-disconnected")}handleDatasourceDestroy(){this.clearLocalGridOptions()}handleRefreshServerSide(e){const{purge:a}=e.detail;this.gridApi&&this.gridApi.refreshServerSide({purge:a})}handleSetServerSideDatasource(e){const{datasource:a}=e.detail;this.gridApi&&this.gridApi.setGridOption("serverSideDatasource",a)}handleAddGridCssClass(e){var a;const{className:t}=e.detail,r=(null===(a=this.gridSlot)||void 0===a?void 0:a.parentElement)||this;r&&r.classList.add(t)}handleRemoveGridCssClass(e){var a;const{className:t}=e.detail,r=(null===(a=this.gridSlot)||void 0===a?void 0:a.parentElement)||this;r&&r.classList.remove(t)}handleApplyServerSideTransaction(e){var a,t;const{transaction:r,async:i,callback:o}=e.detail;if(this.gridApi)if(i)this.gridApi.applyServerSideTransactionAsync(r,e=>{var a,t;this.flashAddedCells([...null!==(a=null==e?void 0:e.add)&&void 0!==a?a:[],...null!==(t=null==e?void 0:e.update)&&void 0!==t?t:[]]),null==o||o(e)});else{const e=this.gridApi.applyServerSideTransaction(r);this.flashAddedCells([...null!==(a=null==e?void 0:e.add)&&void 0!==a?a:[],...null!==(t=null==e?void 0:e.update)&&void 0!==t?t:[]]),o&&o(e)}}handleSetInfiniteDatasource(e){const{datasource:a}=e.detail;this.gridApi&&this.gridApi.setGridOption("datasource",a)}handleRefreshInfiniteCache(e){var a;this.gridApi&&((null===(a=e.detail)||void 0===a?void 0:a.purge)?this.gridApi.purgeInfiniteCache():this.gridApi.refreshInfiniteCache())}combineAllGridComponents(e){const a={[m.IX.action]:H,[m.IX.actionsMenu]:q.cN,[m.IX.boolean]:Q,[m.IX.editable]:J,[m.IX.icon]:le,[m.IX.statusPill]:ce,[m.IX.select]:he,[m.IX.selectEditor]:f,[m.IX.numberEditor]:C,[m.IX.multiselectEditor]:k,[m.IX.dateEditor]:I,[m.IX.stringEditor]:P,[Se.enumFilter]:De,[Se.enumFloatingFilter]:Oe,[m.k7.labelValue]:ur,[m.k7.loadMore]:vr,[m.k7.reload]:mr,[m.k7.rowCount]:fr};return Object.assign(Object.assign(Object.assign({},a),e),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var e,a,t,r,i,o;try{if(!this.initialised||!this.gridApi)return[];if("single"===(o=null===(e=this.gridOptions)||void 0===e?void 0:e.rowSelection)||"multiple"===o||"object"==typeof o&&("singleRow"===(null==o?void 0:o.mode)||"multiRow"===(null==o?void 0:o.mode)))return this.gridApi.getSelectedRows&&this.gridApi.getSelectedRows().length>0?this.gridApi.getSelectedRows():[];if((null===(a=this.gridApi)||void 0===a?void 0:a.getCellRanges)&&this.gridApi.getCellRanges().length>0)return this.getCellRangeRowData();if(!(null===(t=this.gridOptions)||void 0===t?void 0:t.cellSelection)&&!(null===(r=this.gridOptions)||void 0===r?void 0:r.enableRangeSelection)){const e=null===(i=this.gridApi)||void 0===i?void 0:i.getFocusedCell();if(e){const a=this.gridApi.getDisplayedRowAtIndex(e.rowIndex);if(null==a?void 0:a.data)return[a.data]}}return[]}catch(e){return U.error("Grid Pro: Error getting selected rows:",e),[]}}getCellRangeRowData(){var e;if(!(null===(e=this.gridApi)||void 0===e?void 0:e.getCellRanges))return[];const a=this.gridApi.getCellRanges();if(0===a.length)return[];const t=[];return a.forEach(e=>{const a=e.startRow.rowIndex,r=e.endRow.rowIndex;for(let e=a;e<=r;e+=1){const a=this.gridApi.getDisplayedRowAtIndex(e);(null==a?void 0:a.data)&&!t.some(e=>e===a.data)&&t.push(a.data)}}),t}hasSelectedRows(){return this.getSelectedRows().length>0}getStatusPanel(e){var a,t,r;return this.usesAgStatusBar?null===(t=null===(a=this.gridApi)||void 0===a?void 0:a.getStatusPanel)||void 0===t?void 0:t.call(a,e):null===(r=this.statusBar)||void 0===r?void 0:r.getStatusPanel(e)}updateLabelValueStatusBar(e){if(!this.gridApi)return void U.warn("Grid Pro: Cannot update label-value status bar - grid API not available");const a=this.updateStatusPanel(m.k7.labelValue,Object.assign({},e));a&&"function"==typeof a.updateParams||U.warn("Grid Pro: Label-value status bar component not found or updateParams method not available")}debouncedColumnAutosize(){this.gridAutosizingEnabled&&(this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.debounced=setTimeout(()=>{var e;null===(e=this.gridApi)||void 0===e||e.sizeColumnsToFit()},Na))}removeConfigWidthsToAutosize(e){return e.map(e=>Object.assign(Object.assign({},e),{width:null}))}saveColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()&&this.gridApi){let e=this.gridApi.getColumnState();e=Or(e),e=this.gridAutosizingEnabled?this.removeConfigWidthsToAutosize(e):e;const a=0===e.filter(e=>{if(e.hide)return!1;const a=this.gridApi.getColumn(e.colId);return Boolean(a&&this.gridApi.getDisplayNameForColumn(a,"header"))}).length;if(0===e.length||JSON.stringify(e)===JSON.stringify(this.columnState)||a)return;yield this.statePersistence.saveColumnState(this.persistColumnStateKey,e),this.columnState=e}})}getSavedColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){return this.columnState=[],this.statePersistanceEnabled()&&(this.columnState=yield this.statePersistence.getColumnState(this.persistColumnStateKey)),this.columnState})}restoreColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){var e;this.rehydrationAttempted=!0;const a=Or(yield this.getSavedColumnState());a&&a.length>0&&(null===(e=this.gridApi)||void 0===e||e.applyColumnState({state:a,applyOrder:!0}))})}cacheFilterConfig(){var e;this.setFilterModel((null===(e=this.gridApi)||void 0===e?void 0:e.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,r.sH)(this,void 0,void 0,function*(){var e,a;const t=yield this.getfilterModel();void 0!==t&&(null===(e=this.gridApi)||void 0===e||e.setFilterModel(t),null===(a=this.gridApi)||void 0===a||a.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof Et}get gridParams(){return{globalListener:this.boundGlobalEventListener,globalSyncListener:this.boundContextMenuListener,modules:[qe,d.Vc,d.ZuP]}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")||this.querySelector("grid-pro-infinite-datasource")}get isInfiniteRowModel(){return this.gridProDatasource instanceof Tt}notifyDatasourceVisibleColumns(){var e,a,t,r;const i=this.gridProDatasource;if(!i)return;const o=Ce(null===(a=null===(e=this.gridApi)||void 0===e?void 0:e.getAllDisplayedColumns)||void 0===a?void 0:a.call(e),null===(r=null===(t=this.gridApi)||void 0===t?void 0:t.getColumnDefs)||void 0===r?void 0:r.call(t));o.length&&i.setVisibleColumns(o)}set gridOptions(e){!this.applyingDatasourceGridOptions&&e&&(this.userProvidedGridOptions=Object.assign({},e));const a=()=>{!this.disposed&&this.isConnected&&(this.debouncedSaveColumnState(),this.debouncedColumnAutosize())},t=()=>{!this.disposed&&this.isConnected&&this.debouncedNotifyDatasourceVisibleColumns()};Array.from(this.attributes).forEach(e=>{const a=this.agPropertiesMap[e.name];a&&(this.agAttributes[a]=e.value)});const{columnDefs:i,components:o,defaultColDef:n,getRowId:l,onGridReady:s,onFilterChanged:g,onFirstDataRendered:d,statusBar:c}=e,u=(0,r.Tt)(e,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered","statusBar"]);this.userStatusBar=c;const p=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.gridOptionsConfig),{defaultColDef:Object.assign({enableCellChangeFlash:this.enableCellFlashing,filter:!0,resizable:!0,sortable:!0},n),components:this.combineAllGridComponents(o),headerHeight:this.headerHeight,rowHeight:this.rowHeight,animateRows:!1,suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:e=>(0,r.sH)(this,void 0,void 0,function*(){var a,t,r;if(this.gridApi=e.api,!!this.contextMenuItems!==this.gridCreatedWithMenuSuppressed&&this.syncContextMenuSuppression(),this.applyStatusBarMode(),this.gridEventsQueue.length&&this.gridEventsQueue.forEach(e=>{this.addGridEventListener(e)}),this.pendingSchemaUpdate){const e=this.pendingSchemaUpdate;this.pendingSchemaUpdate=void 0;try{yield this.processSchemaUpdate(e)}catch(e){U.error("Grid Pro: failed to apply the pending schema update on grid ready:",e)}}this.rowData&&this.gridApi.setGridOption("rowData",this.rowData),s&&s(e),(null===(a=this.gridProDatasource)||void 0===a?void 0:a.keepColDefsOnClearRowData)&&(null===(t=this.columnState)||void 0===t?void 0:t.length)>0&&this.gridApi.applyColumnState({state:this.columnState,applyOrder:!0}),this.$emit(Lr,{event:e,gridId:this.id}),this.$emit(m.mr,{event:e,gridId:this.id}),this.notifyDatasourceVisibleColumns(),null===(r=this.gridProDatasource)||void 0===r||r.$emit(Da.ready),this.restoreColumnState(),this.restoreCachedFilterConfig(),this.debouncedColumnAutosize()}),onFirstDataRendered:e=>{this.notifyDatasourceVisibleColumns(),d&&d(e)},onColumnPinned:a,onColumnResized:a,onColumnMoved:a,onColumnVisible:()=>{a(),t()},onDisplayedColumnsChanged:()=>{a(),t()},onFilterChanged:e=>{!this.disposed&&this.isConnected&&(this.debouncedSaveFilterModel(),g&&g(e))},onGridSizeChanged:a,onSortChanged:a}),u),c&&!this.withStatusBar?{statusBar:c}:{});this.gridProDatasource?(p.columnDefs=i,p.getRowId=l,this.setupStatusBar(p),this.setLocalGridOptions(p)):this.mergeAllColumnDefsAndStates(i).then(e=>{!this.disposed&&this.isConnected&&(p.columnDefs=e,p.getRowId=l,this.setupStatusBar(p),this.setLocalGridOptions(p),this.initGrid())})}setLocalGridOptions(e){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),Ya(e,this.agAttributes)),this.agGridOptions.context=Object.assign(Object.assign({},this.agGridOptions.context),{[Ye]:this.columnDragBridge}),null==this.agGridOptions.allowDragFromColumnsToolPanel&&(this.agGridOptions.allowDragFromColumnsToolPanel=!0)}clearLocalGridOptions(){this.agGridOptions=void 0}resetGridOptionsState(){this.userProvidedGridOptions=void 0,this.agGridOptions=void 0}initGrid(){s.DOM.queueUpdate(()=>{!this.disposed&&this.isConnected&&this.gridSlot&&(this.initialised&&(this.destroyGridInstance(),this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild)),this.gridCreatedWithMenuSuppressed=!!this.contextMenuItems,this.agGrid=(0,d.Dvw)(this.gridSlot,this.gridCreatedWithMenuSuppressed?Object.assign(Object.assign({},this.agGridOptions),{suppressContextMenu:!0}):this.agGridOptions,this.gridParams),this.initialised=!0)})}mergeAllColumnDefsAndStates(e){return(0,r.sH)(this,arguments,void 0,function*(e,a=!1){var t;const r=e||[];r.forEach(e=>{if(this.headerCaseType&&e.field&&!e.headerName){const a=c[this.headerCaseType];a?e.headerName=a(e.field):U.warn(`Invalid header-case-type attribute value: ${this.headerCaseType}. Please use one of the following: camelCase, capitalCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase.`)}});const i=Array.from(this.querySelectorAll(this.columnComponentName)).map(e=>e.definition).map(e=>{var a;if(this.enableCellFlashing&&void 0===e.enableCellChangeFlash&&(e.enableCellChangeFlash=!0),Ft(e.filter)){if(!(null!=e.filterParams&&"values"in e.filterParams)){const a=Pt(r.find(a=>a.field===e.field));a&&(e.filterParams=Object.assign(Object.assign({},e.filterParams),{values:a}))}e.filter===Se.enumFilter&&(null!==(a=e.floatingFilterComponent)&&void 0!==a||(e.floatingFilterComponent=Se.enumFloatingFilter))}e.editable&&(e.cellRenderer||e.cellRendererSelector||(e.cellRendererSelector=a=>{var t;if((null===(t=a.data)||void 0===t?void 0:t[m.A7])===e.field)return{component:m.IX.editable}}),Pr(e,e.field),e.cellClassRules||(e.cellClassRules={error:e=>{var a,t;return(null===(t=null===(a=e.data)||void 0===a?void 0:a[m.h1])||void 0===t?void 0:t.column)===e.colDef.field}}));const t=r.find(a=>e.field===a.field);return Object.assign(Object.assign({},t),e)}),o=i.map(e=>e.field),n=[...i,...this.onlyTemplateColDefs?[]:r.filter(e=>!o.includes(e.field))];if(this.gridProDatasource&&a){const e=yield this.getSavedColumnState();if((null==e?void 0:e.length)>0)return Ir(n,e);if((null===(t=this.gridProDatasource.deferredColumnStates)||void 0===t?void 0:t.length)>0)return Ir(n,this.gridProDatasource.deferredColumnStates)}return n})}setupStatusBar(e){var a;this.usesAgStatusBar&&this.withStatusBar?e.statusBar=this.buildAgStatusBar(e.rowModelType):null===(a=this.statusBar)||void 0===a||a.syncPanels()}get observedAttributes(){const e=Ga.map(e=>e.toLowerCase()),a=Ga.map(e=>(0,Dr.w)(e));return e.concat(a)}agAttributeChangedCallback(e,a,t){var r;if(a===t)return;const i=this.agPropertiesMap[e];i&&(this.agAttributes[i]=t,this.initialised&&(null===(r=this.gridApi)||void 0===r||r.setGridOption(i,t),"suppressContextMenu"===i&&this.contextMenuItems&&this.syncContextMenuSuppression()))}syncContextMenuSuppression(){var e,a,t,r;const i=null!==(t=null!==(e=this.agAttributes.suppressContextMenu)&&void 0!==e?e:null===(a=this.agGridOptions)||void 0===a?void 0:a.suppressContextMenu)&&void 0!==t&&t;null===(r=this.gridApi)||void 0===r||r.setGridOption("suppressContextMenu",!!this.contextMenuItems||i)}showContextMenu(e){var a,t,r,i,o;const n=null===(a=this.contextMenuItems)||void 0===a?void 0:a.call(this,e);if(!(null==n?void 0:n.length))return;const l=e.event instanceof MouseEvent?e.event:null,s=null==l?void 0:l.composedPath()[0],g=s instanceof Element?s:null;let d=null!==(t=null==l?void 0:l.clientX)&&void 0!==t?t:0,c=null!==(r=null==l?void 0:l.clientY)&&void 0!==r?r:0;const u=null==g?void 0:g.closest(".ag-cell");if(0===d&&0===c&&u){const e=u.getBoundingClientRect();d=e.left,c=e.bottom}null===(i=this.closeContextMenu)||void 0===i||i.call(this);const[p="foundation"]=this.tagName.toLowerCase().split("-");this.closeContextMenu=la({prefix:p,x:d,y:c,items:n,container:null!==(o=this.shadowRoot)&&void 0!==o?o:void 0,themeSource:g}),this.closeContextMenu&&(null==l?void 0:l.cancelable)&&l.preventDefault()}globalEventListener(e,a){const t=e.toLowerCase(),r=new Event(t);r.agGridDetails=a,this.dispatchEvent(r);const i="on"+t;"function"==typeof this[i]&&this[i](r)}}(0,r.Cg)([s.observable],Gr.prototype,"gridApi",void 0),(0,r.Cg)([s.observable],Gr.prototype,"gridErrorItems",void 0),(0,r.Cg)([cr],Gr.prototype,"statePersistence",void 0),(0,r.Cg)([(0,s.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],Gr.prototype,"autoCellRendererByType",void 0),(0,r.Cg)([(0,s.attr)({attribute:"only-template-col-defs",mode:"boolean"})],Gr.prototype,"onlyTemplateColDefs",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"grid-autosizing"})],Gr.prototype,"gridAutosizingEnabled",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],Gr.prototype,"enableCellFlashing",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-row-flashing"})],Gr.prototype,"enableRowFlashing",void 0),(0,r.Cg)([(0,s.attr)({attribute:"persist-column-state-key"})],Gr.prototype,"persistColumnStateKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"persist-filter-model-key"})],Gr.prototype,"persistFilterModelKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"header-case-type"})],Gr.prototype,"headerCaseType",void 0),(0,r.Cg)([s.observable],Gr.prototype,"rowData",void 0),(0,r.Cg)([s.attr],Gr.prototype,"columnComponentName",void 0),(0,r.Cg)([s.observable],Gr.prototype,"eventsAndCallbacks",void 0),(0,r.Cg)([s.attr],Gr.prototype,"headerHeight",void 0),(0,r.Cg)([s.attr],Gr.prototype,"rowHeight",void 0),(0,r.Cg)([s.observable],Gr.prototype,"classNames",void 0),(0,r.Cg)([s.observable],Gr.prototype,"agGrid",void 0),(0,r.Cg)([s.observable],Gr.prototype,"gridSlot",void 0),(0,r.Cg)([s.observable],Gr.prototype,"themeMode",void 0),(0,r.Cg)([s.observable],Gr.prototype,"gridComponents",void 0),(0,r.Cg)([s.observable],Gr.prototype,"statusBarConfig",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"with-status-bar"})],Gr.prototype,"withStatusBar",void 0),(0,r.Cg)([s.observable],Gr.prototype,"statusBarMode",void 0),(0,r.Cg)([s.observable],Gr.prototype,"contextMenuItems",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-column-selection"})],Gr.prototype,"enableColumnSelection",void 0),(0,r.Cg)([s.observable],Gr.prototype,"customErrorHandlerTemplate",void 0),(0,r.Cg)([m.lz],Gr.prototype,"gridOptionsConfig",void 0),(0,r.Cg)([s.observable],Gr.prototype,"provider",void 0);const Br=Gr.compose(Object.assign({baseName:"grid-pro",template:sr,styles:s.css`
9453
9453
  ${Lt}
9454
9454
  ${ir}
9455
9455
  ${He}
@@ -9591,7 +9591,7 @@
9591
9591
  .grid-pro-infinite .ag-header-cell-sortable:hover .ag-sort-none-icon {
9592
9592
  opacity: 1;
9593
9593
  }
9594
- `,shadowOptions:di},ci));var bi=t(29310),wi=t(72974),yi=t(84646),Ci=t(52945);(0,i.N)(rt,it,Et,v,we),wi.syG.registerModules([yi.n7,bi.Q]);class xi extends((0,o.S)(g.FoundationElement)){rowDataChanged(e,a){this.initialised&&this.gridApi&&this.gridApi.setRowData(a)}themeChanged(e,a){if(!a)return this.classNames="",void this.destroyFontFace();this.classNames=(0,te.x)((0,m.eL)(a),a),this.insertFontFace(a)}gridSlotChanged(){this.gridSlot&&!this.initialised&&this.agGridOptions&&this.initGrid()}getfilterModel(){return(0,r.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(e){return(0,r.sH)(this,void 0,void 0,function*(){this.persistFilterModelKey?yield this.statePersistence.saveFilterModel(this.persistFilterModelKey,e):this._filterConfig=e})}constructor(){super(),this.cachedTotalColumnWidth=null,this.columnCount=0,this.gridErrorItems=[],this.disposed=!1,this.debouncedSaveColumnState=p()(this.saveColumnState.bind(this),400),this.debouncedSaveFilterModel=p()(this.cacheFilterConfig.bind(this),400),this.debouncedNotifyDatasourceVisibleColumns=p()(this.notifyDatasourceVisibleColumns.bind(this),400),this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.sizeColumnsToContent=!1,this.sizeColumnsToFit=!1,this.addIndex=0,this.asyncAdd=!1,this.asyncRemove=!1,this.asyncUpdate=!0,this.enableCellFlashing=!1,this.enabledRowFlashing=!1,this.enableRowFlashing=!1,this.defaultColumnConfig=[],this.gridFontFace=tr,this.columnComponentName="grid-pro-column",this.theme=m.mJ.alpine,this.themeMode="dark",this.statusBarConfig=m.o2,this.withStatusBar=!1,this.applyingDatasourceGridOptions=!1,this.rehydrationAttempted=!1,this.eventHandlers=[],this.gridEventsQueue=[],this.registeredGridEvents=new Set,this.gridEventListeners=new Map,this.boundGlobalEventListener=this.globalEventListener.bind(this),this._filterConfig=void 0,this.agAttributes={},this.agPropertiesMap=Ga.reduce((e,a)=>(e[a.toLowerCase()]=a,e[(0,Dr.w)(a)]=a,e),{});const e=this.hideDatasourceError.bind(this);this.eventHandlers.push([tt.dataInit,e],[Fa.datasourceErrorClose,e],[Qa.error,this.handleBaseDatasourceError.bind(this)],[Qa.connected,e],[Da.initialize,this.handleInitialize.bind(this)],[Da.dataLoaded,this.handleDataLoaded.bind(this)],[Da.dataChanged,this.handleDataChanged.bind(this)],[Da.schemaUpdated,this.handleSchemaUpdated.bind(this)],[Da.dataCleared,this.handleDataCleared.bind(this)],[Da.loadingStarted,this.handleLoadingStarted.bind(this)],[Da.loadingFinished,this.handleLoadingFinished.bind(this)],[Da.noDataAvailable,this.handleNoDataAvailable.bind(this)],[Da.filtersRestored,this.handleFiltersRestored.bind(this)],[Da.moreDataAvailable,this.handleMoreDataAvailable.bind(this)],[Da.error,this.handleDatasourceError.bind(this)],[Da.destroy,this.handleDatasourceDestroy.bind(this)],[Da.cacheFilterConfig,this.cacheFilterConfig.bind(this)],[Da.refreshServerSide,this.handleRefreshServerSide.bind(this)],[Da.setServerSideDatasource,this.handleSetServerSideDatasource.bind(this)],[Da.addGridCssClass,this.handleAddGridCssClass.bind(this)],[Da.removeGridCssClass,this.handleRemoveGridCssClass.bind(this)],[Da.applyServerSideTransaction,this.handleApplyServerSideTransaction.bind(this)],[Da.setInfiniteDatasource,this.refuseInfiniteDatasource.bind(this)])}refuseInfiniteDatasource(){U.error('GridProLegacy does not support the Infinite Row Model; use GridPro (AG Grid v36) with grid-pro-infinite-datasource / datasource-type="infinite".')}addEventListener(e,a,t){super.addEventListener(e,a,t),wi.kNx.PUBLIC_EVENTS.includes(e)&&(this.gridApi?this.addGridEventListener(e):this.gridEventsQueue.includes(e)||this.gridEventsQueue.push(e))}addGridEventListener(e){if(this.registeredGridEvents.has(e))return;this.registeredGridEvents.add(e);const a=a=>{this.$emit(e,a)};this.gridEventListeners.set(e,a),this.gridApi.addEventListener(e,a)}handleError(e,a){this.gridErrorItems=[...this.gridErrorItems,{detail:a.detail,type:e}]}handleBaseDatasourceError(e){const a={detail:{message:e.detail.message},type:Pa.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:a.detail,type:a.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(e=>e.type!==Pa.datasource),this.removeAttribute("ds-disconnected")}connectedCallback(){super.connectedCallback(),this.disposed=!1,this.gridAutosizingEnabled&&(this.visibilityObserverCleanup=(0,n.j)(this,e=>{e&&this.debouncedColumnAutosize()})),this.rehydrationAttempted=!1,this.eventHandlers.forEach(([e,a])=>{this.addEventListener(e,a)}),this.shouldRunConnect&&Ga.forEach(e=>{Object.defineProperty(this,e,{set:a=>{this.agAttributeChangedCallback((0,Dr.w)(e),void 0,a)},enumerable:!0,configurable:!0})})}disconnectedCallback(){this.disposed=!0,this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel(),this.visibilityObserverCleanup&&(this.visibilityObserverCleanup(),this.visibilityObserverCleanup=void 0),super.disconnectedCallback(),this.rehydrationAttempted=!1;const e=this.shouldRunDisconnect;this.eventHandlers.forEach(([e,a])=>{this.removeEventListener(e,a)}),e?this.performDisconnectCleanup():queueMicrotask(()=>{this.isConnected||this.performDisconnectCleanup()})}performDisconnectCleanup(){this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.initialised=!1,this.resetGridOptionsState(),this.destroyGridInstance(),this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel(),this.invalidateColumnWidthCache(),this.registeredGridEvents.clear(),this.gridEventsQueue=[]}destroyGridInstance(){var e,a;if(this.gridApi&&this.gridEventListeners.forEach((e,a)=>{this.gridApi.removeEventListener(a,e)}),this.gridEventListeners.clear(),this.gridApi){if(!this.isServerSide)try{null===(a=(e=this.gridApi).flushAsyncTransactions)||void 0===a||a.call(e),this.gridApi.setRowData([])}catch(e){U.debug("Grid Pro: failed to clear row data before destroy",e)}this.gridApi.destroy()}else this.agGrid&&this.agGrid.destroy();this.gridSlot&&this.gridSlot.replaceChildren(),this.gridApi=void 0,this.columnApi=void 0,this.agGrid=void 0}handleInitialize(e){const{options:a,keepColDefsOnClearRowData:t}=e.detail;let r;t&&(r=this.gridApi.getColumnDefs(),this.columnState=this.columnApi.getColumnState());const i=Object.assign(Object.assign(Object.assign({},this.userProvidedGridOptions),r&&{columnDefs:r}),a);this.applyingDatasourceGridOptions=!0;try{this.gridOptions=Object.assign({},i),this.initGrid()}finally{this.applyingDatasourceGridOptions=!1}}handleDataLoaded(e){const{data:a}=e.detail;this.gridApi&&this.gridApi.setRowData(a)}handleDataChanged(e){var a,t,r;const{changes:i}=e.detail;if(this.gridApi&&!this.isServerSide){if((null===(a=i.add)||void 0===a?void 0:a.length)>0)if(this.asyncAdd)this.gridApi.applyTransactionAsync({add:i.add,addIndex:this.addIndex},e=>{this.flashAddedCells(null==e?void 0:e.add)});else{const e=this.gridApi.applyTransaction({add:i.add,addIndex:this.addIndex});this.flashAddedCells(null==e?void 0:e.add)}(null===(t=i.update)||void 0===t?void 0:t.length)>0&&(this.asyncUpdate?this.gridApi.applyTransactionAsync({update:i.update}):this.gridApi.applyTransaction({update:i.update})),(null===(r=i.remove)||void 0===r?void 0:r.length)>0&&(this.asyncRemove?this.gridApi.applyTransactionAsync({remove:i.remove}):this.gridApi.applyTransaction({remove:i.remove}))}}flashAddedCells(e){this.enableRowFlashing&&(null==e?void 0:e.length)&&this.gridApi.flashCells({rowNodes:e})}handleSchemaUpdated(e){return(0,r.sH)(this,void 0,void 0,function*(){this.gridApi?yield this.processSchemaUpdate(e.detail):this.pendingSchemaUpdate=e.detail})}processSchemaUpdate(e){return(0,r.sH)(this,arguments,void 0,function*({schema:e,metadata:a}){const t=this.gridApi.getColumnDefs();if(!t||0===t.length){const t=a.map(a=>{var t;return Object.assign(Object.assign({},e.find(e=>e.field===a.name)),null===(t=this.gridApi)||void 0===t?void 0:t.getColumnDef(a.name))}).map(e=>Object.assign(Object.assign({},e),{cellRenderer:this.autoCellRendererByType?e.cellRenderer:void 0,cellEditor:this.autoCellRendererByType?e.cellEditor:void 0})),r=yield this.mergeAllColumnDefsAndStates(t,!0);r&&(r.forEach(e=>{"children"in e||(e.rowGroup||(e.rowGroup=null),e.pivot||(e.pivot=null))}),this.gridApi.setColumnDefs(r),this.restoreCachedFilterConfig())}})}handleDataCleared(e){var a,t;const{includeSchema:r}=e.detail;this.gridApi&&(this.isServerSide||(this.asyncAdd||this.asyncUpdate||this.asyncRemove)&&(null===(t=(a=this.gridApi).flushAsyncTransactions)||void 0===t||t.call(a)),r&&this.gridApi.setColumnDefs([]),this.isServerSide||(this.gridApi.setRowData([]),this.gridApi.refreshCells({force:!0})))}handleLoadingStarted(){this.gridApi&&this.gridApi.showLoadingOverlay()}handleLoadingFinished(){this.gridApi&&this.gridApi.hideOverlay()}handleNoDataAvailable(){this.gridApi&&this.gridApi.showNoRowsOverlay()}handleFiltersRestored(){this.restoreCachedFilterConfig()}handleMoreDataAvailable(e){var a,t,r,i;const{hasMoreData:o,sourceRef:n}=e.detail;if(!this.gridApi)return;const l=null===(t=(a=this.gridApi).getStatusPanel)||void 0===t?void 0:t.call(a,m.k7.loadMore);l&&(null===(i=(r=l).updateParams)||void 0===i||i.call(r,{moreRows:o,sourceRef:n}))}handleDatasourceError(e){this.setAttribute("ds-disconnected","ds-disconnected")}handleDatasourceDestroy(){this.clearLocalGridOptions()}handleRefreshServerSide(e){const{purge:a}=e.detail;this.gridApi&&this.gridApi.refreshServerSide({purge:a})}handleSetServerSideDatasource(e){const{datasource:a}=e.detail;this.gridApi&&this.gridApi.setServerSideDatasource(a)}handleAddGridCssClass(e){var a;const{className:t}=e.detail,r=(null===(a=this.gridSlot)||void 0===a?void 0:a.parentElement)||this;r&&r.classList.add(t)}handleRemoveGridCssClass(e){var a;const{className:t}=e.detail,r=(null===(a=this.gridSlot)||void 0===a?void 0:a.parentElement)||this;r&&r.classList.remove(t)}handleApplyServerSideTransaction(e){var a,t;const{transaction:r,async:i,callback:o}=e.detail;if(this.gridApi)if(i)this.gridApi.applyServerSideTransactionAsync(r,e=>{var a,t;this.flashAddedCells([...null!==(a=null==e?void 0:e.add)&&void 0!==a?a:[],...null!==(t=null==e?void 0:e.update)&&void 0!==t?t:[]]),null==o||o(e)});else{const e=this.gridApi.applyServerSideTransaction(r);this.flashAddedCells([...null!==(a=null==e?void 0:e.add)&&void 0!==a?a:[],...null!==(t=null==e?void 0:e.update)&&void 0!==t?t:[]]),o&&o(e)}}combineAllGridComponents(e){const a={[m.IX.action]:H,[m.IX.actionsMenu]:q.cN,[m.IX.boolean]:Q,[m.IX.editable]:J,[m.IX.icon]:le,[m.IX.statusPill]:ce,[m.IX.select]:he,[m.IX.selectEditor]:f,[m.IX.numberEditor]:C,[m.IX.multiselectEditor]:k,[m.IX.dateEditor]:I,[m.IX.stringEditor]:P,[m.k7.labelValue]:ur,[m.k7.loadMore]:vr,[m.k7.reload]:mr,[m.k7.rowCount]:fr};return Object.assign(Object.assign(Object.assign({},a),e),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var e,a,t,r;try{if(!this.initialised||!this.gridApi)return[];const i=null===(e=this.gridOptions)||void 0===e?void 0:e.rowSelection;if("single"===i||"multiple"===i)return this.gridApi.getSelectedRows&&this.gridApi.getSelectedRows().length>0?this.gridApi.getSelectedRows():[];if((null===(a=this.gridApi)||void 0===a?void 0:a.getCellRanges)&&this.gridApi.getCellRanges().length>0)return this.getCellRangeRowData();if(!(null===(t=this.gridOptions)||void 0===t?void 0:t.enableRangeSelection)){const e=null===(r=this.gridApi)||void 0===r?void 0:r.getFocusedCell();if(e){const a=this.gridApi.getDisplayedRowAtIndex(e.rowIndex);if(null==a?void 0:a.data)return[a.data]}}return[]}catch(e){return U.error("Grid Pro: Error getting selected rows:",e),[]}}getCellRangeRowData(){var e;if(!(null===(e=this.gridApi)||void 0===e?void 0:e.getCellRanges))return[];const a=this.gridApi.getCellRanges();if(0===a.length)return[];const t=[];return a.forEach(e=>{const a=e.startRow.rowIndex,r=e.endRow.rowIndex;for(let e=a;e<=r;e+=1){const a=this.gridApi.getDisplayedRowAtIndex(e);(null==a?void 0:a.data)&&!t.some(e=>e===a.data)&&t.push(a.data)}}),t}hasSelectedRows(){return this.getSelectedRows().length>0}updateLabelValueStatusBar(e){var a,t;if(!this.gridApi)return void U.warn("Grid Pro: Cannot update label-value status bar - grid API not available");const r=null===(t=(a=this.gridApi).getStatusPanel)||void 0===t?void 0:t.call(a,m.k7.labelValue);r&&"function"==typeof r.updateParams?r.updateParams(e):U.warn("Grid Pro: Label-value status bar component not found or updateParams method not available")}debouncedColumnAutosize(){this.gridAutosizingEnabled&&(this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.debounced=setTimeout(()=>{var e;null===(e=this.gridApi)||void 0===e||e.sizeColumnsToFit()},Na))}removeConfigWidthsToAutosize(e){return e.map(e=>Object.assign(Object.assign({},e),{width:null}))}saveColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()){let e=this.columnApi.getColumnState();e=Or(e),e=this.gridAutosizingEnabled?this.removeConfigWidthsToAutosize(e):e;const a=0===e.filter(e=>{if(e.hide)return!1;const a=this.columnApi.getColumn(e.colId);return Boolean(a.getColDef().headerName)}).length;if(0===e.length||JSON.stringify(e)===JSON.stringify(this.columnState)||a)return;yield this.statePersistence.saveColumnState(this.persistColumnStateKey,e),this.columnState=e}})}getSavedColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){return this.columnState=[],this.statePersistanceEnabled()&&(this.columnState=yield this.statePersistence.getColumnState(this.persistColumnStateKey)),this.columnState})}deleteColumnState(){return(0,r.sH)(this,arguments,void 0,function*(e=!0){var a;if(this.statePersistanceEnabled()&&(yield this.statePersistence.deleteColumnState(this.persistColumnStateKey),this.columnState=[]),e&&this.columnApi){if((null===(a=this.defaultColumnConfig)||void 0===a?void 0:a.length)>0){const e=Tr(this.defaultColumnConfig);this.columnApi.applyColumnState({state:e,applyOrder:!0})}else this.columnApi.resetColumnState();this.handleColumnSizing()}})}restoreColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){var e;this.rehydrationAttempted=!0;const a=Or(yield this.getSavedColumnState());a&&a.length>0&&(null===(e=this.columnApi)||void 0===e||e.applyColumnState({state:a,applyOrder:!0}))})}cacheFilterConfig(){var e;this.setFilterModel((null===(e=this.gridApi)||void 0===e?void 0:e.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,r.sH)(this,void 0,void 0,function*(){var e,a;const t=yield this.getfilterModel();void 0!==t&&(null===(e=this.gridApi)||void 0===e||e.setFilterModel(t),null===(a=this.gridApi)||void 0===a||a.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof Et}get gridParams(){return{globalEventListener:this.boundGlobalEventListener}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")}notifyDatasourceVisibleColumns(){var e,a,t,r;const i=this.gridProDatasource;if(!i)return;const o=Ce(null===(a=null===(e=this.columnApi)||void 0===e?void 0:e.getAllDisplayedColumns)||void 0===a?void 0:a.call(e),null===(r=null===(t=this.gridApi)||void 0===t?void 0:t.getColumnDefs)||void 0===r?void 0:r.call(t));o.length&&i.setVisibleColumns(o)}set gridOptions(e){!this.applyingDatasourceGridOptions&&e&&(this.userProvidedGridOptions=Object.assign({},e));const a=()=>{!this.disposed&&this.isConnected&&(this.debouncedSaveColumnState(),this.debouncedColumnAutosize(),this.invalidateColumnWidthCache())},t=()=>{!this.disposed&&this.isConnected&&this.debouncedNotifyDatasourceVisibleColumns()};Array.from(this.attributes).forEach(e=>{const a=this.agPropertiesMap[e.name];a&&(this.agAttributes[a]=e.value)});const i=e,{columnDefs:o,components:n,defaultColDef:l,getRowId:s,onGridReady:g,onFilterChanged:d,onFirstDataRendered:c}=i,u=(0,r.Tt)(i,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered"]),p=this.gridOptionsConfig,h=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p),{defaultColDef:Object.assign({enableCellChangeFlash:this.enableCellFlashing,filter:!0,resizable:!0,sortable:!0},l),components:this.combineAllGridComponents(n),suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:e=>(0,r.sH)(this,void 0,void 0,function*(){var a,t;if(this.gridApi=e.api,this.columnApi=e.columnApi,this.gridEventsQueue.length&&this.gridEventsQueue.forEach(e=>{this.addGridEventListener(e)}),this.pendingSchemaUpdate){const e=this.pendingSchemaUpdate;this.pendingSchemaUpdate=void 0,yield this.processSchemaUpdate(e)}this.rowData&&this.gridApi.setRowData(this.rowData),g&&g(e),this.columnState&&(null===(a=this.columnState)||void 0===a?void 0:a.length)>0&&this.columnApi.applyColumnState({state:this.columnState,applyOrder:!0}),this.$emit(wi.sVA.EVENT_GRID_READY,{event:e,gridId:this.id}),this.$emit(m.mr,{event:e,gridId:this.id}),this.notifyDatasourceVisibleColumns(),null===(t=this.gridProDatasource)||void 0===t||t.$emit(Da.ready),this.restoreColumnState(),this.restoreCachedFilterConfig(),this.debouncedColumnAutosize()}),onFirstDataRendered:e=>{this.handleColumnSizing(),this.notifyDatasourceVisibleColumns(),c&&c(e)},onColumnPinned:a,onColumnResized:a,onColumnMoved:a,onColumnVisible:()=>{a(),t()},onDisplayedColumnsChanged:()=>{a(),t()},onFilterChanged:e=>{!this.disposed&&this.isConnected&&(this.debouncedSaveFilterModel(),d&&d(e))},onGridSizeChanged:a,onSortChanged:a}),u),v="getRowId"in(null!=e?e:{});this.gridProDatasource?(h.columnDefs=o,v&&(h.getRowId=s),this.setupStatusBar(h),this.setLocalGridOptions(h)):this.mergeAllColumnDefsAndStates(o).then(e=>{!this.disposed&&this.isConnected&&(h.columnDefs=e,v&&(h.getRowId=s),this.setupStatusBar(h),this.setLocalGridOptions(h),this.initGrid())})}setLocalGridOptions(e){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),Ya(e,this.agAttributes))}clearLocalGridOptions(){this.agGridOptions=void 0}resetGridOptionsState(){this.userProvidedGridOptions=void 0,this.agGridOptions=void 0}initGrid(){s.DOM.queueUpdate(()=>{!this.disposed&&this.isConnected&&this.gridSlot&&(this.initialised&&(this.destroyGridInstance(),this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild)),this.agGrid=new wi.xA9(this.gridSlot,this.agGridOptions,this.gridParams),this.initialised=!0)})}applyTemplateDefinitions(e,a=!1){return U.deprecated("applyTemplateDefinitions","Use `mergeAllColumnDefsAndStates` instead."),this.mergeAllColumnDefsAndStates(e,a)}mergeAllColumnDefsAndStates(e){return(0,r.sH)(this,arguments,void 0,function*(e,a=!1){var t;const r=e||[];r.forEach(e=>{if(this.headerCaseType&&e.field&&!e.headerName){const a=c[this.headerCaseType];a?e.headerName=a(e.field):U.warn(`Invalid header-case-type attribute value: ${this.headerCaseType}. Please use one of the following: camelCase, capitalCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase.`)}});const i=Array.from(this.querySelectorAll(this.columnComponentName)).map(e=>e.definition).map(e=>{var a,t;if(this.enableCellFlashing&&void 0===e.enableCellChangeFlash&&(e.enableCellChangeFlash=!0),"agSetColumnFilter"===e.filter){if(!(null!=e.filterParams&&"values"in e.filterParams)){const i=null===(t=null===(a=r.find(a=>a.field===e.field))||void 0===a?void 0:a.filterParams)||void 0===t?void 0:t.values;i&&(e.filterParams=Object.assign(Object.assign({},e.filterParams),{values:i}))}}e.editable&&(e.cellRenderer||e.cellRendererSelector||(e.cellRendererSelector=a=>{if(null==a?void 0:a.data)return a.data[m.A7]===e.field?{component:m.IX.editable}:void 0}),e.tooltipComponent||e.tooltipValueGetter||(e.tooltipComponent=Ar,e.tooltipValueGetter=a=>{if(!(null==a?void 0:a.data))return;const t=a.data[m.h1];return t&&t.column===e.field?t.message:void 0}),e.cellClassRules||(e.cellClassRules={error:e=>{var a;return!(!(null==e?void 0:e.colDef)||!(null==e?void 0:e.data))&&(null===(a=e.data[m.h1])||void 0===a?void 0:a.column)===e.colDef.field}}));const i=r.find(a=>e.field===a.field);return Object.assign(Object.assign({},i),e)}),o=i.map(e=>e.field),n=[...i,...this.onlyTemplateColDefs?[]:r.filter(e=>!o.includes(e.field))];if(this.gridProDatasource&&a){const e=yield this.getSavedColumnState();if((null==e?void 0:e.length)>0)return Ir(n,e);if((null===(t=this.gridProDatasource.deferredColumnStates)||void 0===t?void 0:t.length)>0)return Ir(n,this.gridProDatasource.deferredColumnStates)}return n})}panelExists(e,a){return a.some(a=>a.statusPanel===e)}addRowCountPanel(e,a){if(this.statusBarConfig&&!0===this.statusBarConfig.rows){const t=this.isServerSide||"serverSide"===(null==a?void 0:a.rowModelType);if(t)this.panelExists(m.k7.rowCount,e)||e.push({statusPanel:m.k7.rowCount,align:"left"});else if(!t){const a="agTotalAndFilteredRowCountComponent";this.panelExists(a,e)||e.push({statusPanel:a,align:"left"})}}}addMaxRowsPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.maxRows&&(this.panelExists(m.k7.labelValue,e)||e.push({statusPanel:m.k7.labelValue,statusPanelParams:{label:"Max Rows",value:this.gridProDatasource.maxRows||xa.OD.MAX_ROWS_250,hide:!1},align:"left"}))}addAggregationPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.aggregation&&(this.panelExists("agAggregationComponent",e)||e.push({statusPanel:"agAggregationComponent",align:"right"}))}addDatasourcePanels(e){if(this.gridProDatasource){const a=this.gridProDatasource.getDatasourceStatusBarPanels(this.isServerSide,this.statusBarConfig).filter(a=>!this.panelExists(a.statusPanel,e));e.push(...a)}}setupStatusBar(e){var a,t;if(this.withStatusBar&&this.statusBarConfig){const r=[...(null===(a=e.statusBar)||void 0===a?void 0:a.statusPanels)||[]];this.addRowCountPanel(r,e),this.addMaxRowsPanel(r),this.addAggregationPanel(r),this.addDatasourcePanels(r);const i=((null===(t=e.statusBar)||void 0===t?void 0:t.statusPanels)||[]).filter(e=>!this.panelExists(e.statusPanel,r));r.push(...i),e.statusBar={statusPanels:r}}}handleColumnSizing(){(this.sizeColumnsToContent||this.sizeColumnsToFit)&&(this.sizeColumnsToContent&&this.sizeColumnsToFit&&this.columnApi&&this.gridApi?this.handleBothSizingModes():this.handleIndividualSizingModes())}handleBothSizingModes(){if(this.calculateTotalColumnWidth()>this.getGridWidth()){if(!this.columnApi)return;this.columnApi.autoSizeAllColumns()}else{if(!this.gridApi)return;this.gridApi.sizeColumnsToFit()}}handleIndividualSizingModes(){this.sizeColumnsToContent&&this.columnApi&&this.columnApi.autoSizeAllColumns(),this.sizeColumnsToFit&&this.gridApi&&this.gridApi.sizeColumnsToFit()}calculateTotalColumnWidth(){if(!this.columnApi)return 0;const e=this.columnApi.getAllGridColumns(),a=e.length;return null!==this.cachedTotalColumnWidth&&this.columnCount===a||(this.cachedTotalColumnWidth=e.reduce((e,a)=>e+(a.getActualWidth()||0),0),this.columnCount=a),this.cachedTotalColumnWidth}invalidateColumnWidthCache(){this.cachedTotalColumnWidth=null,this.columnCount=0}getGridWidth(){const e=this;let a=(null==e?void 0:e.clientWidth)||0;return 0===a&&this.gridSlot&&(a=this.gridSlot.clientWidth||0),0===a&&(a=this.clientWidth||0),a}get observedAttributes(){const e=Ga.map(e=>e.toLowerCase()),a=Ga.map(e=>(0,Dr.w)(e));return e.concat(a)}agAttributeChangedCallback(e,a,t){if(a===t)return;const r=this.agPropertiesMap[e];if(r&&(this.agAttributes[r]=t,this.initialised&&this.gridApi)){const e={};e[r]={currentValue:t},wi.kNx.processOnChange(e,this.gridApi)}}globalEventListener(e,a){const t=e.toLowerCase(),r=new Event(t);r.agGridDetails=a,this.dispatchEvent(r);const i="on"+t;"function"==typeof this[i]&&this[i](r)}insertFontFace(e){const a=ar[e]||this.gridFontFace;this.destroyFontFace();const t=(0,Ci.O5)(a,(0,m.b7)(e));t&&(this.fontFaceDestroy=t)}destroyFontFace(){this.fontFaceDestroy&&(this.fontFaceDestroy(),this.fontFaceDestroy=null)}}(0,r.Cg)([s.observable],xi.prototype,"columnApi",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridApi",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridErrorItems",void 0),(0,r.Cg)([cr],xi.prototype,"statePersistence",void 0),(0,r.Cg)([(0,s.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],xi.prototype,"autoCellRendererByType",void 0),(0,r.Cg)([(0,s.attr)({attribute:"only-template-col-defs",mode:"boolean"})],xi.prototype,"onlyTemplateColDefs",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"grid-autosizing"})],xi.prototype,"gridAutosizingEnabled",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"size-columns-to-content"})],xi.prototype,"sizeColumnsToContent",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"size-columns-to-fit"})],xi.prototype,"sizeColumnsToFit",void 0),(0,r.Cg)([(0,s.attr)({attribute:"add-index"})],xi.prototype,"addIndex",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"async-add"})],xi.prototype,"asyncAdd",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"async-remove"})],xi.prototype,"asyncRemove",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"async-update"})],xi.prototype,"asyncUpdate",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],xi.prototype,"enableCellFlashing",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enabled-row-flashing"})],xi.prototype,"enabledRowFlashing",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-row-flashing"})],xi.prototype,"enableRowFlashing",void 0),(0,r.Cg)([(0,s.attr)({attribute:"persist-column-state-key"})],xi.prototype,"persistColumnStateKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"persist-filter-model-key"})],xi.prototype,"persistFilterModelKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"default-column-config"})],xi.prototype,"defaultColumnConfig",void 0),(0,r.Cg)([(0,s.attr)({attribute:"header-case-type"})],xi.prototype,"headerCaseType",void 0),(0,r.Cg)([s.observable],xi.prototype,"rowData",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridFontFace",void 0),(0,r.Cg)([s.attr],xi.prototype,"columnComponentName",void 0),(0,r.Cg)([s.observable],xi.prototype,"eventsAndCallbacks",void 0),(0,r.Cg)([s.attr],xi.prototype,"headerHeight",void 0),(0,r.Cg)([s.attr],xi.prototype,"rowHeight",void 0),(0,r.Cg)([s.attr],xi.prototype,"theme",void 0),(0,r.Cg)([s.observable],xi.prototype,"classNames",void 0),(0,r.Cg)([s.observable],xi.prototype,"agGrid",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridSlot",void 0),(0,r.Cg)([s.observable],xi.prototype,"themeMode",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridComponents",void 0),(0,r.Cg)([s.observable],xi.prototype,"statusBarConfig",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"with-status-bar"})],xi.prototype,"withStatusBar",void 0),(0,r.Cg)([s.observable],xi.prototype,"customErrorHandlerTemplate",void 0),(0,r.Cg)([m.lz],xi.prototype,"gridOptionsConfig",void 0);const Si=xi.compose(Object.assign({baseName:"grid-pro",styles:nr,template:sr,shadowOptions:Wa},qa));var zi=t(93188);const ki=s.css`
9594
+ `,shadowOptions:di},ci));var bi=t(29310),wi=t(72974),yi=t(84646),Ci=t(52945);(0,i.N)(rt,it,Et,v,we),wi.syG.registerModules([yi.n7,bi.Q]);class xi extends((0,o.S)(g.FoundationElement)){rowDataChanged(e,a){this.initialised&&this.gridApi&&this.gridApi.setRowData(a)}themeChanged(e,a){if(!a)return this.classNames="",void this.destroyFontFace();this.classNames=(0,te.x)((0,m.eL)(a),a),this.insertFontFace(a)}gridSlotChanged(){this.gridSlot&&!this.initialised&&this.agGridOptions&&this.initGrid()}getfilterModel(){return(0,r.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(e){return(0,r.sH)(this,void 0,void 0,function*(){this.persistFilterModelKey?yield this.statePersistence.saveFilterModel(this.persistFilterModelKey,e):this._filterConfig=e})}constructor(){super(),this.cachedTotalColumnWidth=null,this.columnCount=0,this.gridErrorItems=[],this.disposed=!1,this.debouncedSaveColumnState=p()(this.saveColumnState.bind(this),400),this.debouncedSaveFilterModel=p()(this.cacheFilterConfig.bind(this),400),this.debouncedNotifyDatasourceVisibleColumns=p()(this.notifyDatasourceVisibleColumns.bind(this),400),this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.sizeColumnsToContent=!1,this.sizeColumnsToFit=!1,this.addIndex=0,this.asyncAdd=!1,this.asyncRemove=!1,this.asyncUpdate=!0,this.enableCellFlashing=!1,this.enabledRowFlashing=!1,this.enableRowFlashing=!1,this.defaultColumnConfig=[],this.gridFontFace=tr,this.columnComponentName="grid-pro-column",this.theme=m.mJ.alpine,this.themeMode="dark",this.statusBarConfig=m.o2,this.withStatusBar=!1,this.applyingDatasourceGridOptions=!1,this.rehydrationAttempted=!1,this.eventHandlers=[],this.gridEventsQueue=[],this.registeredGridEvents=new Set,this.gridEventListeners=new Map,this.boundGlobalEventListener=this.globalEventListener.bind(this),this._filterConfig=void 0,this.agAttributes={},this.agPropertiesMap=Ga.reduce((e,a)=>(e[a.toLowerCase()]=a,e[(0,Dr.w)(a)]=a,e),{});const e=this.hideDatasourceError.bind(this);this.eventHandlers.push([tt.dataInit,e],[Fa.datasourceErrorClose,e],[Qa.error,this.handleBaseDatasourceError.bind(this)],[Qa.connected,e],[Da.initialize,this.handleInitialize.bind(this)],[Da.dataLoaded,this.handleDataLoaded.bind(this)],[Da.dataChanged,this.handleDataChanged.bind(this)],[Da.schemaUpdated,this.handleSchemaUpdated.bind(this)],[Da.dataCleared,this.handleDataCleared.bind(this)],[Da.loadingStarted,this.handleLoadingStarted.bind(this)],[Da.loadingFinished,this.handleLoadingFinished.bind(this)],[Da.noDataAvailable,this.handleNoDataAvailable.bind(this)],[Da.filtersRestored,this.handleFiltersRestored.bind(this)],[Da.moreDataAvailable,this.handleMoreDataAvailable.bind(this)],[Da.error,this.handleDatasourceError.bind(this)],[Da.destroy,this.handleDatasourceDestroy.bind(this)],[Da.cacheFilterConfig,this.cacheFilterConfig.bind(this)],[Da.refreshServerSide,this.handleRefreshServerSide.bind(this)],[Da.setServerSideDatasource,this.handleSetServerSideDatasource.bind(this)],[Da.addGridCssClass,this.handleAddGridCssClass.bind(this)],[Da.removeGridCssClass,this.handleRemoveGridCssClass.bind(this)],[Da.applyServerSideTransaction,this.handleApplyServerSideTransaction.bind(this)],[Da.setInfiniteDatasource,this.refuseInfiniteDatasource.bind(this)])}refuseInfiniteDatasource(){U.error('GridProLegacy does not support the Infinite Row Model; use GridPro (AG Grid v36) with grid-pro-infinite-datasource / datasource-type="infinite".')}addEventListener(e,a,t){super.addEventListener(e,a,t),wi.kNx.PUBLIC_EVENTS.includes(e)&&(this.gridApi?this.addGridEventListener(e):this.gridEventsQueue.includes(e)||this.gridEventsQueue.push(e))}addGridEventListener(e){if(this.registeredGridEvents.has(e))return;this.registeredGridEvents.add(e);const a=a=>{this.$emit(e,a)};this.gridEventListeners.set(e,a),this.gridApi.addEventListener(e,a)}handleError(e,a){this.gridErrorItems=[...this.gridErrorItems,{detail:a.detail,type:e}]}handleBaseDatasourceError(e){const a={detail:{message:e.detail.message},type:Pa.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:a.detail,type:a.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(e=>e.type!==Pa.datasource),this.removeAttribute("ds-disconnected")}connectedCallback(){super.connectedCallback(),this.disposed=!1,this.gridAutosizingEnabled&&(this.visibilityObserverCleanup=(0,n.j)(this,e=>{e&&this.debouncedColumnAutosize()})),this.rehydrationAttempted=!1,this.eventHandlers.forEach(([e,a])=>{this.addEventListener(e,a)}),this.shouldRunConnect&&Ga.forEach(e=>{Object.defineProperty(this,e,{set:a=>{this.agAttributeChangedCallback((0,Dr.w)(e),void 0,a)},enumerable:!0,configurable:!0})})}disconnectedCallback(){this.debouncedSaveColumnState.flush(),this.disposed=!0,this.debouncedSaveFilterModel.cancel(),this.visibilityObserverCleanup&&(this.visibilityObserverCleanup(),this.visibilityObserverCleanup=void 0),super.disconnectedCallback(),this.rehydrationAttempted=!1;const e=this.shouldRunDisconnect;this.eventHandlers.forEach(([e,a])=>{this.removeEventListener(e,a)}),e?this.performDisconnectCleanup():queueMicrotask(()=>{this.isConnected||this.performDisconnectCleanup()})}performDisconnectCleanup(){this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.initialised=!1,this.resetGridOptionsState(),this.destroyGridInstance(),this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel(),this.invalidateColumnWidthCache(),this.registeredGridEvents.clear(),this.gridEventsQueue=[]}destroyGridInstance(){var e,a;if(this.gridApi&&this.gridEventListeners.forEach((e,a)=>{this.gridApi.removeEventListener(a,e)}),this.gridEventListeners.clear(),this.gridApi){if(!this.isServerSide)try{null===(a=(e=this.gridApi).flushAsyncTransactions)||void 0===a||a.call(e),this.gridApi.setRowData([])}catch(e){U.debug("Grid Pro: failed to clear row data before destroy",e)}this.gridApi.destroy()}else this.agGrid&&this.agGrid.destroy();this.gridSlot&&this.gridSlot.replaceChildren(),this.gridApi=void 0,this.columnApi=void 0,this.agGrid=void 0}handleInitialize(e){const{options:a,keepColDefsOnClearRowData:t}=e.detail;let r;t&&(r=this.gridApi.getColumnDefs(),this.columnState=this.columnApi.getColumnState());const i=Object.assign(Object.assign(Object.assign({},this.userProvidedGridOptions),r&&{columnDefs:r}),a);this.applyingDatasourceGridOptions=!0;try{this.gridOptions=Object.assign({},i),this.initGrid()}finally{this.applyingDatasourceGridOptions=!1}}handleDataLoaded(e){const{data:a}=e.detail;this.gridApi&&this.gridApi.setRowData(a)}handleDataChanged(e){var a,t,r;const{changes:i}=e.detail;if(this.gridApi&&!this.isServerSide){if((null===(a=i.add)||void 0===a?void 0:a.length)>0)if(this.asyncAdd)this.gridApi.applyTransactionAsync({add:i.add,addIndex:this.addIndex},e=>{this.flashAddedCells(null==e?void 0:e.add)});else{const e=this.gridApi.applyTransaction({add:i.add,addIndex:this.addIndex});this.flashAddedCells(null==e?void 0:e.add)}(null===(t=i.update)||void 0===t?void 0:t.length)>0&&(this.asyncUpdate?this.gridApi.applyTransactionAsync({update:i.update}):this.gridApi.applyTransaction({update:i.update})),(null===(r=i.remove)||void 0===r?void 0:r.length)>0&&(this.asyncRemove?this.gridApi.applyTransactionAsync({remove:i.remove}):this.gridApi.applyTransaction({remove:i.remove}))}}flashAddedCells(e){this.enableRowFlashing&&(null==e?void 0:e.length)&&this.gridApi.flashCells({rowNodes:e})}handleSchemaUpdated(e){return(0,r.sH)(this,void 0,void 0,function*(){this.gridApi?yield this.processSchemaUpdate(e.detail):this.pendingSchemaUpdate=e.detail})}processSchemaUpdate(e){return(0,r.sH)(this,arguments,void 0,function*({schema:e,metadata:a}){const t=this.gridApi.getColumnDefs();if(!t||0===t.length){const t=a.map(a=>{var t;return Object.assign(Object.assign({},e.find(e=>e.field===a.name)),null===(t=this.gridApi)||void 0===t?void 0:t.getColumnDef(a.name))}).map(e=>Object.assign(Object.assign({},e),{cellRenderer:this.autoCellRendererByType?e.cellRenderer:void 0,cellEditor:this.autoCellRendererByType?e.cellEditor:void 0})),r=yield this.mergeAllColumnDefsAndStates(t,!0);r&&(r.forEach(e=>{"children"in e||(e.rowGroup||(e.rowGroup=null),e.pivot||(e.pivot=null))}),this.gridApi.setColumnDefs(r),this.restoreCachedFilterConfig())}})}handleDataCleared(e){var a,t;const{includeSchema:r}=e.detail;this.gridApi&&(this.isServerSide||(this.asyncAdd||this.asyncUpdate||this.asyncRemove)&&(null===(t=(a=this.gridApi).flushAsyncTransactions)||void 0===t||t.call(a)),r&&this.gridApi.setColumnDefs([]),this.isServerSide||(this.gridApi.setRowData([]),this.gridApi.refreshCells({force:!0})))}handleLoadingStarted(){this.gridApi&&this.gridApi.showLoadingOverlay()}handleLoadingFinished(){this.gridApi&&this.gridApi.hideOverlay()}handleNoDataAvailable(){this.gridApi&&this.gridApi.showNoRowsOverlay()}handleFiltersRestored(){this.restoreCachedFilterConfig()}handleMoreDataAvailable(e){var a,t,r,i;const{hasMoreData:o,sourceRef:n}=e.detail;if(!this.gridApi)return;const l=null===(t=(a=this.gridApi).getStatusPanel)||void 0===t?void 0:t.call(a,m.k7.loadMore);l&&(null===(i=(r=l).updateParams)||void 0===i||i.call(r,{moreRows:o,sourceRef:n}))}handleDatasourceError(e){this.setAttribute("ds-disconnected","ds-disconnected")}handleDatasourceDestroy(){this.clearLocalGridOptions()}handleRefreshServerSide(e){const{purge:a}=e.detail;this.gridApi&&this.gridApi.refreshServerSide({purge:a})}handleSetServerSideDatasource(e){const{datasource:a}=e.detail;this.gridApi&&this.gridApi.setServerSideDatasource(a)}handleAddGridCssClass(e){var a;const{className:t}=e.detail,r=(null===(a=this.gridSlot)||void 0===a?void 0:a.parentElement)||this;r&&r.classList.add(t)}handleRemoveGridCssClass(e){var a;const{className:t}=e.detail,r=(null===(a=this.gridSlot)||void 0===a?void 0:a.parentElement)||this;r&&r.classList.remove(t)}handleApplyServerSideTransaction(e){var a,t;const{transaction:r,async:i,callback:o}=e.detail;if(this.gridApi)if(i)this.gridApi.applyServerSideTransactionAsync(r,e=>{var a,t;this.flashAddedCells([...null!==(a=null==e?void 0:e.add)&&void 0!==a?a:[],...null!==(t=null==e?void 0:e.update)&&void 0!==t?t:[]]),null==o||o(e)});else{const e=this.gridApi.applyServerSideTransaction(r);this.flashAddedCells([...null!==(a=null==e?void 0:e.add)&&void 0!==a?a:[],...null!==(t=null==e?void 0:e.update)&&void 0!==t?t:[]]),o&&o(e)}}combineAllGridComponents(e){const a={[m.IX.action]:H,[m.IX.actionsMenu]:q.cN,[m.IX.boolean]:Q,[m.IX.editable]:J,[m.IX.icon]:le,[m.IX.statusPill]:ce,[m.IX.select]:he,[m.IX.selectEditor]:f,[m.IX.numberEditor]:C,[m.IX.multiselectEditor]:k,[m.IX.dateEditor]:I,[m.IX.stringEditor]:P,[m.k7.labelValue]:ur,[m.k7.loadMore]:vr,[m.k7.reload]:mr,[m.k7.rowCount]:fr};return Object.assign(Object.assign(Object.assign({},a),e),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var e,a,t,r;try{if(!this.initialised||!this.gridApi)return[];const i=null===(e=this.gridOptions)||void 0===e?void 0:e.rowSelection;if("single"===i||"multiple"===i)return this.gridApi.getSelectedRows&&this.gridApi.getSelectedRows().length>0?this.gridApi.getSelectedRows():[];if((null===(a=this.gridApi)||void 0===a?void 0:a.getCellRanges)&&this.gridApi.getCellRanges().length>0)return this.getCellRangeRowData();if(!(null===(t=this.gridOptions)||void 0===t?void 0:t.enableRangeSelection)){const e=null===(r=this.gridApi)||void 0===r?void 0:r.getFocusedCell();if(e){const a=this.gridApi.getDisplayedRowAtIndex(e.rowIndex);if(null==a?void 0:a.data)return[a.data]}}return[]}catch(e){return U.error("Grid Pro: Error getting selected rows:",e),[]}}getCellRangeRowData(){var e;if(!(null===(e=this.gridApi)||void 0===e?void 0:e.getCellRanges))return[];const a=this.gridApi.getCellRanges();if(0===a.length)return[];const t=[];return a.forEach(e=>{const a=e.startRow.rowIndex,r=e.endRow.rowIndex;for(let e=a;e<=r;e+=1){const a=this.gridApi.getDisplayedRowAtIndex(e);(null==a?void 0:a.data)&&!t.some(e=>e===a.data)&&t.push(a.data)}}),t}hasSelectedRows(){return this.getSelectedRows().length>0}updateLabelValueStatusBar(e){var a,t;if(!this.gridApi)return void U.warn("Grid Pro: Cannot update label-value status bar - grid API not available");const r=null===(t=(a=this.gridApi).getStatusPanel)||void 0===t?void 0:t.call(a,m.k7.labelValue);r&&"function"==typeof r.updateParams?r.updateParams(e):U.warn("Grid Pro: Label-value status bar component not found or updateParams method not available")}debouncedColumnAutosize(){this.gridAutosizingEnabled&&(this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.debounced=setTimeout(()=>{var e;null===(e=this.gridApi)||void 0===e||e.sizeColumnsToFit()},Na))}removeConfigWidthsToAutosize(e){return e.map(e=>Object.assign(Object.assign({},e),{width:null}))}saveColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()&&this.columnApi){let e=this.columnApi.getColumnState();e=Or(e),e=this.gridAutosizingEnabled?this.removeConfigWidthsToAutosize(e):e;const a=0===e.filter(e=>{if(e.hide)return!1;const a=this.columnApi.getColumn(e.colId);return Boolean(a&&this.columnApi.getDisplayNameForColumn(a,"header"))}).length;if(0===e.length||JSON.stringify(e)===JSON.stringify(this.columnState)||a)return;yield this.statePersistence.saveColumnState(this.persistColumnStateKey,e),this.columnState=e}})}getSavedColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){return this.columnState=[],this.statePersistanceEnabled()&&(this.columnState=yield this.statePersistence.getColumnState(this.persistColumnStateKey)),this.columnState})}deleteColumnState(){return(0,r.sH)(this,arguments,void 0,function*(e=!0){var a;if(this.statePersistanceEnabled()&&(yield this.statePersistence.deleteColumnState(this.persistColumnStateKey),this.columnState=[]),e&&this.columnApi){if((null===(a=this.defaultColumnConfig)||void 0===a?void 0:a.length)>0){const e=Tr(this.defaultColumnConfig);this.columnApi.applyColumnState({state:e,applyOrder:!0})}else this.columnApi.resetColumnState();this.handleColumnSizing()}})}restoreColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){var e;this.rehydrationAttempted=!0;const a=Or(yield this.getSavedColumnState());a&&a.length>0&&(null===(e=this.columnApi)||void 0===e||e.applyColumnState({state:a,applyOrder:!0}))})}cacheFilterConfig(){var e;this.setFilterModel((null===(e=this.gridApi)||void 0===e?void 0:e.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,r.sH)(this,void 0,void 0,function*(){var e,a;const t=yield this.getfilterModel();void 0!==t&&(null===(e=this.gridApi)||void 0===e||e.setFilterModel(t),null===(a=this.gridApi)||void 0===a||a.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof Et}get gridParams(){return{globalEventListener:this.boundGlobalEventListener}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")}notifyDatasourceVisibleColumns(){var e,a,t,r;const i=this.gridProDatasource;if(!i)return;const o=Ce(null===(a=null===(e=this.columnApi)||void 0===e?void 0:e.getAllDisplayedColumns)||void 0===a?void 0:a.call(e),null===(r=null===(t=this.gridApi)||void 0===t?void 0:t.getColumnDefs)||void 0===r?void 0:r.call(t));o.length&&i.setVisibleColumns(o)}set gridOptions(e){!this.applyingDatasourceGridOptions&&e&&(this.userProvidedGridOptions=Object.assign({},e));const a=()=>{!this.disposed&&this.isConnected&&(this.debouncedSaveColumnState(),this.debouncedColumnAutosize(),this.invalidateColumnWidthCache())},t=()=>{!this.disposed&&this.isConnected&&this.debouncedNotifyDatasourceVisibleColumns()};Array.from(this.attributes).forEach(e=>{const a=this.agPropertiesMap[e.name];a&&(this.agAttributes[a]=e.value)});const i=e,{columnDefs:o,components:n,defaultColDef:l,getRowId:s,onGridReady:g,onFilterChanged:d,onFirstDataRendered:c}=i,u=(0,r.Tt)(i,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered"]),p=this.gridOptionsConfig,h=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p),{defaultColDef:Object.assign({enableCellChangeFlash:this.enableCellFlashing,filter:!0,resizable:!0,sortable:!0},l),components:this.combineAllGridComponents(n),suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:e=>(0,r.sH)(this,void 0,void 0,function*(){var a,t;if(this.gridApi=e.api,this.columnApi=e.columnApi,this.gridEventsQueue.length&&this.gridEventsQueue.forEach(e=>{this.addGridEventListener(e)}),this.pendingSchemaUpdate){const e=this.pendingSchemaUpdate;this.pendingSchemaUpdate=void 0,yield this.processSchemaUpdate(e)}this.rowData&&this.gridApi.setRowData(this.rowData),g&&g(e),this.columnState&&(null===(a=this.columnState)||void 0===a?void 0:a.length)>0&&this.columnApi.applyColumnState({state:this.columnState,applyOrder:!0}),this.$emit(wi.sVA.EVENT_GRID_READY,{event:e,gridId:this.id}),this.$emit(m.mr,{event:e,gridId:this.id}),this.notifyDatasourceVisibleColumns(),null===(t=this.gridProDatasource)||void 0===t||t.$emit(Da.ready),this.restoreColumnState(),this.restoreCachedFilterConfig(),this.debouncedColumnAutosize()}),onFirstDataRendered:e=>{this.handleColumnSizing(),this.notifyDatasourceVisibleColumns(),c&&c(e)},onColumnPinned:a,onColumnResized:a,onColumnMoved:a,onColumnVisible:()=>{a(),t()},onDisplayedColumnsChanged:()=>{a(),t()},onFilterChanged:e=>{!this.disposed&&this.isConnected&&(this.debouncedSaveFilterModel(),d&&d(e))},onGridSizeChanged:a,onSortChanged:a}),u),v="getRowId"in(null!=e?e:{});this.gridProDatasource?(h.columnDefs=o,v&&(h.getRowId=s),this.setupStatusBar(h),this.setLocalGridOptions(h)):this.mergeAllColumnDefsAndStates(o).then(e=>{!this.disposed&&this.isConnected&&(h.columnDefs=e,v&&(h.getRowId=s),this.setupStatusBar(h),this.setLocalGridOptions(h),this.initGrid())})}setLocalGridOptions(e){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),Ya(e,this.agAttributes))}clearLocalGridOptions(){this.agGridOptions=void 0}resetGridOptionsState(){this.userProvidedGridOptions=void 0,this.agGridOptions=void 0}initGrid(){s.DOM.queueUpdate(()=>{!this.disposed&&this.isConnected&&this.gridSlot&&(this.initialised&&(this.destroyGridInstance(),this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild)),this.agGrid=new wi.xA9(this.gridSlot,this.agGridOptions,this.gridParams),this.initialised=!0)})}applyTemplateDefinitions(e,a=!1){return U.deprecated("applyTemplateDefinitions","Use `mergeAllColumnDefsAndStates` instead."),this.mergeAllColumnDefsAndStates(e,a)}mergeAllColumnDefsAndStates(e){return(0,r.sH)(this,arguments,void 0,function*(e,a=!1){var t;const r=e||[];r.forEach(e=>{if(this.headerCaseType&&e.field&&!e.headerName){const a=c[this.headerCaseType];a?e.headerName=a(e.field):U.warn(`Invalid header-case-type attribute value: ${this.headerCaseType}. Please use one of the following: camelCase, capitalCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase.`)}});const i=Array.from(this.querySelectorAll(this.columnComponentName)).map(e=>e.definition).map(e=>{var a,t;if(this.enableCellFlashing&&void 0===e.enableCellChangeFlash&&(e.enableCellChangeFlash=!0),"agSetColumnFilter"===e.filter){if(!(null!=e.filterParams&&"values"in e.filterParams)){const i=null===(t=null===(a=r.find(a=>a.field===e.field))||void 0===a?void 0:a.filterParams)||void 0===t?void 0:t.values;i&&(e.filterParams=Object.assign(Object.assign({},e.filterParams),{values:i}))}}e.editable&&(e.cellRenderer||e.cellRendererSelector||(e.cellRendererSelector=a=>{if(null==a?void 0:a.data)return a.data[m.A7]===e.field?{component:m.IX.editable}:void 0}),e.tooltipComponent||e.tooltipValueGetter||(e.tooltipComponent=Ar,e.tooltipValueGetter=a=>{if(!(null==a?void 0:a.data))return;const t=a.data[m.h1];return t&&t.column===e.field?t.message:void 0}),e.cellClassRules||(e.cellClassRules={error:e=>{var a;return!(!(null==e?void 0:e.colDef)||!(null==e?void 0:e.data))&&(null===(a=e.data[m.h1])||void 0===a?void 0:a.column)===e.colDef.field}}));const i=r.find(a=>e.field===a.field);return Object.assign(Object.assign({},i),e)}),o=i.map(e=>e.field),n=[...i,...this.onlyTemplateColDefs?[]:r.filter(e=>!o.includes(e.field))];if(this.gridProDatasource&&a){const e=yield this.getSavedColumnState();if((null==e?void 0:e.length)>0)return Ir(n,e);if((null===(t=this.gridProDatasource.deferredColumnStates)||void 0===t?void 0:t.length)>0)return Ir(n,this.gridProDatasource.deferredColumnStates)}return n})}panelExists(e,a){return a.some(a=>a.statusPanel===e)}addRowCountPanel(e,a){if(this.statusBarConfig&&!0===this.statusBarConfig.rows){const t=this.isServerSide||"serverSide"===(null==a?void 0:a.rowModelType);if(t)this.panelExists(m.k7.rowCount,e)||e.push({statusPanel:m.k7.rowCount,align:"left"});else if(!t){const a="agTotalAndFilteredRowCountComponent";this.panelExists(a,e)||e.push({statusPanel:a,align:"left"})}}}addMaxRowsPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.maxRows&&(this.panelExists(m.k7.labelValue,e)||e.push({statusPanel:m.k7.labelValue,statusPanelParams:{label:"Max Rows",value:this.gridProDatasource.maxRows||xa.OD.MAX_ROWS_250,hide:!1},align:"left"}))}addAggregationPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.aggregation&&(this.panelExists("agAggregationComponent",e)||e.push({statusPanel:"agAggregationComponent",align:"right"}))}addDatasourcePanels(e){if(this.gridProDatasource){const a=this.gridProDatasource.getDatasourceStatusBarPanels(this.isServerSide,this.statusBarConfig).filter(a=>!this.panelExists(a.statusPanel,e));e.push(...a)}}setupStatusBar(e){var a,t;if(this.withStatusBar&&this.statusBarConfig){const r=[...(null===(a=e.statusBar)||void 0===a?void 0:a.statusPanels)||[]];this.addRowCountPanel(r,e),this.addMaxRowsPanel(r),this.addAggregationPanel(r),this.addDatasourcePanels(r);const i=((null===(t=e.statusBar)||void 0===t?void 0:t.statusPanels)||[]).filter(e=>!this.panelExists(e.statusPanel,r));r.push(...i),e.statusBar={statusPanels:r}}}handleColumnSizing(){(this.sizeColumnsToContent||this.sizeColumnsToFit)&&(this.sizeColumnsToContent&&this.sizeColumnsToFit&&this.columnApi&&this.gridApi?this.handleBothSizingModes():this.handleIndividualSizingModes())}handleBothSizingModes(){if(this.calculateTotalColumnWidth()>this.getGridWidth()){if(!this.columnApi)return;this.columnApi.autoSizeAllColumns()}else{if(!this.gridApi)return;this.gridApi.sizeColumnsToFit()}}handleIndividualSizingModes(){this.sizeColumnsToContent&&this.columnApi&&this.columnApi.autoSizeAllColumns(),this.sizeColumnsToFit&&this.gridApi&&this.gridApi.sizeColumnsToFit()}calculateTotalColumnWidth(){if(!this.columnApi)return 0;const e=this.columnApi.getAllGridColumns(),a=e.length;return null!==this.cachedTotalColumnWidth&&this.columnCount===a||(this.cachedTotalColumnWidth=e.reduce((e,a)=>e+(a.getActualWidth()||0),0),this.columnCount=a),this.cachedTotalColumnWidth}invalidateColumnWidthCache(){this.cachedTotalColumnWidth=null,this.columnCount=0}getGridWidth(){const e=this;let a=(null==e?void 0:e.clientWidth)||0;return 0===a&&this.gridSlot&&(a=this.gridSlot.clientWidth||0),0===a&&(a=this.clientWidth||0),a}get observedAttributes(){const e=Ga.map(e=>e.toLowerCase()),a=Ga.map(e=>(0,Dr.w)(e));return e.concat(a)}agAttributeChangedCallback(e,a,t){if(a===t)return;const r=this.agPropertiesMap[e];if(r&&(this.agAttributes[r]=t,this.initialised&&this.gridApi)){const e={};e[r]={currentValue:t},wi.kNx.processOnChange(e,this.gridApi)}}globalEventListener(e,a){const t=e.toLowerCase(),r=new Event(t);r.agGridDetails=a,this.dispatchEvent(r);const i="on"+t;"function"==typeof this[i]&&this[i](r)}insertFontFace(e){const a=ar[e]||this.gridFontFace;this.destroyFontFace();const t=(0,Ci.O5)(a,(0,m.b7)(e));t&&(this.fontFaceDestroy=t)}destroyFontFace(){this.fontFaceDestroy&&(this.fontFaceDestroy(),this.fontFaceDestroy=null)}}(0,r.Cg)([s.observable],xi.prototype,"columnApi",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridApi",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridErrorItems",void 0),(0,r.Cg)([cr],xi.prototype,"statePersistence",void 0),(0,r.Cg)([(0,s.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],xi.prototype,"autoCellRendererByType",void 0),(0,r.Cg)([(0,s.attr)({attribute:"only-template-col-defs",mode:"boolean"})],xi.prototype,"onlyTemplateColDefs",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"grid-autosizing"})],xi.prototype,"gridAutosizingEnabled",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"size-columns-to-content"})],xi.prototype,"sizeColumnsToContent",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"size-columns-to-fit"})],xi.prototype,"sizeColumnsToFit",void 0),(0,r.Cg)([(0,s.attr)({attribute:"add-index"})],xi.prototype,"addIndex",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"async-add"})],xi.prototype,"asyncAdd",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"async-remove"})],xi.prototype,"asyncRemove",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"async-update"})],xi.prototype,"asyncUpdate",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],xi.prototype,"enableCellFlashing",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enabled-row-flashing"})],xi.prototype,"enabledRowFlashing",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"enable-row-flashing"})],xi.prototype,"enableRowFlashing",void 0),(0,r.Cg)([(0,s.attr)({attribute:"persist-column-state-key"})],xi.prototype,"persistColumnStateKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"persist-filter-model-key"})],xi.prototype,"persistFilterModelKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"default-column-config"})],xi.prototype,"defaultColumnConfig",void 0),(0,r.Cg)([(0,s.attr)({attribute:"header-case-type"})],xi.prototype,"headerCaseType",void 0),(0,r.Cg)([s.observable],xi.prototype,"rowData",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridFontFace",void 0),(0,r.Cg)([s.attr],xi.prototype,"columnComponentName",void 0),(0,r.Cg)([s.observable],xi.prototype,"eventsAndCallbacks",void 0),(0,r.Cg)([s.attr],xi.prototype,"headerHeight",void 0),(0,r.Cg)([s.attr],xi.prototype,"rowHeight",void 0),(0,r.Cg)([s.attr],xi.prototype,"theme",void 0),(0,r.Cg)([s.observable],xi.prototype,"classNames",void 0),(0,r.Cg)([s.observable],xi.prototype,"agGrid",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridSlot",void 0),(0,r.Cg)([s.observable],xi.prototype,"themeMode",void 0),(0,r.Cg)([s.observable],xi.prototype,"gridComponents",void 0),(0,r.Cg)([s.observable],xi.prototype,"statusBarConfig",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean",attribute:"with-status-bar"})],xi.prototype,"withStatusBar",void 0),(0,r.Cg)([s.observable],xi.prototype,"customErrorHandlerTemplate",void 0),(0,r.Cg)([m.lz],xi.prototype,"gridOptionsConfig",void 0);const Si=xi.compose(Object.assign({baseName:"grid-pro",styles:nr,template:sr,shadowOptions:Wa},qa));var zi=t(93188);const ki=s.css`
9595
9595
  .ag-theme-genesis-rapid,
9596
9596
  .ag-theme-genesis-rapid-dark,
9597
9597
  .ag-theme-genesis-rapid-light {
@@ -10526,4 +10526,4 @@
10526
10526
  </div>
10527
10527
  </div>
10528
10528
  `,Ro=ko(),Ao={menuTabs:["filterMenuTab","generalMenuTab","columnsMenuTab"]},Do=(e,a)=>!e.composedPath().includes(a);function Eo(e,a,t,i){return(0,r.sH)(this,void 0,void 0,function*(){var r;try{const o=function(e,a){const t=(new fo.K).withField(e).withValue(null!=a?a:"").withSerialiser(vt.n.EQ).withGroup("default").build();return t.serialiser(t)}(t,i),n=yield e.request(a,{DETAILS:{CRITERIA_MATCH:o}});return 1===(null===(r=n.REPLY)||void 0===r?void 0:r.length)?n.REPLY[0]:void 0}catch(e){return void console.error(`Failed to retrieve object from the ${a} resource: ${e instanceof Error?e.message:String(e)}`)}})}class Mo extends((0,o.S)(g.FoundationElement)){constructor(){super(...arguments),this.requestSupportsAdvancedSearch=!1,this.defaultSlottedNodes=[],this.getAndSetRowsDebounce=p()(()=>this.getAndSetRows(),300),this.handleClickOutside=e=>{Do(e,this)&&(this.open=!1)}}get connect(){var e;return null!==(e=this.connectOverride)&&void 0!==e?e:this._connectDI}set connect(e){this.connectOverride=e}get value(){return s.Observable.track(this,"value"),this._value}set value(e){e!==this._value&&(e?Eo(this.connect,this.resourceName,this.valueKey,e).then(a=>{this.value===e&&(this.selectedRow=a)}):this.selectedRow=void 0,this.emitValue(e))}get displayValue(){return this.selectedRow&&this.labelKey&&this.selectedRow[this.labelKey]||this.value||""}get hasSearchKey(){return!!this.searchKey&&this.searchKey.length>0}get hasSlottedContent(){return!(!this.defaultSlottedNodes||0===this.defaultSlottedNodes.length)&&this.defaultSlottedNodes.some(e=>{var a;return e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&(null===(a=e.textContent)||void 0===a?void 0:a.trim().length)>0})}connectedCallback(){var e;super.connectedCallback(),(null===(e=this.optionsElement)||void 0===e?void 0:e.style)&&this.dropdownWidthChanged(),this.open=!1,this.filterSearch="",this.grid&&(this.grid.gridOptions={defaultColDef:Ao,onRowClicked:e=>{this.selectedRow=e.data,this.emitValue(e.data[this.valueKey]),this.toggle()}})}setGridRowData(e){var a;const t=null===(a=this.grid)||void 0===a?void 0:a.gridApi;t&&("function"==typeof t.updateGridOptions?t.updateGridOptions({rowData:e}):t.setRowData(e))}setGridColumnDefs(e){var a;const t=null===(a=this.grid)||void 0===a?void 0:a.gridApi;t&&("function"==typeof t.updateGridOptions?t.updateGridOptions({columnDefs:e}):t.setColumnDefs(e))}emitValue(e){this._value=e,this.$emit("change",e),this.$emit("input",e),s.Observable.notify(this,"value")}toggle(){this.open=!this.open}getAndSetRows(){return(0,r.sH)(this,void 0,void 0,function*(){var e,a;if(!(null===(e=this.grid)||void 0===e?void 0:e.gridApi))return;const t=this.lastRequest={},r=this.request?{REQUEST:Object.assign({},this.request)}:{},i=Array.isArray(this.searchKey)&&1===this.searchKey.length?this.searchKey[0]:this.searchKey;let o;if(i&&this.filterSearch)if(this.requestSupportsAdvancedSearch){const e=(Array.isArray(i)?i:[i]).map(e=>{var a;return(new fo.K).withField(e).withValue(null!==(a=this.filterSearch)&&void 0!==a?a:"").withSerialiser(vt.n.containsIgnoreCase).withGroup("default").build()}),a=new bo.b;a.Or(e,{join:wo.r.Or()}),o=a.build()}else{if(Array.isArray(i))throw Error("MulticolumnDropdown: Unable to search multiple keys via request; if the request is a GPAL ReqRep, set requestSupportsAdvancedSearch to true");r.REQUEST=Object.assign(Object.assign({},r.REQUEST),{[i]:`*${this.filterSearch}*`})}const n=null===(a=this.baseCriteria)||void 0===a?void 0:a.trim();n&&o?o=`(${o}) && (${n})`:n&&(o=n),o&&(r.DETAILS={CRITERIA_MATCH:o});try{const e=yield this.connect.request(this.resourceName,r);if(t!==this.lastRequest)return;const a=(null==e?void 0:e.REPLY)||[];this.setGridRowData(a),a.length>0?this.grid.gridApi.hideOverlay():this.grid.gridApi.showNoRowsOverlay()}catch(e){console.error(`Failed to retrieve rows from the ${this.resourceName} resource: ${e instanceof Error?e.message:String(e)}`)}})}filterSearchChanged(){var e,a;this.open&&(null===(a=null===(e=this.grid)||void 0===e?void 0:e.gridApi)||void 0===a||a.showLoadingOverlay(),this.getAndSetRowsDebounce())}requestChanged(){var e,a;this.open&&(null===(a=null===(e=this.grid)||void 0===e?void 0:e.gridApi)||void 0===a||a.showLoadingOverlay(),this.getAndSetRows())}columnDefinitionsChanged(){this.setGridColumnDefs(this.columnDefinitions)}openChanged(){var e,a;this.open?(document.addEventListener("mousedown",this.handleClickOutside),(null===(e=this.grid)||void 0===e?void 0:e.gridApi)&&(this.grid.gridApi.showLoadingOverlay(),this.getAndSetRows())):(document.removeEventListener("mousedown",this.handleClickOutside),this.filterSearch="",(null===(a=this.grid)||void 0===a?void 0:a.gridApi)&&this.setGridRowData([]))}dropdownWidthChanged(){var e,a;null===(a=null===(e=this.optionsElement)||void 0===e?void 0:e.style)||void 0===a||a.setProperty(Co,this.dropdownWidth>0?`${this.dropdownWidth}px`:"inherit")}disconnectedCallback(){document.removeEventListener("mousedown",this.handleClickOutside),super.disconnectedCallback();const e=this.shouldRunDisconnect;s.DOM.queueUpdate(()=>{var a;e&&((null===(a=this.grid)||void 0===a?void 0:a.gridApi)&&this.setGridRowData([]),this.selectedRow=void 0,this._value=void 0)})}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}}(0,r.Cg)([za.dm],Mo.prototype,"_connectDI",void 0),(0,r.Cg)([(0,s.attr)({mode:"boolean"})],Mo.prototype,"disabled",void 0),(0,r.Cg)([(0,s.attr)({attribute:"resource-name"})],Mo.prototype,"resourceName",void 0),(0,r.Cg)([(0,s.attr)({attribute:"search-key",converter:yo})],Mo.prototype,"searchKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"advanced-search-req",mode:"boolean"})],Mo.prototype,"requestSupportsAdvancedSearch",void 0),(0,r.Cg)([(0,s.attr)({attribute:"value-key"})],Mo.prototype,"valueKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"label-key"})],Mo.prototype,"labelKey",void 0),(0,r.Cg)([(0,s.attr)({attribute:"dropdown-placement"})],Mo.prototype,"dropdownPlacement",void 0),(0,r.Cg)([s.attr],Mo.prototype,"dropdownWidth",void 0),(0,r.Cg)([s.observable],Mo.prototype,"request",void 0),(0,r.Cg)([s.observable],Mo.prototype,"columnDefinitions",void 0),(0,r.Cg)([s.observable],Mo.prototype,"baseCriteria",void 0),(0,r.Cg)([s.observable],Mo.prototype,"defaultSlottedNodes",void 0),(0,r.Cg)([s.observable],Mo.prototype,"filterSearch",void 0),(0,r.Cg)([s.observable],Mo.prototype,"open",void 0),(0,r.Cg)([s.observable],Mo.prototype,"selectedRow",void 0),(0,r.Cg)([s.volatile],Mo.prototype,"displayValue",null),(0,r.Cg)([s.volatile],Mo.prototype,"hasSearchKey",null),(0,r.Cg)([s.volatile],Mo.prototype,"hasSlottedContent",null);const Oo=Mo.compose({baseName:"multicolumn-dropdown",template:Ro,styles:zo}),To=Mo.compose({baseName:"multicolumn-dropdown",template:ko("rapid"),styles:zo});class Io{constructor(e,a){this.criteria=e,this.onActiveChanged=a,this.matchedRowIds=new Set,this.lastReportedActive=!1}get active(){return this.matchedRowIds.size>0}get matchCount(){return this.matchedRowIds.size}reset(){this.matchedRowIds.clear(),this.report()}handleDataChanged(e){var a;const{add:t=[],update:r=[],remove:i=[]}=null!==(a=null==e?void 0:e.changes)&&void 0!==a?a:{};for(const e of i)this.syncRow(e,!0);for(const e of t)this.syncRow(e,!1);for(const e of r)this.syncRow(e,!1);this.report()}handleDataCleared(){this.reset()}observe(e){const a=e=>{this.handleDataChanged(e.detail)},t=()=>{this.handleDataCleared()};return e.addEventListener(Da.dataChanged,a),e.addEventListener(Da.dataCleared,t),()=>{e.removeEventListener(Da.dataChanged,a),e.removeEventListener(Da.dataCleared,t)}}syncRow(e,a){var t;if(!e)return;const r=String(null!==(t=e[this.criteria.rowIdField])&&void 0!==t?t:"");r&&(!a&&Ht(this.criteria,e)?this.matchedRowIds.add(r):this.matchedRowIds.delete(r))}report(){const e=this.active;e!==this.lastReportedActive&&(this.lastReportedActive=e,this.onActiveChanged(e))}}const Lo={foundationIconRenderer:se,foundationGridProActionRenderer:W,foundationGridProActionsMenuRenderer:q.su,foundationAgBooleanRenderer:X,foundationAgTextRenderer:lo,foundationAgTextFieldRenderer:ro,foundationAgEditableRenderer:ae,foundationAgSelectRenderer:fe,foundationSelectEditor:y,foundationNumberEditor:z,foundationDateEditor:F,foundationMultiselectEditor:D,foundationStringEditor:j,foundationMulticolumnDropdown:Oo,foundationStatusPillRenderer:ue,StatusPillRenderer:ce,foundationGridPro:Br,foundationColumnSelection:ea,foundationGridProStatusBar:Rr,register(e,...a){if(e)for(const t in this)"register"!==t&&this[t]().register(e,...a)}},No=[{id:"error",label:"Error",value:"var(--error-fill-rest, #c62828)"},{id:"warning",label:"Warning",value:"var(--warning-fill-rest, #ef6c00)"},{id:"success",label:"Success",value:"var(--success-fill-rest, #2e7d32)"},{id:"accent",label:"Accent",value:"var(--accent-fill-rest, #1565c0)"},{id:"neutral",label:"Neutral",value:"var(--neutral-fill-rest, #546e7a)"}],Fo=[{id:"slow",label:"Slow",value:1400},{id:"normal",label:"Normal",value:1e3},{id:"fast",label:"Fast",value:500}],Po=[{id:"row",label:"Whole row",value:"row"},{id:"cell",label:"Alert field cell",value:"cell"}],Go={color:No[0].value,durationMs:Fo[1].value,scope:"row"};function Bo(e){return{color:"string"==typeof(null==e?void 0:e.color)&&e.color.trim().length>0?e.color:Go.color,durationMs:"number"==typeof(null==e?void 0:e.durationMs)&&Number.isFinite(e.durationMs)&&e.durationMs>0?e.durationMs:Go.durationMs,scope:"row"===(null==e?void 0:e.scope)||"cell"===(null==e?void 0:e.scope)?e.scope:Go.scope}}const jo=new Map;function Uo(e){const{persistPreferencesKey:a,target:t,mirrorColorTo:r=[]}=e,i=a?function(e){if(e.statePersistence)return e.statePersistence;try{return g.DI.getOrCreateDOMContainer().get(cr)}catch(e){return void U.debug("Row alert preferences will not persist; no StatePersistence available",e)}}(e):void 0,o=new Set;let n=Bo(Object.assign(Object.assign({},Go),e.preferences));function l(){const e=null!=t?t:"undefined"==typeof document?void 0:document.documentElement;if(e){e.style.setProperty("--row-alert-color",n.color),e.style.setProperty("--alert-flash-duration",`${n.durationMs}ms`);for(const a of r)e.style.setProperty(a,n.color)}}function s(e,t){n=e,l();for(const e of o)e(n);t&&a&&(null==i?void 0:i.saveRowAlertPreferences)&&i.saveRowAlertPreferences(a,n).catch(e=>{U.warn("Could not save row alert preferences",e)})}return l(),a&&(null==i?void 0:i.getRowAlertPreferences)&&i.getRowAlertPreferences(a).then(e=>{s(Bo(Object.assign(Object.assign({},n),e)),!1)}).catch(e=>{U.warn("Could not load row alert preferences",e)}),{get preferences(){return n},change(e){s(Bo(Object.assign(Object.assign({},n),e)),!0)},subscribe:e=>(o.add(e),()=>{o.delete(e)})}}function Ho(e,a={}){var t,r,i,o,n;const{colorPresets:l=No,ratePresets:s=Fo,menuLabel:g="Alert flash"}=a,d=function(e){const{persistPreferencesKey:a}=e;if(!a)return Uo(e);let t=jo.get(a);return t||(t=Uo(e),jo.set(a,t)),t}(a),c=Yt(e)[$t],u=Wt(Object.assign(Object.assign({},e),{flashField:null!==(r=null!==(t=e.flashField)&&void 0!==t?t:e.stateField)&&void 0!==r?r:null===(n=null===(o=null===(i=e.anyOf)||void 0===i?void 0:i[0])||void 0===o?void 0:o[0])||void 0===n?void 0:n.field}))[Vt];function p(e,a,t,r){return e.map(e=>({name:e.label,checked:e.value===a,action:()=>{d.change(t(e.value)),r()}}))}const h={rowClassRules:{[$t]:e=>"row"===d.preferences.scope&&c(e)},defaultColDef:{cellClassRules:{[Vt]:e=>"cell"===d.preferences.scope&&u(e)}},get preferences(){return d.preferences},createMenuItem(e){const a=()=>{var a;return null===(a=null==e?void 0:e.redrawRows)||void 0===a?void 0:a.call(e)};return{name:g,subMenu:[{name:"Flash target",subMenu:p(Po,d.preferences.scope,e=>({scope:e}),a)},{name:"Color",subMenu:p(l,d.preferences.color,e=>({color:e}),()=>{})},{name:"Flash rate",subMenu:p(s,d.preferences.durationMs,e=>({durationMs:e}),()=>{})},{name:"Reset to defaults",action:()=>{h.reset(),a()}}]}},getContextMenuItems(e){var a;return[...null!==(a=e.defaultItems)&&void 0!==a?a:[],"separator",h.createMenuItem(e.api)]},setPreferences(e){d.change(e)},reset(){d.change(Go)},subscribe:e=>d.subscribe(e)};return h}var $o=t(92277);const Vo=/^(?:[A-Za-z0-9+/]{4})*?(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Yo=e=>{const a=e.split(":");let t,r;2===a.length?[t,r]=a:r=e;const i=(e=>{if(Vo.test(e)){const a=atob(e),t=new Uint8Array(a.length);return[...a].forEach((e,r)=>{t[r]=a.charCodeAt(r)}),t.buffer}return e})(r);if("str"===t){return new TextDecoder("utf-8").decode(i)}return i},Wo=e=>{const a=(e=>{if("string"==typeof e)return btoa(e);if(e instanceof ArrayBuffer){const a=new Uint8Array(e).reduce((e,a)=>e+String.fromCharCode(a),"");return btoa(a)}return""})(e);return"string"==typeof e?`str:${a}`:e instanceof ArrayBuffer?`bin:${a}`:""},qo={account:"genesis",namespace:"default",authKey:"kv-default",authEmail:void 0},Qo=g.DI.createInterface();var Ko,_o;!function(e){e.REQ_KEY_VALUE_LIST="REQ_KEY_VALUE_LIST",e.REQ_KEY_VALUE_READ="REQ_KEY_VALUE_READ"}(Ko||(Ko={})),function(e){e.EVENT_KEY_VALUE_PUT="EVENT_KEY_VALUE_PUT",e.EVENT_KEY_VALUE_DELETE="EVENT_KEY_VALUE_DELETE"}(_o||(_o={}));let Xo=class{constructor(e,a,t=qo){this.connect=e,this.user=a,this.kvStorageConfig=t}delete(e){return(0,r.sH)(this,void 0,void 0,function*(){const a={DETAILS:{KEYS:e}},t=yield this.connect.commitEvent(_o.EVENT_KEY_VALUE_DELETE,a);return!(!t||"EVENT_ACK"!==t.MESSAGE_TYPE)||{ERROR:t.ERROR,WARNING:t.WARNING}})}get(e){return(0,r.sH)(this,void 0,void 0,function*(){var a;const t={REQUEST:{USER_NAME:null!==(a=this.kvStorageConfig.authEmail)&&void 0!==a?a:this.user.userName,KEY:e}},r=yield this.connect.request(Ko.REQ_KEY_VALUE_READ,t);if(r&&r.REPLY&&r.REPLY.length>0){const a=r.REPLY.map(e=>{const a=this.getDecodedValue(e.VALUE);return{kv:{key:e.KEY,value:a}}});return e?a[0]:a}return e?void 0:[]})}getDecodedValue(e){e.startsWith("str:")||e.startsWith("bin:")||(e=`str:${e}`);let a=Yo(e);return"string"==typeof a&&a.startsWith("str:")&&(a=Yo(a)),"string"==typeof a&&a.startsWith("bin:")&&(a=Yo(a)),a}list(){return(0,r.sH)(this,void 0,void 0,function*(){var e;const a={REQUEST:{USER_NAME:null!==(e=this.kvStorageConfig.authEmail)&&void 0!==e?e:this.user.userName}},t=yield this.connect.request(Ko.REQ_KEY_VALUE_LIST,a);if(t&&t.REPLY&&t.REPLY.length>0){return t.REPLY.map(e=>e.KEY)}return[]})}put(e){return(0,r.sH)(this,void 0,void 0,function*(){const a={DETAILS:{RECORDS:e.map(e=>({KEY:e.key,VALUE:e.base64?Wo(e.value):e.value}))}},t=yield this.connect.commitEvent(_o.EVENT_KEY_VALUE_PUT,a);return!(!t||"EVENT_ACK"!==t.MESSAGE_TYPE)||{ERROR:t.ERROR,WARNING:t.WARNING}})}};Xo=(0,r.Cg)([(0,r.Qj)(0,za.dm),(0,r.Qj)(1,$o.KJ),(0,r.Qj)(2,(0,g.optional)(Qo))],Xo);const Jo=g.DI.createInterface(e=>e.singleton(Xo));class Zo{getColumnState(e){return(0,r.sH)(this,void 0,void 0,function*(){var a;yield this.migrateLocalStorageToKVStorage(e);const t=yield this.kvStorage.get(e),r=t?null===(a=t.kv)||void 0===a?void 0:a.value:void 0;return r?JSON.parse(r):[]})}saveColumnState(e,a){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(a)}])})}deleteColumnState(e){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.delete([e])})}migrateLocalStorageToKVStorage(e){return(0,r.sH)(this,void 0,void 0,function*(){var a;const t=yield this.kvStorage.get(e);if(t&&(null===(a=t.kv)||void 0===a?void 0:a.value))return;const r=this.session.getLocalStorageItem("gridOptions"),i=r?JSON.parse(r)[e]:void 0;i&&(U.debug(`Columns state migration for key: ${e} from LocalStorage to KV Storage`),this.kvStorage.put([{key:e,value:i}]))})}getFilterModel(e){return(0,r.sH)(this,void 0,void 0,function*(){var a;const t=yield this.kvStorage.get(e),r=t?null===(a=t.kv)||void 0===a?void 0:a.value:void 0;return r?JSON.parse(r):{}})}saveFilterModel(e,a){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(a)}])})}getRowAlertPreferences(e){return(0,r.sH)(this,void 0,void 0,function*(){var a;const t=yield this.kvStorage.get(e),r=t?null===(a=t.kv)||void 0===a?void 0:a.value:void 0;return r?JSON.parse(r):{}})}saveRowAlertPreferences(e,a){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(a)}])})}}(0,r.Cg)([Jo],Zo.prototype,"kvStorage",void 0),(0,r.Cg)([gr.N],Zo.prototype,"session",void 0);const en=l.SwatchRGB.from((0,Ii.parseColorHexRGB)("#4c4c4c")),an=l.SwatchRGB.from((0,Ii.parseColorHexRGB)("#c01754")),{create:tn}=g.DesignToken,rn={foregroundColor:tn("fui-ag-foreground-color").withDefault(an),backgroundColor:tn("fui-ag-background-color").withDefault(en)},on={processCellCallback:e=>["+","=","-","@","\t","\n"].some(a=>String(e.value).startsWith(a))?`'${e.value}`:e.value}}}]);
10529
- //# sourceMappingURL=109.1860458195909a0a7e1f1372dbc60ed7.js.map
10529
+ //# sourceMappingURL=109.e48005de550391b981190e1cdc459dd6.js.map