@genesislcap/design-system-configurator 14.475.0 → 14.475.1-alpha-0dba2b1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -390,7 +390,7 @@
390
390
  </${r}>
391
391
  </div>
392
392
  `)}
393
- `}},24638(e,a,r){r.d(a,{X:()=>E});var t=r(55823),o=r(96730),i=r(48707),n=r(21281),l=r(34193),g=r(9033),s=r(21409),d=r(52945),c=r(49229),p=r(33681),u=r(90509),h=r(79270),v=r(1510),m=r(35610),f=r(41119),b=r(32610);function w(e){switch(null==e?void 0:e.toLowerCase()){case"int":case"long":case"double":case"bigdecimal":case"number":return"agNumberColumnFilter";case"date":case"datetime":return"agDateColumnFilter";case"enum":return"agSetColumnFilter";default:return"agTextColumnFilter"}}function y(e){switch(e.type){case f.w.BOOLEAN:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["contains",{displayKey:"true",displayName:"True",predicate:(e,a)=>"true"===a||!0===a,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,a)=>"false"===a||!1===a,numberOfInputs:0},{displayKey:"true-false",displayName:"True/False",predicate:(e,a)=>"true"===a||!0===a||"false"===a||!1===a,numberOfInputs:0}]};case f.w.ENUM:return(0,b.O7)(e,w(e.type));case f.w.DATE:case f.w.DATETIME:return{comparator:(e,a)=>{if(!a)return-1;const r=new Date(a).setHours(0,0,0,0),t=e.getTime();return r===t?0:r<t?-1:r>t?1:void 0},buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,browserDatePicker:!0,filterOptions:["equals","lessThan","greaterThan","inRange",{displayKey:"isToday",displayName:"Is today",numberOfInputs:0,predicate:()=>!0},"blank","notBlank"]};case f.w.NUMBER:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"]};default:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["contains","equals","notEqual",{displayKey:"wordStartsWith",displayName:"Word starts with",numberOfInputs:1,predicate:()=>!0},"blank","notBlank"]}}}var z=r(17465),x=r(49874),C=r(40113),k=r(26347),A=r(32808);class D{constructor(e){var a;this.rowData=new Map,this.serverRowsCount=0,this.clientRowsCount=0,this.moreRows=!1,this.calculatedRowsCount=0,this.currentSequenceId=null,this.reloadResourceDataFunc=e.reloadResourceDataFunc,this.errorHandlerFunc=e.errorHandlerFunc,this.onNoDataAvailableFunc=e.onNoDataAvailableFunc,this.onDataAvailableFunc=e.onDataAvailableFunc,this.resourceName=e.resourceName,this.resourceParams=e.resourceParams,this.originalCriteriaMatch=this.getResourceParam("CRITERIA_MATCH"),this.resourceIndexes=e.resourceIndexes,this.resourceColDefs=e.resourceColDefs,this.maxRows=e.maxRows,this.maxView=e.maxView,this.rowId=e.rowId,this.pagination=e.pagination,this.zeroBasedViewNumber=e.zeroBasedViewNumber,this.pagingMode=e.pagingMode,this.criteriaOnlyRequest=null!==(a=e.criteriaOnlyRequest)&&void 0!==a&&a}getResourceParam(e){var a,r;return(null===(a=this.resourceParams)||void 0===a?void 0:a.DETAILS)&&"object"==typeof this.resourceParams.DETAILS?this.resourceParams.DETAILS[e]:null===(r=this.resourceParams)||void 0===r?void 0:r[e]}setResourceParam(e,a){var r;(null===(r=this.resourceParams)||void 0===r?void 0:r.DETAILS)&&"object"==typeof this.resourceParams.DETAILS?this.resourceParams.DETAILS[e]=a:this.resourceParams[e]=a}getRows(e){throw new Error("Method not implemented.")}setupFiltering(e){return(0,t.sH)(this,void 0,void 0,function*(){const a=e.request.filterModel,r=Object.keys(a).length>0,t=0===Object.keys(a).length,o=JSON.stringify(a)!==JSON.stringify(this.currentFilterModel);if(o||r){if(t&&this.currentFilterModel)return this.currentFilterModel=null,this.setResourceParam("CRITERIA_MATCH",this.originalCriteriaMatch),void(yield this.refreshDatasource(e));if(o&&r)return this.currentFilterModel=a,this.setResourceParam("CRITERIA_MATCH",this.buildCriteriaMatchFromFilters()),void(yield this.refreshDatasource(e))}})}setupFilteringAndSorting(e){return(0,t.sH)(this,void 0,void 0,function*(){yield this.setupFiltering(e),yield this.setupSorting(e)})}destroy(){this.rowData=new Map,this.clientRowsCount=0,this.calculatedRowsCount=0,this.serverRowsCount=0,this.currentSequenceId=0,this.moreRows=!1,this.sourceRef=void 0,this.lastSuccessRowData=void 0}refreshDatasource(e){return(0,t.sH)(this,void 0,void 0,function*(){this.destroy(),this.updateResourceParams(e),yield this.reloadResourceDataFunc({criteria:this.getResourceParam("CRITERIA_MATCH"),orderBy:this.getResourceParam("ORDER_BY"),reverse:this.getResourceParam("REVERSE")})})}updateResourceParams(e){void 0!==e.criteria&&(this.originalCriteriaMatch=e.criteria,this.setResourceParam("CRITERIA_MATCH",this.buildCriteriaMatchFromFilters())),void 0!==e.orderBy&&this.setResourceParam("ORDER_BY",e.orderBy),void 0!==e.reverse&&this.setResourceParam("REVERSE",e.reverse)}getOrderByAndToBeSortedColIds(e,a){for(const[r,t]of e.entries()){const e=t.findIndex(e=>e===a);if(-1!==e){return{orderBy:r,toBeSorted:[...t].splice(e,1)}}}}buildCriteriaMatchFromFilters(){this.setResourceParam("CRITERIA_MATCH",this.originalCriteriaMatch);let e=this.getResourceParam("CRITERIA_MATCH");e&&"string"==typeof e&&(e=e.split(";"),this.setResourceParam("CRITERIA_MATCH",e)),e||(e=[],this.setResourceParam("CRITERIA_MATCH",e));return e.concat(this.criteriaFromFilters()).join(" && ")}criteriaFromFilters(){const e=[];return this.getFiltersByType("text").forEach(a=>{if(this.currentFilterModel[a].filter||"false"!==this.currentFilterModel[a].type&&"true"!==this.currentFilterModel[a].type)switch(this.currentFilterModel[a].type){case"blank":e.push(`(${a} == '' || ${a} == null)`);break;case"contains":e.push(`Expr.containsIgnoreCase(${a}, '${this.currentFilterModel[a].filter}')`);break;case"equals":e.push(`${a} == '${this.currentFilterModel[a].filter}'`);break;case"notBlank":e.push(`(${a} != '' && ${a} != null)`);break;case"notEqual":e.push(`${a} != '${this.currentFilterModel[a].filter}'`);break;case"wordStartsWith":e.push(`Expr.containsWordsStartingWithIgnoreCase(${a}, '${this.currentFilterModel[a].filter}')`)}else e.push(`${a} == ${this.currentFilterModel[a].type}`)}),this.getFiltersByType("set").forEach(a=>{var r,t,o;const i=null===(r=this.currentFilterModel)||void 0===r?void 0:r[a],n=null!==(t=null==i?void 0:i.values)&&void 0!==t?t:[];if(!n||0===n.length)return;const l=null===(o=this.resourceColDefs)||void 0===o?void 0:o.find(e=>e.NAME===a);let g;if(null==l?void 0:l.VALID_VALUES)try{g=Array.isArray(l.VALID_VALUES)?l.VALID_VALUES:l.VALID_VALUES.split("|")}catch(e){g=void 0}if(g&&g.length===n.length&&g.every(e=>n.includes(e)))return;const s=n.map(e=>{const r=String(e).replace(/'/g,"\\'");return`${a} == '${r}'`});s.length>0&&e.push(`(${s.join(" || ")})`)}),this.getFiltersByType("number").forEach(a=>{const r=this.currentFilterModel[a].filter,t=this.currentFilterModel[a].filterTo;switch(this.currentFilterModel[a].type){case"equals":!isNaN(r)&&e.push(`${a} == ${r}`);break;case"notEqual":!isNaN(r)&&e.push(`${a} != ${r}`);break;case"greaterThan":!isNaN(r)&&e.push(`${a} > ${r}`);break;case"greaterThanOrEqual":!isNaN(r)&&e.push(`${a} >= ${r}`);break;case"lessThan":!isNaN(r)&&e.push(`${a} < ${r}`);break;case"lessThanOrEqual":!isNaN(r)&&e.push(`${a} <= ${r}`);break;case"inRange":!isNaN(r)&&!isNaN(t)&&e.push(`${a} >= ${r} && ${a} <= ${t}`);break;case"blank":e.push(`${a} == 0`);break;case"notBlank":e.push(`${a} != 0`)}}),this.getFiltersByType("date").forEach(a=>{var r,t;const o=null===(r=this.currentFilterModel[a].dateFrom)||void 0===r?void 0:r.replace(/-/g,"").replace("T","-").split(" ")[0],i=null===(t=this.currentFilterModel[a].dateTo)||void 0===t?void 0:t.replace(/-/g,"").replace("T","-").split(" ")[0];switch(this.currentFilterModel[a].type){case"equals":e.push(`Expr.dateIsEqual(${a}, '${o}')`);break;case"lessThan":e.push(`Expr.dateIsBefore(${a}, '${o}')`);break;case"greaterThan":e.push(`Expr.dateIsAfter(${a}, '${o}')`);break;case"inRange":e.push(`Expr.dateIsAfter(${a}, '${o}') && Expr.dateIsBefore(${a}, '${i}')`);break;case"isToday":const r=new Date,t=`${r.getFullYear()}-${(r.getMonth()+1).toString().padStart(2,"0")}-${r.getDate().toString().padStart(2,"0")} 00:00:00`;e.push(`Expr.dateIsEqual(${a}, '${t}')`);break;case"blank":e.push(`${a} == null`);break;case"notBlank":e.push(`${a} != null`)}}),e}getFiltersByType(e){var a;return Object.keys(null!==(a=this.currentFilterModel)&&void 0!==a?a:{}).filter(e=>-1!==this.resourceColDefs.findIndex(a=>a.NAME===e)).filter(a=>this.currentFilterModel[a].filterType===e)}getPageNumber(e,a,r,t=!0){void 0!==r&&e>r&&(e=Math.floor((r-1)/a)*a+1);const o=Math.ceil(e/a);return t?o:o+1}getCorrectRowCount(e){const a=e.request.endRow;this.calculatedRowsCount=this.clientRowsCount||a;const r=Math.min(this.serverRowsCount,this.maxView);let t;const o=this.getResourceParam("CRITERIA_MATCH");if(this.pagination){if(t=o?void 0:Math.min(this.serverRowsCount,this.maxView),o){const e=this.rowData.size;t=e>0?Math.min(e,this.maxView):r}return t}return a===this.serverRowsCount?t=this.serverRowsCount:a>this.maxView||a>this.calculatedRowsCount?t=Math.min(r,this.calculatedRowsCount):!this.moreRows&&this.serverRowsCount>this.calculatedRowsCount&&(t=this.calculatedRowsCount),t}get isNotFirstViewNumber(){return this.zeroBasedViewNumber?this.currentSequenceId>0:this.currentSequenceId>1}completeEmptyResult(e){var a,r;if(null===(r=null===(a=this.lastSuccessRowData)||void 0===a?void 0:a.rowData)||void 0===r?void 0:r.length)return void e.success(this.lastSuccessRowData);this.rowData=new Map;const t={rowData:[],rowCount:0};e.success(t),this.notifyNoDataAvailableIfEmpty(e,t)}notifyNoDataAvailableIfEmpty(e,a){var r;const t=!(null===(r=a.rowData)||void 0===r?void 0:r.length),o=0===e.request.startRow;o&&t?this.notifyNoDataAvailable():o&&!t&&this.notifyDataAvailable()}notifyNoDataAvailable(){var e;null===(e=this.onNoDataAvailableFunc)||void 0===e||e.call(this)}notifyDataAvailable(){var e;null===(e=this.onDataAvailableFunc)||void 0===e||e.call(this)}getEffectivePagingMode(){return this.pagingMode?"offsetBased"!==this.pagingMode||this.criteriaOnlyRequest?this.pagingMode:(z.v.warn("offsetBased paging mode requires criteriaOnlyRequest support. Falling back to viewBased mode."),"viewBased"):this.criteriaOnlyRequest?"offsetBased":"viewBased"}}(0,t.Cg)([C.N],D.prototype,"auth",void 0),(0,t.Cg)([k.dm],D.prototype,"connect",void 0),(0,t.Cg)([A.k],D.prototype,"uuid",void 0);class S extends D{constructor(e){super(e),this.createDataserverStreamFunc=e.createDataserverStreamFunc}refreshDatasource(e){const a=Object.create(null,{refreshDatasource:{get:()=>super.refreshDatasource}});return(0,t.sH)(this,void 0,void 0,function*(){var r;null===(r=this.dataserverStreamSubscription)||void 0===r||r.unsubscribe(),this.dataserverStreamSubscription=void 0,this.dataserverStream=void 0,yield a.refreshDatasource.call(this,e)})}getRows(e){return(0,t.sH)(this,void 0,void 0,function*(){var a,r;if(yield this.setupFiltering(e),yield this.setupSorting(e),this.pagination&&!this.isNewPageSize&&this.currentSequenceId>0){if(JSON.stringify(null!==(a=e.request.filterModel)&&void 0!==a?a:{})===JSON.stringify(null!==(r=this.currentFilterModel)&&void 0!==r?r:{})&&this.lastSuccessRowData)return void e.success(this.lastSuccessRowData)}if(this.dataserverStream||(this.dataserverStream=yield this.createDataserverStreamFunc(this.resourceParams)),this.currentSequenceId>=1&&(this.moreRows||e.request.startRow>=Number(this.maxRows))){if(this.pagination){const a=Number.isFinite(Number(e.request.startRow))?Number(e.request.startRow):0;this.resourceParams.VIEW_NUMBER=this.getPageNumber(a,this.maxRows,this.maxView,this.zeroBasedViewNumber)}const a=this.pagination?this.resourceParams.VIEW_NUMBER:Number.isFinite(Number(this.resourceParams.VIEW_NUMBER))?Number(this.resourceParams.VIEW_NUMBER):0;Number.isFinite(a)&&this.connect.getMoreRows(this.sourceRef,a)}let o=!0;this.dataserverStreamSubscription=this.dataserverStream.subscribe(a=>{var r;const i=null===(r=null==a?void 0:a.ROW)||void 0===r?void 0:r.length;(o||i>0&&0===this.rowData.size)&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){var r,t;if(this.resourceParams.CRITERIA_MATCH&&this.pagination){const e=yield this.connect.snapshot(this.resourceName,{MAX_ROWS:this.maxView,MAX_VIEW:this.maxView,CRITERIA_MATCH:this.resourceParams.CRITERIA_MATCH});e.ROW||e.ROWS_COUNT?this.serverRowsCount=this.resourceParams.CRITERIA_MATCH&&null!==(t=null===(r=e.ROW)||void 0===r?void 0:r.length)&&void 0!==t?t:e.ROWS_COUNT:(z.v.warn("No data returned when criteria is applied."),this.serverRowsCount=0,this.clientRowsCount=0)}this.applyServerSideData(e,a),o=!1}))})})}applyServerSideData(e,a){var r;const t=a.MESSAGE_TYPE;if(t&&(t===n.Go.LOGOFF_ACK||t===n.Go.MSG_NACK)){if(this.errorHandlerFunc){const e=t===n.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`;this.errorHandlerFunc(e,"connection")}return void e.fail()}if(this.moreRows=a.MORE_ROWS,!a.ROW){if(this.currentSequenceId>=1&&this.rowData.size>0){const a={rowData:Array.from(this.rowData.values()),rowCount:this.getCorrectRowCount(e)};return this.lastSuccessRowData=a,void e.success(a)}return void this.completeEmptyResult(e)}{const e=(0,l.d)(a);this.handleCurrentStreamLoad(e)}this.currentSequenceId=a.SEQUENCE_ID,1===this.currentSequenceId&&(this.sourceRef=a.SOURCE_REF,0===this.serverRowsCount&&(this.serverRowsCount=null!==(r=a.ROWS_COUNT)&&void 0!==r?r:this.rowData.size),this.getResourceParam("CRITERIA_MATCH")&&a.ROW&&(this.serverRowsCount=a.ROW.length,this.clientRowsCount=a.ROW.length));const o={rowData:Array.from(this.rowData.values())};o.rowCount=this.getCorrectRowCount(e),this.lastSuccessRowData=o,e.success(o),this.notifyNoDataAvailableIfEmpty(e,o)}setupSorting(e){return(0,t.sH)(this,void 0,void 0,function*(){var a;const r=e.request.sortModel;if((null===(a=this.currentSortModel)||void 0===a?void 0:a.length)!==r.length||r.length>0){if(0===r.length&&this.currentSortModel)return this.calculatedRowsCount=0,this.currentSortModel=null,this.resourceParams.ORDER_BY=null,this.resourceParams.REVERSE=null,void(yield this.refreshDatasource(e));if(r.length>0){const a=r[0].colId,t=r[0].sort,o=this.getOrderByAndToBeSortedColIds(this.resourceIndexes,a);if(!o){this.calculatedRowsCount=0;const r=(0,x.i)(this.resourceIndexes),t=(0,x.P)(this.resourceIndexes);return z.v.warn(`The FIELD/column (${a}) being sorted is not part of an INDEX, required for the [orderBy] operation. See https://learn.genesis.global/docs/database/data-types/index-entities/`),z.v.debug("Available indexes:",r),z.v.debug("Columns that can be sorted with the available indexes:",t),void e.fail()}if(JSON.stringify(r)!==JSON.stringify(this.currentSortModel))return this.currentSortModel=r,this.resourceParams.ORDER_BY=o.orderBy,this.resourceParams.REVERSE="desc"===t,void(yield this.refreshDatasource(e))}}})}destroy(){const e=Object.create(null,{destroy:{get:()=>super.destroy}});return(0,t.sH)(this,void 0,void 0,function*(){var a;this.dataserverStream=void 0,null===(a=this.dataserverStreamSubscription)||void 0===a||a.unsubscribe(),this.dataserverStreamSubscription=void 0,yield e.destroy.call(this)})}handleCurrentStreamLoad(e){var a,r;if(!e)return;const t=new Map;null===(a=e.inserts)||void 0===a||a.forEach(e=>{t.set(e[this.rowId],e)}),this.clientRowsCount+=null!==(r=e.inserts.length)&&void 0!==r?r:0,this.rowData=t}}var R=r(62051),M=r.n(R);class T extends D{constructor(e){var a,r,t,o,i;super(e),this.discoveredTotalRowCount=null,this.currentNextOffset=0,this.createReqRepRequestFunc=e.createReqRepRequestFunc,this.createReqRepStreamFunc=e.createReqRepStreamFunc,this.onPollingUpdate=e.onPollingUpdateFunc,this.resetPreviousPollResult=e.resetPreviousPollResultFunc,this.usePolling=null!==(a=e.usePolling)&&void 0!==a&&a,this.debouncedCreateStream=M()(e=>this.createPollingStream(e),300);"viewBased"===this.getEffectivePagingMode()?(null===(t=null===(r=e.resourceParams)||void 0===r?void 0:r.DETAILS)||void 0===t?void 0:t.VIEW_NUMBER)||(this.resourceParams.DETAILS.VIEW_NUMBER=this.zeroBasedViewNumber?0:1):(null===(i=null===(o=e.resourceParams)||void 0===o?void 0:o.DETAILS)||void 0===i?void 0:i.OFFSET)||(this.resourceParams.DETAILS.OFFSET=0)}getRows(e){return(0,t.sH)(this,void 0,void 0,function*(){if(yield this.setupFiltering(e),yield this.setupSorting(e),this.pagination&&!this.isNewPageSize&&this.currentSequenceId>0)return void e.success(this.lastSuccessRowData);const a=this.getEffectivePagingMode();this.updatePaginationParams(e,a);const r={DETAILS:this.buildRequestDetails(a)},t=yield this.createReqRepRequestFunc(r),o=yield this.determineIsLastView(t,r,a);this.applyServerSideData(e,t,o),this.schedulePollingStream(r)})}updatePaginationParams(e,a){"viewBased"===a?null!==this.currentSequenceId&&this.currentSequenceId>=0&&this.moreRows&&(this.pagination?this.resourceParams.DETAILS.VIEW_NUMBER=this.getPageNumber(e.request.startRow,this.maxRows,void 0,this.zeroBasedViewNumber):this.resourceParams.DETAILS.VIEW_NUMBER+=1):this.resourceParams.DETAILS.OFFSET=e.request.startRow}determineIsLastView(e,a,r){return(0,t.sH)(this,void 0,void 0,function*(){var t;const o="MORE_ROWS"in e;let i=!1;if("viewBased"===r){if(o)i=!e.MORE_ROWS;else if(-1!==e.NEXT_VIEW){const r=Object.assign(Object.assign({},a),{DETAILS:Object.assign(Object.assign({},a.DETAILS),{VIEW_NUMBER:e.NEXT_VIEW})}),o=yield this.createReqRepRequestFunc(r);i=-1===o.NEXT_VIEW&&0===(null===(t=o.REPLY)||void 0===t?void 0:t.length)}}else i=o&&!e.MORE_ROWS,"NEXT_OFFSET"in e&&-1!==e.NEXT_OFFSET?this.currentNextOffset=e.NEXT_OFFSET:this.currentNextOffset=0;return i})}schedulePollingStream(e){this.usePolling&&this.createReqRepStreamFunc&&(this.destroyPollingStream(),this.debouncedCreateStream(e))}applyServerSideData(e,a,r){var t,o,i;const l=a.MESSAGE_TYPE;if(l&&(l===n.Go.LOGOFF_ACK||l===n.Go.MSG_NACK)){if(this.errorHandlerFunc){const e=l===n.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`;this.errorHandlerFunc(e,"connection")}return void e.fail()}const g=this.getEffectivePagingMode();if(this.moreRows="MORE_ROWS"in a?a.MORE_ROWS:"viewBased"===g?!r&&-1!==a.NEXT_VIEW&&a.NEXT_VIEW>this.resourceParams.DETAILS.VIEW_NUMBER:!r&&-1!==a.NEXT_OFFSET&&a.NEXT_OFFSET>this.resourceParams.DETAILS.OFFSET,!(null===(t=a.REPLY)||void 0===t?void 0:t.length))return void this.completeEmptyResult(e);if(this.handleCurrentStreamLoad(a.REPLY),this.currentSequenceId="viewBased"===g?this.resourceParams.DETAILS.VIEW_NUMBER:Math.floor(this.resourceParams.DETAILS.OFFSET/this.maxRows),this.sourceRef=a.SOURCE_REF,!this.moreRows){const a=this.rowData.size;this.discoveredTotalRowCount=e.request.startRow+a}this.pagination?this.serverRowsCount=null!==(o=a.ROWS_COUNT)&&void 0!==o?o:this.rowData.size:this.serverRowsCount+=null!==(i=a.ROWS_COUNT)&&void 0!==i?i:this.rowData.size;const s={rowData:Array.from(this.rowData.values())};s.rowCount=this.getCorrectRowCount(e),this.lastSuccessRowData=s,e.success(s),this.notifyNoDataAvailableIfEmpty(e,s)}getCorrectRowCount(e){let a;return this.pagination,a=this.moreRows?-1:this.discoveredTotalRowCount||e.request.startRow+this.rowData.size,a}handleCurrentStreamLoad(e){if(!e||0==e.length)return;const a=new Map;e.forEach(e=>{const r=e[this.rowId];if(r)return void a.set(r,e);const t=`The specified rowId (${this.rowId}) is not present in the data. Since this is a snapshot (isSnapshot=true), an auto-generated UUID will be used. For custom identifiers, use the 'row-id' attribute.`;v.v.error(t);const o=this.uuid.createId();e[this.rowId]=o,a.set(o,e)}),this.rowData=a}setupSorting(e){return(0,t.sH)(this,void 0,void 0,function*(){var a;const r=e.request.sortModel;if((null===(a=this.currentSortModel)||void 0===a?void 0:a.length)!==r.length||r.length>0){if(0===r.length&&this.currentSortModel)return this.calculatedRowsCount=0,this.currentSortModel=null,this.resourceParams.DETAILS.ORDER_BY=void 0,void(yield this.refreshDatasource(e));if(r.length>0){const a=r[0].colId,t=r[0].sort;if(JSON.stringify(r)!==JSON.stringify(this.currentSortModel))return this.currentSortModel=r,this.resourceParams.DETAILS.ORDER_BY=a+("desc"===t?" DESC":" ASC"),void(yield this.refreshDatasource(e))}}})}refreshDatasource(e){const a=Object.create(null,{refreshDatasource:{get:()=>super.refreshDatasource}});return(0,t.sH)(this,void 0,void 0,function*(){this.destroyPollingStream(),this.debouncedCreateStream&&this.debouncedCreateStream.cancel(),this.discoveredTotalRowCount=null,this.currentNextOffset=0,this.resourceParams.DETAILS.VIEW_NUMBER=this.zeroBasedViewNumber?0:1,this.resourceParams.DETAILS.OFFSET=0,yield a.refreshDatasource.call(this,e)})}destroy(){const e=Object.create(null,{destroy:{get:()=>super.destroy}});return(0,t.sH)(this,void 0,void 0,function*(){this.destroyPollingStream(),this.debouncedCreateStream&&this.debouncedCreateStream.cancel(),yield e.destroy.call(this)})}createPollingStream(e){return(0,t.sH)(this,void 0,void 0,function*(){try{this.destroyPollingStream(),this.currentStreamParams=e;const{stream:a,datasource:r}=yield this.createReqRepStreamFunc(e);this.reqRepPollingStream=a,this.reqRepPollingDatasource=r,this.reqRepPollingSubscription=this.reqRepPollingStream.subscribe({next:a=>{this.currentStreamParams&&JSON.stringify(this.currentStreamParams)===JSON.stringify(e)&&this.onPollingUpdate&&this.onPollingUpdate(a)},error:e=>{var a;v.v.error("Polling stream error:",e),this.errorHandlerFunc&&this.errorHandlerFunc((null===(a=null==e?void 0:e.receivedMessage)||void 0===a?void 0:a.ERROR)||(null==e?void 0:e.message),"stream")}}),v.v.debug("Polling stream created for params:",e)}catch(e){v.v.error("Failed to create polling stream:",e)}})}destroyPollingStream(){this.reqRepPollingSubscription&&(this.reqRepPollingSubscription.unsubscribe(),this.reqRepPollingSubscription=void 0,v.v.debug("Polling subscription destroyed")),this.reqRepPollingDatasource&&(this.reqRepPollingDatasource.destroy(),this.reqRepPollingDatasource=void 0,v.v.debug("Polling datasource destroyed")),this.reqRepPollingStream=void 0,this.currentStreamParams=void 0,this.resetPreviousPollResult&&this.resetPreviousPollResult()}buildRequestDetails(e){const a={CRITERIA_MATCH:this.resourceParams.DETAILS.CRITERIA_MATCH,MAX_ROWS:this.resourceParams.DETAILS.MAX_ROWS,ORDER_BY:this.resourceParams.DETAILS.ORDER_BY};return"viewBased"===e?Object.assign(Object.assign({},a),{VIEW_NUMBER:this.resourceParams.DETAILS.VIEW_NUMBER}):Object.assign(Object.assign({},a),{OFFSET:this.resourceParams.DETAILS.OFFSET})}}let E=class extends((0,s.S)(m.ML)){constructor(){super(...arguments),this.zeroBasedViewNumber=!1,this.liveUpdates=!1,this.request={},this.sortIndicatorCSSDestroy=null,this.previousPollResult=new Map,this.hasCapturedFirstPollResult=!1}resourceNameChanged(e,a){e&&e!==a&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){yield this.restart()}))}criteriaChanged(e,a){const r=e!==(0,o.Q)(a,";");this.ssrmDatasource&&r&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){yield this.ssrmDatasource.refreshDatasource({criteria:a})}))}connectedCallback(){super.connectedCallback();const e=this.shouldRunConnect;p.DOM.queueUpdate(()=>{e&&(this.init(),this.subscribeToConnection())})}disconnectedCallback(){super.disconnectedCallback();const e=this.shouldRunDisconnect;p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){e&&(yield this.destroy(),this.unsubscribeFromConnection())}))}deepClone(){const e=super.deepClone();return e.deferredGridOptions=structuredClone(this.deferredGridOptions),e.deferredColumnStates=structuredClone(this.deferredColumnStates),e}reloadResourceData(e){return(0,t.sH)(this,void 0,void 0,function*(){var a;if(this.datasource.destroy(),null===(a=this.liveUpdatesStream)||void 0===a||a.unsubscribe(),this.liveUpdatesStream=void 0,this.$emit(h.c.cacheFilterConfig),this.clearRowData(null),this.setDisconnected(!1),this.$emit(h.c.refreshServerSide,{purge:!0}),e){const a=Object.assign(Object.assign({},this.datasourceOptions()),e);(yield this.initializeDatasource(a,!0,!1))||(this.$emit(h.c.setServerSideDatasource,{datasource:null}),v.v.error("Genesis Datasource re-init failed on filtering/sorting."))}else this.ssrmDatasource&&(yield this.ssrmDatasource.destroy(),this.ssrmDatasource=void 0),this.$emit(h.c.setServerSideDatasource,{datasource:null}),this.$emit(h.c.loadingStarted),yield this.init()})}applyServerSideSortIndicatorStyling(){this.removeServerSideSortIndicatorStyling(),this.$emit(h.c.addGridCssClass,{className:"grid-pro-server-side"}),this.sortIndicatorCSSDestroy=(0,d.O5)('\n .grid-pro-server-side .ag-header-cell-sortable .ag-sort-indicator-container {\n opacity: 1 !important;\n visibility: visible !important;\n }\n \n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-container {\n opacity: 0.4 !important;\n }\n \n .grid-pro-server-side .ag-header-cell-sorted .ag-sort-indicator-container {\n opacity: 1 !important;\n }\n \n .grid-pro-server-side .ag-sort-ascending-icon::before,\n .grid-pro-server-side .ag-sort-descending-icon::before,\n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-icon::before {\n font-family: var(--ag-icon-font-family, agGridAlpine) !important;\n font-size: var(--ag-icon-size, 16px) !important;\n color: var(--ag-header-foreground-color, var(--ag-foreground-color)) !important;\n }\n \n .grid-pro-server-side .ag-sort-ascending-icon::before {\n content: "\\e90d" !important; /* AG Grid sort up icon */\n }\n \n .grid-pro-server-side .ag-sort-descending-icon::before {\n content: "\\e90c" !important; /* AG Grid sort down icon */\n }\n \n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-icon::before {\n content: "\\e90b" !important; /* AG Grid sort icon */\n opacity: 0.6 !important;\n }\n \n /* Ensure the sort indicator is always visible for sortable columns in server-side mode */\n .grid-pro-server-side .ag-header-cell-sortable .ag-sort-indicator-icon {\n display: inline-block !important;\n }\n',"grid-pro-server-side-sort")}removeServerSideSortIndicatorStyling(){this.$emit(h.c.removeGridCssClass,{className:"grid-pro-server-side"}),this.sortIndicatorCSSDestroy&&(this.sortIndicatorCSSDestroy(),this.sortIndicatorCSSDestroy=null)}init(){return(0,t.sH)(this,void 0,void 0,function*(){const e=Object.assign({getRowId:e=>e.data?String(e.data[this.rowId]):null,getRowStyle(e){var a,r;if(null===(r=null===(a=e.data)||void 0===a?void 0:a.ROW_REF)||void 0===r?void 0:r.includes("_deleted"))return{color:"grey"}},cacheBlockSize:this.maxRows,defaultColDef:{filter:!0,resizable:!0,sortable:!1,unSortIcon:!0},rowBuffer:0,rowModelType:"serverSide",suppressServerSideInfiniteScroll:!1,suppressMultiSort:!0,onFilterChanged:e=>{},onSortChanged:e=>{},onPaginationChanged:e=>this.onPaginationChanged(e)},this.deferredGridOptions);this.$emit(h.c.initialize,{options:e,keepColDefsOnClearRowData:this.keepColDefsOnClearRowData}),this.addEventListener(h.c.ready,e=>(0,t.sH)(this,void 0,void 0,function*(){const{pagination:a}=e.detail;this.pagination=a;if(!(yield this.initializeDatasource(this.datasourceOptions(),!0,!1)))return v.v.debug(`Genesis Datasource init failed for ${this.resourceName}`),this.clearRowData(),void this.setDisconnected(!0);this.$emit(u.V.dataInit),this.setDisconnected(!1),this.indexes=this.getResourceIndexes(this.datasource.availableIndexes,this.datasource.availableSortableFields);const r=(0,i.X)(this.datasource.originalFieldDef),t=yield this.getAgColumnDefs(r);if(this.$emit(h.c.schemaUpdated,{schema:t,metadata:r}),this.isRequestServer){const e=!this.isSnapshot&&!this.disablePolling;this.ssrmDatasource=new T({createReqRepRequestFunc:this.createReqRepRequest.bind(this),createReqRepStreamFunc:e?this.createReqRepStream.bind(this):void 0,onPollingUpdateFunc:e?this.applyReqRepPollingUpdate.bind(this):void 0,resetPreviousPollResultFunc:e?this.resetPreviousPollResult.bind(this):void 0,usePolling:e,reloadResourceDataFunc:this.reloadResourceData.bind(this),errorHandlerFunc:this.handleErrors.bind(this),onNoDataAvailableFunc:()=>this.$emit(h.c.noDataAvailable),onDataAvailableFunc:()=>this.$emit(h.c.loadingFinished),resourceName:this.resourceName,resourceParams:this.datasource.requestOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,maxView:+this.maxView,rowId:this.rowId,pagination:this.pagination,zeroBasedViewNumber:this.zeroBasedViewNumber,pagingMode:this.pagingMode,criteriaOnlyRequest:this.datasource.criteriaOnlyRequest})}else this.ssrmDatasource=new S({createDataserverStreamFunc:this.createDataserverStream.bind(this),reloadResourceDataFunc:this.reloadResourceData.bind(this),errorHandlerFunc:this.handleErrors.bind(this),onNoDataAvailableFunc:()=>this.$emit(h.c.noDataAvailable),onDataAvailableFunc:()=>this.$emit(h.c.loadingFinished),resourceName:this.resourceName,resourceParams:this.datasource.dataserverOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,maxView:+this.maxView,rowId:this.rowId,pagination:this.pagination,zeroBasedViewNumber:this.zeroBasedViewNumber});this.$emit(h.c.setServerSideDatasource,{datasource:this.ssrmDatasource}),this.$emit(h.c.filtersRestored),this.applyServerSideSortIndicatorStyling()}),{once:!0}),this.resourceName||this.handleErrors("Application not connected or invalid resource name, datasource will not work.","unknown")})}onPaginationChanged(e){var a;this.ssrmDatasource&&(this.ssrmDatasource.isNewPageSize=null!==(a=e.newPage)&&void 0!==a&&a)}destroy(){return(0,t.sH)(this,void 0,void 0,function*(){var e,a;this.datasource.destroy(),null===(e=this.liveUpdatesStream)||void 0===e||e.unsubscribe(),this.liveUpdatesStream=void 0,this.clearRowData(),this.ssrmDatasource&&(yield this.ssrmDatasource.destroy(),null===(a=this.pollingDatasource)||void 0===a||a.destroy(),this.ssrmDatasource=void 0),this.removeServerSideSortIndicatorStyling(),this.$emit(h.c.setServerSideDatasource,{datasource:null}),this.$emit(h.c.refreshServerSide,{purge:!0})})}restart(){return(0,t.sH)(this,void 0,void 0,function*(){yield this.destroy(),yield this.init()})}clearRowData(e=!0){this.rowData=new Map,e&&this.$emit(h.c.dataCleared,{includeSchema:!0}),this.transactionData={remove:[]},this.$emit(h.c.applyServerSideTransaction,{transaction:this.transactionData}),this.transactionData=void 0}getResourceIndexes(e,a){const r=new Map,t=new Set;if(null==e||e.forEach(e=>{const a=e.FIELDS.split(" ");r.set(e.NAME,a),a.forEach(e=>t.add(e))}),a&&a.length>0&&a.forEach(e=>t.add(e)),0===r.size&&t.size>0)r.set("SORTABLE_FIELDS",Array.from(t));else if(a&&a.length>0&&r.size>0){const e=new Set;r.forEach(a=>{a.forEach(a=>e.add(a))});const t=a.filter(a=>!e.has(a));t.length>0&&r.set("SORTABLE_FIELDS",t)}return r}createReqRepRequest(){return(0,t.sH)(this,arguments,void 0,function*(e=null){return yield this.datasource.snapshot(e)})}createReqRepStream(){return(0,t.sH)(this,arguments,void 0,function*(e=null){var a,r,t,o,i,n,l,g;const s=null!==(r=null===(a=null==e?void 0:e.DETAILS)||void 0===a?void 0:a.OFFSET)&&void 0!==r?r:0,d=null!==(o=null===(t=null==e?void 0:e.DETAILS)||void 0===t?void 0:t.MAX_ROWS)&&void 0!==o?o:this.maxRows,c=d+s,p=Object.assign(Object.assign({},this.datasourceOptions()),{criteria:null!==(n=null===(i=null==e?void 0:e.DETAILS)||void 0===i?void 0:i.CRITERIA_MATCH)&&void 0!==n?n:this.criteria,maxRows:c,orderBy:null!==(g=null===(l=null==e?void 0:e.DETAILS)||void 0===l?void 0:l.ORDER_BY)&&void 0!==g?g:this.orderBy});v.v.debug("Creating polling datasource for all loaded rows:",{currentOffset:s,baseMaxRows:d,totalRowsToFetch:c});if(yield this.pollingDatasource.init(p,!0,!0))return{stream:this.pollingDatasource.stream,datasource:this.pollingDatasource};v.v.error("Polling datasource init failed")})}resetPreviousPollResult(){this.previousPollResult.clear(),this.hasCapturedFirstPollResult=!1,v.v.debug("Previous poll result cleared")}applyReqRepPollingUpdate(e){var a;if(!this.ssrmDatasource||!e.REPLY)return;const r=e.REPLY;if(!Array.isArray(r)||!(null===(a=e.MESSAGE_TYPE)||void 0===a?void 0:a.startsWith("REP_")))return void v.v.error("received invalid RequestServerResult for polling update",e);if(!this.hasCapturedFirstPollResult)return r.forEach(e=>{this.previousPollResult.set(e[this.rowId],e)}),this.hasCapturedFirstPollResult=!0,void v.v.debug("First poll result stored for future comparison",{rowCount:this.previousPollResult.size});const t=new Map;r.forEach(e=>{t.set(e[this.rowId],e)});const o=[],i=[],n=[];r.forEach(e=>{const a=e[this.rowId];if(this.previousPollResult.has(a)){const r=this.previousPollResult.get(a);this.serializer.serialize(r)!==this.serializer.serialize(e)&&o.push(e)}else i.push(e)}),this.previousPollResult.forEach((e,a)=>{t.has(a)||n.push(e)}),(o.length>0||n.length>0||i.length>0)&&(this.previousPollResult=t,v.v.debug("Applying reqRep polling update via applyServerSideTransaction:",{added:i.length,updated:o.length,removed:n.length,totalInPoll:t.size}),this.$emit(h.c.applyServerSideTransaction,{transaction:{add:i,update:o,remove:n}}))}applyLiveServerSideUpdate(e){var a,r,t;const o=null!==(a=e.inserts)&&void 0!==a?a:[],i=null!==(r=e.updates)&&void 0!==r?r:[],n=null!==(t=e.deletes)&&void 0!==t?t:[];if(!o.length&&!i.length&&!n.length)return;const l=o.length-n.length;this.ssrmDatasource&&(this.ssrmDatasource.serverRowsCount+=l,this.ssrmDatasource.clientRowsCount+=l),this.transactionData={add:[],remove:[],update:[]},this.handleStreamInserts(o),this.handleStreamUpdates(i),this.handleStreamDeletes(n),this.transactionData.add.length>0&&this.$emit(h.c.applyServerSideTransaction,{transaction:{route:[],add:this.transactionData.add,addIndex:this.reverse?0:this.transactionData.addIndex}}),(this.transactionData.update.length>0||this.transactionData.remove.length>0)&&this.$emit(h.c.applyServerSideTransaction,{transaction:{route:[],update:this.transactionData.update,remove:this.transactionData.remove}})}createDataserverStream(){return(0,t.sH)(this,arguments,void 0,function*(e=null){if(this.liveUpdates){const e=e=>(0,t.sH)(this,void 0,void 0,function*(){var a;if(e.MESSAGE_TYPE!==n.Go.QUERY_UPDATE||!e.ROW)return;if(!(null===(a=this.ssrmDatasource)||void 0===a?void 0:a.sourceRef))return;if(void 0!==e.SEQUENCE_ID&&e.SEQUENCE_ID<=1)return;const r=e,t=Array.isArray(r.ROW)?r.ROW:r.ROW?[r.ROW]:[],o=this.ssrmDatasource.rowData,i=t.map(e=>{var a;const r=null!==(a=e.DETAILS)&&void 0!==a?a:{},t=r[this.rowId],i=null!=t?null==o?void 0:o.get(t):void 0;if(!i)return e;const n=Object.assign({},i);for(const[a,r]of Object.entries(e))"DETAILS"!==a&&null!=r&&(n[a]=r);return Object.assign(Object.assign({},n),{DETAILS:r})}),g=Object.assign(Object.assign({},r),{ROW:i}),s=(0,l.d)(g,this.rowId);this.applyLiveServerSideUpdate(s)}),a=e=>{var a;v.v.error(e),this.handleErrors((null===(a=e.receivedMessage)||void 0===a?void 0:a.ERROR)||e.message,"stream")};this.liveUpdatesStream=this.connect.stream(this.resourceName,()=>{},a,this.datasource.dataserverOnlyParams).subscribe(a=>e(a))}return yield this.datasource.startStream(),this.datasource.stream})}getAgColumnDefs(e){return(0,t.sH)(this,void 0,void 0,function*(){const a=this.generateColumnDefsFromMetadata(e,y,w);return a.forEach(e=>{e.sortable=[].concat(...this.indexes.values()).includes(e.field),this.datasource.criteriaOnlyRequest&&(e.filter=this.datasource.availableCriteriaFields.includes(e.field)?e.filter:null)}),a})}applyTransaction(e){this.$emit(h.c.applyServerSideTransaction,{transaction:e})}loadMore(){throw new Error("loadMore() method is not supported for server-side datasource")}};(0,t.Cg)([c.b_],E.prototype,"serializer",void 0),(0,t.Cg)([g.yW],E.prototype,"pollingDatasource",void 0),(0,t.Cg)([(0,p.attr)({mode:"boolean",attribute:"zero-based-view-number"})],E.prototype,"zeroBasedViewNumber",void 0),(0,t.Cg)([(0,p.attr)({mode:"boolean",attribute:"live-updates"})],E.prototype,"liveUpdates",void 0),(0,t.Cg)([(0,p.attr)({attribute:"paging-mode"})],E.prototype,"pagingMode",void 0),(0,t.Cg)([p.observable],E.prototype,"request",void 0),E=(0,t.Cg)([(0,p.customElement)({name:"grid-pro-server-side-datasource"})],E)},60591(e,a,r){r.d(a,{g:()=>t});const t=r(33681).css`
393
+ `}},24638(e,a,r){r.d(a,{X:()=>E});var t=r(55823),o=r(96730),i=r(48707),n=r(21281),l=r(34193),g=r(9033),s=r(21409),d=r(52945),c=r(49229),p=r(33681),u=r(90509),h=r(79270),v=r(1510),m=r(35610),f=r(41119),b=r(32610);function w(e){switch(null==e?void 0:e.toLowerCase()){case"int":case"long":case"double":case"bigdecimal":case"number":return"agNumberColumnFilter";case"date":case"datetime":return"agDateColumnFilter";case"enum":return"agSetColumnFilter";default:return"agTextColumnFilter"}}function y(e){switch(e.type){case f.w.BOOLEAN:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["contains",{displayKey:"true",displayName:"True",predicate:(e,a)=>"true"===a||!0===a,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,a)=>"false"===a||!1===a,numberOfInputs:0},{displayKey:"true-false",displayName:"True/False",predicate:(e,a)=>"true"===a||!0===a||"false"===a||!1===a,numberOfInputs:0}]};case f.w.ENUM:return(0,b.O7)(e,w(e.type));case f.w.DATE:case f.w.DATETIME:return{comparator:(e,a)=>{if(!a)return-1;const r=new Date(a).setHours(0,0,0,0),t=e.getTime();return r===t?0:r<t?-1:r>t?1:void 0},buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,browserDatePicker:!0,filterOptions:["equals","lessThan","greaterThan","inRange",{displayKey:"isToday",displayName:"Is today",numberOfInputs:0,predicate:()=>!0},"blank","notBlank"]};case f.w.NUMBER:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"]};default:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["contains","equals","notEqual",{displayKey:"wordStartsWith",displayName:"Word starts with",numberOfInputs:1,predicate:()=>!0},"blank","notBlank"]}}}var z=r(17465),x=r(49874),C=r(40113),k=r(26347),A=r(32808);class D{constructor(e){var a;this.rowData=new Map,this.serverRowsCount=0,this.clientRowsCount=0,this.moreRows=!1,this.calculatedRowsCount=0,this.currentSequenceId=null,this.reloadResourceDataFunc=e.reloadResourceDataFunc,this.errorHandlerFunc=e.errorHandlerFunc,this.onNoDataAvailableFunc=e.onNoDataAvailableFunc,this.onDataAvailableFunc=e.onDataAvailableFunc,this.resourceName=e.resourceName,this.resourceParams=e.resourceParams,this.originalCriteriaMatch=this.getResourceParam("CRITERIA_MATCH"),this.resourceIndexes=e.resourceIndexes,this.resourceColDefs=e.resourceColDefs,this.maxRows=e.maxRows,this.maxView=e.maxView,this.rowId=e.rowId,this.pagination=e.pagination,this.zeroBasedViewNumber=e.zeroBasedViewNumber,this.pagingMode=e.pagingMode,this.criteriaOnlyRequest=null!==(a=e.criteriaOnlyRequest)&&void 0!==a&&a}getResourceParam(e){var a,r;return(null===(a=this.resourceParams)||void 0===a?void 0:a.DETAILS)&&"object"==typeof this.resourceParams.DETAILS?this.resourceParams.DETAILS[e]:null===(r=this.resourceParams)||void 0===r?void 0:r[e]}setResourceParam(e,a){var r;(null===(r=this.resourceParams)||void 0===r?void 0:r.DETAILS)&&"object"==typeof this.resourceParams.DETAILS?this.resourceParams.DETAILS[e]=a:this.resourceParams[e]=a}getRows(e){throw new Error("Method not implemented.")}setupFiltering(e){return(0,t.sH)(this,void 0,void 0,function*(){const a=e.request.filterModel,r=Object.keys(a).length>0,t=0===Object.keys(a).length,o=JSON.stringify(a)!==JSON.stringify(this.currentFilterModel);if(o||r){if(t&&this.currentFilterModel)return this.currentFilterModel=null,this.setResourceParam("CRITERIA_MATCH",this.originalCriteriaMatch),void(yield this.refreshDatasource(e));if(o&&r)return this.currentFilterModel=a,this.setResourceParam("CRITERIA_MATCH",this.buildCriteriaMatchFromFilters()),void(yield this.refreshDatasource(e))}})}setupFilteringAndSorting(e){return(0,t.sH)(this,void 0,void 0,function*(){yield this.setupFiltering(e),yield this.setupSorting(e)})}destroy(){this.rowData=new Map,this.clientRowsCount=0,this.calculatedRowsCount=0,this.serverRowsCount=0,this.currentSequenceId=0,this.moreRows=!1,this.sourceRef=void 0,this.lastSuccessRowData=void 0}refreshDatasource(e){return(0,t.sH)(this,void 0,void 0,function*(){this.destroy(),this.updateResourceParams(e),yield this.reloadResourceDataFunc({criteria:this.getResourceParam("CRITERIA_MATCH"),orderBy:this.getResourceParam("ORDER_BY"),reverse:this.getResourceParam("REVERSE")})})}updateResourceParams(e){void 0!==e.criteria&&(this.originalCriteriaMatch=e.criteria,this.setResourceParam("CRITERIA_MATCH",this.buildCriteriaMatchFromFilters())),void 0!==e.orderBy&&this.setResourceParam("ORDER_BY",e.orderBy),void 0!==e.reverse&&this.setResourceParam("REVERSE",e.reverse)}getOrderByAndToBeSortedColIds(e,a){for(const[r,t]of e.entries()){const e=t.findIndex(e=>e===a);if(-1!==e){return{orderBy:r,toBeSorted:[...t].splice(e,1)}}}}buildCriteriaMatchFromFilters(){this.setResourceParam("CRITERIA_MATCH",this.originalCriteriaMatch);let e=this.getResourceParam("CRITERIA_MATCH");e&&"string"==typeof e&&(e=e.split(";"),this.setResourceParam("CRITERIA_MATCH",e)),e||(e=[],this.setResourceParam("CRITERIA_MATCH",e));return e.concat(this.criteriaFromFilters()).join(" && ")}criteriaFromFilters(){const e=[];return this.getFiltersByType("text").forEach(a=>{if(this.currentFilterModel[a].filter||"false"!==this.currentFilterModel[a].type&&"true"!==this.currentFilterModel[a].type)switch(this.currentFilterModel[a].type){case"blank":e.push(`(${a} == '' || ${a} == null)`);break;case"contains":e.push(`Expr.containsIgnoreCase(${a}, '${this.currentFilterModel[a].filter}')`);break;case"equals":e.push(`${a} == '${this.currentFilterModel[a].filter}'`);break;case"notBlank":e.push(`(${a} != '' && ${a} != null)`);break;case"notEqual":e.push(`${a} != '${this.currentFilterModel[a].filter}'`);break;case"wordStartsWith":e.push(`Expr.containsWordsStartingWithIgnoreCase(${a}, '${this.currentFilterModel[a].filter}')`)}else e.push(`${a} == ${this.currentFilterModel[a].type}`)}),this.getFiltersByType("set").forEach(a=>{var r,t,o;const i=null===(r=this.currentFilterModel)||void 0===r?void 0:r[a],n=null!==(t=null==i?void 0:i.values)&&void 0!==t?t:[];if(!n||0===n.length)return;const l=null===(o=this.resourceColDefs)||void 0===o?void 0:o.find(e=>e.NAME===a);let g;if(null==l?void 0:l.VALID_VALUES)try{g=Array.isArray(l.VALID_VALUES)?l.VALID_VALUES:l.VALID_VALUES.split("|")}catch(e){g=void 0}if(g&&g.length===n.length&&g.every(e=>n.includes(e)))return;const s=n.map(e=>{const r=String(e).replace(/'/g,"\\'");return`${a} == '${r}'`});s.length>0&&e.push(`(${s.join(" || ")})`)}),this.getFiltersByType("number").forEach(a=>{const r=this.currentFilterModel[a].filter,t=this.currentFilterModel[a].filterTo;switch(this.currentFilterModel[a].type){case"equals":!isNaN(r)&&e.push(`${a} == ${r}`);break;case"notEqual":!isNaN(r)&&e.push(`${a} != ${r}`);break;case"greaterThan":!isNaN(r)&&e.push(`${a} > ${r}`);break;case"greaterThanOrEqual":!isNaN(r)&&e.push(`${a} >= ${r}`);break;case"lessThan":!isNaN(r)&&e.push(`${a} < ${r}`);break;case"lessThanOrEqual":!isNaN(r)&&e.push(`${a} <= ${r}`);break;case"inRange":!isNaN(r)&&!isNaN(t)&&e.push(`${a} >= ${r} && ${a} <= ${t}`);break;case"blank":e.push(`${a} == 0`);break;case"notBlank":e.push(`${a} != 0`)}}),this.getFiltersByType("date").forEach(a=>{var r,t;const o=null===(r=this.currentFilterModel[a].dateFrom)||void 0===r?void 0:r.replace(/-/g,"").replace("T","-").split(" ")[0],i=null===(t=this.currentFilterModel[a].dateTo)||void 0===t?void 0:t.replace(/-/g,"").replace("T","-").split(" ")[0];switch(this.currentFilterModel[a].type){case"equals":e.push(`Expr.dateIsEqual(${a}, '${o}')`);break;case"lessThan":e.push(`Expr.dateIsBefore(${a}, '${o}')`);break;case"greaterThan":e.push(`Expr.dateIsAfter(${a}, '${o}')`);break;case"inRange":e.push(`Expr.dateIsAfter(${a}, '${o}') && Expr.dateIsBefore(${a}, '${i}')`);break;case"isToday":const r=new Date,t=`${r.getFullYear()}-${(r.getMonth()+1).toString().padStart(2,"0")}-${r.getDate().toString().padStart(2,"0")} 00:00:00`;e.push(`Expr.dateIsEqual(${a}, '${t}')`);break;case"blank":e.push(`${a} == null`);break;case"notBlank":e.push(`${a} != null`)}}),e}getFiltersByType(e){var a;return Object.keys(null!==(a=this.currentFilterModel)&&void 0!==a?a:{}).filter(e=>-1!==this.resourceColDefs.findIndex(a=>a.NAME===e)).filter(a=>this.currentFilterModel[a].filterType===e)}getPageNumber(e,a,r,t=!0){void 0!==r&&e>r&&(e=Math.floor((r-1)/a)*a+1);const o=Math.ceil(e/a);return t?o:o+1}getCorrectRowCount(e){const a=e.request.endRow;this.calculatedRowsCount=this.clientRowsCount||a;const r=Math.min(this.serverRowsCount,this.maxView);let t;const o=this.getResourceParam("CRITERIA_MATCH");if(this.pagination){if(t=o?void 0:Math.min(this.serverRowsCount,this.maxView),o){const e=this.rowData.size;t=e>0?Math.min(e,this.maxView):r}return t}return a===this.serverRowsCount?t=this.serverRowsCount:a>this.maxView||a>this.calculatedRowsCount?t=Math.min(r,this.calculatedRowsCount):!this.moreRows&&this.serverRowsCount>this.calculatedRowsCount&&(t=this.calculatedRowsCount),t}get isNotFirstViewNumber(){return this.zeroBasedViewNumber?this.currentSequenceId>0:this.currentSequenceId>1}completeEmptyResult(e){var a,r;if(null===(r=null===(a=this.lastSuccessRowData)||void 0===a?void 0:a.rowData)||void 0===r?void 0:r.length)return void e.success(this.lastSuccessRowData);this.rowData=new Map;const t={rowData:[],rowCount:0};e.success(t),this.notifyNoDataAvailableIfEmpty(e,t)}notifyNoDataAvailableIfEmpty(e,a){var r;const t=!(null===(r=a.rowData)||void 0===r?void 0:r.length),o=0===e.request.startRow;o&&t?this.notifyNoDataAvailable():o&&!t&&this.notifyDataAvailable()}notifyNoDataAvailable(){var e;null===(e=this.onNoDataAvailableFunc)||void 0===e||e.call(this)}notifyDataAvailable(){var e;null===(e=this.onDataAvailableFunc)||void 0===e||e.call(this)}getEffectivePagingMode(){return this.pagingMode?"offsetBased"!==this.pagingMode||this.criteriaOnlyRequest?this.pagingMode:(z.v.warn("offsetBased paging mode requires criteriaOnlyRequest support. Falling back to viewBased mode."),"viewBased"):this.criteriaOnlyRequest?"offsetBased":"viewBased"}}(0,t.Cg)([C.N],D.prototype,"auth",void 0),(0,t.Cg)([k.dm],D.prototype,"connect",void 0),(0,t.Cg)([A.k],D.prototype,"uuid",void 0);class S extends D{constructor(e){super(e),this.createDataserverStreamFunc=e.createDataserverStreamFunc}refreshDatasource(e){const a=Object.create(null,{refreshDatasource:{get:()=>super.refreshDatasource}});return(0,t.sH)(this,void 0,void 0,function*(){var r;null===(r=this.dataserverStreamSubscription)||void 0===r||r.unsubscribe(),this.dataserverStreamSubscription=void 0,this.dataserverStream=void 0,yield a.refreshDatasource.call(this,e)})}getRows(e){return(0,t.sH)(this,void 0,void 0,function*(){var a,r;if(yield this.setupFiltering(e),yield this.setupSorting(e),this.pagination&&!this.isNewPageSize&&this.currentSequenceId>0){if(JSON.stringify(null!==(a=e.request.filterModel)&&void 0!==a?a:{})===JSON.stringify(null!==(r=this.currentFilterModel)&&void 0!==r?r:{})&&this.lastSuccessRowData)return void e.success(this.lastSuccessRowData)}if(this.dataserverStream||(this.dataserverStream=yield this.createDataserverStreamFunc(this.resourceParams)),this.currentSequenceId>=1&&(this.moreRows||e.request.startRow>=Number(this.maxRows))){if(this.pagination){const a=Number.isFinite(Number(e.request.startRow))?Number(e.request.startRow):0;this.resourceParams.VIEW_NUMBER=this.getPageNumber(a,this.maxRows,this.maxView,this.zeroBasedViewNumber)}const a=this.pagination?this.resourceParams.VIEW_NUMBER:Number.isFinite(Number(this.resourceParams.VIEW_NUMBER))?Number(this.resourceParams.VIEW_NUMBER):0;Number.isFinite(a)&&this.connect.getMoreRows(this.sourceRef,a)}let o=!0;this.dataserverStreamSubscription=this.dataserverStream.subscribe(a=>{var r;const i=null===(r=null==a?void 0:a.ROW)||void 0===r?void 0:r.length;(o||i>0&&0===this.rowData.size)&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){var r,t;if(this.resourceParams.CRITERIA_MATCH&&this.pagination){const e=yield this.connect.snapshot(this.resourceName,{MAX_ROWS:this.maxView,MAX_VIEW:this.maxView,CRITERIA_MATCH:this.resourceParams.CRITERIA_MATCH});e.ROW||e.ROWS_COUNT?this.serverRowsCount=this.resourceParams.CRITERIA_MATCH&&null!==(t=null===(r=e.ROW)||void 0===r?void 0:r.length)&&void 0!==t?t:e.ROWS_COUNT:(z.v.warn("No data returned when criteria is applied."),this.serverRowsCount=0,this.clientRowsCount=0)}this.applyServerSideData(e,a),o=!1}))})})}applyServerSideData(e,a){var r;const t=a.MESSAGE_TYPE;if(t&&(t===n.Go.LOGOFF_ACK||t===n.Go.MSG_NACK)){if(this.errorHandlerFunc){const e=t===n.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`;this.errorHandlerFunc(e,"connection")}return void e.fail()}if(this.moreRows=a.MORE_ROWS,!a.ROW){if(this.currentSequenceId>=1&&this.rowData.size>0){const a={rowData:Array.from(this.rowData.values()),rowCount:this.getCorrectRowCount(e)};return this.lastSuccessRowData=a,void e.success(a)}return void this.completeEmptyResult(e)}{const e=(0,l.d)(a);this.handleCurrentStreamLoad(e)}this.currentSequenceId=a.SEQUENCE_ID,1===this.currentSequenceId&&(this.sourceRef=a.SOURCE_REF,0===this.serverRowsCount&&(this.serverRowsCount=null!==(r=a.ROWS_COUNT)&&void 0!==r?r:this.rowData.size),this.getResourceParam("CRITERIA_MATCH")&&a.ROW&&(this.serverRowsCount=a.ROW.length,this.clientRowsCount=a.ROW.length));const o={rowData:Array.from(this.rowData.values())};o.rowCount=this.getCorrectRowCount(e),this.lastSuccessRowData=o,e.success(o),this.notifyNoDataAvailableIfEmpty(e,o)}setupSorting(e){return(0,t.sH)(this,void 0,void 0,function*(){var a;const r=e.request.sortModel;if((null===(a=this.currentSortModel)||void 0===a?void 0:a.length)!==r.length||r.length>0){if(0===r.length&&this.currentSortModel)return this.calculatedRowsCount=0,this.currentSortModel=null,this.resourceParams.ORDER_BY=null,this.resourceParams.REVERSE=null,void(yield this.refreshDatasource(e));if(r.length>0){const a=r[0].colId,t=r[0].sort,o=this.getOrderByAndToBeSortedColIds(this.resourceIndexes,a);if(!o){this.calculatedRowsCount=0;const r=(0,x.i)(this.resourceIndexes),t=(0,x.P)(this.resourceIndexes);return z.v.warn(`The FIELD/column (${a}) being sorted is not part of an INDEX, required for the [orderBy] operation. See https://learn.genesis.global/docs/database/data-types/index-entities/`),z.v.debug("Available indexes:",r),z.v.debug("Columns that can be sorted with the available indexes:",t),void e.fail()}if(JSON.stringify(r)!==JSON.stringify(this.currentSortModel))return this.currentSortModel=r,this.resourceParams.ORDER_BY=o.orderBy,this.resourceParams.REVERSE="desc"===t,void(yield this.refreshDatasource(e))}}})}destroy(){const e=Object.create(null,{destroy:{get:()=>super.destroy}});return(0,t.sH)(this,void 0,void 0,function*(){var a;this.dataserverStream=void 0,null===(a=this.dataserverStreamSubscription)||void 0===a||a.unsubscribe(),this.dataserverStreamSubscription=void 0,yield e.destroy.call(this)})}handleCurrentStreamLoad(e){var a,r;if(!e)return;const t=new Map;null===(a=e.inserts)||void 0===a||a.forEach(e=>{t.set(e[this.rowId],e)}),this.clientRowsCount+=null!==(r=e.inserts.length)&&void 0!==r?r:0,this.rowData=t}}var R=r(62051),M=r.n(R);class T extends D{constructor(e){var a,r,t,o,i;super(e),this.discoveredTotalRowCount=null,this.currentNextOffset=0,this.createReqRepRequestFunc=e.createReqRepRequestFunc,this.createReqRepStreamFunc=e.createReqRepStreamFunc,this.onPollingUpdate=e.onPollingUpdateFunc,this.resetPreviousPollResult=e.resetPreviousPollResultFunc,this.usePolling=null!==(a=e.usePolling)&&void 0!==a&&a,this.debouncedCreateStream=M()(e=>this.createPollingStream(e),300);"viewBased"===this.getEffectivePagingMode()?(null===(t=null===(r=e.resourceParams)||void 0===r?void 0:r.DETAILS)||void 0===t?void 0:t.VIEW_NUMBER)||(this.resourceParams.DETAILS.VIEW_NUMBER=this.zeroBasedViewNumber?0:1):(null===(i=null===(o=e.resourceParams)||void 0===o?void 0:o.DETAILS)||void 0===i?void 0:i.OFFSET)||(this.resourceParams.DETAILS.OFFSET=0)}getRows(e){return(0,t.sH)(this,void 0,void 0,function*(){if(yield this.setupFiltering(e),yield this.setupSorting(e),this.pagination&&!this.isNewPageSize&&this.currentSequenceId>0)return void e.success(this.lastSuccessRowData);const a=this.getEffectivePagingMode();this.updatePaginationParams(e,a);const r={DETAILS:this.buildRequestDetails(a)},t=yield this.createReqRepRequestFunc(r),o=yield this.determineIsLastView(t,r,a);this.applyServerSideData(e,t,o),this.schedulePollingStream(r)})}updatePaginationParams(e,a){"viewBased"===a?null!==this.currentSequenceId&&this.currentSequenceId>=0&&this.moreRows&&(this.pagination?this.resourceParams.DETAILS.VIEW_NUMBER=this.getPageNumber(e.request.startRow,this.maxRows,void 0,this.zeroBasedViewNumber):this.resourceParams.DETAILS.VIEW_NUMBER+=1):this.resourceParams.DETAILS.OFFSET=e.request.startRow}determineIsLastView(e,a,r){return(0,t.sH)(this,void 0,void 0,function*(){var t;const o="MORE_ROWS"in e;let i=!1;if("viewBased"===r){if(o)i=!e.MORE_ROWS;else if(-1!==e.NEXT_VIEW){const r=Object.assign(Object.assign({},a),{DETAILS:Object.assign(Object.assign({},a.DETAILS),{VIEW_NUMBER:e.NEXT_VIEW})}),o=yield this.createReqRepRequestFunc(r);i=-1===o.NEXT_VIEW&&0===(null===(t=o.REPLY)||void 0===t?void 0:t.length)}}else i=o&&!e.MORE_ROWS,"NEXT_OFFSET"in e&&-1!==e.NEXT_OFFSET?this.currentNextOffset=e.NEXT_OFFSET:this.currentNextOffset=0;return i})}schedulePollingStream(e){this.usePolling&&this.createReqRepStreamFunc&&(this.destroyPollingStream(),this.debouncedCreateStream(e))}applyServerSideData(e,a,r){var t,o,i;const l=a.MESSAGE_TYPE;if(l&&(l===n.Go.LOGOFF_ACK||l===n.Go.MSG_NACK)){if(this.errorHandlerFunc){const e=l===n.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`;this.errorHandlerFunc(e,"connection")}return void e.fail()}const g=this.getEffectivePagingMode();if(this.moreRows="MORE_ROWS"in a?a.MORE_ROWS:"viewBased"===g?!r&&-1!==a.NEXT_VIEW&&a.NEXT_VIEW>this.resourceParams.DETAILS.VIEW_NUMBER:!r&&-1!==a.NEXT_OFFSET&&a.NEXT_OFFSET>this.resourceParams.DETAILS.OFFSET,!(null===(t=a.REPLY)||void 0===t?void 0:t.length))return void this.completeEmptyResult(e);if(this.handleCurrentStreamLoad(a.REPLY),this.currentSequenceId="viewBased"===g?this.resourceParams.DETAILS.VIEW_NUMBER:Math.floor(this.resourceParams.DETAILS.OFFSET/this.maxRows),this.sourceRef=a.SOURCE_REF,!this.moreRows){const a=this.rowData.size;this.discoveredTotalRowCount=e.request.startRow+a}this.pagination?this.serverRowsCount=null!==(o=a.ROWS_COUNT)&&void 0!==o?o:this.rowData.size:this.serverRowsCount+=null!==(i=a.ROWS_COUNT)&&void 0!==i?i:this.rowData.size;const s={rowData:Array.from(this.rowData.values())};s.rowCount=this.getCorrectRowCount(e),this.lastSuccessRowData=s,e.success(s),this.notifyNoDataAvailableIfEmpty(e,s)}getCorrectRowCount(e){let a;return this.pagination,a=this.moreRows?-1:this.discoveredTotalRowCount||e.request.startRow+this.rowData.size,a}handleCurrentStreamLoad(e){if(!e||0==e.length)return;const a=new Map;e.forEach(e=>{const r=e[this.rowId];if(r)return void a.set(r,e);const t=`The specified rowId (${this.rowId}) is not present in the data. Since this is a snapshot (isSnapshot=true), an auto-generated UUID will be used. For custom identifiers, use the 'row-id' attribute.`;v.v.error(t);const o=this.uuid.createId();e[this.rowId]=o,a.set(o,e)}),this.rowData=a}setupSorting(e){return(0,t.sH)(this,void 0,void 0,function*(){var a;const r=e.request.sortModel;if((null===(a=this.currentSortModel)||void 0===a?void 0:a.length)!==r.length||r.length>0){if(0===r.length&&this.currentSortModel)return this.calculatedRowsCount=0,this.currentSortModel=null,this.resourceParams.DETAILS.ORDER_BY=void 0,void(yield this.refreshDatasource(e));if(r.length>0){const a=r[0].colId,t=r[0].sort;if(JSON.stringify(r)!==JSON.stringify(this.currentSortModel))return this.currentSortModel=r,this.resourceParams.DETAILS.ORDER_BY=a+("desc"===t?" DESC":" ASC"),void(yield this.refreshDatasource(e))}}})}refreshDatasource(e){const a=Object.create(null,{refreshDatasource:{get:()=>super.refreshDatasource}});return(0,t.sH)(this,void 0,void 0,function*(){this.destroyPollingStream(),this.debouncedCreateStream&&this.debouncedCreateStream.cancel(),this.discoveredTotalRowCount=null,this.currentNextOffset=0,this.resourceParams.DETAILS.VIEW_NUMBER=this.zeroBasedViewNumber?0:1,this.resourceParams.DETAILS.OFFSET=0,yield a.refreshDatasource.call(this,e)})}destroy(){const e=Object.create(null,{destroy:{get:()=>super.destroy}});return(0,t.sH)(this,void 0,void 0,function*(){this.destroyPollingStream(),this.debouncedCreateStream&&this.debouncedCreateStream.cancel(),yield e.destroy.call(this)})}createPollingStream(e){return(0,t.sH)(this,void 0,void 0,function*(){try{this.destroyPollingStream(),this.currentStreamParams=e;const{stream:a,datasource:r}=yield this.createReqRepStreamFunc(e);this.reqRepPollingStream=a,this.reqRepPollingDatasource=r,this.reqRepPollingSubscription=this.reqRepPollingStream.subscribe({next:a=>{this.currentStreamParams&&JSON.stringify(this.currentStreamParams)===JSON.stringify(e)&&this.onPollingUpdate&&this.onPollingUpdate(a)},error:e=>{var a;v.v.error("Polling stream error:",e),this.errorHandlerFunc&&this.errorHandlerFunc((null===(a=null==e?void 0:e.receivedMessage)||void 0===a?void 0:a.ERROR)||(null==e?void 0:e.message),"stream")}}),v.v.debug("Polling stream created for params:",e)}catch(e){v.v.error("Failed to create polling stream:",e)}})}destroyPollingStream(){this.reqRepPollingSubscription&&(this.reqRepPollingSubscription.unsubscribe(),this.reqRepPollingSubscription=void 0,v.v.debug("Polling subscription destroyed")),this.reqRepPollingDatasource&&(this.reqRepPollingDatasource.destroy(),this.reqRepPollingDatasource=void 0,v.v.debug("Polling datasource destroyed")),this.reqRepPollingStream=void 0,this.currentStreamParams=void 0,this.resetPreviousPollResult&&this.resetPreviousPollResult()}buildRequestDetails(e){const a={CRITERIA_MATCH:this.resourceParams.DETAILS.CRITERIA_MATCH,MAX_ROWS:this.resourceParams.DETAILS.MAX_ROWS,ORDER_BY:this.resourceParams.DETAILS.ORDER_BY};return"viewBased"===e?Object.assign(Object.assign({},a),{VIEW_NUMBER:this.resourceParams.DETAILS.VIEW_NUMBER}):Object.assign(Object.assign({},a),{OFFSET:this.resourceParams.DETAILS.OFFSET})}}let E=class extends((0,s.S)(m.ML)){constructor(){super(...arguments),this.zeroBasedViewNumber=!1,this.liveUpdates=!1,this.request={},this.sortIndicatorCSSDestroy=null,this.previousPollResult=new Map,this.hasCapturedFirstPollResult=!1}resourceNameChanged(e,a){e&&e!==a&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){yield this.restart()}))}criteriaChanged(e,a){const r=e!==(0,o.Q)(a,";");this.ssrmDatasource&&r&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){yield this.ssrmDatasource.refreshDatasource({criteria:a})}))}connectedCallback(){super.connectedCallback();const e=this.shouldRunConnect;p.DOM.queueUpdate(()=>{e&&(this.init(),this.subscribeToConnection())})}disconnectedCallback(){super.disconnectedCallback();const e=this.shouldRunDisconnect;p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){e&&(yield this.destroy(),this.unsubscribeFromConnection())}))}deepClone(){const e=super.deepClone();return e.deferredGridOptions=structuredClone(this.deferredGridOptions),e.deferredColumnStates=structuredClone(this.deferredColumnStates),e}reloadResourceData(e){return(0,t.sH)(this,void 0,void 0,function*(){var a;if(this.datasource.destroy(),null===(a=this.liveUpdatesStream)||void 0===a||a.unsubscribe(),this.liveUpdatesStream=void 0,this.$emit(h.c.cacheFilterConfig),this.clearRowData(null),this.setDisconnected(!1),e){const a=Object.assign(Object.assign({},this.datasourceOptions()),e);if(!(yield this.initializeDatasource(a,!0,!1)))return this.$emit(h.c.setServerSideDatasource,{datasource:null}),void v.v.error("Genesis Datasource re-init failed on filtering/sorting.");this.$emit(h.c.refreshServerSide,{purge:!0})}else this.$emit(h.c.refreshServerSide,{purge:!0}),this.ssrmDatasource&&(yield this.ssrmDatasource.destroy(),this.ssrmDatasource=void 0),this.$emit(h.c.setServerSideDatasource,{datasource:null}),this.$emit(h.c.loadingStarted),yield this.init()})}applyServerSideSortIndicatorStyling(){this.removeServerSideSortIndicatorStyling(),this.$emit(h.c.addGridCssClass,{className:"grid-pro-server-side"}),this.sortIndicatorCSSDestroy=(0,d.O5)('\n .grid-pro-server-side .ag-header-cell-sortable .ag-sort-indicator-container {\n opacity: 1 !important;\n visibility: visible !important;\n }\n \n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-container {\n opacity: 0.4 !important;\n }\n \n .grid-pro-server-side .ag-header-cell-sorted .ag-sort-indicator-container {\n opacity: 1 !important;\n }\n \n .grid-pro-server-side .ag-sort-ascending-icon::before,\n .grid-pro-server-side .ag-sort-descending-icon::before,\n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-icon::before {\n font-family: var(--ag-icon-font-family, agGridAlpine) !important;\n font-size: var(--ag-icon-size, 16px) !important;\n color: var(--ag-header-foreground-color, var(--ag-foreground-color)) !important;\n }\n \n .grid-pro-server-side .ag-sort-ascending-icon::before {\n content: "\\e90d" !important; /* AG Grid sort up icon */\n }\n \n .grid-pro-server-side .ag-sort-descending-icon::before {\n content: "\\e90c" !important; /* AG Grid sort down icon */\n }\n \n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-icon::before {\n content: "\\e90b" !important; /* AG Grid sort icon */\n opacity: 0.6 !important;\n }\n \n /* Ensure the sort indicator is always visible for sortable columns in server-side mode */\n .grid-pro-server-side .ag-header-cell-sortable .ag-sort-indicator-icon {\n display: inline-block !important;\n }\n',"grid-pro-server-side-sort")}removeServerSideSortIndicatorStyling(){this.$emit(h.c.removeGridCssClass,{className:"grid-pro-server-side"}),this.sortIndicatorCSSDestroy&&(this.sortIndicatorCSSDestroy(),this.sortIndicatorCSSDestroy=null)}init(){return(0,t.sH)(this,void 0,void 0,function*(){const e=Object.assign({getRowId:e=>e.data?String(e.data[this.rowId]):null,getRowStyle(e){var a,r;if(null===(r=null===(a=e.data)||void 0===a?void 0:a.ROW_REF)||void 0===r?void 0:r.includes("_deleted"))return{color:"grey"}},cacheBlockSize:this.maxRows,defaultColDef:{filter:!0,resizable:!0,sortable:!1,unSortIcon:!0},rowBuffer:0,rowModelType:"serverSide",suppressServerSideInfiniteScroll:!1,suppressMultiSort:!0,onFilterChanged:e=>{},onSortChanged:e=>{},onPaginationChanged:e=>this.onPaginationChanged(e)},this.deferredGridOptions);this.$emit(h.c.initialize,{options:e,keepColDefsOnClearRowData:this.keepColDefsOnClearRowData}),this.addEventListener(h.c.ready,e=>(0,t.sH)(this,void 0,void 0,function*(){const{pagination:a}=e.detail;this.pagination=a;if(!(yield this.initializeDatasource(this.datasourceOptions(),!0,!1)))return v.v.debug(`Genesis Datasource init failed for ${this.resourceName}`),this.clearRowData(),void this.setDisconnected(!0);this.$emit(u.V.dataInit),this.setDisconnected(!1),this.indexes=this.getResourceIndexes(this.datasource.availableIndexes,this.datasource.availableSortableFields);const r=(0,i.X)(this.datasource.originalFieldDef),t=yield this.getAgColumnDefs(r);if(this.$emit(h.c.schemaUpdated,{schema:t,metadata:r}),this.isRequestServer){const e=!this.isSnapshot&&!this.disablePolling;this.ssrmDatasource=new T({createReqRepRequestFunc:this.createReqRepRequest.bind(this),createReqRepStreamFunc:e?this.createReqRepStream.bind(this):void 0,onPollingUpdateFunc:e?this.applyReqRepPollingUpdate.bind(this):void 0,resetPreviousPollResultFunc:e?this.resetPreviousPollResult.bind(this):void 0,usePolling:e,reloadResourceDataFunc:this.reloadResourceData.bind(this),errorHandlerFunc:this.handleErrors.bind(this),onNoDataAvailableFunc:()=>this.$emit(h.c.noDataAvailable),onDataAvailableFunc:()=>this.$emit(h.c.loadingFinished),resourceName:this.resourceName,resourceParams:this.datasource.requestOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,maxView:+this.maxView,rowId:this.rowId,pagination:this.pagination,zeroBasedViewNumber:this.zeroBasedViewNumber,pagingMode:this.pagingMode,criteriaOnlyRequest:this.datasource.criteriaOnlyRequest})}else this.ssrmDatasource=new S({createDataserverStreamFunc:this.createDataserverStream.bind(this),reloadResourceDataFunc:this.reloadResourceData.bind(this),errorHandlerFunc:this.handleErrors.bind(this),onNoDataAvailableFunc:()=>this.$emit(h.c.noDataAvailable),onDataAvailableFunc:()=>this.$emit(h.c.loadingFinished),resourceName:this.resourceName,resourceParams:this.datasource.dataserverOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,maxView:+this.maxView,rowId:this.rowId,pagination:this.pagination,zeroBasedViewNumber:this.zeroBasedViewNumber});this.$emit(h.c.setServerSideDatasource,{datasource:this.ssrmDatasource}),this.$emit(h.c.filtersRestored),this.applyServerSideSortIndicatorStyling()}),{once:!0}),this.resourceName||this.handleErrors("Application not connected or invalid resource name, datasource will not work.","unknown")})}onPaginationChanged(e){var a;this.ssrmDatasource&&(this.ssrmDatasource.isNewPageSize=null!==(a=e.newPage)&&void 0!==a&&a)}destroy(){return(0,t.sH)(this,void 0,void 0,function*(){var e,a;this.datasource.destroy(),null===(e=this.liveUpdatesStream)||void 0===e||e.unsubscribe(),this.liveUpdatesStream=void 0,this.clearRowData(),this.ssrmDatasource&&(yield this.ssrmDatasource.destroy(),null===(a=this.pollingDatasource)||void 0===a||a.destroy(),this.ssrmDatasource=void 0),this.removeServerSideSortIndicatorStyling(),this.$emit(h.c.setServerSideDatasource,{datasource:null}),this.$emit(h.c.refreshServerSide,{purge:!0})})}restart(){return(0,t.sH)(this,void 0,void 0,function*(){yield this.destroy(),yield this.init()})}clearRowData(e=!0){this.rowData=new Map,e&&this.$emit(h.c.dataCleared,{includeSchema:!0}),this.transactionData={remove:[]},this.$emit(h.c.applyServerSideTransaction,{transaction:this.transactionData}),this.transactionData=void 0}getResourceIndexes(e,a){const r=new Map,t=new Set;if(null==e||e.forEach(e=>{const a=e.FIELDS.split(" ");r.set(e.NAME,a),a.forEach(e=>t.add(e))}),a&&a.length>0&&a.forEach(e=>t.add(e)),0===r.size&&t.size>0)r.set("SORTABLE_FIELDS",Array.from(t));else if(a&&a.length>0&&r.size>0){const e=new Set;r.forEach(a=>{a.forEach(a=>e.add(a))});const t=a.filter(a=>!e.has(a));t.length>0&&r.set("SORTABLE_FIELDS",t)}return r}createReqRepRequest(){return(0,t.sH)(this,arguments,void 0,function*(e=null){return yield this.datasource.snapshot(e)})}createReqRepStream(){return(0,t.sH)(this,arguments,void 0,function*(e=null){var a,r,t,o,i,n,l,g;const s=null!==(r=null===(a=null==e?void 0:e.DETAILS)||void 0===a?void 0:a.OFFSET)&&void 0!==r?r:0,d=null!==(o=null===(t=null==e?void 0:e.DETAILS)||void 0===t?void 0:t.MAX_ROWS)&&void 0!==o?o:this.maxRows,c=d+s,p=Object.assign(Object.assign({},this.datasourceOptions()),{criteria:null!==(n=null===(i=null==e?void 0:e.DETAILS)||void 0===i?void 0:i.CRITERIA_MATCH)&&void 0!==n?n:this.criteria,maxRows:c,orderBy:null!==(g=null===(l=null==e?void 0:e.DETAILS)||void 0===l?void 0:l.ORDER_BY)&&void 0!==g?g:this.orderBy});v.v.debug("Creating polling datasource for all loaded rows:",{currentOffset:s,baseMaxRows:d,totalRowsToFetch:c});if(yield this.pollingDatasource.init(p,!0,!0))return{stream:this.pollingDatasource.stream,datasource:this.pollingDatasource};v.v.error("Polling datasource init failed")})}resetPreviousPollResult(){this.previousPollResult.clear(),this.hasCapturedFirstPollResult=!1,v.v.debug("Previous poll result cleared")}applyReqRepPollingUpdate(e){var a;if(!this.ssrmDatasource||!e.REPLY)return;const r=e.REPLY;if(!Array.isArray(r)||!(null===(a=e.MESSAGE_TYPE)||void 0===a?void 0:a.startsWith("REP_")))return void v.v.error("received invalid RequestServerResult for polling update",e);if(!this.hasCapturedFirstPollResult)return r.forEach(e=>{this.previousPollResult.set(e[this.rowId],e)}),this.hasCapturedFirstPollResult=!0,void v.v.debug("First poll result stored for future comparison",{rowCount:this.previousPollResult.size});const t=new Map;r.forEach(e=>{t.set(e[this.rowId],e)});const o=[],i=[],n=[];r.forEach(e=>{const a=e[this.rowId];if(this.previousPollResult.has(a)){const r=this.previousPollResult.get(a);this.serializer.serialize(r)!==this.serializer.serialize(e)&&o.push(e)}else i.push(e)}),this.previousPollResult.forEach((e,a)=>{t.has(a)||n.push(e)}),(o.length>0||n.length>0||i.length>0)&&(this.previousPollResult=t,v.v.debug("Applying reqRep polling update via applyServerSideTransaction:",{added:i.length,updated:o.length,removed:n.length,totalInPoll:t.size}),this.$emit(h.c.applyServerSideTransaction,{transaction:{add:i,update:o,remove:n}}))}applyLiveServerSideUpdate(e){var a,r,t;const o=null!==(a=e.inserts)&&void 0!==a?a:[],i=null!==(r=e.updates)&&void 0!==r?r:[],n=null!==(t=e.deletes)&&void 0!==t?t:[];if(!o.length&&!i.length&&!n.length)return;const l=o.length-n.length;this.ssrmDatasource&&(this.ssrmDatasource.serverRowsCount+=l,this.ssrmDatasource.clientRowsCount+=l),this.transactionData={add:[],remove:[],update:[]},this.handleStreamInserts(o),this.handleStreamUpdates(i),this.handleStreamDeletes(n),this.transactionData.add.length>0&&this.$emit(h.c.applyServerSideTransaction,{transaction:{route:[],add:this.transactionData.add,addIndex:this.reverse?0:this.transactionData.addIndex}}),(this.transactionData.update.length>0||this.transactionData.remove.length>0)&&this.$emit(h.c.applyServerSideTransaction,{transaction:{route:[],update:this.transactionData.update,remove:this.transactionData.remove}})}createDataserverStream(){return(0,t.sH)(this,arguments,void 0,function*(e=null){if(this.liveUpdates){const e=e=>(0,t.sH)(this,void 0,void 0,function*(){var a;if(e.MESSAGE_TYPE!==n.Go.QUERY_UPDATE||!e.ROW)return;if(!(null===(a=this.ssrmDatasource)||void 0===a?void 0:a.sourceRef))return;if(void 0!==e.SEQUENCE_ID&&e.SEQUENCE_ID<=1)return;const r=e,t=Array.isArray(r.ROW)?r.ROW:r.ROW?[r.ROW]:[],o=this.ssrmDatasource.rowData,i=t.map(e=>{var a;const r=null!==(a=e.DETAILS)&&void 0!==a?a:{},t=r[this.rowId],i=null!=t?null==o?void 0:o.get(t):void 0;if(!i)return e;const n=Object.assign({},i);for(const[a,r]of Object.entries(e))"DETAILS"!==a&&null!=r&&(n[a]=r);return Object.assign(Object.assign({},n),{DETAILS:r})}),g=Object.assign(Object.assign({},r),{ROW:i}),s=(0,l.d)(g,this.rowId);this.applyLiveServerSideUpdate(s)}),a=e=>{var a;v.v.error(e),this.handleErrors((null===(a=e.receivedMessage)||void 0===a?void 0:a.ERROR)||e.message,"stream")};this.liveUpdatesStream=this.connect.stream(this.resourceName,()=>{},a,this.datasource.dataserverOnlyParams).subscribe(a=>e(a))}return yield this.datasource.startStream(),this.datasource.stream})}getAgColumnDefs(e){return(0,t.sH)(this,void 0,void 0,function*(){const a=this.generateColumnDefsFromMetadata(e,y,w);return a.forEach(e=>{e.sortable=[].concat(...this.indexes.values()).includes(e.field),this.datasource.criteriaOnlyRequest&&(e.filter=this.datasource.availableCriteriaFields.includes(e.field)?e.filter:null)}),a})}applyTransaction(e){this.$emit(h.c.applyServerSideTransaction,{transaction:e})}loadMore(){throw new Error("loadMore() method is not supported for server-side datasource")}};(0,t.Cg)([c.b_],E.prototype,"serializer",void 0),(0,t.Cg)([g.yW],E.prototype,"pollingDatasource",void 0),(0,t.Cg)([(0,p.attr)({mode:"boolean",attribute:"zero-based-view-number"})],E.prototype,"zeroBasedViewNumber",void 0),(0,t.Cg)([(0,p.attr)({mode:"boolean",attribute:"live-updates"})],E.prototype,"liveUpdates",void 0),(0,t.Cg)([(0,p.attr)({attribute:"paging-mode"})],E.prototype,"pagingMode",void 0),(0,t.Cg)([p.observable],E.prototype,"request",void 0),E=(0,t.Cg)([(0,p.customElement)({name:"grid-pro-server-side-datasource"})],E)},60591(e,a,r){r.d(a,{g:()=>t});const t=r(33681).css`
394
394
  .ag-dnd-ghost {
395
395
  background: var(--ag-header-background-color, var(--ag-background-color, #1f2126));
396
396
  border: solid 1px;
@@ -8657,4 +8657,4 @@
8657
8657
  ${new i.CSSVarsTokenMapper(a)}
8658
8658
  }
8659
8659
  `;var c,p;!function(e){e.action="action",e.actionsMenu="actionsMenu",e.boolean="boolean",e.editable="editable",e.icon="icon",e.text="text",e.select="select",e.statusPill="statusPill",e.dateEditor="dateEditor",e.selectEditor="selectEditor",e.numberEditor="numberEditor",e.stringEditor="stringEditor",e.multiselectEditor="multiselectEditor"}(c||(c={})),function(e){e.labelValue="labelValue",e.pagination="pagination",e.loadMore="loadMore",e.reload="reload",e.rowCount="rowCount"}(p||(p={}));const u="onGridReady",h="__editedColumn",v="__errorColumn",m={},f=l.DI.createInterface(e=>e.instance(m));var b;!function(e){e.camelCase="camelCase",e.capitalCase="capitalCase",e.dotCase="dotCase",e.headerCase="headerCase",e.noCase="noCase",e.paramCase="paramCase",e.pascalCase="pascalCase",e.pathCase="pathCase",e.sentenceCase="sentenceCase",e.snakeCase="snakeCase"}(b||(b={}));const w={rows:!0,maxRows:!1,aggregation:!0,loadMore:{tooltip:"Load more rows from server"},reload:{tooltip:"Reload the datasource."}}},11749(e,a,r){r.d(a,{H:()=>i});var t=r(55823),o=r(98316);class i{getColumnState(e){return(0,t.sH)(this,void 0,void 0,function*(){const a=this.session.getLocalStorageItem("gridOptions");if(a){const r=JSON.parse(a);if(e in r)return JSON.parse(r[e])}return[]})}saveColumnState(e,a){return(0,t.sH)(this,void 0,void 0,function*(){const r=JSON.parse(this.session.getLocalStorageItem("gridOptions")||"{}");r[e]=JSON.stringify(a),this.session.setLocalStorageItem("gridOptions",JSON.stringify(r))})}deleteColumnState(e){return(0,t.sH)(this,void 0,void 0,function*(){const a=JSON.parse(this.session.getLocalStorageItem("gridOptions")||"{}");delete a[e],this.session.setLocalStorageItem("gridOptions",JSON.stringify(a))})}getFilterModel(e){return(0,t.sH)(this,void 0,void 0,function*(){const a=this.session.getLocalStorageItem("gridOptions");if(a){const r=JSON.parse(a);if(e in r)return JSON.parse(r[e])}return{}})}saveFilterModel(e,a){return(0,t.sH)(this,void 0,void 0,function*(){const r=JSON.parse(this.session.getLocalStorageItem("gridOptions")||"{}");r[e]=JSON.stringify(a),this.session.setLocalStorageItem("gridOptions",JSON.stringify(r))})}}(0,t.Cg)([o.N],i.prototype,"session",void 0)},53397(e,a,r){r.d(a,{l:()=>i});var t=r(38370),o=r(11749);const i=t.DI.createInterface(e=>e.singleton(o.H))},52540(e,a,r){r.d(a,{k:()=>t});class t{init(e){this.element=document.createElement("div"),this.element.classList.add("ag-status-name-value","ag-status-panel"),this.element.setAttribute("data-test-id","grid-label-value-panel"),this.element.setAttribute("role","status"),this.currentParams=e,this.updateDisplay()}updateParams(e){this.currentParams=Object.assign(Object.assign({},this.currentParams),e),this.updateDisplay()}updateDisplay(){this.element&&(this.currentParams.hide?this.element.style.display="none":(this.element.style.display="",this.element.setAttribute("aria-label",`${this.currentParams.label}: ${this.currentParams.value}`),this.labelElement||(this.labelElement=document.createElement("span"),this.labelElement.setAttribute("data-test-id","grid-label-value-label"),this.labelElement.setAttribute("aria-hidden","true"),this.element.appendChild(this.labelElement)),this.labelElement.innerHTML=`${this.currentParams.label}:&nbsp; `,this.valueElement||(this.valueElement=document.createElement("span"),this.valueElement.classList.add("ag-status-name-value-value"),this.valueElement.setAttribute("data-test-id","grid-label-value-value"),this.valueElement.setAttribute("aria-hidden","true"),this.element.appendChild(this.valueElement)),this.valueElement.innerHTML=this.currentParams.value))}getGui(){return this.element}destroy(){}}},49104(e,a,r){r.d(a,{s:()=>n});var t=r(55823),o=r(68424),i=r(63486);class n{constructor(){this.buttonLabel="Load More",this.isLoading=!1,this.isLeftAligned=!1}init(e){var a,r,t;for(this.params=e,this.gridApi=e.api,this.element=document.createElement("div"),this.element.classList.add("ag-status-panel","ag-load-more-panel"),this.element.setAttribute("data-test-id","grid-load-more-panel"),this.element.setAttribute("role","region"),this.element.setAttribute("aria-label","Load more data controls"),this.element.style.display="flex",this.element.style.alignItems="center",this.isLeftAligned=(null===(t=null===(r=null===(a=this.gridApi)||void 0===a?void 0:a.gridOptionsService)||void 0===r?void 0:r.gridOptions)||void 0===t?void 0:t.pagination)||!1,this.element.style.justifyContent=this.isLeftAligned?"flex-start":"flex-end",this.element.style.paddingLeft="var(--ag-grid-size)",this.element.style.paddingRight="var(--ag-grid-size)",this.element.style.height="var(--ag-status-bar-height)",this.designSystemPrefix=(0,o.JH)(this.element,"zero"),this.createProgressRing(),this.createLoadMoreButton(),this.updateButtonVisibility();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.isLeftAligned?(this.element.appendChild(this.loadMoreButton),this.element.appendChild(this.progressRing)):(this.element.appendChild(this.progressRing),this.element.appendChild(this.loadMoreButton))}createProgressRing(){this.progressRing=document.createElement(`${this.designSystemPrefix}-progress-ring`),this.progressRing.setAttribute("data-test-id","grid-load-more-progress"),this.progressRing.setAttribute("aria-label","Loading more data"),this.progressRing.style.width="20px",this.progressRing.style.height="20px",this.progressRing.style.margin=this.isLeftAligned?"0 0 0 8px":"0 8px 0 0",this.progressRing.style.display="none"}createLoadMoreButton(){var e,a;this.loadMoreButton=document.createElement(`${this.designSystemPrefix}-button`),this.loadMoreButton.setAttribute("data-test-id","grid-load-more-button");const r=(null===(e=this.params)||void 0===e?void 0:e.appearance)||"outline";this.loadMoreButton.setAttribute("appearance",r),this.loadMoreButton.textContent=this.buttonLabel,this.loadMoreButton.style.margin="2px 8px",this.loadMoreButton.style.minWidth="120px",this.loadMoreButton.style.textAlign="center",this.loadMoreButton.style.height="24px",this.loadMoreButton.style.lineHeight="20px",(null===(a=this.params)||void 0===a?void 0:a.tooltip)&&(this.loadMoreButton.setAttribute("title",this.params.tooltip),this.loadMoreButton.setAttribute("aria-describedby","grid-load-more-tooltip")),this.updateAriaLabel(),this.loadMoreButton.setAttribute("role","button"),this.clickHandler=()=>(0,t.sH)(this,void 0,void 0,function*(){if(!this.isLoading)try{this.showLoading(!0),yield(0,i.c)(500),this.params.onLoadMore&&this.params.onLoadMore()}catch(e){this.showLoading(!1)}}),this.loadMoreButton.addEventListener("click",this.clickHandler)}updateAriaLabel(){var e,a;let r;r=(null===(e=this.params)||void 0===e?void 0:e.tooltip)?this.params.tooltip:this.isLoading?"Loading more data":(null===(a=this.params)||void 0===a?void 0:a.moreRows)?"Load more rows from server":"No more rows available",this.loadMoreButton.setAttribute("aria-label",r)}showLoading(e){var a;this.isLoading=e,e?(this.progressRing.style.display="inline-block",this.loadMoreButton.setAttribute("disabled","true"),this.loadMoreButton.textContent="Loading..."):(this.progressRing.style.display="none",(null===(a=this.params)||void 0===a?void 0:a.moreRows)?(this.loadMoreButton.textContent="Load More",this.loadMoreButton.removeAttribute("disabled")):(this.loadMoreButton.textContent="No More Rows",this.loadMoreButton.setAttribute("disabled","true"))),this.updateAriaLabel()}updateButtonVisibility(){this.params&&!this.isLoading&&(this.progressRing.style.display="none",this.params.moreRows?(this.loadMoreButton.style.display="inline-flex",this.loadMoreButton.textContent="Load More",this.loadMoreButton.removeAttribute("disabled")):(this.loadMoreButton.style.display="inline-flex",this.loadMoreButton.textContent="No More Rows",this.loadMoreButton.setAttribute("disabled","true")),this.updateAriaLabel())}updateParams(e){var a,r;const t=this.params;this.params=Object.assign(Object.assign({},this.params),e),(null==t?void 0:t.tooltip)!==(null===(a=this.params)||void 0===a?void 0:a.tooltip)&&(null===(r=this.params)||void 0===r?void 0:r.tooltip)&&this.loadMoreButton.setAttribute("title",this.params.tooltip),this.isLoading&&this.showLoading(!1),this.updateButtonVisibility()}getGui(){return this.element}destroy(){this.loadMoreButton&&this.clickHandler&&this.loadMoreButton.removeEventListener("click",this.clickHandler)}}},19060(e,a,r){r.d(a,{h:()=>t});class t{init(e){this.api=e.api,this.element=document.createElement("div"),this.element.className="ag-status-panel",this.element.setAttribute("data-test-id","grid-pagination-panel"),this.element.setAttribute("role","navigation"),this.element.setAttribute("aria-label","Pagination controls"),this.element.style.display="flex",this.element.style.alignItems="center",this.element.style.justifyContent="flex-end",this.element.style.height="var(--ag-status-bar-height)",this.createPaginationPanel(),this.updateDisplay(),this.paginationChangedHandler=()=>{this.updateDisplay()},this.api.addEventListener("paginationChanged",this.paginationChangedHandler)}getGui(){return this.element}createPaginationPanel(){this.paginationPanel=document.createElement("div"),this.paginationPanel.className="ag-paging-panel ag-unselectable",this.paginationPanel.setAttribute("id","ag-pagination-clone"),this.paginationPanel.setAttribute("data-test-id","grid-pagination-controls"),this.paginationSummaryPanel=document.createElement("span"),this.paginationSummaryPanel.className="ag-paging-row-summary-panel",this.paginationSummaryPanel.setAttribute("role","status"),this.paginationSummaryPanel.setAttribute("data-test-id","grid-pagination-summary"),this.paginationSummaryPanel.setAttribute("aria-label","Row count summary"),this.firstPageButton=this.createPaginationButton("btFirst","ag-paging-button ag-disabled","First Page",!0),this.firstPageButton.setAttribute("data-test-id","grid-pagination-first"),this.prevPageButton=this.createPaginationButton("btPrevious","ag-paging-button ag-disabled","Previous Page",!0),this.prevPageButton.setAttribute("data-test-id","grid-pagination-previous"),this.descriptionPanel=document.createElement("span"),this.descriptionPanel.className="ag-paging-description",this.descriptionPanel.setAttribute("role","status"),this.descriptionPanel.setAttribute("data-test-id","grid-pagination-description"),this.descriptionPanel.setAttribute("aria-label","Current page information"),this.pageStartDisplay=document.createElement("span"),this.pageStartDisplay.className="ag-paging-number",this.pageStartDisplay.setAttribute("id","ag-pagination-clone-start-page"),this.pageStartDisplay.setAttribute("data-test-id","grid-pagination-page-label"),this.pageStartDisplay.textContent="Page",this.pageNumberDisplay=document.createElement("span"),this.pageNumberDisplay.className="ag-paging-number",this.pageNumberDisplay.setAttribute("id","ag-pagination-clone-start-page-number"),this.pageNumberDisplay.setAttribute("ref","lbCurrent"),this.pageNumberDisplay.setAttribute("data-test-id","grid-pagination-current-page"),this.pageNumberDisplay.setAttribute("aria-label","Current page number"),this.pageNumberDisplay.textContent="1",this.pageOfDisplay=document.createElement("span"),this.pageOfDisplay.className="ag-paging-number",this.pageOfDisplay.setAttribute("id","ag-pagination-clone-of-page"),this.pageOfDisplay.setAttribute("data-test-id","grid-pagination-of-label"),this.pageOfDisplay.textContent="of",this.pageNumberTotalDisplay=document.createElement("span"),this.pageNumberTotalDisplay.className="ag-paging-number",this.pageNumberTotalDisplay.setAttribute("id","ag-pagination-clone-of-page-number"),this.pageNumberTotalDisplay.setAttribute("ref","lbTotal"),this.pageNumberTotalDisplay.setAttribute("data-test-id","grid-pagination-total-pages"),this.pageNumberTotalDisplay.setAttribute("aria-label","Total number of pages"),this.pageNumberTotalDisplay.textContent="1",this.nextPageButton=this.createPaginationButton("btNext","ag-paging-button","Next Page",!1),this.nextPageButton.setAttribute("data-test-id","grid-pagination-next"),this.lastPageButton=this.createPaginationButton("btLast","ag-paging-button","Last Page",!1),this.lastPageButton.setAttribute("data-test-id","grid-pagination-last"),this.descriptionPanel.appendChild(this.pageStartDisplay),this.descriptionPanel.appendChild(document.createTextNode(" ")),this.descriptionPanel.appendChild(this.pageNumberDisplay),this.descriptionPanel.appendChild(document.createTextNode(" ")),this.descriptionPanel.appendChild(this.pageOfDisplay),this.descriptionPanel.appendChild(document.createTextNode(" ")),this.descriptionPanel.appendChild(this.pageNumberTotalDisplay),this.paginationPanel.appendChild(this.paginationSummaryPanel),this.paginationPanel.appendChild(this.firstPageButton),this.paginationPanel.appendChild(this.prevPageButton),this.paginationPanel.appendChild(this.descriptionPanel),this.paginationPanel.appendChild(this.nextPageButton),this.paginationPanel.appendChild(this.lastPageButton),this.element.appendChild(this.paginationPanel),this.addPaginationEventListeners()}addPaginationEventListeners(){this.firstPageButton.addEventListener("click",()=>this.goToPage("first")),this.prevPageButton.addEventListener("click",()=>this.goToPage("previous")),this.nextPageButton.addEventListener("click",()=>this.goToPage("next")),this.lastPageButton.addEventListener("click",()=>this.goToPage("last")),this.firstPageButton.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.goToPage("first"))}),this.prevPageButton.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.goToPage("previous"))}),this.nextPageButton.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.goToPage("next"))}),this.lastPageButton.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.goToPage("last"))})}createPaginationButton(e,a,r,t){const o=document.createElement("div");o.setAttribute("ref",e),o.className=a,o.setAttribute("role","button"),o.setAttribute("aria-label",r),o.setAttribute("tabindex",t?"-1":"0"),t&&o.setAttribute("aria-disabled","true");const i=document.createElement("span");return i.className=`ag-icon ag-icon-${e.substring(2).toLowerCase()}`,i.setAttribute("unselectable","on"),i.setAttribute("role","presentation"),o.appendChild(i),o}goToPage(e){var a;const r=this.api,[t,o]={first:["paginationGoToFirstPage","goToFirstPage"],previous:["paginationGoToPreviousPage","goToPreviousPage"],next:["paginationGoToNextPage","goToNextPage"],last:["paginationGoToLastPage","goToLastPage"]}[e];"function"==typeof r[t]?r[t]():"function"==typeof(null===(a=r.paginationProxy)||void 0===a?void 0:a[o])&&r.paginationProxy[o]()}updateDisplay(){var e,a,r,t,o,i,n,l,g,s,d,c,p,u,h,v,m,f,b,w,y,z;const x=this.api,C=(null!==(o=null!==(a=null===(e=x.paginationGetCurrentPage)||void 0===e?void 0:e.call(x))&&void 0!==a?a:null===(t=null===(r=x.paginationProxy)||void 0===r?void 0:r.getCurrentPage)||void 0===t?void 0:t.call(r))&&void 0!==o?o:0)+1,k=null!==(s=null!==(n=null===(i=x.paginationGetTotalPages)||void 0===i?void 0:i.call(x))&&void 0!==n?n:null===(g=null===(l=x.paginationProxy)||void 0===l?void 0:l.getTotalPages)||void 0===g?void 0:g.call(l))&&void 0!==s?s:1,A=null!==(c=null===(d=x.paginationGetPageSize)||void 0===d?void 0:d.call(x))&&void 0!==c?c:null===(u=null===(p=x.paginationProxy)||void 0===p?void 0:p.getPageSize)||void 0===u?void 0:u.call(p),D=null!==(v=null===(h=x.paginationGetRowCount)||void 0===h?void 0:h.call(x))&&void 0!==v?v:null===(f=null===(m=x.paginationProxy)||void 0===m?void 0:m.getMasterRowCount)||void 0===f?void 0:f.call(m),S="serverSide"===(null===(z=null===(y=null===(w=(b=this.api).getModel)||void 0===w?void 0:w.call(b))||void 0===y?void 0:y.getType)||void 0===z?void 0:z.call(y))&&x.paginationIsLastPageFound&&!x.paginationIsLastPageFound();this.pageNumberDisplay.textContent=C.toString(),this.pageNumberTotalDisplay.textContent=S?"more":k.toString(),S?(this.pageNumberTotalDisplay.setAttribute("aria-label","More pages available"),this.paginationSummaryPanel.setAttribute("aria-label","Row count summary with more data available")):(this.pageNumberTotalDisplay.setAttribute("aria-label","Total number of pages"),this.paginationSummaryPanel.setAttribute("aria-label","Row count summary"));const R=(C-1)*A+1,M=Math.min(C*A,D),T=S?"more":D.toString();this.paginationSummaryPanel.textContent=`${D>0?R:0} to ${M} of ${T}`;const E=1===C,N=!S&&C>=k;this.updateButtonState(this.firstPageButton,E),this.updateButtonState(this.prevPageButton,E),this.updateButtonState(this.nextPageButton,N),this.updateButtonState(this.lastPageButton,S||N),S?(this.lastPageButton.setAttribute("aria-label","Last page unavailable - total number of pages unknown"),this.lastPageButton.setAttribute("title","Cannot jump to last page when total is unknown")):(this.lastPageButton.setAttribute("aria-label","Last Page"),this.lastPageButton.removeAttribute("title"))}updateButtonState(e,a){a?(e.classList.add("ag-disabled"),e.setAttribute("aria-disabled","true"),e.setAttribute("tabindex","-1")):(e.classList.remove("ag-disabled"),e.setAttribute("aria-disabled","false"),e.setAttribute("tabindex","0"))}destroy(){this.api&&this.paginationChangedHandler&&this.api.removeEventListener("paginationChanged",this.paginationChangedHandler),this.api=null,this.paginationChangedHandler=null}}},88863(e,a,r){r.d(a,{W:()=>n});var t=r(55823),o=r(68424),i=r(63486);class n{constructor(){this.isReloading=!1}init(e){this.params=e,this.element=document.createElement("div"),this.element.classList.add("ag-status-panel","ag-reload-panel"),this.element.setAttribute("data-test-id","grid-reload-panel"),this.element.setAttribute("role","region"),this.element.setAttribute("aria-label","Reload data controls"),this.element.style.display="flex",this.element.style.alignItems="center",this.element.style.justifyContent="center",this.element.style.paddingLeft="var(--ag-grid-size)",this.element.style.height="var(--ag-status-bar-height)",this.designSystemPrefix=(0,o.JH)(this.element,"zero"),this.createRefreshIcon(),this.createProgressRing(),this.element.appendChild(this.refreshIcon),this.element.appendChild(this.progressRing),this.progressRing.style.display="none"}createProgressRing(){this.progressRing=document.createElement(`${this.designSystemPrefix}-progress-ring`),this.progressRing.setAttribute("data-test-id","grid-reload-progress"),this.progressRing.setAttribute("aria-label","Reloading data"),this.progressRing.style.width="20px",this.progressRing.style.height="20px",this.progressRing.style.margin="4px",this.progressRing.style.display="none"}createRefreshIcon(){var e,a,r,o;if("zero"===this.designSystemPrefix||"rapid"===this.designSystemPrefix){this.refreshIcon=document.createElement(`${this.designSystemPrefix}-icon`);const r=(null===(e=this.params)||void 0===e?void 0:e.icon)||"refresh";this.refreshIcon.setAttribute("name",r),this.refreshIcon.setAttribute("aria-label",(null===(a=this.params)||void 0===a?void 0:a.tooltip)||"Reload grid data")}else this.refreshIcon=document.createElement("div"),this.refreshIcon.textContent="↻",this.refreshIcon.setAttribute("aria-label",(null===(r=this.params)||void 0===r?void 0:r.tooltip)||"Reload grid data");this.refreshIcon.setAttribute("data-test-id","grid-reload-button"),this.refreshIcon.setAttribute("role","button"),this.refreshIcon.setAttribute("tabindex","0"),this.refreshIcon.style.cursor="pointer",this.refreshIcon.style.width="28px",this.refreshIcon.style.height="28px",this.refreshIcon.style.display="flex",this.refreshIcon.style.alignItems="center",this.refreshIcon.style.justifyContent="center",this.refreshIcon.style.fontSize="20px",(null===(o=this.params)||void 0===o?void 0:o.tooltip)&&this.refreshIcon.setAttribute("title",this.params.tooltip),this.mouseoverHandler=()=>{this.isReloading||(this.refreshIcon.style.opacity="0.7")},this.refreshIcon.addEventListener("mouseover",this.mouseoverHandler),this.mouseoutHandler=()=>{this.isReloading||(this.refreshIcon.style.opacity="1")},this.refreshIcon.addEventListener("mouseout",this.mouseoutHandler),this.clickHandler=()=>(0,t.sH)(this,void 0,void 0,function*(){if(!this.isReloading)try{this.showReloading(!0),yield(0,i.c)(500),this.params.onReload&&this.params.onReload(),this.showReloading(!1)}catch(e){this.showReloading(!1)}}),this.refreshIcon.addEventListener("click",this.clickHandler),this.refreshIcon.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.clickHandler(new MouseEvent("click")))})}showReloading(e){this.isReloading=e,e?(this.refreshIcon.style.display="none",this.progressRing.style.display="inline-block"):(this.refreshIcon.style.display="inline-flex",this.progressRing.style.display="none")}updateParams(e){var a,r;const t=this.params;this.params=Object.assign(Object.assign({},this.params),e),(null==t?void 0:t.tooltip)!==(null===(a=this.params)||void 0===a?void 0:a.tooltip)&&((null===(r=this.params)||void 0===r?void 0:r.tooltip)?(this.refreshIcon.setAttribute("title",this.params.tooltip),this.refreshIcon.setAttribute("aria-label",this.params.tooltip)):(this.refreshIcon.removeAttribute("title"),this.refreshIcon.setAttribute("aria-label","Reload grid data")))}getGui(){return this.element}destroy(){this.refreshIcon&&(this.refreshIcon.removeEventListener("mouseover",this.mouseoverHandler),this.refreshIcon.removeEventListener("mouseout",this.mouseoutHandler),this.refreshIcon.removeEventListener("click",this.clickHandler))}}},71964(e,a,r){r.d(a,{i:()=>t});class t{init(e){this.api=e.api,this.element=document.createElement("div"),this.element.classList.add("ag-status-name-value","ag-status-panel"),this.element.setAttribute("data-test-id","grid-row-count-panel"),this.element.setAttribute("role","status");const a=document.createElement("span");a.setAttribute("data-test-id","grid-row-count-label"),a.setAttribute("aria-hidden","true"),a.innerHTML="Rows:&nbsp;",this.rowCountDisplay=document.createElement("span"),this.rowCountDisplay.classList.add("ag-status-name-value-value"),this.rowCountDisplay.setAttribute("data-test-id","grid-row-count-value"),this.rowCountDisplay.setAttribute("aria-hidden","true"),this.element.appendChild(a),this.element.appendChild(this.rowCountDisplay),this.updateDisplay(),this.modelUpdatedHandler=()=>{this.updateDisplay()},this.api.addEventListener("modelUpdated",this.modelUpdatedHandler),this.api.addEventListener("rowDataUpdated",this.modelUpdatedHandler)}updateDisplay(){var e,a,r;if(!this.api||!this.rowCountDisplay)return;const t=this.api,o=null!==(r=null===(a=(e=this.api).getDisplayedRowCount)||void 0===a?void 0:a.call(e))&&void 0!==r?r:0,i=void 0!==t.paginationIsLastPageFound&&!t.paginationIsLastPageFound()&&o>0,n=i?o-1+"+":o.toString();this.rowCountDisplay.textContent=n;const l=i?`Row count: ${o} or more rows`:`Row count: ${o} rows`;this.element.setAttribute("aria-label",l)}getGui(){return this.element}destroy(){this.api&&this.modelUpdatedHandler&&(this.api.removeEventListener("modelUpdated",this.modelUpdatedHandler),this.api.removeEventListener("rowDataUpdated",this.modelUpdatedHandler)),this.api=null,this.modelUpdatedHandler=null}}},73203(e,a,r){r.d(a,{y:()=>t});class t{init(e){const a=this.eGui=document.createElement("div"),r=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'>${r}</span>`}getGui(){return this.eGui}}},23201(e,a,r){function t(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}}r.d(a,{n7:()=>i,pr:()=>t,rG:()=>n,yS:()=>l});const o=Object.keys(t({}));function i(e){return Array.isArray(e)?e.map(e=>{const a={},r=a;for(const a of o){const t=e[a];void 0!==t&&(r[a]=t)}return a}):[]}function n(e){return e.map(t)}function l(e,a){const r=i(a),t={},o=[],n="field",l="colId",g=e=>Array.isArray(e.children),s=e=>{var a;return null!==(a=e[n])&&void 0!==a?a:e[l]},d=new Map;r.forEach(e=>{null!=e[l]&&d.set(e[l],e)});const c=e=>{if(g(e))return Object.assign(Object.assign({},e),{children:e.children.map(c)});const a=s(e),r=null!=a?d.get(a):void 0;return r?Object.assign(Object.assign({},e),r):Object.assign({},e)};return r.forEach(a=>{const r=a[l];if(null==r)return;const i=e.find(e=>!g(e)&&(e[n]===r||null!=e[l]&&e[l]===r));if(i){const e=s(i),r=Object.assign(Object.assign({},i),a);null!=e&&(t[e]=r),o.push(r)}}),e.forEach(e=>{if(g(e))return void o.push(c(e));const a=s(e);if(null==a||!t.hasOwnProperty(a)){const r=Object.assign({},e);null!=a&&(t[a]=r),o.push(r)}}),o}},68858(e,a,r){r.d(a,{P:()=>t});const t=e=>e?"string"==typeof e?e:Array.isArray(e)?e.map(t).join(", "):"object"==typeof e?"message"in e&&"string"==typeof e.message?e.message:"TEXT"in e&&"string"==typeof e.TEXT?e.TEXT:JSON.stringify(e):String(e):""},1510(e,a,r){r.d(a,{v:()=>t});const t=(0,r(66506).createLogger)("grid-pro")},49874(e,a,r){function t(e){const a=[];for(const[r]of e)r&&a.push(r);return a}function o(e){const a=[];function r(e){for(const r of e)null!==r&&a.push(r)}for(const[a,t]of e)null!==a&&null!==t&&r(t);return a}r.d(a,{P:()=>o,i:()=>t})},50103(e,a,r){r.d(a,{w:()=>t});const t=e=>e.replace(/([a-z])([A-Z])|\s+/g,"$1-$2").toLowerCase()},21409(e,a,r){r.d(a,{S:()=>o,a:()=>i});var t=r(55823);const o=e=>{var a,r,o,n,l,g,s,d,c;return c=class extends e{constructor(...e){super(e),a.add(this),r.set(this,{_key:"dom"}),o.set(this,""),n.set(this,!1),l.set(this,void 0),g.set(this,!1)}cloneNode(e){const a=this.deepClone();return e&&Array.from(this.childNodes).forEach(e=>{a.appendChild(e.cloneNode(!0))}),a}deepClone(){const e=document.createElement(this.tagName.toLowerCase());return this.getAttributeNames().forEach(a=>e.setAttribute(a,this.getAttribute(a))),e}get shouldRunDisconnect(){return!!(0,t.gn)(this,g,"f")||("dom"===(0,t.gn)(this,r,"f")._key||"foundation-layout-cache"!==(0,t.gn)(this,r,"f")._key&&!((0,t.gn)(this,r,"f").dragging||!(0,t.gn)(this,r,"f").hasFirstLoaded||(0,t.gn)(this,a,"m",s).call(this,"disconnect")))}get shouldRunConnect(){if((0,t.gn)(this,g,"f"))return!0;if("dom"===(0,t.gn)(this,r,"f")._key)return!0;if("foundation-layout-cache"===(0,t.gn)(this,r,"f")._key)return!1;let e="reconnect";return!1===(0,t.gn)(this,n,"f")&&((0,t.GG)(this,n,!0,"f"),e="connect"),!((0,t.gn)(this,r,"f").dragging||!(0,t.gn)(this,r,"f").hasFirstLoaded||(0,t.gn)(this,a,"m",s).call(this,e))}connectedCallback(){super.connectedCallback(),"foundation-layout"!==(0,t.gn)(this,r,"f")._key&&(0,t.GG)(this,r,(0,t.gn)(this,a,"m",d).call(this,this),"f")}},r=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,g=new WeakMap,a=new WeakSet,s=function(e){var a,i;if("foundation-layout"!==(0,t.gn)(this,r,"f")._key)throw new Error("LifecycleMixin: should not be checking a token change if container not in the layout");const n=(0,t.gn)(this,o,"f")!==(0,t.gn)(this,r,"f").lifecycleUpdateToken;let s=!1;return"connect"===e?(0,t.GG)(this,o,null!==(a=(0,t.gn)(this,r,"f").lifecycleUpdateToken)&&void 0!==a?a:"","f"):"disconnect"===e?(s=n,(0,t.GG)(this,l,setTimeout(()=>{(0,t.GG)(this,g,s,"f"),(0,t.gn)(this,g,"f")&&this.disconnectedCallback()},1e4),"f")):"reconnect"===e&&(s=n,(0,t.GG)(this,o,null!==(i=(0,t.gn)(this,r,"f").lifecycleUpdateToken)&&void 0!==i?i:"","f"),clearTimeout((0,t.gn)(this,l,"f"))),s},d=function e(r){var o;if(!0===r.getRootNode()[i])return{_key:"foundation-layout-cache"};if(r.getRootNode()instanceof Document||!(null===(o=r.getRootNode())||void 0===o?void 0:o.host))return{_key:"dom"};const n=r.getRootNode().host;if("FoundationLayoutMain"===n.class){const e=n;return e._key="foundation-layout",e}return(0,t.gn)(this,a,"m",e).call(this,n)},c},i=Symbol("layout-cache-document")},63486(e,a,r){r.d(a,{c:()=>t});const t=e=>new Promise(a=>{setTimeout(a,e)})},52945(e,a,r){r.d(a,{O5:()=>o,fI:()=>i});var t=r(28745);const o=(e,a)=>{var r;let o=document.getElementById(a);if(o)return void t.v.debug(`\n An element with the id of '${a}' already exists and likely has the css rules applied.\n `);const i=null!==(r=document.head)&&void 0!==r?r:document.getElementsByTagName("head")[0];o=document.createElement("style"),o.id=a,i.appendChild(o);if((e.match(/}/g)||[]).length>1)return o.textContent=e,()=>{o&&i.removeChild(o)};{const a=o.sheet.insertRule(e);return()=>{o&&(o.sheet.deleteRule(a),i.removeChild(o))}}};function i(e){const a=[],r=new Set;return function e(t){const o=Array.from(t.querySelectorAll("*"));a.push(...o),o.forEach(a=>{a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),e(a.shadowRoot))})}(e),a}},28745(e,a,r){r.d(a,{v:()=>t});const t=(0,r(66506).createLogger)("foundation-utils")}}]);
8660
- //# sourceMappingURL=445.2ef63d3e6c1723f6088ff7ce10894ef1.js.map
8660
+ //# sourceMappingURL=445.eba9ef88498018de3f6262a44683bb45.js.map