PageSourceSearch

https://apps.elfi.com/seb/webapp/src_app_rate-admin_admin_module_ts.9a3dbfb0640cca7c.js

js elfi.com collected 2026-09-24 12:07:39 UTC 268,186 bytes, 1 lines download raw bytes

1(self.webpackChunkfinstudentweb=self.webpackChunkfinstudentweb||[]).push([["src_app_rate-admin_admin_module_ts"],{6389(w,S,h){"use strict";h.d(S,{AdminModule:()=>oe});var m=h(6089),M=h(9769),c=h(9417),ce=h(7787),D=h(9052),pe=h(7244);let Q=class{static{this.propDecorators={value:[{type:m.pde}],header:[{type:m.pde}]}}};Q=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"column",template:"",standalone:!1})],Q);var me=h(7815),ge=h.n(me),y=h(3794);class J{}class _{}class L{constructor(){this.terms=[]}}var V=h(4412),v=h(9832);class O{constructor(e){this.active=!0,this.value=e}}var f=h(6354),b=h(9437);let T=class{constructor(e){this.executorService=e,this.baseUrl="/admin/tier/products/",this.tierTermStore={tierList:[]},this.obsTierList=new V.t([]),this.tierList=this.obsTierList.asObservable()}getActiveTiers(e,t){this.executorService.query(this.baseUrl+t+"/tiers/ids","GET",{},null,e).pipe((0,f.T)(r=>r)).subscribe(r=>{this.tierTermStore.tierList=[],r.data.forEach(n=>{this.tierTermStore.tierList.push(new O(n))}),this.obsTierList.next(Object.assign({},this.tierTermStore).tierList)})}sendData(e,t){return this.executorService.query(this.baseUrl+t+"/tiers","PUT",e)}getRateData(e,t){return this.executorService.query(this.baseUrl+t+"/tiers","GET",{},null,e)}getTemplate(e,t){if(!e)return;let r=(new y.Nl).set("rateType",t).set("subProductId",e.id.toString());this.executorService.query("/admin/tier/tierRateUpdate/template","GET",null,null,r,"blob").pipe((0,b.W)(n=>this.handleError(n))).subscribe(n=>{const i=window.URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download="VARIABLE"===t?`${e.name}_${t}_${e.id}.xlsx`:`${e.name}_${t}_${e.id}.csv`,document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(i),console.log("Template exported and downloaded successfully")})}handleError(e){return Promise.reject(e.message||e)}static{this.ctorParameters=()=>[{type:v.n}]}};T=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m._qm)(),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n])],T);class ee{constructor(e,t){this.indexValue=e,this.liborMessage=t}}let I=class{constructor(e){this.executorService=e,this.baseUrl="/admin/tier/products/",this.tierTermStore={dtiFicotierList:[]},this.obsdtiFicoList=new V.t([]),this.dtiFicoList=this.obsdtiFicoList.asObservable()}getDtiFicoTiers(e,t){for(;0!=this.tierTermStore.dtiFicotierList.length;)this.tierTermStore.dtiFicotierList.pop();this.executorService.query(this.baseUrl+t+"/dtificotiers/ids","GET",{},null,e).pipe((0,f.T)(r=>r)).subscribe(r=>{r.data.forEach(n=>{this.tierTermStore.dtiFicotierList.push(new O(n))}),this.obsdtiFicoList.next(Object.assign({},this.tierTermStore).dtiFicotierList)})}sendData(e,t){return this.executorService.query(this.baseUrl+t+"/dtificotiers","PUT",JSON.stringify(e))}getDtiFicoData(e,t){return this.executorService.query(this.baseUrl+t+"/dtificotiers","GET",{},null,e)}static{this.ctorParameters=()=>[{type:v.n}]}};I=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m._qm)(),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n])],I);class te{constructor(){this.tierList=[]}}let k=class{constructor(e){this.executorService=e,this.productList=[],this.selectedTierTermStore={selectedTierList:[],product:""},this.obsSelectedTierList=new V.t([]),this.selectedTierList=this.obsSelectedTierList.asObservable(),this.obsProduct=ne
1w V.t(""),this.product=this.obsProduct.asObservable()}getSelectedTierList(e){for(;0!=this.selectedTierTermStore.selectedTierList.length;)this.selectedTierTermStore.selectedTierList.pop();for(let t=0;t<e.length;t++)this.selectedTierTermStore.selectedTierList.push(new O(Number(e[t].value)));this.obsSelectedTierList.next(Object.assign({},this.selectedTierTermStore).selectedTierList)}updateProduct(e){this.selectedTierTermStore.product=e,this.obsProduct.next(Object.assign({},this.selectedTierTermStore).product)}getProducts(){return this.executorService.query("/products","GET",{}).pipe((0,b.W)(e=>this.handleError(e)))}handleError(e){return Promise.reject(e.message||e)}static{this.ctorParameters=()=>[{type:v.n}]}};k=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m._qm)(),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n])],k);var x=h(1425),A=h(8810);let U=class{constructor(e,t,r,n){this.tierTermService=e,this.dtiFicoService=t,this.commonService=r,this._sharedService=n,this.dtificoList=[],this.dtificoTeirList=[],this.selectedTierList=[],this.rateType="",this.termsList=[],this.tierRates=[],this.marginRates=[],this.err={},this.tierTermSpinner={},this.variableIndexRate=new ee(1,"")}ngOnInit(){this.termsList=[],this.subscriptionIds=[],this.tierRates=[],this.tierTermSpinner={tierMaintenance:!1},this.err={decimal:!1,index:!1,libor:!1,inactive:!1,warning:!1},this.subscriptionIds.push(this.dtiFicoService.dtiFicoList.subscribe(e=>{this.dtificoList=e})),this.subscriptionIds.push(this.commonService.selectedTierList.subscribe(e=>{this.selectedTierList=e})),("FIXED"==this.rateType||"VARIABLE"==this.rateType)&&(this.err.decimal=!1),this.subscribeProduct()}clearWarnings(e){setTimeout(()=>{this.clearErrors()},e)}subscribeProduct(){var e=this;this.subscriptionIds.push(this.commonService.product.subscribe(t=>{t&&(e.productId=t,e.setHeaders())}))}getActiveTiers(){let e=new y.Nl;e=e.set("rateType",this.rateType),this.tierTermService.getActiveTiers(e,this.productId)}getRates(e){let t=new y.Nl;t=t.set("rateType",e),this.tierTermService.getRateData(t,this.productId).pipe((0,b.W)(r=>this.handleError(r)),(0,f.T)(r=>r)).subscribe(r=>{let n=r.data.tierList;this.variableIndexRate.indexValue=r.data.indexValue,this.variableIndexRate.liborMessage=r.data.liborMessage,this.tierRates=this.buildRates(n),this.marginRates=this.buildRates(n,!0)})}setHeaders(){this.commonService.getProducts().pipe((0,f.T)(e=>e)).subscribe(e=>{this.commonService.productList=e;for(var t=0;t<e.length;t++)e[t].id==this.productId&&(this.termsList=e[t].termMonths);this.getActiveTiers(),this.getRates(this.rateType)})}updateTierData(){this.checkTierUsedInDtiFicoTable()?(this.clearErrors(),this.err.invalid=!0,this.clearWarnings(5e3)):(this.tierTermSpinner.tierMaintenance=!0,this.clearErrors(),this.tierTermService.sendData(this.getTierRate(this.tierRates),this.productId).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.tierTermSpinner.tierMaintenance=!1,e&&"SUCCESS"==e.type&&(this.getActiveTiers(),this.getRates(this.rateType))}))}checkTierUsedInDtiFicoTable(){let e=this.tierRates.filter(r=>!r.active).map(r=>r.tierName),t=[];return!!e.length&&(e.forEach(r=>{this.tierRates.findIndex(n=>n.active&&n.tierName===r)<0&&(t=t.concat(this.selectedTierList.filter(n=>n.value===r)))}),t.length>0)}updateVariableRate(e,t,r){let n=parseFloat(e);this.tierRates[r].terms[t].value=parseFloat((Number(n)+Number(this.variableIndexRate.indexValue)).toFixed(2))}updateIndexRate(e){let t=parseFloat(e);for(let r=0;r<this.tierRates.length;r++)for(let n=0;n<this.tierRates[r].terms.length;n++)this.tierRates[r].terms[n].value=parseFloat((Number(this.marginRates[r].terms[n].value)+Number(t)).toFixed(2))}removeItem(){let e=this.findLastActiveTierIndex();this.clearErrors();let t=this.tierRates[e].tierName;for(;0!=this.dtificoTeirList.length;)this.dtificoTeirList.pop();for(var r=0;r<this.dtificoList.length;r++){let i=this.dtificoList[r].value;this.dtificoTeirList.push(i)}if(this.err.inactive=this.isInArray(t,this.dtificoTeirList),this.clearWarnings(5e3),this.err.inactive)"VARIABLE"==this.rateType?window.scrollTo(0,window.innerHeight+400):window.scrollTo(0,window.innerHeight-320);else{var n=this;this._sharedService.showConfirm({message:"Are you sure you want delete T"+t+"?",uid:"MODAL_UW_STATUS",confirmCB:function(i){n.matchTeir(e+1,n.selectedTierList)?(n.err.warning=!0,n.clearWarnings(5e3)):(n.tierRates[e].active=0,"FIXED"!==n.rateType&&(n.marginRates[e].active=0))},cancelCB:function(i){}})}}matchTeir(e,t){for(let r=0;r<t.length;r++)if(t[r].value===e)return!0;return!1}isInArray(e,t){return t.indexOf(e)>-1}buildRates(e,t){let r=[];var n=this;let i,a;for(var s=0;s<e.length;s++){if(!r.length){p(d());continue}let o=this.availableTierLocation(r,e[s].tier);o>=0?(i=u(r[o].terms,e[s].termMonths),a=d(),a&&(r[o].terms[i]?r[o].terms[i]=a:r[o].terms.push(a))):p(d())}return r;function p(o){let g=new L;o&&g.terms.push(o),g.tierName=e[s].tier,g.rateType=e[s].rateType,g.active=e[s].active,r.push(g)}function d(){if(-1==n.termsList.indexOf(e[s].termMonths))return null;let o=new _;o.id=e[s].id,o.termMonth=e[s].termMonths;let g=t?parseFloat((Number(e[s].rate)-Number(n.variableIndexRate.indexValue)).toFixed(2)):e[s].rate.toFixed(2);return o.value=g,o}function u(o,g){let E;for(var F=0;F<o.length;F++)if(o[F].termMonth==g){E=F;break}return E}}availableTierLocation(e,t){for(let n=0;n<e.length;n++)if(e[n].tierName==t)return n;return-1}getTierRate(e){var t=new te,r=[];for(let i of e)if(null!=i.terms&&1==i.uiEnable||0==i.active)for(let a of i.terms){var n=new J;n.tier=i.tierName,n.rateType=i.rateType,n.active=i.active,n.termMonths=a.termMonth,n.id=a.id,n.rate=a.value,r.push(n)}return t.tierList=r,t.indexValue=this.variableIndexRate.indexValue,t.liborMessage=this.variableIndexRate.liborMessage,t}addTier(){var e=this;let t=this.tierRates.filter(r=>r.active).length-1;t=-1==t?1:t+1+1,this._sharedService.showConfirm({message:"Do you want to add T"+t+"?",uid:"MODAL_UW_STATUS",confirmCB:function(r){e.addNewTierData(t)},cancelCB:function(r){}})}addNewTierData(e){let t,r,a,s,n=[],i=[],p=1*this.variableIndexRate.indexValue;p=isNaN(p)?0:p;for(var d=0;d<this.termsList.length;d++)t=new _,t.value=p,t.termMonth=this.termsList[d],r=Object.assign({},t),r.value=0,n.push(t),i.push(r);a=new L,a.tierName=e,a.rateType=this.rateType,a.active=1,a.uiEnable=!0,s=Object.assign({},a),a.terms=n,s.terms=i,this.tierRates.push(a),this.marginRates.push(s)}createRange(e){for(var t=[],r=1;r<=e;r++)t.push(r);return t}findLastActiveTierIndex(){let e=-1;for(var t=this.tierRates.length-1;t>=0;t--)if(this.tierRates[t].active){e=t;break}return e}patternMatch(e,t){switch(e){case"LIBOR":this.err.libor=!/^[a-zA-Z0-9\-\s]+$/.test(t);break;
1case"DECIMAL":this.err.decimal=!1,n(t)&&(this.err.decimal=!0,setTimeout(()=>{window.scrollTo(0,window.innerHeight-400)}));break;case"INDEX":this.err.index=!!n(t)}function n(i){return!/^-?[0-9]{1,2}(\.[0-9]{1,2})?$/.test(i)}}handleError(e){return this.tierTermSpinner.tierMaintenance=!1,(0,A.$)(e||"Server Error")}clearErrors(){this.err.libor=!1,this.err.index=!1,this.err.inactive=!1,this.err.warning=!1,this.err.decimal=!1,this.err.invalid=!1}ngOnDestroy(){for(var e=0;e<this.subscriptionIds.length;e++)this.subscriptionIds[e]&&this.subscriptionIds[e].unsubscribe()}static{this.ctorParameters=()=>[{type:T},{type:I},{type:k},{type:x.d}]}static{this.propDecorators={rateType:[{type:m.pde}]}}};U=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"tier-term",template:'<p style="color:blue;font-weight:bold">TIER-TERM rateType={{rateType}}</p>\r\n<div class="tier-block fixed-tier" *ngIf="rateType === \'FIXED\'">\r\n  <div>\r\n    <div>\r\n      <div class="row">\r\n        <div class="col-lg-12">\r\n          <div class="sub-headings">\r\n            \x3c!--Fixed tier maintenance--\x3e\r\n            <h4>Tier Maintenance</h4>\r\n            <button class="btn dti-edit-btn ms-0" (click)="addTier()">\r\n              Add Tier\r\n            </button>\r\n            <button class="btn dti-edit-btn" (click)="removeItem()" [disabled]="!tierRates.length">\r\n              Delete Last Tier\r\n            </button>\r\n\r\n          </div>\r\n        </div>\r\n      </div>\r\n      <div class="tier-table-container table-responsive">\r\n        <table class="col-12 rate-table">\r\n          <thead>\r\n            <tr>\r\n              <th class="border-cell tier-cell tier-row-data" width="16%"></th>\r\n              <th class="border-cell" [attr.colspan]="termsList.length">\r\n                Term\r\n              </th>\r\n            </tr>\r\n            <tr class="term-columns-header-row">\r\n              <th class="border-cell tier-cell tier-row-data" width="16%">Tier</th>\r\n              <th class="border-cell tier-row-header" *ngFor="let term of termsList">\r\n                {{term}} Months\r\n              </th>\r\n              \x3c!-- <th class="border-cell" colspan="2"></th> --\x3e\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            <ng-container *ngFor="let item of tierRates; let i=index">\r\n              <tr *ngIf="item.active == 1">\r\n                <td class="border-cell position-relative">\r\n                  T{{item.tierName}}\r\n                </td>\r\n                <ng-container *ngFor="let term of item.terms">\r\n                  <td class="border-cell position-relative">\r\n                    <input type="hidden" [(ngModel)]="term.id" name="id" />\r\n                    <div>\r\n                      <input type="text" class="table-cell" [(ngModel)]="term.value" name="termValue" maxlength="5" (blur)="patternMatch(\'DECIMAL\', term.value)" #rate="ngModel" [ngModelOptions]="{standalone: true}" [disabled]="(item.uiEnable != null && item.uiEnable === true)?false:true">\r\n                    </div>\r\n                  </td>\r\n                </ng-container>\r\n              </tr>\r\n            </ng-container>\r\n          </tbody>\r\n        </table>\r\n        <div *ngIf="err.inactive" class=" ra-err-blk status-err-blk text-end">\r\n          Cannot change status as the value is used in the DTI vs FICO range table.\r\n        </div>\r\n        <div *ngIf="err.decimal" class="ra-err-blk tm-err-blk text-end">\r\n          Enter only 2.2 long numeric\r\n        </div>\r\n        <div *ngIf="err.warning" class="ra-err-blk status-err-blk text-end">\r\n          Tier is selected in below table, cannot make it Inactive.\r\n        </div>\r\n        <div *ngIf="err.invalid" class="ra-err-blk status-err-blk text-end">\r\n          Invalid tier is selected in below table.\r\n        </div>\r\n      </div>\r\n      <div class="tier-save-row">\r\n        <button class="btn dti-edit-btn pos-rel" value="save" [disabled]="err.decimal|| err.inactive || err.warning || tierTermSpinner.tierMaintenance" 
1(click)="updateTierData()">\r\n          Save\r\n          <span *ngIf="tierTermSpinner.tierMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw pos-abs cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n\x3c!--Variable Table Margin Maintenance--\x3e\r\n<div class="variable-margin" *ngIf="rateType !== \'FIXED\'">\r\n  <div>\r\n    <div class="row position-relative">\r\n      <div class="col-lg-12">\r\n        <div class="margin-heading sub-headings">\r\n          <h4>Margin Maintenance</h4>\r\n          <div class="libor-index">\r\n            <div class="libor-container position-relative">\r\n              <div *ngIf="err.libor" \r\n              class="ra-err-blk index-err-blk position-absolute cus-left">\r\n                Libor message is not valid\r\n              </div>\r\n              <label *ngIf="variableIndexRate.indexValue == 0.2" for="libor">LIBOR</label>\r\n              <label *ngIf="variableIndexRate.indexValue != 0.2" for="libor">PRIME</label>\r\n              <input type="text" id="index" class="index-box" [(ngModel)]="variableIndexRate.liborMessage" (keyup)="patternMatch(\'LIBOR\', variableIndexRate.liborMessage)" name="liborMessage" placeholder="LIBOR"\r\n                maxlength="35">\r\n            </div>\r\n            <div class="index-container position-relative">\r\n              <div *ngIf="err.index" \r\n              class="ra-err-blk index-err-blk position-absolute">\r\n                Enter only 2.2 long numeric\r\n              </div>\r\n              <label for="index">Index</label>\r\n              <input type="text" id="index" class="index-box" [(ngModel)]="variableIndexRate.indexValue" (keyup)="patternMatch(\'INDEX\', variableIndexRate.indexValue)"\r\n                name="index" placeholder="Index" maxlength="5">\r\n                \x3c!-- (change)="updateIndexRate(variableIndexRate.indexValue)" name="index" placeholder="Index" maxlength="5"> --\x3e\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <form class="w-100" #variableForm="ngForm">\r\n      <div class="">\r\n        <table class="col-sm-12 rate-table">\r\n          <thead>\r\n            <tr>\r\n              <th class="border-cell tier-cell" width="16%"></th>\r\n              <th class="border-cell" [attr.colspan]="termsList.length">Term</th>\r\n            </tr>\r\n            <tr class="term-columns-header-row">\r\n              <th class="border-cell tier-cell" width="16%">Tier</th>\r\n              <th class="border-cell" *ngFor="let term of termsList">\r\n                {{term}} Months\r\n              </th>\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            <ng-container *ngFor="let margin of marginRates; let rowindex = index">\r\n              <tr *ngIf="margin.active == 1">\r\n                <td class="border-cell">\r\n                  T{{margin.tierName}}\r\n                </td>\r\n                <input type="hidden" \r\n                [(ngModel)]="margin.rateType" \r\n                name="rateType" />\r\n                <td class="border-cell position-relative" \r\n                *ngFor="let term of margin.terms; let cellindex = index">\r\n                  <input type="hidden" [(ngModel)]="term.id" name="id" />\r\n                  <div>\r\n                    \x3c!-- ust1171: update the rate through template --\x3e\r\n                    <input type="text" class=" table-cell" [(ngModel)]="term.value" #value="ngModel" maxlength="5" (blur)="patternMatch(\'DECIMAL\', term.value)"\r\n                      (change)="updateVariableRate(term.value, cellindex, rowindex)" [ngModelOptions]="{standalone: true}" disabled></div>\r\n                </td>\r\n              </tr>\r\n            </ng-container>\r\n          </tbody>\r\n        </table>\r\n      </div>\r\n    </form>\r\n    <div *ngIf="err.decimal" \r\n    class="ra-err-blk mm-err-blk position-absolute">\r\n      Enter only 2.2 long numeric\r\n    </div>\r\n  </div>\r\n</div>\r\n<div class="tier-block variable-tier" *ngIf="rateType !== \'FIXED\'">\r\n  <div class="row">\r\n    <div class="col-lg-12">\r\n      <div class="row">\r\n        <div class="col-lg-12">\r\n          <div class="sub-headings">\r\n            <h4>Tier Maintenance</h4>\r\n            <button class="btn dti-edit-btn ms-0" (click)="addTier()">\r\n              Add Tier\r\n            </button>\r\n            <button class="btn dti-edit-btn" (click)="removeItem()" [disabled]="!tierRates.length">\r\n              Delete Last Tier\r\n            </button>\r\n          </div>\r\n        </div>\r\n      </div>\r\n      <div class="">\r\n        <table class="col-sm-12 rate-table">\r\n          <thead>\r\n            <tr>\r\n              <th class="border-cell tier-cell" width="16%"></th>\r\n              <th class="border-cell" [attr.colspan]="termsList.length">Term</th>\r\n            </tr>\r\n            <tr class="term-columns-header-row">\r\n              <th class="border-cell tier-cell" width="16%">Tier</th>\r\n              <th class="border-cell" *ngFor="let term of termsList">\r\n                {{term}} Months\r\n              </th>\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            <ng-container *ngFor="let item of tierRates; let i = index">\r\n              <tr *ngIf="item.active == 1">\r\n                <td class="border-cell">\r\n                  T{{item.tierName}}\r\n                </td>\r\n                <input type="hidden" [(ngModel)]="item.rateType" name="rateType" />\r\n                <td *ngFor="let term of item.terms" class="border-cell position-relative">\r\n                  <input type="hidden" [(ngModel)]="term.id" name="id" />\r\n                  <div>\r\n                    <input type="text" class="table-cell" [(ngModel)]="term.value" (blur)="patternMatch(\'DECIMAL\', term.value)" #rate="ngModel" [ngModelOptions]="{standalone: true}" [disabled]="(item.uiEnable != null && item.uiEnable === true)?false:true">\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </ng-container>\r\n          </tbody>\r\n        </table>\r\n        <div *ngIf="err.inactive" class="ra-err-blk status-err-blk text-end">\r\n          Cannot change status as the value is used in the DTI vs FICO range table.\r\n        </div>\r\n        <div *ngIf="err.warning" class="ra-err-blk status-err-blk text-end">\r\n          Tier is selected in below table, cannot make it Inactive.\r\n        </div>\r\n        <div *ngIf="err.invalid" class="ra-err-blk status-err-blk text-end">\r\n          Invalid tier is selected in below table.\r\n        </div>\r\n      </div>\r\n      <div class="tier-save-row">\r\n        <button class="btn dti-edit-btn position-relative" value="save" [disabled]="err.decimal || err.index || err.libor || err.warning || tierTermSpinner.tierMaintenance" 
1(click)="updateTierData()">\r\n          Save\r\n          <span *ngIf="tierTermSpinner.tierMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n',standalone:!1,styles:[ge()]}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[T,I,k,x.d])],U);var Te=h(8551),Ie=h.n(Te),re=h(6144),B=h(4986);class R{constructor(e,t,r){this.min=e,this.max=t,this.id=r}}class ne{}class N{constructor(){this.rowcells=[],this.active=!0}}class C{}class ie{constructor(e,t,r){this.min=e,this.max=t,this.index=r}}let z=class{constructor(e,t,r,n){this.tierTermService=e,this.dtiFicoService=t,this.router=r,this.commonService=n,this.selectedRateTier=[],this.rateType="",this.tiersList=[],this.dtiFicoSpinner={},this.rangeList=[],this.err={},this.dtiRanges=[],this.opendti=!1,this.openfico=!1,this.openeditdti=!1,this.openeditfico=!1,this.opendelfico=!1,this.opendeldti=!1,this.range=new ie(0,0,0)}ngOnInit(){this.dtiFicoSpinner={rangeMaintenance:!1},this.subscriptionIds=[],this.rangeList=[],this.err={dti:{range:!1,rangeValidate:!1,edit:!1,modify:!1},fico:{range:!1,rangeValidate:!1,edit:!1,modify:!1},highFicoRange:!1},this.subscriptionIds.push(this.tierTermService.tierList.subscribe(e=>{this.tiersList=e})),this.subscribeProduct()}subscribeProduct(){var e=this;this.subscriptionIds.push(this.commonService.product.subscribe(t=>{t&&(e.productId=t,e.getBindedTierList(),e.getDtiFicoData(this.rateType))}))}getDtiFicoData(e){let t=new y.Nl;t=t.set("rateType",this.rateType),this.dtiFicoService.getDtiFicoData(t,this.productId).pipe((0,b.W)(r=>this.handleError(r)),(0,f.T)(r=>r)).subscribe(r=>{this.dtiRanges=this.buildData(r.data),this.setHeaders(this.getDtiFico(this.dtiRanges))})}setHeaders(e){for(;this.rangeList.length>0;)this.rangeList.pop();for(let n=0;n<e.length;n++)0==e[n].active&&(e.splice(n,1),n-=1);for(var t=new re.NZ,r=0;r<e.length;r++)t.add(e[r].ficoMin+"-"+e[r].ficoMax);for(let n of t.toArray())this.rangeList.push(n)}adddtiRange(){this.range=new R(0,0,0),this.opendti=!0}addficoRange(){this.range=new R(0,0,0),this.openfico=!0}getBindedTierList(){let e=new y.Nl;e=e.set("rateType",this.rateType),this.dtiFicoService.getDtiFicoTiers(e,this.productId)}submit(){this.dtiFicoSpinner.rangeMaintenance=!0,this.dtiFicoService.sendData(this.getDtiFico(this.dtiRanges),this.productId).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.dtiFicoSpinner.rangeMaintenance=!1,this.updateBindedTiers(e)})}updateBindedTiers(e){e&&"SUCCESS"==e.type&&(this.getBindedTierList(),this.getDtiFicoData(this.rateType))}buildData(e){let t=[];for(var r=0;r<e.length;r++){let a,n=new C,i=new N;if(n.id=e[r].id,n.value=e[r].tier,n.ficoMax=e[r].ficoMax,n.ficoMin=e[r].ficoMin,n.active=e[r].active,n.columnArrayCell=r,i.rowcells.push(n),i.dtiMax=e[r].dtiMax,i.dtiMin=e[r].dtiMin,i.rateType=e[r].rateType,i.rowArrayCell=r,t.length<=0)t.push(i);else if(a=this.availableTierLocation(t,e[r].dtiMin,e[r].dtiMax),a>-1){let s=t[a].rowcells,p=!1;for(let d=0;d<s.length;d++)if(s[d].ficoMax==n.ficoMax&&s[d].ficoMin==n.ficoMin){p=!0;break}p||s.push(n)}else t.push(i)}return t}availableTierLocation(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];if(a.dtiMin==t&&a.dtiMax==r)return i}return-1}getDtiFico(e){let t=[];for(let r of e)if(r.rowcells)for(let n of r.rowcells){let i=new ne;i.id=n.id,i.dtiMax=r.dtiMax,i.dtiMin=r.dtiMin,i.active=n.active,i.ficoMax=n.ficoMax,i.ficoMin=n.ficoMin,i.rateType=r.rateType,i.tier=n.value,t.push(i)}return t}makeInactive(e,t){for(let r=0;r<e.length;r++)e[r].rowcells[t].active=0}createRange(e){for(var t=[],r=1;r<=e;r++)t.push(r);return t}deleteFico(e,t,r){let n;for(let i=0;i<this.dtiRanges.length;i++)if(this.dtiRanges[i].active){n=0;for(let a=0;a<this.dtiRanges[i].rowcells.length;a++)this.dtiRanges[i].rowcells[a].active&&(n+=1)}this.opendelfico=!0,r.index=e,r.range=t,r.canDelete=1!=n}deleteFicoRange(e){let t=e.index,r=e.range.split("-");for(this.range.min=r[0],this.range.max=r[1];
1this.dtiRanges[0].rowcells[t].ficoMax!=this.range.max;)t+=1;this.makeInactive(this.dtiRanges,t),this.rangeList.splice(e.index,1),this.opendelfico=!1,this.getRateTierSelected()}editFico(e,t,r){let n=e.split("-"),i=n[0],a=n[1];r.min=i,r.max=a,r.editMax=a,r.index=t,this.range=new R(1*i,1*a,0),this.openeditfico=!0}editFicoRange(e,t){let r=1*e.min,n=1*e.max;r>n?this.err.fico.rangeValidate=!0:(this.err.fico.rangeValidate=!1,this.editFicoRangeMidCombinationCheck(e,{maxValue:t.editMax,index:t.index})?this.err.fico.edit=!0:(this.err.fico.edit=!1,this.editFicoColumn(r,n,{maxValue:t.editMax,index:t.index}),this.setHeaders(this.getDtiFico(this.dtiRanges)),t.editMax=0,this.openeditfico=!0))}editFicoRangeMidCombinationCheck(e,t){var r=this;let n,i=!!function a(p){let d=0;for(let o=t.index-1;o>=0;o--)if(r.dtiRanges[0].rowcells[o].active){d=r.dtiRanges[0].rowcells[o].ficoMax;break}return p>=850||d>=p}(1*e.min);return n=t.index+1!=this.dtiRanges[0].rowcells.length&&!!function s(p){let d=0,u=r.dtiRanges[0].rowcells.length;for(let o=t.index+1;o<u;o++)if(r.dtiRanges[0].rowcells[o].active&&r.dtiRanges[0].rowcells[o].ficoMax!=t.maxValue){d=Number(r.dtiRanges[0].rowcells[o].ficoMin);break}return 0!=d&&p>=d}(1*e.max),i||n}editFicoColumn(e,t,r){let n=r.index;for(;this.dtiRanges[0].rowcells[n].ficoMax!=r.maxValue;)n+=1;for(let i=0;i<this.dtiRanges.length;i++)this.dtiRanges[i].rowcells[n].active&&(this.dtiRanges[i].rowcells[n].ficoMin=e,this.dtiRanges[i].rowcells[n].ficoMax=t)}addFicoNumericMatch(e){this.verifyLastMaxFicoRange(e.min),this.err.fico.range=!!this.addFicoCombineNumericCheck(e),this.err.highFicoRange=!!this.addFicoCombineHigherRangeCheck(e)}verifyLastMaxFicoRange(e){let t=this.getLastMaxFicoRange();this.err.fico.modify=t>e}getLastMaxFicoRange(){let e=0;if(this.dtiRanges.length&&this.dtiRanges[0].rowcells){for(let r=this.dtiRanges[0].rowcells.length;r>0;r--)if(this.dtiRanges[0].rowcells[r-1].active){e=this.dtiRanges[0].rowcells[r-1].ficoMax;break}}return e}addFicoCombineNumericCheck(e){let t=!1;return""!=e.max&&(t=!!this.ficoNumericMatch(e.max)),!(!t&&!this.ficoNumericMatch(e.min))}editDtiNumericMatch(e){this.err.dti.range=!!this.dtiCombineNumericCheck(e)}dtiCombineNumericCheck(e){return!!this.dtiDecimalMatch(e.max)||!!this.dtiDecimalMatch(e.min)}dtiDecimalMatch(e){return!/^-?[0-9]{1,2}(\.[0-9]{1,2})?$/.test(e)}addFicoCombineHigherRangeCheck(e){let t,r;return(0!=e.max||""!=e.max)&&(t=e.max>850),r=e.min>849,t||r}editFicoNumericMatch(e){this.err.fico.range=!!this.ficoEditCombineNumericCheck(e),this.err.highFicoRange=!!this.addFicoCombineHigherRangeCheck(e)}ficoEditCombineNumericCheck(e){return!!this.ficoNumericMatch(e.max)||!!this.ficoNumericMatch(e.min)}ficoNumericMatch(e){return!/^[0-9]{1,4}?$/.test(e)}addNewDtiRange(e,t,r){let n=this.rangeValidation(1*e.min,1*e.max,!0);if(this.err.dti.rangeValidate=!1,n)this.err.dti.rangeValidate=!0;else{let i;if(this.dtiRanges.length>0){let a;for(let s=0;s<this.dtiRanges.length;s++)if(this.dtiRanges[s].active){a=s;break}i=this.createNewDTIRow(e,a)}else i=this.createNewDTIRow(e,0),this.openfico=!0;this.dtiRanges.push(i),this.opendti=!1}}createNewDTIRow(e,t){let i,r=new N,n=[];this.dtiRanges.length&&(n=this.dtiRanges[t].rowcells),r.dtiMax=1*e.max,r.dtiMin=1*e.min,r.rateType=this.rateType;for(let a=0;a<n.length;a++)i=new C,e.id>0&&(i.id=e.id),i.ficoMax=n[a].ficoMax,i.ficoMin=n[a].ficoMin,i.value=1,i.active=this.dtiRanges[t].rowcells[a].active?1:0,r.rowcells.push(i);return r}addNewFicoRange(e,t){1*e.max||(e.max=850),this.err.fico.rangeValidate=!1,this.rangeValidation(1*e.min,1*e.max)?this.err.fico.rangeValidate=!0:(this.err.fico.rangeValidate=!1,this.dtiRanges.length>0&&this.createNewFicoColumn(e),this.setHeaders(this.getDtiFico(this.dtiRanges)),this.openfico=!0,this.range=new R(0,0,0))}createNewFicoColumn(e){for(let t=0;t<this.dtiRanges.length;t++){let r=new C;e.id>0&&(r.id=e.id),r.value=1,r.ficoMax=e.max,r.ficoMin=e.min,r.active=this.dtiRanges[t].active?1:0,this.dtiRanges[t].rowcells.push(r)}}rangeValidation(e,t,r){if(e>=t)return!0;{let d,n=[],i=[],a=r?this.dtiRanges:this.dtiRanges[0].rowcells,s="ficoMin",p="ficoMax";r&&(s="dtiMin",p="dtiMax");for(let u=0;u<a.length;u++)d=r?this.dtiRanges[u].rowcells[0].active:this.dtiRanges[0].rowcells[u].active,d&&(n.push(a[u][s]),i.push(a[u][p]));return this.rangeCompare(i,n,e,t)}}deleteDti(e,t){t.index=e;let r=0;for(let n=0;n<this.dtiRanges.length;n++)this.dtiRanges[n].active&&(r+=1);t.canDelete=1!=r,this.opendeldti=!0}
1deleteDtiModel(e){let t=e.index,r=this.dtiRanges[t].rowcells.length;for(let n=0;n<r;n++)this.dtiRanges[t].rowcells[n].active=0;this.dtiRanges[t].active=!1,this.opendeldti=!1,this.getRateTierSelected()}editDti(e,t,r,n){n.min=e,n.max=t,n.editMax=t,n.index=r,this.range=new R(e,t,0),this.openeditdti=!0}editDtiRange(e,t){1*e.min>=1*e.max?this.err.dti.rangeValidate=!0:(this.err.dti.rangeValidate=!1,this.editDtiRangeMidCombinationCheck(e,{index:t.index,maxValue:t.editMax})?this.err.dti.edit=!0:(this.err.dti.edit=!1,this.editDtiColumn(1*e.min,1*e.max,{index:t.index,maxValue:t.editMax}),t.editMax=0,this.openeditdti=!1))}editDtiRangeMidCombinationCheck(e,t){var r=this;let n=function a(){let p=0;for(let d=t.index-1;d>=0;d--)if(r.dtiRanges[d].active){p=r.dtiRanges[d].dtiMax;break}return p}()>=1*e.min,i=t.index+1!=this.dtiRanges.length&&!!function s(p){let d=0,u=r.dtiRanges.length;for(let o=t.index+1;o<u;o++)if(r.dtiRanges[o].active&&r.dtiRanges[o].dtiMax!=t.maxValue){d=Number(r.dtiRanges[o].dtiMin);break}return 0!=d&&p>=d}(1*e.max);return n||i}editDtiColumn(e,t,r){let n=r.index;for(;this.dtiRanges[n].dtiMax!=r.maxValue;)n+=1;this.dtiRanges[n].active&&(this.dtiRanges[n].dtiMin=e,this.dtiRanges[n].dtiMax=t)}addDtiNumericMatch(e){this.verifyLastMaxDTIRange(e.min),this.err.dti.range=!!this.dtiCombineNumericCheck(e)}verifyLastMaxDTIRange(e){let t=this.getLastMaxDtiRange();this.err.dti.modify=t>=e}getLastMaxDtiRange(){let e;e=this.dtiRanges.length;let t=0;for(let r=e;r>0;r--)if(this.dtiRanges[r-1].rowcells[0].active){t=this.dtiRanges[r-1].dtiMax;break}return t}rangeCompare(e,t,r,n){let i=[];for(let a=0;a<t.length;a++)i.push(n>=t[a]&&n<=e[a]),i.push(r>=t[a]&&r<=e[a]);return-1!=i.indexOf(!0)}getRateTierSelected(){this.commonService.getSelectedTierList(this.getSelectedTierList())}getSelectedTierList(){for(;0!=this.selectedRateTier.length;)this.selectedRateTier.pop();for(let e=0;e<this.dtiRanges.length;e++)if(this.dtiRanges[e].active)for(let t=0;t<this.dtiRanges[e].rowcells.length;t++)if(this.dtiRanges[e].rowcells[t].active){let r=this.dtiRanges[e].rowcells[t].value;this.selectedRateTier.push(new O(r))}return this.selectedRateTier}actionOnClose(){this.err={dti:{range:!1,rangeValidate:!1,edit:!1,modify:!1},fico:{range:!1,rangeValidate:!1,modify:!1,edit:!1}},this.range=new R(0,0,0),this.err.highFicoRange=!1}clearErrors(){this.err.dti.rangeValidate=!1,this.err.dti.edit=!1,this.err.fico.rangeValidate=!1,this.err.fico.edit=!1}handleError(e){return this.dtiFicoSpinner.rangeMaintenance=!1,(0,A.$)(e||"Server Error")}ngOnDestroy(){for(var e=0;e<this.subscriptionIds.length;e++)this.subscriptionIds[e]&&this.subscriptionIds[e].unsubscribe()}static{this.ctorParameters=()=>[{type:T},{type:I},{type:B.Ix},{type:k}]}static{this.propDecorators={rateType:[{type:m.pde}]}}};z=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"dti-fico",template:'<div class="dti-wrap" \r\n*ngIf="rateType === \'FIXED\'">\r\n  <div>\r\n    <div class="row">\r\n      <div class="col-lg-12">\r\n        <div class="sub-headings">\r\n          <h4>DTI / FICO Range Maintenance </h4>\r\n          <button class="btn dti-edit-btn ml-0" \r\n          (click)="adddtiRange()"\r\n          [disabled]="!tiersList.length"\r\n          style="display: none;">\r\n            Add DTI Range\r\n          </button>\r\n          <button class="btn dti-edit-btn" \r\n          (click)="addficoRange()"\r\n          [disabled]="!dtiRanges.length"\r\n          style="display: none;">\r\n            Add Fico Range\r\n          </button>\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <div class="dti-table-container table-responsive">\r\n      <table class="col-12 rate-table ra-rate-table padded-cell">\r\n        <thead>\r\n          <tr>\r\n            <th class="border-cell header-cell" \r\n            rowspan="2" width="16%">\r\n              DTI Range\r\n            </th>\r\n            <th class="border-cell header-cell" \r\n            [attr.colspan]="rangeList.length">\r\n              FICO Range\r\n            </th>\r\n          </tr>\r\n          <tr>\r\n            <th class="border-cell padded-cell" \r\n            *ngFor="let range of rangeList; let rowindex = index">
1\r\n              <span class="edit-icon" style="display: none;"\r\n              (click)="editFico(range, rowindex, editFicoModel)">\r\n              </span>\r\n              <span class="delete-icon" style="display: none;"\r\n              (click)="deleteFico(rowindex, range, ficoDeleteConfirmation)">\r\n              </span>\r\n              <span class="range-one-start">{{range}}</span>\r\n            </th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          <tr *ngFor="let range of dtiRanges; let rowindex = index">\r\n            <td class="border-cell padded-cell" \r\n            [hidden]="!range.active">\r\n              <div>\r\n                <span class="edit-icon" style="display: none;"\r\n                (click)="editDti(range.dtiMin, range.dtiMax, rowindex, editDtiModel)">\r\n                </span>\r\n                <span class="delete-icon" style="display: none;"\r\n                (click)="deleteDti(rowindex, dtiDeleteConfirmation)">\r\n                </span>\r\n                <span class="dti-range-one-start">\r\n                  {{range.dtiMin}}\r\n                  </span> - \r\n                  <span class="dti-range-one-end">\r\n                    {{range.dtiMax}}\r\n                  </span>\r\n              </div>\r\n            </td>\r\n            <ng-container *ngFor="let rowcell of range.rowcells; let ind = index;">\r\n              <td class="border-cell padded-cell"\r\n              [hidden]="rowcell.active==0">\r\n                <select style="display: none;"\r\n                [(ngModel)]="rowcell.value" \r\n                name="value" \r\n                (change)="getRateTierSelected($event.target.value)">\r\n                  <option *ngFor="let cell of tiersList" \r\n                  value="{{cell.value}}" \r\n                  [hidden]="!cell.active" >\r\n                    T{{cell.value}}\r\n                  </option>\r\n                </select>\r\n                T{{rowcell.value}}\r\n              </td>\r\n            </ng-container>\r\n            <ng-container *ngIf="range.rowcells && (range.rowcells.length < rangeList.length)">\r\n              <td *ngFor="let x of createRange(rangeList.length - range.rowcells.length)"\r\n              class="border-cell padded-cell">\r\n                -\r\n              </td>\r\n            </ng-container>\r\n          </tr>\r\n        </tbody>\r\n      </table>\r\n    </div>\r\n    <div class="row" style="display: none;">\r\n      <div class="col-sm-12">\r\n        <button class="btn button-new-css tier-save-btn position-relative" value="save" [disabled]="dtiFicoSpinner.rangeMaintenance"  (click)="submit()">\r\n          Save\r\n          <span *ngIf="dtiFicoSpinner.rangeMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>      \r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n\x3c!--Variable Table --\x3e\r\n<div class="dti-wrap" \r\n*ngIf="rateType !== \'FIXED\'">\r\n  <div>\r\n    <div class="row">\r\n      <div class="col-lg-12">\r\n        <div class="sub-headings">\r\n          <h4>DTI / FICO Range Maintenance</h4>\r\n          <button class="btn dti-edit-btn ms-0" \r\n          (click)="adddtiRange()"\r\n          [disabled]="!tiersList.length"\r\n          style="display: none;">\r\n            Add DTI Range</button>\r\n          <button class="btn dti-edit-btn" \r\n          (click)="addficoRange()"\r\n          [disabled]="!dtiRanges.length"\r\n          style="display: none;">\r\n            Add Fico Range\r\n          </button>\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <div class="dti-table-container table-responsive">\r\n      <table class="col-12 rate-table ra-rate-table padded-cell">\r\n        <thead>\r\n          <tr>\r\n            <th class="border-cell header-cell" \r\n            rowspan="2" width="16%">\r\n              DTI Range\r\n            </th>\r\n            <th class="border-cell header-cell" \r\n            [attr.colspan]="rangeList.length">\r\n              FICO Range\r\n            </th>\r\n          </tr>\r\n          <tr>\r\n            <th class="border-cell padded-cell" \r\n            *ngFor="let range of rangeList; let rowindex = index">
1\r\n              <span class="edit-icon" style="display: none;"\r\n              (click)="editFico(range, rowindex, editFicoModel)">\r\n              </span>\r\n              <span class="delete-icon" style="display: none;"\r\n              (click)="deleteFico(rowindex, range, ficoDeleteConfirmation)">\r\n              </span>\r\n              <span class="range-one-start">\r\n                {{range}}\r\n              </span>\r\n            </th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          <tr *ngFor="let range of dtiRanges; let rowindex = index">\r\n            <td class="border-cell padded-cell" \r\n            [hidden]="!range.active">\r\n              <div>\r\n                <span class="edit-icon" style="display: none;"\r\n                (click)="editDti(range.dtiMin, range.dtiMax, rowindex, editDtiModel)">\r\n                </span>\r\n                <span class="delete-icon" style="display: none;"\r\n                (click)="deleteDti(rowindex, dtiDeleteConfirmation)">\r\n                </span>\r\n                <span class="dti-range-one-start">\r\n                  {{range.dtiMin}}\r\n                </span> - \r\n                <span class="dti-range-one-end">\r\n                  {{range.dtiMax}}\r\n                </span>\r\n              </div>\r\n            </td>\r\n            <ng-container *ngFor="let rowcell of range.rowcells;">\r\n              <td class="border-cell padded-cell" \r\n              [hidden]="rowcell.active==0">\r\n                <select [(ngModel)]="rowcell.value" style="display: none;"\r\n                name="value" \r\n                (change)="getRateTierSelected($event.target.value)">\r\n                  <option *ngFor="let cell of tiersList" \r\n                  value="{{cell.value}}" \r\n                  [hidden]="!cell.active" >\r\n                    T{{cell.value}}\r\n                  </option>\r\n                </select>\r\n                T{{rowcell.value}}\r\n              </td>\r\n            </ng-container>\r\n            <ng-container *ngIf="range.rowcells && (range.rowcells.length < rangeList.length)">\r\n              <td *ngFor="let x of createRange(rangeList.length - range.rowcells.length)"\r\n              class="border-cell padded-cell">\r\n                -\r\n              </td>\r\n            </ng-container>\r\n          </tr>\r\n        </tbody>\r\n      </table>\r\n    </div>\r\n    <div class="row" style="display: none;">\r\n      <div class="col-sm-12">\r\n        <button class="btn button-new-css tier-save-btn position-relative" value="save"  [disabled]="dtiFicoSpinner.rangeMaintenance" (click)="submit()">\r\n          Save\r\n          <span *ngIf="dtiFicoSpinner.rangeMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n\x3c!--Popup Models --\x3e\r\n\x3c!--ADD DTI RANGE Models --\x3e\r\n<p-dialog header="Add DTI Range" [(visible)]="opendti" [draggable]= false [closeOnEscape]= true [dismissableMask]= true (onHide)="actionOnClose()" closeIcon="rate-modal-close" [closable]= true class="rate-modal" [modal]=true  position="top" #addDtiModel>\r\n  <div class="modal-body">\r\n  <form #addDtiRangeForm="ngForm" class="form-inline">\r\n    <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.dti.range && !err.dti.modify" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 2.2 character long numeric\r\n            </div>\r\n            <div *ngIf="err.dti.modify && !err.dti.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous DTI column.\r\n            </div>\r\n            <div *ngIf="err.dti.modify && err.dti.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous DTI column and Please enter 2.2 character long numeric\r\n            </div>\r\n            <div *ngIf="err.dti.rangeValidate" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <input type="hidden" [(ngModel)]="range.id" name="id">\r\n            <div class="row">\r\n            <div class="col-md-3 offset-md-3">\r\n              <div class="mb-3">
1\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="addDtiNumericMatch(range)"\r\n                 maxlength="5" \r\n                 [(ngModel)]="range.min" \r\n                 maxlength="5" \r\n                 name="min" placeholder="Min" \r\n                 #min="ngModel">\r\n              </div>\r\n            </div>\r\n            <div class="col-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="addDtiNumericMatch(range)"\r\n                maxlength="5" \r\n                [(ngModel)]="range.max" \r\n                maxlength="5" name="max" \r\n                placeholder="Max" #max="ngModel">\r\n              </div>\r\n            </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n    </form>\r\n  </div>\r\n  <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" \r\n    type="button" \r\n    [disabled]="err.dti.range||\r\n    err.dti.modify" \r\n    (click)="addNewDtiRange(addDtiRangeForm.value, addDtiModel, (!dtiRanges.length ? addFicoModel : null))">\r\n      Submit\r\n    </button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--EDIT DTI RANGE MODEL--\x3e\r\n<p-dialog header="Edit DTI Range" [(visible)]="openeditdti" [draggable]= false [closeOnEscape]= true [dismissableMask]= true closeIcon="rate-modal-close" (onHide)="actionOnClose()" [closable]= true class="rate-modal" [modal]=true  position="top" #editDtiModel >\r\n  <div class="modal-body">\r\n    <form #editDtiRangeForm="ngForm" \r\n    class="form-inline">\r\n      <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.dti.range" \r\n            class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 2.2 character long numeric\r\n            </div>\r\n            <div *ngIf="err.dti.edit" \r\n            class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Range is not acceptable.Please don\'t overlap with last and next range.\r\n            </div>\r\n            <div *ngIf="err.dti.rangeValidate" \r\n            class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <input type="hidden" [(ngModel)]="range.id" name="id">\r\n          <div class="row">\r\n            <div class="col-md-3 offset-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" class="form-control b-input-box" \r\n                id="fname" (blur)="clearErrors()" \r\n                (change)="editDtiNumericMatch(range)"\r\n                  [(ngModel)]="range.min" \r\n                  maxlength="5" name="min" \r\n                  placeholder="Min">\r\n              </div>\r\n            </div>\r\n            <div class="col-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" class="form-control b-input-box" \r\n                id="fname" \r\n                (blur)="clearErrors()" \r\n                (change)="editDtiNumericMatch(range)"\r\n                [(ngModel)]="range.max" maxlength="5" name="max" \r\n                placeholder="Max">\r\n              </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </form>\r\n    </div>\r\n    <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" type="button" \r\n    [disabled]="err.dti.range" \r\n    (click)="editDtiRange(editDtiRangeForm.value, editDtiModel)">Submit</button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--ADD FICO RANGE Models --\x3e\r\n<p-dialog header="Add FICO Range" [(visible)]="openfico" [draggable]= fal
1se (onHide)="actionOnClose()" closeIcon="rate-modal-close" [closeOnEscape]= "(dtiRanges.length == 1 && \r\n!(dtiRanges[0].rowcells && dtiRanges[0].rowcells.length)) ? false : true" [closable]= "(dtiRanges.length == 1 && \r\n!(dtiRanges[0].rowcells && dtiRanges[0].rowcells.length)) ? false : true" class="rate-modal" [modal]=true  position="top">\r\n<div class="modal-body">\r\n    <form #addficoRangeForm="ngForm" class="form-inline">\r\n      <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.highFicoRange && !err.fico.range && !err.fico.modify" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Min value cannot start at 850 and Max value cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.range && !err.fico.modify && !err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric.\r\n            </div>\r\n            <div *ngIf="err.fico.modify && !err.fico.range && !err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous FICO column.\r\n            </div>\r\n            <div *ngIf="err.fico.modify && err.fico.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous FICO column & Please enter 4 character long numeric.\r\n            </div>\r\n            <div *ngIf="err.fico.modify && err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous FICO column & cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.range && err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric & cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.rangeValidate" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <input type="hidden" \r\n            [(ngModel)]="range.id" \r\n            name="id">\r\n            <div class="row">\r\n            <div class="col-md-3 offset-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="addFicoNumericMatch(range)"\r\n                [(ngModel)]="range.min" \r\n                maxlength="4" name="min" \r\n                placeholder="Min">\r\n              </div>\r\n            </div>\r\n            <div class="col-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" class="form-control b-input-box" \r\n                id="fname" \r\n                [(ngModel)]="range.max" \r\n                (blur)="addFicoNumericMatch(range)"\r\n                name="max" maxlength="4" placeholder="Max">\r\n              </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </form>\r\n    </div>\r\n    <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" \r\n    type="button" \r\n    [disabled]="err.fico.range||\r\n    err.fico.modify||\r\n    err.highFicoRange"\r\n    (click)="addNewFicoRange(addficoRangeForm.value, addFicoModel)">Submit</button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--EDIT FICO RANGE MODEL--\x3e\r\n<p-dialog header="Edit FICO Range" [(visible)]="openeditfico" [draggable]= false [closeOnEscape]= true (onHide)="actionOnClose()" [dismissableMask]= true [closable]= true closeIcon="rate-modal-close" class="rate-modal" [modal]=true  position="top" #editFicoModel>\r\n  <div class="modal-body">\r\n    <form #editFicoRangeForm="ngForm" \r\n    class="form-inline">\r\n      <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.fico.edit" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Range is not acceptable. Please don\'t overlap with last and next range.\r\n            </div>\r\n            <div *ngIf="err.fico.rangeValidate" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <div *ngIf="err.highFicoRange && !err.fico.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Min value cannot start at 850 and Max value cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.range  && !err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric.\r\n            </div>\r\n            <div *ngIf="err.fico.range && err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric & cannot exceed 850.\r\n            </div>\r\n            <input type="hidden" [(ngModel)]="range.id" name="id">\r\n            <div class="row">\r\n            <div class="col-lg-3 offset-md-3">\r\n              <div class="mb-3">
1\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="editFicoNumericMatch(range)"\r\n                maxlength="4" \r\n                [(ngModel)]="range.min" \r\n                name="min" placeholder="Min">\r\n              </div>\r\n            </div>\r\n            <div class="col-lg-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="editFicoNumericMatch(range)"\r\n                maxlength="4" \r\n                [(ngModel)]="range.max" \r\n                name="max" placeholder="Max">\r\n              </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </form>\r\n    </div>\r\n    <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" \r\n    type="button" \r\n    [disabled]="err.fico.range|| err.highFicoRange" \r\n    (click)="editFicoRange(editFicoRangeForm.value, editFicoModel)">\r\n      Submit\r\n    </button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--FICO DELETE CONFIRMATION MODEL--\x3e\r\n<p-dialog  [(visible)]="opendelfico" [draggable]= false [closeOnEscape]= true (onHide)="actionOnClose()" [dismissableMask]= true closeIcon="rate-modal-close" [closable]= true class="rate-modal delete-modal" [modal]=true  position="top" #ficoDeleteConfirmation>\r\n  <p-header>\r\n    Are you sure want to delete. \r\n</p-header> \r\n<p>Please ensure that you save changes before exiting the Rate Maintenance page</p>\r\n    <div *ngIf="!ficoDeleteConfirmation.canDelete" class="ra-err-blk position-absolute email-pop-error-txt">\r\n      You cannot delete last FICO range. You can edit only.\r\n    </div>\r\n    <p-footer>\r\n    <div class="text-center modal-body">\r\n      <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n      type="button"\r\n      [disabled]="!ficoDeleteConfirmation.canDelete"\r\n      (click)="deleteFicoRange(ficoDeleteConfirmation)">Yes</button>\r\n      <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n      type="button" \r\n      (click)="ficoDeleteConfirmation.close()">No</button>\r\n    </div>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n  \x3c!--DTI DELETE CONFIRMATION MODEL--\x3e\r\n  <p-dialog  [(visible)]="opendeldti" [draggable]= false [closeOnEscape]= true (onHide)="actionOnClose()" [dismissableMask]= true closeIcon="rate-modal-close" [closable]= true class="rate-modal delete-modal"  [modal]=true  position="top" #dtiDeleteConfirmation>\r\n    <p-header>\r\n      Are you sure want to delete. \r\n  </p-header> \r\n    <p>Please ensure that you save changes before exiting the Rate Maintenance page</p>\r\n      <div *ngIf="!dtiDeleteConfirmation.canDelete" class="ra-err-blk position-absolute email-pop-error-txt">\r\n        You cannot delete last DTI range. You can edit only.\r\n      </div>\r\n      <p-footer>\r\n      <div class="text-center modal-body">\r\n        <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n        type="button" \r\n        [disabled]="!dtiDeleteConfirmation.canDelete"\r\n        (click)="deleteDtiModel(dtiDeleteConfirmation)">Yes</button>\r\n        <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n        type="button" \r\n        (click)="dtiDeleteConfirmation.close()">No</button>\r\n      </div>\r\n    </p-footer>\r\n  </p-dialog>',standalone:!1,styles:[Ie()]}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[T,I,B.Ix,k])],z);let ae=class{static{this.propDecorators={value:[{type:m.pde}]}}};ae=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"column",template:"",standalone:!1})],ae);var De=h(6227),_e=h.n(De),Le=h(5312);let P=class{constructor(e,t){this.executorService=e,this.router=t,this.tabs=[],this.assetsBasePath=Le.c.assetsBasePath}ngOnInit(){this.tabs=this.getTabsList();let t=window.location.pathname.split("/"),r=t[t.length-1];this.updateSelectedTabByPath(r),this.isInschoolEnabled()}goBack(){this.router.navigate(["/dashboard"])}getTabsList(){return[{id:1,route:"fixed",title:"Fixed Rates",active:!0},{id:2,route:"variable",title:"Variable Rates",active:!1},{id:3,route:"adjustments",title:"Adjustment",active:!1},{id:4,route:"housingexpense",title:"Housing Expense",active:!1},{id:5,route:"paymentfactors",title:"Payment Factors",active:!1},{id:6,route:"securitization",title:"Securitization",active:!1},{id:7,route:"adverseAction",title:"Adverse Action",active:!1},{id:8,route:"SMSOpt-out",title:"SMS Opt-out/in",active:!1},{id:9,route:"credit-report-config",title:"Credit Report Configuration",active:!1},{id:10,route:"Document-upload-config",title:"PDF Upload",active:!1}
1,{id:11,route:"tierRateUpload",title:"Ratesheet Upload",active:!1},{id:12,route:"discount",title:"Discount",active:!1}]}updateSelectedTabByPath(e){let t=-1;for(var r=0;r<this.tabs.length;r++)this.tabs[r].route==e?(this.tabs[r].active=!0,t=r):this.tabs[r].active=!1;-1==t&&(this.tabs[0].active=!0)}updateSelectedTab(e,t){for(var r=0;r<this.tabs.length;r++)this.tabs[r].active=this.tabs[r].id==t}isInschoolButtonEnabled(e){this.inschoolButton=1==e?"true":"false",this.saveInSchoolFlag(this.inschoolButton)}saveInSchoolFlag(e){this.executorService.query("/inschoolButton/"+e+"/save","POST").pipe((0,b.W)(t=>this.handleError(t)),(0,f.T)(t=>t)).subscribe(t=>{})}isInschoolEnabled(){return this.executorService.query("/api/public/inschoolButton","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.selected="TRUE"===e.data.value||"true"===e.data.value})}handleError(e){return console.error("An error occurred",e),Promise.reject(e.message||e)}static{this.ctorParameters=()=>[{type:v.n},{type:B.Ix}]}};P=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"admin",template:'<div class="rate-admin-modern">\r\n    \x3c!-- Header Section with white background - only title and checkbox --\x3e\r\n    <div class="rate-admin-modern__header">\r\n        <div class="rate-admin-modern__header-content">\r\n            <div class="rate-admin-modern__title-row">\r\n                <h1 class="rate-admin-modern__title">\r\n                    <img\r\n                        class="rate-admin-modern__back-arrow"\r\n                        [src]="assetsBasePath + \'images/arrow-chevron-left.png\'"\r\n                        alt="Back"\r\n                        (click)="goBack()" />\r\n                    Rate Maintenance\r\n                </h1>\r\n                <label class="rate-admin-modern__checkbox-label">\r\n                    <input \r\n                        type="checkbox" \r\n                        id="inschool-button" \r\n                        [(ngModel)]="selected" \r\n                        (change)="isInschoolButtonEnabled(selected)" \r\n                        class="rate-admin-modern__checkbox">\r\n                    <span class="rate-admin-modern__checkbox-text">Enable In-school</span>\r\n                </label>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n    \x3c!-- Navigation Tabs Section - outside white background --\x3e\r\n    <div class="rate-admin-modern__tabs-wrapper">\r\n        <nav class="rate-admin-modern__tabs">\r\n            <a \r\n                class="rate-admin-modern__tab" \r\n                [ngClass]="{\'rate-admin-modern__tab--active\': tab.active}" \r\n                *ngFor="let tab of tabs; let i = index" \r\n                [routerLink]="tab.route" \r\n                (click)="updateSelectedTab(i, tab.id)">\r\n                {{tab.title}}\r\n            </a>\r\n        </nav>\r\n    </div>\r\n\r\n    \x3c!-- Main Content Area --\x3e\r\n    <div class="rate-admin-modern__content">\r\n        <router-outlet></router-outlet>\r\n    </div>\r\n</div>\r\n',encapsulation:m.gXe.None,standalone:!1,styles:[_e()]}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n,B.Ix])],P);let se=class{constructor(e,t){this.executorService=e,this.fb=t,this.allchecked=!1,this.referenceSpinner=!1,this.securityUploadInProcess=!1,this.upload=!1,this.document=[],this.documents=[],this.sizeLimit=8388608,this.url=this.executorService.getCompleteURL("/securitization/fileUpload"),this.access_token=this.executorService.getAccessToken(),this.uploader=new D.l0({url:this.url,authToken:this.getCookie("XSRF-TOKEN"),authTokenHeader:"X-XSRF-TOKEN",maxFileSize:this.sizeLimit,filters:[{name:"extension",fn:r=>"csv"===r.name.slice(r.name.lastIndexOf(".")+1).toLowerCase()}]})}ngOnInit(){this.initForm(),this.listofDocumentCategories()}onFileSelected(e){const t=e.target;if(!t.files||0===t.files.length)return;const r=t.files[0],n=this.validateFile(r);if(!n.valid)return alert(n.message),void(t.value="");this.uploader.clearQueue(),this.uploader.addToQueue([r]),this.uploadForm.get("name")?.setValue(r?.name||"")}validateFile(e){return e.size<=0?{valid:!1,message:"Empty file cannot be uploaded"}:e.size>this.sizeLimit?{valid:!1,message:"File size should not exceed 8 MB"}:"csv"!==e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()?{valid:!1,message:"Only CSV files allowed"}:{valid:!0}}listofDocumentCategories(){this.executorService.query("/securitization/documentCategory","GET",{}).pipe((0,f.T)(e=>e)).subscribe({next:e=>{Array.isArray(e)?this.documents=e:this.documents=e&&"object"==typeof e&&(e.data||e.result||e.documents)||[]},error:e=>{this.documents=[]}})}handleError(e){return this.sharedService.showLoader(!1),this.referenceSpinner=!1,console.error("An error occurred",e),Promise.reject(e.message||e)}selectAllDoc(e){e==event?this.toggleAllDocuments(e.target.checked):e.selected?(this.allchecked=!1,e.selected=!1,e.documentTypes.forEac
1h(t=>t.selected=!1)):(e.selected=!0,e.documentTypes.forEach(t=>t.selected=!0),this.upload=!1)}toggleAllDocuments(e){this.documents.forEach(t=>t.selected=e),this.documents.forEach(t=>{t.documentTypes.forEach(r=>{r.selected=e})}),1==e&&(this.upload=!1)}toggleParentWithRespectToChild(e,t){t.selected?this.upload=!1:(e.selected=!1,this.allchecked=!1)}selectedDocumentTypes(){this.document=[],this.documents.forEach(e=>{e.documentTypes.forEach(t=>{t.selected&&this.document.push(t.key)})}),this.document.length<=0&&(this.upload=!0)}getCookie(e){var r=("; "+document.cookie).split("; "+e+"=");if(2==r.length)return decodeURIComponent(r.pop().split(";").shift())}initForm(e){this.uploadForm=this.fb.group({file:[""],name:[{value:"",disabled:!0},c.k0.compose([c.k0.required])]}),this.initUploadOptions()}initUploadOptions(){var e=this;this.uploader.onBuildItemForm=(t,r)=>{let n=e.uploadForm.getRawValue();r.append("filename",n.name),r.append("documents",this.document),r.append("documentDescription",n.description)},this.uploader.onCompleteItem=(t,r,n,i)=>{e.securityUploadInProcess=!1},this.uploader.onSuccessItem=(t,r,n,i)=>{let a="string"==typeof r?JSON.parse(r):r;a&&("SUCCESS"==a.type?(this.message="Request has been initiated with securitization#"+a.data+". File uploaded successfully. Please check the final zipped file on FTP server after some time. ",e.uploadForm.reset(),e.uploader.clearQueue()):"ERROR"==a.type&&(this.message=a.error))},this.uploader.onErrorItem=(t,r,n,i)=>{e.securityUploadInProcess=!1,alert("Upload failed!")}}handleUpload(){let e=this.uploader.queue.length,t=this.uploader.queue[e-1];if(this.selectedDocumentTypes(),this.upload)return alert("Atleast one document type should be selected."),!1;this.securityUploadInProcess=!0,this.executorService.uploadDocument(this.uploader,t,this.url,this.getCookie("XSRF-TOKEN"),this.sizeLimit,null,[{name:"extension",fn:n=>"csv"===n.name.slice(n.name.lastIndexOf(".")+1).toLowerCase()}])}static{this.ctorParameters=()=>[{type:v.n},{type:c.ok}]}};se=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"security",template:'\x3c!-- /*******************************************************************************\r\n* This program contains trade secrets or otherwise confidential information *\r\n* owned by TAVANT Technologies. It may not be reproduced, published or\r\n* disclosed to others without TAVANT Technologies authorization. Access to\r\n* and use of this information is strictly limited and controlled by TAVANT\r\n* Technologies. Copyright 2017\r\n*******************************************************************************/ --\x3e\r\n\r\n<div class="row-wrap py-3">\r\n    <div class="me-3 width-100 d-flex">\r\n        <input type="checkbox" class="cus-checkbox-style basic-info-check" [(ngModel)]="allchecked" name="allcheck" (change)="selectAllDoc($event)">\r\n        <label class="doc-category-secur">All</label>\r\n    </div>\r\n    <div *ngFor="let item of documents;let k = index;" class="w-space-nowrap">\r\n        <div class="ms-0">\r\n            <div class="d-flex">\r\n                <input id="doc-category-{{k}}" type="checkbox" [checked]="item.selected" class="cus-checkbox-style basic-info-check" (change)="selectAllDoc(item)"> \r\n                <label for="doc-category-{{k}}" class="doc-category-secur common-cursor-class">{{item.categoryName}}</label>\r\n            </div>\r\n            <div class="col-lg-12 p-0">\r\n                <div *ngFor="let option of item.documentTypes;let i = index;">\r\n                    <input type="checkbox" id="child-docname-{{i}}" [(ngModel)]="option.selected" name="doccheck" (change)="toggleParentWithRespectToChild(item, option)"\r\n                        class="cus-checkbox-style basic-info-check"> {{option.value}}\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<form [formGroup]="uploadForm">\r\n    <div class="row">\r\n        <div class="col-lg-5">\r\n            <div class="mb-3 ld-form-cus">\r\n                <label for="name" class="borrower-labels">\r\n                </label>\r\n                <input type="text" class="form-control b-input-box" id="filename" placeholder="File Name" formControlName="name">\r\n\r\n            </div>\r\n            <div class="col-lg-12 text-start common-success-msg ps-0">{{message}}</div>\r\n        </div>\r\n        <div class="col-lg-4 text-start me-0">\r\n            <div class="mb-3 ld-form-cus browse-btn-upload-blk">\r\n                <label class="button-new-css browse-btn" for="fileSelectId">\r\n                    Browse\r\n                </label>\r\n                <input id="fileSelectId" type="file" class="hide" (change)="onFileSelected($event)" formControlName="file" placeholder="Browse"\r\n                    accept=".csv">\r\n                <button type="button" class="button-new-css upload-btn-cus position-relative" (click)="handleUpload()" [disabled]="!uploadForm.valid || uploader.queue.length < 1 || securityUploadInProcess">
1\r\n                    Upload\r\n                    <span *ngIf="securityUploadInProcess">\r\n                        <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls f-18"></i>\r\n                    </span>\r\n                </button>  \r\n                \x3c!-- <div class="doc-porgress-blk" *ngIf="uploader.queue.length">\r\n                    <div>\r\n                        <ngb-progressbar type="primary" [value]="uploader.queue[uploader.queue.length-1].progress"></ngb-progressbar>\r\n                    </div>\r\n                </div> --\x3e\r\n            </div>\r\n        </div>\r\n    </div>\r\n</form>',standalone:!0,imports:[M.MD,c.X1,c.YN]}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n,c.ok])],se);var Ve=h(3049);var Be=h(5523),ze=h.n(Be),H=h(5802);let j=class{constructor(e,t,r,n,i,a){this.tierTermService=e,this.executorService=t,this._commonService=r,this.dtiFicoService=n,this._sharedService=i,this.ngZone=a,this.rate="FIXED",this.rateType="FIXED",this.dtificoList=[],this.dtificoTeirList=[],this.selectedTierList=[],this.termsList=[],this.tierRates=[],this.marginRates=[],this.err={},this.tierTermSpinner={},this.selectedRateTier=[],this.tiersList=[],this.dtiFicoSpinner={},this.rangeList=[],this.dtiRanges=[],this.opendti=!1,this.openfico=!1,this.openeditdti=!1,this.openeditfico=!1,this.opendelfico=!1,this.opendeldti=!1,this.variableIndexRate=new ee(1,""),this.range=new ie(0,0,0)}ngOnInit(){this.termsList=[],this.subscriptionIds=[],this.tierRates=[],this.tierTermSpinner={tierMaintenance:!1},this.dtiFicoSpinner={rangeMaintenance:!1},this.rangeList=[],this.err={decimal:!1,index:!1,libor:!1,inactive:!1,warning:!1,dti:{range:!1,rangeValidate:!1,edit:!1,modify:!1},fico:{range:!1,rangeValidate:!1,edit:!1,modify:!1},highFicoRange:!1},this.subscriptionIds.push(this.tierTermService.tierList.subscribe(e=>{this.tiersList=e})),this.subscriptionIds.push(this.dtiFicoService.dtiFicoList.subscribe(e=>{this.dtificoList=e})),this.subscriptionIds.push(this._commonService.selectedTierList.subscribe(e=>{this.selectedTierList=e})),this.subscribeProduct(),this.getProductParams()}getProductParams(){this.executorService.query("/products","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.ngZone.run(()=>{this.productList=e,this.product=e[0],this.onChange()})})}onChange(){this._commonService.updateProduct(this.product.id)}exportTemplate(){this.tierTermService.getTemplate(this.product,this.rate)}clearWarnings(e){setTimeout(()=>{this.clearErrors()},e)}subscribeProduct(){var e=this;this.subscriptionIds.push(this._commonService.product.subscribe(t=>{t&&(e.productId=t,e.setHeaders(),e.getBindedTierList(),e.getDtiFicoData(e.rateType))}))}getActiveTiers(){let e=new y.Nl;e=e.set("rateType",this.rateType),this.tierTermService.getActiveTiers(e,this.productId)}getRates(e){let t=new y.Nl;t=t.set("rateType",e),this.tierTermService.getRateData(t,this.productId).pipe((0,b.W)(r=>this.handleError(r)),(0,f.T)(r=>r)).subscribe(r=>{this.ngZone.run(()=>{let n=r&&r.data&&r.data.tierList?r.data.tierList:[];this.variableIndexRate.indexValue=r.data?r.data.indexValue:0,this.variableIndexRate.liborMessage=r.data?r.data.liborMessage:"",this.tierRates=this.buildRates(n),this.marginRates=this.buildRates(n,!0)})})}setHeaders(){this._commonService.getProducts().pipe((0,f.T)(e=>e)).subscribe(e=>{this.ngZone.run(()=>{this._commonService.productList=e;for(var t=0;t<e.length;t++)e[t].id==this.productId&&(this.termsList=e[t].termMonths);this.getActiveTiers(),this.getRates(this.rateType)})})}updateTierData(){this.checkTierUsedInDtiFicoTable()?(this.clearErrors(),this.err.invalid=!0,this.clearWarnings(5e3)):(this.tierTermSpinner.tierMaintenance=!0,this.clearErrors(),this.tierTermService.sendData(this.getTierRate(this.tierRates),this.productId).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.ngZone.run(()=>{this.tierTermSpinner.tierMaintenance=!1,e&&"SUCCESS"==e.type&&(this.getActiveTiers(),this.getRates(this.rateType))})}))}checkTierUsedInDtiFicoTable(){let e=this.tierRates.filter(r=>!r.active).map(r=>r.tierName),t=[];return!!e.length&&(e.forEach(r=>{this.tierRates.findIndex(n=>n.active&&n.tierName===r)<0&&(t=t.concat(this.selectedTierList.filter(n=>n.value===r)))}),t.length>0)}updateVariableRate(e,t,r){let n=parseFloat(e);this.tierRates[r].terms[t].value=parseFloat((Number(n)+Number(this.variableIndexRate.indexValue)).toFixed(2))}updateIndexRate(e){let t=parseFloat(e);for(let r=0;r<this.tierRates.length;r++)for(let n=0;n<this.tierRates[r].terms.length;n++)this.tierRates[r].terms[n].value=parseFloat((Number(this.marginRates[r].terms[n].value)+Number(t)).toFixed(2))}removeItem(){let e=this.findLastActiveTierIndex();this.clearErrors();let t=this.tierRates[e].tierName;for(;0!=this.dtificoTeirList.length;)this.dtificoTeirList.pop();for(var r=0;r<this.dtificoList.length;r++){let i=this.dtificoList[r].value;this.dtificoTeirList.push(i)}if(this.err.inactive=this.isInArray(t,this.dtificoTeirList),this.clearWarnings(5e3),this.err.inactive)"VARIABLE"==this.rateType?window.scrollTo(0,window.innerHeight+400):window.scrollTo(0,window.innerHeight-320);else{var n=this;this._sharedService.showConfirm({message:"Are you sure you want delete T"+t+"?",uid:"MODAL_UW_STATUS",confirmCB:function(i){n.ngZone.run(()=>{n.matchTeir(e+1,n.selectedTierList)?(n.err.warning=!0,n.clearWarnings(5e3)):(n.tierRates[e].active=0,"FIXED"!==n.rateType&&(n.marginRates[e].active=0))})},cancelCB:function(i){}})}}matchTeir(e,t){for(let r=0;r<t.length;r++)if(t[r].value===e)return!0;return!1}isInArray(e,t){return t.indexOf(e)>-1}buildRates(e,t){let r=[];var n=this;let i,a;for(var s=0;s<e.length;s++){if(!r.length){p(d());continue}let o=this.availableTierLocation(r,e[s].tier);o>=0?(i=u(r[o].terms,e[s].termMonths),a=d(),a&&(r[o].terms[i]?r[o].terms[i]=a:r[o].terms.push(a))):p(d())}return r;function p(o){let g=new L;o&&g.terms.push(o),g.tierName=e[s].tier,g.rateType=e[s].rateType,g.active=e[s].active,r.push(g)}function d(){if(-1==n.termsList.indexOf(e[s].termMonths))return null;let o=new _;o.id=e[s].id,o.termMonth=e[s].termMonths;let g=t?parseFloat((Number(e[s].rate)-Number(n.variableIndexRate.indexValue)).toFixed(2)):e[s].rate.toFixed(2);return o.value=g,o}function u(o,g){let E;for(var F=0;F<o.length;F++)if(o[F].termMonth==g){E=F;break}return E}}availableTierLocation(e,t){for(let n=0;n<e.length;n++)if(e[n].tierName==t)return n;return-1}getTierRate(e){var t=new te,r=[];for(let i of e)if(null!=i.terms&&1==i.uiEnable||0==i.active)for(let a of i.terms){var n=new J;n.tier=i.tierName,n.rateType=i.rateType,n.active=i.active,n.termMonths=a.termMonth,n.id=a.id,n.rate=a.value,r.push(n)}return t.tierList=r,t.indexValue=this.variableIndexRate.indexValue,t.liborMessage=this.variableIndexRate.liborMessage,t}addTier(){var e=this;let t=this.tierRates.filter(r=>r.active).length-1;t=-1==t?1:t+1+1,this._sharedService.showConfirm({message:"Do you want to add T"+t+"?",uid:"MODAL_UW_STATUS",confirmCB:function(r){e.ngZone.run(()=>{e.addNewTierData(t)})},cancelCB:function(r){}})}addNewTierData(e){let t,r,a,s,n=[],i=[],p=1*this.variableIndexRate.indexValue;p=isNaN(p)?0:p;for(var d=0;d<this.termsList.length;d++)t=new _,t.value=p,t.termMonth=this.termsList[d],r=Object.assign({},t),r.value=0,n.push(t),i.push(r);a=new L,a.tierName=e,a.rateType=this.rateType,a.active=1,a.uiEnable=!0,s=Object.assign({},a),a.terms=n,s.terms=i,this.tierRates.push(a),this.marginRates.push(s)}createRange(e){for(var t=[],r=1;r<=e;r++)t.push(r);return t}findLastActiveTierIndex(){let e=-1;for(var t=this.tierRates.length-1;t>=0;t--)if(this.tierRates[t].active){e=t;break}return e}patternMatch(e,t){switch(e){case"LIBOR":this.err.libor=!/^[a-zA-Z0-9\-\s]+$/.test(t);break;
1case"DECIMAL":this.err.decimal=!1,n(t)&&(this.err.decimal=!0,setTimeout(()=>{window.scrollTo(0,window.innerHeight-400)}));break;case"INDEX":this.err.index=!!n(t)}function n(i){return!/^-?[0-9]{1,2}(\.[0-9]{1,2})?$/.test(i)}}getDtiFicoData(e){let t=new y.Nl;t=t.set("rateType",this.rateType),this.dtiFicoService.getDtiFicoData(t,this.productId).pipe((0,b.W)(r=>this.handleError(r)),(0,f.T)(r=>r)).subscribe(r=>{this.ngZone.run(()=>{this.dtiRanges=this.buildData(r.data),this.setFicoHeaders(this.getDtiFico(this.dtiRanges))})})}setFicoHeaders(e){for(;this.rangeList.length>0;)this.rangeList.pop();for(let n=0;n<e.length;n++)0==e[n].active&&(e.splice(n,1),n-=1);for(var t=new re.NZ,r=0;r<e.length;r++)t.add(e[r].ficoMin+"-"+e[r].ficoMax);for(let n of t.toArray())this.rangeList.push(n)}adddtiRange(){this.range=new R(0,0,0),this.opendti=!0}addficoRange(){this.range=new R(0,0,0),this.openfico=!0}getBindedTierList(){let e=new y.Nl;e=e.set("rateType",this.rateType),this.dtiFicoService.getDtiFicoTiers(e,this.productId)}submit(){this.dtiFicoSpinner.rangeMaintenance=!0,this.dtiFicoService.sendData(this.getDtiFico(this.dtiRanges),this.productId).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.ngZone.run(()=>{this.dtiFicoSpinner.rangeMaintenance=!1,this.updateBindedTiers(e)})})}updateBindedTiers(e){e&&"SUCCESS"==e.type&&(this.getBindedTierList(),this.getDtiFicoData(this.rateType))}buildData(e){let t=[];for(var r=0;r<e.length;r++){let a,n=new C,i=new N;if(n.id=e[r].id,n.value=e[r].tier,n.ficoMax=e[r].ficoMax,n.ficoMin=e[r].ficoMin,n.active=e[r].active,n.columnArrayCell=r,i.rowcells.push(n),i.dtiMax=e[r].dtiMax,i.dtiMin=e[r].dtiMin,i.rateType=e[r].rateType,i.rowArrayCell=r,t.length<=0)t.push(i);else if(a=this.availableDtiLocation(t,e[r].dtiMin,e[r].dtiMax),a>-1){let s=t[a].rowcells,p=!1;for(let d=0;d<s.length;d++)if(s[d].ficoMax==n.ficoMax&&s[d].ficoMin==n.ficoMin){p=!0;break}p||s.push(n)}else t.push(i)}return t}availableDtiLocation(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];if(a.dtiMin==t&&a.dtiMax==r)return i}return-1}getDtiFico(e){let t=[];for(let r of e)if(r.rowcells)for(let n of r.rowcells){let i=new ne;i.id=n.id,i.dtiMax=r.dtiMax,i.dtiMin=r.dtiMin,i.active=n.active,i.ficoMax=n.ficoMax,i.ficoMin=n.ficoMin,i.rateType=r.rateType,i.tier=n.value,t.push(i)}return t}makeInactive(e,t){for(let r=0;r<e.length;r++)e[r].rowcells[t].active=0}deleteFico(e,t,r){let n;for(let i=0;i<this.dtiRanges.length;i++)if(this.dtiRanges[i].active){n=0;for(let a=0;a<this.dtiRanges[i].rowcells.length;a++)this.dtiRanges[i].rowcells[a].active&&(n+=1)}this.opendelfico=!0,r.index=e,r.range=t,r.canDelete=1!=n}deleteFicoRange(e){let t=e.index;const r=e.range.split("-");for(this.range.min=Number(r[0]),this.range.max=Number(r[1]);this.dtiRanges[0].rowcells[t].ficoMax!=this.range.max;)t+=1;this.makeInactive(this.dtiRanges,t),this.rangeList.splice(e.index,1),this.opendelfico=!1,this.getRateTierSelected()}editFico(e,t,r){let n=e.split("-"),i=n[0],a=n[1];r.min=i,r.max=a,r.editMax=a,r.index=t,this.range=new R(1*i,1*a,0),this.openeditfico=!0}editFicoRange(e,t){let r=1*e.min,n=1*e.max;r>n?this.err.fico.rangeValidate=!0:(this.err.fico.rangeValidate=!1,this.editFicoRangeMidCombinationCheck(e,{maxValue:t.editMax,index:t.index})?this.err.fico.edit=!0:(this.err.fico.edit=!1,this.editFicoColumn(r,n,{maxValue:t.editMax,index:t.index}),this.setFicoHeaders(this.getDtiFico(this.dtiRanges)),t.editMax=0,this.openeditfico=!1))}editFicoRangeMidCombinationCheck(e,t){var r=this;let n,i=!!function a(p){let d=0;for(let o=t.index-1;o>=0;o--)if(r.dtiRanges[0].rowcells[o].active){d=r.dtiRanges[0].rowcells[o].ficoMax;break}return p>=850||d>=p}(1*e.min);return n=t.index+1!=this.dtiRanges[0].rowcells.length&&!!function s(p){let d=0,u=r.dtiRanges[0].rowcells.length;for(let o=t.index+1;o<u;o++)if(r.dtiRanges[0].rowcells[o].active&&r.dtiRanges[0].rowcells[o].ficoMax!=t.maxValue){d=Number(r.dtiRanges[0].rowcells[o].ficoMin);break}return 0!=d&&p>=d}(1*e.max),i||n}editFicoColumn(e,t,r){let n=r.index;for(;this.dtiRanges[0].rowcells[n].ficoMax!=r.maxValue;)n+=1;for(let i=0;i<this.dtiRanges.length;i++)this.dtiRanges[i].rowcells[n].active&&(this.dtiRanges[i].rowcells[n].ficoMin=e,this.dtiRanges[i].rowcells[n].ficoMax=t)}addFicoNumericMatch(e){this.verifyLastMaxFicoRange(e.min),this.err.fico.range=!!this.addFicoCombineNumericCheck(e),this.err.highFicoRange=!!this.addFicoCombineHigherRangeCheck(e)}verifyLastMaxFicoRange(e){let t=this.getLastMaxFicoRange();this.err.fico.modify=t>e}getLastMaxFicoRange(){let e=0;if(this.dtiRanges.length&&this.dtiRanges[0].rowcells){for(let r=this.dtiRanges[0].rowcells.length;r>0;r--)if(this.dtiRanges[0].rowcells[r-1].active){e=this.dtiRanges[0].rowcells[r-1].ficoMax;break}}return e}addFicoCombineNumericCheck(e){let t=!1;return""!=e.max&&(t=!!this.ficoNumericMatch(e.max)),!(!t&&!this.ficoNumericMatch(e.min))}editDtiNumericMatch(e){this.err.dti.range=!!this.dtiCombineNumericCheck(e)}dtiCombineNumericCheck(e){return!!this.dtiDecimalMatch(e.max)||!!this.dtiDecimalMatch(e.min)}dtiDecimalMatch(e){return!/^-?[0-9]{1,2}(\.[0-9]{1,2})?$/.test(e)}
1addFicoCombineHigherRangeCheck(e){let t=!1;const r=e.max;0!==r&&""!==r&&(t=Number(r)>850);const n=Number(e.min)>849;return t||n}editFicoNumericMatch(e){this.err.fico.range=!!this.ficoEditCombineNumericCheck(e),this.err.highFicoRange=!!this.addFicoCombineHigherRangeCheck(e)}ficoEditCombineNumericCheck(e){return!!this.ficoNumericMatch(e.max)||!!this.ficoNumericMatch(e.min)}ficoNumericMatch(e){return!/^[0-9]{1,4}?$/.test(e)}addNewDtiRange(e,t,r){let n=this.rangeValidation(1*e.min,1*e.max,!0);if(this.err.dti.rangeValidate=!1,n)this.err.dti.rangeValidate=!0;else{let i;if(this.dtiRanges.length>0){let a;for(let s=0;s<this.dtiRanges.length;s++)if(this.dtiRanges[s].active){a=s;break}i=this.createNewDTIRow(e,a)}else i=this.createNewDTIRow(e,0),this.openfico=!0;this.dtiRanges.push(i),this.opendti=!1}}createNewDTIRow(e,t){let i,r=new N,n=[];this.dtiRanges.length&&(n=this.dtiRanges[t].rowcells),r.dtiMax=1*e.max,r.dtiMin=1*e.min,r.rateType=this.rateType;for(let a=0;a<n.length;a++)i=new C,e.id>0&&(i.id=e.id),i.ficoMax=n[a].ficoMax,i.ficoMin=n[a].ficoMin,i.value=1,i.active=this.dtiRanges[t].rowcells[a].active?1:0,r.rowcells.push(i);return r}addNewFicoRange(e,t){1*e.max||(e.max=850),this.err.fico.rangeValidate=!1,this.rangeValidation(1*e.min,1*e.max)?this.err.fico.rangeValidate=!0:(this.err.fico.rangeValidate=!1,this.dtiRanges.length>0&&this.createNewFicoColumn(e),this.setFicoHeaders(this.getDtiFico(this.dtiRanges)),this.openfico=!0,this.range=new R(0,0,0))}createNewFicoColumn(e){for(let t=0;t<this.dtiRanges.length;t++){let r=new C;e.id>0&&(r.id=e.id),r.value=1,r.ficoMax=e.max,r.ficoMin=e.min,r.active=this.dtiRanges[t].active?1:0,this.dtiRanges[t].rowcells.push(r)}}rangeValidation(e,t,r){if(e>=t)return!0;{let d,n=[],i=[],a=r?this.dtiRanges:this.dtiRanges[0].rowcells,s="ficoMin",p="ficoMax";r&&(s="dtiMin",p="dtiMax");for(let u=0;u<a.length;u++)d=r?this.dtiRanges[u].rowcells[0].active:this.dtiRanges[0].rowcells[u].active,d&&(n.push(a[u][s]),i.push(a[u][p]));return this.rangeCompare(i,n,e,t)}}deleteDti(e,t){t.index=e;let r=0;for(let n=0;n<this.dtiRanges.length;n++)this.dtiRanges[n].active&&(r+=1);t.canDelete=1!=r,this.opendeldti=!0}deleteDtiModel(e){let t=e.index,r=this.dtiRanges[t].rowcells.length;for(let n=0;n<r;n++)this.dtiRanges[t].rowcells[n].active=0;this.dtiRanges[t].active=!1,this.opendeldti=!1,this.getRateTierSelected()}editDti(e,t,r,n){n.min=e,n.max=t,n.editMax=t,n.index=r,this.range=new R(e,t,0),this.openeditdti=!0}editDtiRange(e,t){1*e.min>=1*e.max?this.err.dti.rangeValidate=!0:(this.err.dti.rangeValidate=!1,this.editDtiRangeMidCombinationCheck(e,{index:t.index,maxValue:t.editMax})?this.err.dti.edit=!0:(this.err.dti.edit=!1,this.editDtiColumn(1*e.min,1*e.max,{index:t.index,maxValue:t.editMax}),t.editMax=0,this.openeditdti=!1))}editDtiRangeMidCombinationCheck(e,t){var r=this;let n=function a(){let p=0;for(let d=t.index-1;d>=0;d--)if(r.dtiRanges[d].active){p=r.dtiRanges[d].dtiMax;break}return p}()>=1*e.min,i=t.index+1!=this.dtiRanges.length&&!!function s(p){let d=0,u=r.dtiRanges.length;for(let o=t.index+1;o<u;o++)if(r.dtiRanges[o].active&&r.dtiRanges[o].dtiMax!=t.maxValue){d=Number(r.dtiRanges[o].dtiMin);break}return 0!=d&&p>=d}(1*e.max);return n||i}editDtiColumn(e,t,r){let n=r.index;for(;this.dtiRanges[n].dtiMax!=r.maxValue;)n+=1;this.dtiRanges[n].active&&(this.dtiRanges[n].dtiMin=e,this.dtiRanges[n].dtiMax=t)}addDtiNumericMatch(e){this.verifyLastMaxDTIRange(e.min),this.err.dti.range=!!this.dtiCombineNumericCheck(e)}verifyLastMaxDTIRange(e){let t=this.getLastMaxDtiRange();this.err.dti.modify=t>=e}getLastMaxDtiRange(){let e;e=this.dtiRanges.length;let t=0;for(let r=e;r>0;r--)if(this.dtiRanges[r-1].rowcells[0].active){t=this.dtiRanges[r-1].dtiMax;break}return t}rangeCompare(e,t,r,n){let i=[];for(let a=0;a<t.length;a++)i.push(n>=t[a]&&n<=e[a]),i.push(r>=t[a]&&r<=e[a]);return-1!=i.indexOf(!0)}getRateTierSelected(){this._commonService.getSelectedTierList(this.getSelectedTierList())}getSelectedTierList(){for(;0!=this.selectedRateTier.length;)this.selectedRateTier.pop();for(let e=0;e<this.dtiRanges.length;e++)if(this.dtiRanges[e].active)for(let t=0;t<this.dtiRanges[e].rowcells.length;t++)if(this.dtiRanges[e].rowcells[t].active){let r=this.dtiRanges[e].rowcells[t].value;this.selectedRateTier.push(new O(r))}return this.selectedRateTier}actionOnClose(){this.err={dti:{range:!1,rangeValidate:!1,edit:!1,modify:!1},fico:{range:!1,rangeValidate:!1,modify:!1,edit:!1}},this.range=new R(0,0,0),this.err.highFicoRange=!1}handleError(e){return this.tierTermSpinner.tierMaintenance=!1,this.dtiFicoSpinner.rangeMaintenance=!1,(0,A.$)(e||"Server Error")}clearErrors(){this.err.libor=!1,this.err.index=!1,this.err.inactive=!1,this.err.warning=!1,this.err.decimal=!1,this.err.invalid=!1,this.err.dti.rangeValidate=!1,this.err.dti.edit=!1,this.err.fico.rangeValidate=!1,this.err.fico.edit=!1}ngOnDestroy(){for(var e=0;e<this.subscriptionIds.length;e++)this.subscriptionIds[e]&&this.subscriptionIds[e].unsubscribe()}static{this.ctorParameters=()=>[{type:T},{type:v.n},{type:k},{type:I},{type:x.d},{type:H.SKi}]}};j=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"fixed",template:'\x3c!-- <tier-term [rateType]="rate"></tier-term>\r\n<dti-fico [rateType]="rate"></dti-fico> --\x3e\r\n<div>\r\n\t<div class="mb-3 ld-form-cus">
1\r\n\t\t<label for="fname" class="borrower-labels">Product</label>\r\n\t\t<div class="d-flex justify-content-between align-items-center">\r\n\t\t\t<select class="form-control select-b-input-box product-select" [(ngModel)]="product" (change)="onChange()" name="pname">\r\n\t\t\t\t<option *ngFor="let item of productList" [ngValue]="item">{{item.name}}</option>\r\n\t\t\t</select>\r\n\t\t\t<button type="button" class="btn dti-edit-btn position-relative" (click)="exportTemplate()" [disabled]="!product">\r\n\t\t\t\tExport Template\r\n\t\t\t</button>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n\r\n<div class="tier-block fixed-tier" *ngIf="rateType === \'FIXED\'">\r\n  <div>\r\n    <div>\r\n      <div class="row">\r\n        <div class="col-lg-12">\r\n          <div class="sub-headings">\r\n            \x3c!--Fixed tier maintenance--\x3e\r\n            <h4>Tier Maintenance</h4>\r\n            <button class="btn dti-edit-btn ms-0" (click)="addTier()">\r\n              Add Tier\r\n            </button>\r\n            <button class="btn dti-edit-btn" (click)="removeItem()" [disabled]="!tierRates.length">\r\n              Delete Last Tier\r\n            </button>\r\n\r\n          </div>\r\n        </div>\r\n      </div>\r\n      <div class="tier-table-container table-responsive">\r\n        <table class="col-12 rate-table">\r\n          <thead>\r\n            <tr>\r\n              <th class="border-cell tier-cell tier-row-data" width="16%"></th>\r\n              <th class="border-cell" [attr.colspan]="termsList.length">\r\n                Term\r\n              </th>\r\n            </tr>\r\n            <tr class="term-columns-header-row">\r\n              <th class="border-cell tier-cell tier-row-data" width="16%">Tier</th>\r\n              <th class="border-cell tier-row-header" *ngFor="let term of termsList">\r\n                {{term}} Months\r\n              </th>\r\n              \x3c!-- <th class="border-cell" colspan="2"></th> --\x3e\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            <ng-container *ngFor="let item of tierRates; let i=index">\r\n              <tr *ngIf="item.active == 1">\r\n                <td class="border-cell position-relative">\r\n                  T{{item.tierName}}\r\n                </td>\r\n                <ng-container *ngFor="let term of item.terms">\r\n                  <td class="border-cell position-relative">\r\n                    <input type="hidden" [(ngModel)]="term.id" name="id" />\r\n                    <div>\r\n                      <input type="text" class="table-cell" [(ngModel)]="term.value" name="termValue" maxlength="5" (blur)="patternMatch(\'DECIMAL\', term.value)" #rate="ngModel" [ngModelOptions]="{standalone: true}" [disabled]="(item.uiEnable != null && item.uiEnable === true)?false:true">\r\n                    </div>\r\n                  </td>\r\n                </ng-container>\r\n              </tr>\r\n            </ng-container>\r\n          </tbody>\r\n        </table>\r\n        <div *ngIf="err.inactive" class=" ra-err-blk status-err-blk text-end">\r\n          Cannot change status as the value is used in the DTI vs FICO range table.\r\n        </div>\r\n        <div *ngIf="err.decimal" class="ra-err-blk tm-err-blk text-end">\r\n          Enter only 2.2 long numeric\r\n        </div>\r\n        <div *ngIf="err.warning" class="ra-err-blk status-err-blk text-end">\r\n          Tier is selected in below table, cannot make it Inactive.\r\n        </div>\r\n        <div *ngIf="err.invalid" class="ra-err-blk status-err-blk text-end">\r\n          Invalid tier is selected in below table.\r\n        </div>\r\n      </div>\r\n      <div class="tier-save-row">\r\n        <button class="btn dti-edit-btn pos-rel" value="save" [disabled]="err.decimal|| err.inactive || err.warning || tierTermSpinner.tierMaintenance" (click)="updateTierData()">\r\n          Save\r\n          <span *ngIf="tierTermSpinner.tierMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw pos-abs cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n\x3c!-- ===================== DTI / FICO Range Maintenance ===================== --\x3e\r\n<div class="dti-wrap" \r\n*ngIf="rateType === \'FIXED\'">\r\n  <div>\r\n    <div class="row">\r\n      <div class="col-lg-12">\r\n        <div class="sub-headings">\r\n          <h4>DTI / FICO Range Maintenance </h4>\r\n          <button class="btn dti-edit-btn ml-0" \r\n          (click)="adddtiRange()"\r\n          [disabled]="!tiersList.length"\r\n          style="display: none;">\r\n            Add DTI Range\r\n          </button>\r\n          <button class="btn dti-edit-btn" \r\n          (click)="addficoRange()"\r\n          [disabled]="!dtiRanges.length"\r\n          style="display: none;">\r\n            Add Fico Range\r\n          </button>\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <div class="dti-table-container table-responsive">\r\n      <table class="col-12 rate-table ra-rate-table padded-cell">\r\n        <thead>\r\n          <tr>\r\n            <th class="border-cell header-cell" \r\n            rowspan="2" width="16%">\r\n              DTI Range\r\n            </th>\r\n            <th class="border-cell header-cell" \r\n            [attr.colspan]="rangeList.length">\r\n              FICO Range\r\n            </th>\r\n          </tr>\r\n          <tr>\r\n            <th class="border-cell padded-cell" \r\n            *ngFor="let range of rangeList; let rowindex = index">
1\r\n              <span class="edit-icon" style="display: none;"\r\n              (click)="editFico(range, rowindex, editFicoModel)">\r\n              </span>\r\n              <span class="delete-icon" style="display: none;"\r\n              (click)="deleteFico(rowindex, range, ficoDeleteConfirmation)">\r\n              </span>\r\n              <span class="range-one-start">{{range}}</span>\r\n            </th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          <tr *ngFor="let range of dtiRanges; let rowindex = index">\r\n            <td class="border-cell padded-cell" \r\n            [hidden]="!range.active">\r\n              <div>\r\n                <span class="edit-icon" style="display: none;"\r\n                (click)="editDti(range.dtiMin, range.dtiMax, rowindex, editDtiModel)">\r\n                </span>\r\n                <span class="delete-icon" style="display: none;"\r\n                (click)="deleteDti(rowindex, dtiDeleteConfirmation)">\r\n                </span>\r\n                <span class="dti-range-one-start">\r\n                  {{range.dtiMin}}\r\n                  </span> - \r\n                  <span class="dti-range-one-end">\r\n                    {{range.dtiMax}}\r\n                  </span>\r\n              </div>\r\n            </td>\r\n            <ng-container *ngFor="let rowcell of range.rowcells; let ind = index;">\r\n              <td class="border-cell padded-cell"\r\n              [hidden]="rowcell.active==0">\r\n                <select style="display: none;"\r\n                [(ngModel)]="rowcell.value" \r\n                name="value" \r\n                (change)="getRateTierSelected($event.target.value)">\r\n                  <option *ngFor="let cell of tiersList" \r\n                  value="{{cell.value}}" \r\n                  [hidden]="!cell.active" >\r\n                    T{{cell.value}}\r\n                  </option>\r\n                </select>\r\n                T{{rowcell.value}}\r\n              </td>\r\n            </ng-container>\r\n            <ng-container *ngIf="range.rowcells && (range.rowcells.length < rangeList.length)">\r\n              <td *ngFor="let x of createRange(rangeList.length - range.rowcells.length)"\r\n              class="border-cell padded-cell">\r\n                -\r\n              </td>\r\n            </ng-container>\r\n          </tr>\r\n        </tbody>\r\n      </table>\r\n    </div>\r\n    <div class="row" style="display: none;">\r\n      <div class="col-sm-12">\r\n        <button class="btn button-new-css tier-save-btn position-relative" value="save" [disabled]="dtiFicoSpinner.rangeMaintenance"  (click)="submit()">\r\n          Save\r\n          <span *ngIf="dtiFicoSpinner.rangeMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>      \r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n\x3c!--Variable Table --\x3e\r\n<div class="dti-wrap" \r\n*ngIf="rateType !== \'FIXED\'">\r\n  <div>\r\n    <div class="row">\r\n      <div class="col-lg-12">\r\n        <div class="sub-headings">\r\n          <h4>DTI / FICO Range Maintenance</h4>\r\n          <button class="btn dti-edit-btn ms-0" \r\n          (click)="adddtiRange()"\r\n          [disabled]="!tiersList.length"\r\n          style="display: none;">\r\n            Add DTI Range</button>\r\n          <button class="btn dti-edit-btn" \r\n          (click)="addficoRange()"\r\n          [disabled]="!dtiRanges.length"\r\n          style="display: none;">\r\n            Add Fico Range\r\n          </button>\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <div class="dti-table-container table-responsive">\r\n      <table class="col-12 rate-table ra-rate-table padded-cell">\r\n        <thead>\r\n          <tr>\r\n            <th class="border-cell header-cell" \r\n            rowspan="2" width="16%">\r\n              DTI Range\r\n            </th>\r\n            <th class="border-cell header-cell" \r\n            [attr.colspan]="rangeList.length">\r\n              FICO Range\r\n            </th>\r\n          </tr>\r\n          <tr>\r\n            <th class="border-cell padded-cell" \r\n            *ngFor="let range of rangeList; let rowindex = index">
1\r\n              <span class="edit-icon" style="display: none;"\r\n              (click)="editFico(range, rowindex, editFicoModel)">\r\n              </span>\r\n              <span class="delete-icon" style="display: none;"\r\n              (click)="deleteFico(rowindex, range, ficoDeleteConfirmation)">\r\n              </span>\r\n              <span class="range-one-start">\r\n                {{range}}\r\n              </span>\r\n            </th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          <tr *ngFor="let range of dtiRanges; let rowindex = index">\r\n            <td class="border-cell padded-cell" \r\n            [hidden]="!range.active">\r\n              <div>\r\n                <span class="edit-icon" style="display: none;"\r\n                (click)="editDti(range.dtiMin, range.dtiMax, rowindex, editDtiModel)">\r\n                </span>\r\n                <span class="delete-icon" style="display: none;"\r\n                (click)="deleteDti(rowindex, dtiDeleteConfirmation)">\r\n                </span>\r\n                <span class="dti-range-one-start">\r\n                  {{range.dtiMin}}\r\n                </span> - \r\n                <span class="dti-range-one-end">\r\n                  {{range.dtiMax}}\r\n                </span>\r\n              </div>\r\n            </td>\r\n            <ng-container *ngFor="let rowcell of range.rowcells;">\r\n              <td class="border-cell padded-cell" \r\n              [hidden]="rowcell.active==0">\r\n                <select [(ngModel)]="rowcell.value" style="display: none;"\r\n                name="value" \r\n                (change)="getRateTierSelected($event.target.value)">\r\n                  <option *ngFor="let cell of tiersList" \r\n                  value="{{cell.value}}" \r\n                  [hidden]="!cell.active" >\r\n                    T{{cell.value}}\r\n                  </option>\r\n                </select>\r\n                T{{rowcell.value}}\r\n              </td>\r\n            </ng-container>\r\n            <ng-container *ngIf="range.rowcells && (range.rowcells.length < rangeList.length)">\r\n              <td *ngFor="let x of createRange(rangeList.length - range.rowcells.length)"\r\n              class="border-cell padded-cell">\r\n                -\r\n              </td>\r\n            </ng-container>\r\n          </tr>\r\n        </tbody>\r\n      </table>\r\n    </div>\r\n    <div class="row" style="display: none;">\r\n      <div class="col-sm-12">\r\n        <button class="btn button-new-css tier-save-btn position-relative" value="save"  [disabled]="dtiFicoSpinner.rangeMaintenance" (click)="submit()">\r\n          Save\r\n          <span *ngIf="dtiFicoSpinner.rangeMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n\x3c!--Popup Models --\x3e\r\n\x3c!--ADD DTI RANGE Models --\x3e\r\n<p-dialog header="Add DTI Range" [(visible)]="opendti" [draggable]= false [closeOnEscape]= true [dismissableMask]= true (onHide)="actionOnClose()" closeIcon="rate-modal-close" [closable]= true class="rate-modal" [modal]=true  position="top" #addDtiModel>\r\n  <div class="modal-body">\r\n  <form #addDtiRangeForm="ngForm" class="form-inline">\r\n    <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.dti.range && !err.dti.modify" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 2.2 character long numeric\r\n            </div>\r\n            <div *ngIf="err.dti.modify && !err.dti.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous DTI column.\r\n            </div>\r\n            <div *ngIf="err.dti.modify && err.dti.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous DTI column and Please enter 2.2 character long numeric\r\n            </div>\r\n            <div *ngIf="err.dti.rangeValidate" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <input type="hidden" [(ngModel)]="range.id" name="id">\r\n            <div class="row">\r\n            <div class="col-md-3 offset-md-3">\r\n              <div class="mb-3">
1\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="addDtiNumericMatch(range)"\r\n                 maxlength="5" \r\n                 [(ngModel)]="range.min" \r\n                 maxlength="5" \r\n                 name="min" placeholder="Min" \r\n                 #min="ngModel">\r\n              </div>\r\n            </div>\r\n            <div class="col-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="addDtiNumericMatch(range)"\r\n                maxlength="5" \r\n                [(ngModel)]="range.max" \r\n                maxlength="5" name="max" \r\n                placeholder="Max" #max="ngModel">\r\n              </div>\r\n            </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n    </form>\r\n  </div>\r\n  <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" \r\n    type="button" \r\n    [disabled]="err.dti.range||\r\n    err.dti.modify" \r\n    (click)="addNewDtiRange(addDtiRangeForm.value, addDtiModel, (!dtiRanges.length ? addFicoModel : null))">\r\n      Submit\r\n    </button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--EDIT DTI RANGE MODEL--\x3e\r\n<p-dialog header="Edit DTI Range" [(visible)]="openeditdti" [draggable]= false [closeOnEscape]= true [dismissableMask]= true closeIcon="rate-modal-close" (onHide)="actionOnClose()" [closable]= true class="rate-modal" [modal]=true  position="top" #editDtiModel >\r\n  <div class="modal-body">\r\n    <form #editDtiRangeForm="ngForm" \r\n    class="form-inline">\r\n      <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.dti.range" \r\n            class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 2.2 character long numeric\r\n            </div>\r\n            <div *ngIf="err.dti.edit" \r\n            class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Range is not acceptable.Please don\'t overlap with last and next range.\r\n            </div>\r\n            <div *ngIf="err.dti.rangeValidate" \r\n            class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <input type="hidden" [(ngModel)]="range.id" name="id">\r\n          <div class="row">\r\n            <div class="col-md-3 offset-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" class="form-control b-input-box" \r\n                id="fname" (blur)="clearErrors()" \r\n                (change)="editDtiNumericMatch(range)"\r\n                  [(ngModel)]="range.min" \r\n                  maxlength="5" name="min" \r\n                  placeholder="Min">\r\n              </div>\r\n            </div>\r\n            <div class="col-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" class="form-control b-input-box" \r\n                id="fname" \r\n                (blur)="clearErrors()" \r\n                (change)="editDtiNumericMatch(range)"\r\n                [(ngModel)]="range.max" maxlength="5" name="max" \r\n                placeholder="Max">\r\n              </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </form>\r\n    </div>\r\n    <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" type="button" \r\n    [disabled]="err.dti.range" \r\n    (click)="editDtiRange(editDtiRangeForm.value, editDtiModel)">Submit</button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--ADD FICO RANGE Models --\x3e\r\n<p-dialog header="Add FICO Range" [(visible)]="openfico" [draggable]= fal
1se (onHide)="actionOnClose()" closeIcon="rate-modal-close" [closeOnEscape]="(dtiRanges.length == 1 && \r\n!(dtiRanges[0].rowcells && dtiRanges[0].rowcells.length)) ? false : true" [closable]="(dtiRanges.length == 1 && \r\n!(dtiRanges[0].rowcells && dtiRanges[0].rowcells.length)) ? false : true" class="rate-modal" [modal]=true  position="top">\r\n<div class="modal-body">\r\n    <form #addficoRangeForm="ngForm" class="form-inline">\r\n      <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.highFicoRange && !err.fico.range && !err.fico.modify" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Min value cannot start at 850 and Max value cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.range && !err.fico.modify && !err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric.\r\n            </div>\r\n            <div *ngIf="err.fico.modify && !err.fico.range && !err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous FICO column.\r\n            </div>\r\n            <div *ngIf="err.fico.modify && err.fico.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous FICO column & Please enter 4 character long numeric.\r\n            </div>\r\n            <div *ngIf="err.fico.modify && err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous FICO column & cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.range && err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric & cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.rangeValidate" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <input type="hidden" \r\n            [(ngModel)]="range.id" \r\n            name="id">\r\n            <div class="row">\r\n            <div class="col-md-3 offset-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="addFicoNumericMatch(range)"\r\n                [(ngModel)]="range.min" \r\n                maxlength="4" name="min" \r\n                placeholder="Min">\r\n              </div>\r\n            </div>\r\n            <div class="col-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" class="form-control b-input-box" \r\n                id="fname" \r\n                [(ngModel)]="range.max" \r\n                (blur)="addFicoNumericMatch(range)"\r\n                name="max" maxlength="4" placeholder="Max">\r\n              </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </form>\r\n    </div>\r\n    <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" \r\n    type="button" \r\n    [disabled]="err.fico.range||\r\n    err.fico.modify||\r\n    err.highFicoRange"\r\n    (click)="addNewFicoRange(addficoRangeForm.value, addFicoModel)">Submit</button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--EDIT FICO RANGE MODEL--\x3e\r\n<p-dialog header="Edit FICO Range" [(visible)]="openeditfico" [draggable]= false [closeOnEscape]= true (onHide)="actionOnClose()" [dismissableMask]= true [closable]= true closeIcon="rate-modal-close" class="rate-modal" [modal]=true  position="top" #editFicoModel>\r\n  <div class="modal-body">\r\n    <form #editFicoRangeForm="ngForm" \r\n    class="form-inline">\r\n      <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.fico.edit" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Range is not acceptable. Please don\'t overlap with last and next range.\r\n            </div>\r\n            <div *ngIf="err.fico.rangeValidate" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <div *ngIf="err.highFicoRange && !err.fico.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Min value cannot start at 850 and Max value cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.range  && !err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric.\r\n            </div>\r\n            <div *ngIf="err.fico.range && err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric & cannot exceed 850.\r\n            </div>\r\n            <input type="hidden" [(ngModel)]="range.id" name="id">\r\n            <div class="row">\r\n            <div class="col-lg-3 offset-md-3">\r\n              <div class="mb-3">
1\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="editFicoNumericMatch(range)"\r\n                maxlength="4" \r\n                [(ngModel)]="range.min" \r\n                name="min" placeholder="Min">\r\n              </div>\r\n            </div>\r\n            <div class="col-lg-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="editFicoNumericMatch(range)"\r\n                maxlength="4" \r\n                [(ngModel)]="range.max" \r\n                name="max" placeholder="Max">\r\n              </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </form>\r\n    </div>\r\n    <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" \r\n    type="button" \r\n    [disabled]="err.fico.range|| err.highFicoRange" \r\n    (click)="editFicoRange(editFicoRangeForm.value, editFicoModel)">\r\n      Submit\r\n    </button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--FICO DELETE CONFIRMATION MODEL--\x3e\r\n<p-dialog  [(visible)]="opendelfico" [draggable]= false [closeOnEscape]= true (onHide)="actionOnClose()" [dismissableMask]= true closeIcon="rate-modal-close" [closable]= true class="rate-modal delete-modal" [modal]=true  position="top" #ficoDeleteConfirmation>\r\n  <p-header>\r\n    Are you sure want to delete. \r\n</p-header> \r\n<p>Please ensure that you save changes before exiting the Rate Maintenance page</p>\r\n    <div *ngIf="!ficoDeleteConfirmation.canDelete" class="ra-err-blk position-absolute email-pop-error-txt">\r\n      You cannot delete last FICO range. You can edit only.\r\n    </div>\r\n    <p-footer>\r\n    <div class="text-center modal-body">\r\n      <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n      type="button"\r\n      [disabled]="!ficoDeleteConfirmation.canDelete"\r\n      (click)="deleteFicoRange(ficoDeleteConfirmation)">Yes</button>\r\n      <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n      type="button" \r\n      (click)="ficoDeleteConfirmation.close()">No</button>\r\n    </div>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n  \x3c!--DTI DELETE CONFIRMATION MODEL--\x3e\r\n  <p-dialog  [(visible)]="opendeldti" [draggable]= false [closeOnEscape]= true (onHide)="actionOnClose()" [dismissableMask]= true closeIcon="rate-modal-close" [closable]= true class="rate-modal delete-modal"  [modal]=true  position="top" #dtiDeleteConfirmation>\r\n    <p-header>\r\n      Are you sure want to delete. \r\n  </p-header> \r\n    <p>Please ensure that you save changes before exiting the Rate Maintenance page</p>\r\n      <div *ngIf="!dtiDeleteConfirmation.canDelete" class="ra-err-blk position-absolute email-pop-error-txt">\r\n        You cannot delete last DTI range. You can edit only.\r\n      </div>\r\n      <p-footer>\r\n      <div class="text-center modal-body">\r\n        <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n        type="button" \r\n        [disabled]="!dtiDeleteConfirmation.canDelete"\r\n        (click)="deleteDtiModel(dtiDeleteConfirmation)">Yes</button>\r\n        <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n        type="button" \r\n        (click)="dtiDeleteConfirmation.close()">No</button>\r\n      </div>\r\n    </p-footer>\r\n  </p-dialog>',standalone:!1,styles:[ze()]}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[T,v.n,k,I,x.d,H.SKi])],j);var Xe=h(3321),$e=h.n(Xe);let W=class{constructor(e,t,r,n,i,a){this.tierTermService=e,this.executorService=t,this._commonService=r,this.dtiFicoService=n,this._sharedService=i,this.ngZone=a,this.rate="VARIABLE",this.rateType="VARIABLE",this.dtificoList=[],this.dtificoTeirList=[],this.selectedTierList=[],this.termsList=[],this.tierRates=[],this.marginRates=[],this.err={},this.tierTermSpinner={},this.selectedRateTier=[],this.tiersList=[],this.dtiFicoSpinner={},this.rangeList=[],this.dtiRanges=[],this.opendti=!1,this.openfico=!1,this.openeditdti=!1,this.openeditfico=!1,this.opendelfico=!1,this.opendeldti=!1,this.variableIndexRate=new ee(1,""),this.range=new ie(0,0,0)}ngOnInit(){this.termsList=[],this.subscriptionIds=[],this.tierRates=[],this.tierTermSpinner={tierMaintenance:!1},this.dtiFicoSpinner={rangeMaintenance:!1},this.rangeList=[],this.err={decimal:!1,index:!1,libor:!1,inactive:!1,warning:!1,dti:{range:!1,rangeValidate:!1,edit:!1,modify:!1},fico:{range:!1,rangeValidate:!1,edit:!1,modify:!1},highFicoRange:!1},this.subscriptionIds.push(this.tierTermService.tierList.subscribe(e=>{this.tiersList=e})),this.subscriptionIds.push(this.dtiFicoService.dtiFicoList.subscribe(e=>{this.dtificoList=e})),this.subscriptionIds.push(this._commonService.selectedTierList.subscribe(e=>{this.selectedTierList=e}
1)),this.subscribeProduct(),this.getProductParams()}getProductParams(){this.executorService.query("/products","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.ngZone.run(()=>{this.productList=e,this.product=e[0],this.onChange()})})}onChange(){this._commonService.updateProduct(this.product.id)}exportTemplate(){this.tierTermService.getTemplate(this.product,this.rate)}clearWarnings(e){setTimeout(()=>{this.clearErrors()},e)}subscribeProduct(){var e=this;this.subscriptionIds.push(this._commonService.product.subscribe(t=>{t&&(e.productId=t,e.setHeaders(),e.getBindedTierList(),e.getDtiFicoData(e.rateType))}))}getActiveTiers(){let e=new y.Nl;e=e.set("rateType",this.rateType),this.tierTermService.getActiveTiers(e,this.productId)}getRates(e){let t=new y.Nl;t=t.set("rateType",e),this.tierTermService.getRateData(t,this.productId).pipe((0,b.W)(r=>this.handleError(r)),(0,f.T)(r=>r)).subscribe(r=>{this.ngZone.run(()=>{let n=r&&r.data&&r.data.tierList?r.data.tierList:[];this.variableIndexRate.indexValue=r.data?r.data.indexValue:0,this.variableIndexRate.liborMessage=r.data?r.data.liborMessage:"",this.tierRates=this.buildRates(n),this.marginRates=this.buildRates(n,!0)})})}setHeaders(){this._commonService.getProducts().pipe((0,f.T)(e=>e)).subscribe(e=>{this.ngZone.run(()=>{this._commonService.productList=e;for(var t=0;t<e.length;t++)e[t].id==this.productId&&(this.termsList=e[t].termMonths);this.getActiveTiers(),this.getRates(this.rateType)})})}updateTierData(){this.checkTierUsedInDtiFicoTable()?(this.clearErrors(),this.err.invalid=!0,this.clearWarnings(5e3)):(this.tierTermSpinner.tierMaintenance=!0,this.clearErrors(),this.tierTermService.sendData(this.getTierRate(this.tierRates),this.productId).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.ngZone.run(()=>{this.tierTermSpinner.tierMaintenance=!1,e&&"SUCCESS"==e.type&&(this.getActiveTiers(),this.getRates(this.rateType))})}))}checkTierUsedInDtiFicoTable(){let e=this.tierRates.filter(r=>!r.active).map(r=>r.tierName),t=[];return!!e.length&&(e.forEach(r=>{this.tierRates.findIndex(n=>n.active&&n.tierName===r)<0&&(t=t.concat(this.selectedTierList.filter(n=>n.value===r)))}),t.length>0)}updateVariableRate(e,t,r){let n=parseFloat(e);this.tierRates[r].terms[t].value=parseFloat((Number(n)+Number(this.variableIndexRate.indexValue)).toFixed(2))}updateIndexRate(e){let t=parseFloat(e);for(let r=0;r<this.tierRates.length;r++)for(let n=0;n<this.tierRates[r].terms.length;n++)this.tierRates[r].terms[n].value=parseFloat((Number(this.marginRates[r].terms[n].value)+Number(t)).toFixed(2))}removeItem(){let e=this.findLastActiveTierIndex();this.clearErrors();let t=this.tierRates[e].tierName;for(;0!=this.dtificoTeirList.length;)this.dtificoTeirList.pop();for(var r=0;r<this.dtificoList.length;r++){let i=this.dtificoList[r].value;this.dtificoTeirList.push(i)}if(this.err.inactive=this.isInArray(t,this.dtificoTeirList),this.clearWarnings(5e3),this.err.inactive)"VARIABLE"==this.rateType?window.scrollTo(0,window.innerHeight+400):window.scrollTo(0,window.innerHeight-320);else{var n=this;this._sharedService.showConfirm({message:"Are you sure you want delete T"+t+"?",uid:"MODAL_UW_STATUS",confirmCB:function(i){n.ngZone.run(()=>{n.matchTeir(e+1,n.selectedTierList)?(n.err.warning=!0,n.clearWarnings(5e3)):(n.tierRates[e].active=0,"FIXED"!==n.rateType&&(n.marginRates[e].active=0))})},cancelCB:function(i){}})}}matchTeir(e,t){for(let r=0;r<t.length;r++)if(t[r].value===e)return!0;return!1}isInArray(e,t){return t.indexOf(e)>-1}buildRates(e,t){let r=[];var n=this;let i,a;for(var s=0;s<e.length;s++){if(!r.length){p(d());continue}let o=this.availableTierLocation(r,e[s].tier);o>=0?(i=u(r[o].terms,e[s].termMonths),a=d(),a&&(r[o].terms[i]?r[o].terms[i]=a:r[o].terms.push(a))):p(d())}return r;function p(o){let g=new L;o&&g.terms.push(o),g.tierName=e[s].tier,g.rateType=e[s].rateType,g.active=e[s].active,r.push(g)}function d(){if(-1==n.termsList.indexOf(e[s].termMonths))return null;let o=new _;o.id=e[s].id,o.termMonth=e[s].termMonths;let g=t?parseFloat((Number(e[s].rate)-Number(n.variableIndexRate.indexValue)).toFixed(2)):e[s].rate.toFixed(2);return o.value=g,o}function u(o,g){let E;for(var F=0;F<o.length;F++)if(o[F].termMonth==g){E=F;break}return E}}availableTierLocation(e,t){for(let n=0;n<e.length;n++)if(e[n].tierName==t)return n;return-1}getTierRate(e){var t=new te,r=[];for(let i of e)if(null!=i.terms&&1==i.uiEnable||0==i.active)for(let a of i.terms){var n=new J;n.tier=i.tierName,n.rateType=i.rateType,n.active=i.active,n.termMonths=a.termMonth,n.id=a.id,n.rate=a.value,r.push(n)}return t.tierList=r,t.indexValue=this.variableIndexRate.indexValue,t.liborMessage=this.variableIndexRate.liborMessage,t}addTier(){var e=this;let t=this.tierRates.filter(r=>r.active).length-1;t=-1==t?1:t+1+1,this._sharedService.showConfirm({message:"Do you want to add T"+t+"?",uid:"MODAL_UW_STATUS",confirmCB:function(r){e.ngZone.run(()=>{e.addNewTierData(t)})},cancelCB:function(r){}})}addNewTierData(e){let t,r,a,s,n=[],i=[],p=1*this.variableIndexRate.indexValue;p=isNaN(p)?0:p;for(var d=0;d<this.termsList.length;d++)t=new _,t.value=p,t.termMonth=this.termsList[d],r=Object.assign({},t),r.value=0,n.push(t),i.push(r);a=new L,a.tierName=e,a.rateType=this.rateType,a.active=1,a.uiEnable=!0,s=Object.assign({},a),a.terms=n,s.terms=i,this.tierRates.push(a),this.marginRates.push(s)}createRange(e){for(var t=[],r=1;r<=e;r++)t.push(r);return t}findLastActiveTierIndex(){let e=-1;for(var t=this.tierRates.length-1;t>=0;t--)if(this.tierRates[t].active){e=t;break}return e}patternMatch(e,t){switch(e){case"LIBOR":this.err.libor=!/^[a-zA-Z0-9\-\s]+$/.test(t);break;
1case"DECIMAL":this.err.decimal=!1,n(t)&&(this.err.decimal=!0,setTimeout(()=>{window.scrollTo(0,window.innerHeight-400)}));break;case"INDEX":this.err.index=!!n(t)}function n(i){return!/^-?[0-9]{1,2}(\.[0-9]{1,2})?$/.test(i)}}getDtiFicoData(e){let t=new y.Nl;t=t.set("rateType",this.rateType),this.dtiFicoService.getDtiFicoData(t,this.productId).pipe((0,b.W)(r=>this.handleError(r)),(0,f.T)(r=>r)).subscribe(r=>{this.ngZone.run(()=>{this.dtiRanges=this.buildData(r.data),this.setFicoHeaders(this.getDtiFico(this.dtiRanges))})})}setFicoHeaders(e){for(;this.rangeList.length>0;)this.rangeList.pop();for(let n=0;n<e.length;n++)0==e[n].active&&(e.splice(n,1),n-=1);for(var t=new re.NZ,r=0;r<e.length;r++)t.add(e[r].ficoMin+"-"+e[r].ficoMax);for(let n of t.toArray())this.rangeList.push(n)}adddtiRange(){this.range=new R(0,0,0),this.opendti=!0}addficoRange(){this.range=new R(0,0,0),this.openfico=!0}getBindedTierList(){let e=new y.Nl;e=e.set("rateType",this.rateType),this.dtiFicoService.getDtiFicoTiers(e,this.productId)}submit(){this.dtiFicoSpinner.rangeMaintenance=!0,this.dtiFicoService.sendData(this.getDtiFico(this.dtiRanges),this.productId).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.ngZone.run(()=>{this.dtiFicoSpinner.rangeMaintenance=!1,this.updateBindedTiers(e)})})}updateBindedTiers(e){e&&"SUCCESS"==e.type&&(this.getBindedTierList(),this.getDtiFicoData(this.rateType))}buildData(e){let t=[];for(var r=0;r<e.length;r++){let a,n=new C,i=new N;if(n.id=e[r].id,n.value=e[r].tier,n.ficoMax=e[r].ficoMax,n.ficoMin=e[r].ficoMin,n.active=e[r].active,n.columnArrayCell=r,i.rowcells.push(n),i.dtiMax=e[r].dtiMax,i.dtiMin=e[r].dtiMin,i.rateType=e[r].rateType,i.rowArrayCell=r,t.length<=0)t.push(i);else if(a=this.availableDtiLocation(t,e[r].dtiMin,e[r].dtiMax),a>-1){let s=t[a].rowcells,p=!1;for(let d=0;d<s.length;d++)if(s[d].ficoMax==n.ficoMax&&s[d].ficoMin==n.ficoMin){p=!0;break}p||s.push(n)}else t.push(i)}return t}availableDtiLocation(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];if(a.dtiMin==t&&a.dtiMax==r)return i}return-1}getDtiFico(e){let t=[];for(let r of e)if(r.rowcells)for(let n of r.rowcells){let i=new ne;i.id=n.id,i.dtiMax=r.dtiMax,i.dtiMin=r.dtiMin,i.active=n.active,i.ficoMax=n.ficoMax,i.ficoMin=n.ficoMin,i.rateType=r.rateType,i.tier=n.value,t.push(i)}return t}makeInactive(e,t){for(let r=0;r<e.length;r++)e[r].rowcells[t].active=0}deleteFico(e,t,r){let n;for(let i=0;i<this.dtiRanges.length;i++)if(this.dtiRanges[i].active){n=0;for(let a=0;a<this.dtiRanges[i].rowcells.length;a++)this.dtiRanges[i].rowcells[a].active&&(n+=1)}this.opendelfico=!0,r.index=e,r.range=t,r.canDelete=1!=n}deleteFicoRange(e){let t=e.index;const r=e.range.split("-");for(this.range.min=Number(r[0]),this.range.max=Number(r[1]);this.dtiRanges[0].rowcells[t].ficoMax!=this.range.max;)t+=1;this.makeInactive(this.dtiRanges,t),this.rangeList.splice(e.index,1),this.opendelfico=!1,this.getRateTierSelected()}editFico(e,t,r){let n=e.split("-"),i=n[0],a=n[1];r.min=i,r.max=a,r.editMax=a,r.index=t,this.range=new R(1*i,1*a,0),this.openeditfico=!0}editFicoRange(e,t){let r=1*e.min,n=1*e.max;r>n?this.err.fico.rangeValidate=!0:(this.err.fico.rangeValidate=!1,this.editFicoRangeMidCombinationCheck(e,{maxValue:t.editMax,index:t.index})?this.err.fico.edit=!0:(this.err.fico.edit=!1,this.editFicoColumn(r,n,{maxValue:t.editMax,index:t.index}),this.setFicoHeaders(this.getDtiFico(this.dtiRanges)),t.editMax=0,this.openeditfico=!1))}editFicoRangeMidCombinationCheck(e,t){var r=this;let n,i=!!function a(p){let d=0;for(let o=t.index-1;o>=0;o--)if(r.dtiRanges[0].rowcells[o].active){d=r.dtiRanges[0].rowcells[o].ficoMax;break}return p>=850||d>=p}(1*e.min);return n=t.index+1!=this.dtiRanges[0].rowcells.length&&!!function s(p){let d=0,u=r.dtiRanges[0].rowcells.length;for(let o=t.index+1;o<u;o++)if(r.dtiRanges[0].rowcells[o].active&&r.dtiRanges[0].rowcells[o].ficoMax!=t.maxValue){d=Number(r.dtiRanges[0].rowcells[o].ficoMin);break}return 0!=d&&p>=d}(1*e.max),i||n}editFicoColumn(e,t,r){let n=r.index;for(;this.dtiRanges[0].rowcells[n].ficoMax!=r.maxValue;)n+=1;for(let i=0;i<this.dtiRanges.length;i++)this.dtiRanges[i].rowcells[n].active&&(this.dtiRanges[i].rowcells[n].ficoMin=e,this.dtiRanges[i].rowcells[n].ficoMax=t)}addFicoNumericMatch(e){this.verifyLastMaxFicoRange(e.min),this.err.fico.range=!!this.addFicoCombineNumericCheck(e),this.err.highFicoRange=!!this.addFicoCombineHigherRangeCheck(e)}verifyLastMaxFicoRange(e){let t=this.getLastMaxFicoRange();this.err.fico.modify=t>e}getLastMaxFicoRange(){let e=0;if(this.dtiRanges.length&&this.dtiRanges[0].rowcells){for(let r=this.dtiRanges[0].rowcells.length;r>0;r--)if(this.dtiRanges[0].rowcells[r-1].active){e=this.dtiRanges[0].rowcells[r-1].ficoMax;break}}return e}addFicoCombineNumericCheck(e){let t=!1;return""!=e.max&&(t=!!this.ficoNumericMatch(e.max)),!(!t&&!this.ficoNumericMatch(e.min))}editDtiNumericMatch(e){this.err.dti.range=!!this.dtiCombineNumericCheck(e)}dtiCombineNumericCheck(e){return!!this.dtiDecimalMatch(e.max)||!!this.dtiDecimalMatch(e.min)}dtiDecimalMatch(e){return!/^-?[0-9]{1,2}(\.[0-9]{1,2})?$/.test(e)}
1addFicoCombineHigherRangeCheck(e){let t=!1;const r=e.max;0!==r&&""!==r&&(t=Number(r)>850);const n=Number(e.min)>849;return t||n}editFicoNumericMatch(e){this.err.fico.range=!!this.ficoEditCombineNumericCheck(e),this.err.highFicoRange=!!this.addFicoCombineHigherRangeCheck(e)}ficoEditCombineNumericCheck(e){return!!this.ficoNumericMatch(e.max)||!!this.ficoNumericMatch(e.min)}ficoNumericMatch(e){return!/^[0-9]{1,4}?$/.test(e)}addNewDtiRange(e,t,r){let n=this.rangeValidation(1*e.min,1*e.max,!0);if(this.err.dti.rangeValidate=!1,n)this.err.dti.rangeValidate=!0;else{let i;if(this.dtiRanges.length>0){let a;for(let s=0;s<this.dtiRanges.length;s++)if(this.dtiRanges[s].active){a=s;break}i=this.createNewDTIRow(e,a)}else i=this.createNewDTIRow(e,0),this.openfico=!0;this.dtiRanges.push(i),this.opendti=!1}}createNewDTIRow(e,t){let i,r=new N,n=[];this.dtiRanges.length&&(n=this.dtiRanges[t].rowcells),r.dtiMax=1*e.max,r.dtiMin=1*e.min,r.rateType=this.rateType;for(let a=0;a<n.length;a++)i=new C,e.id>0&&(i.id=e.id),i.ficoMax=n[a].ficoMax,i.ficoMin=n[a].ficoMin,i.value=1,i.active=this.dtiRanges[t].rowcells[a].active?1:0,r.rowcells.push(i);return r}addNewFicoRange(e,t){1*e.max||(e.max=850),this.err.fico.rangeValidate=!1,this.rangeValidation(1*e.min,1*e.max)?this.err.fico.rangeValidate=!0:(this.err.fico.rangeValidate=!1,this.dtiRanges.length>0&&this.createNewFicoColumn(e),this.setFicoHeaders(this.getDtiFico(this.dtiRanges)),this.openfico=!0,this.range=new R(0,0,0))}createNewFicoColumn(e){for(let t=0;t<this.dtiRanges.length;t++){let r=new C;e.id>0&&(r.id=e.id),r.value=1,r.ficoMax=e.max,r.ficoMin=e.min,r.active=this.dtiRanges[t].active?1:0,this.dtiRanges[t].rowcells.push(r)}}rangeValidation(e,t,r){if(e>=t)return!0;{let d,n=[],i=[],a=r?this.dtiRanges:this.dtiRanges[0].rowcells,s="ficoMin",p="ficoMax";r&&(s="dtiMin",p="dtiMax");for(let u=0;u<a.length;u++)d=r?this.dtiRanges[u].rowcells[0].active:this.dtiRanges[0].rowcells[u].active,d&&(n.push(a[u][s]),i.push(a[u][p]));return this.rangeCompare(i,n,e,t)}}deleteDti(e,t){t.index=e;let r=0;for(let n=0;n<this.dtiRanges.length;n++)this.dtiRanges[n].active&&(r+=1);t.canDelete=1!=r,this.opendeldti=!0}deleteDtiModel(e){let t=e.index,r=this.dtiRanges[t].rowcells.length;for(let n=0;n<r;n++)this.dtiRanges[t].rowcells[n].active=0;this.dtiRanges[t].active=!1,this.opendeldti=!1,this.getRateTierSelected()}editDti(e,t,r,n){n.min=e,n.max=t,n.editMax=t,n.index=r,this.range=new R(e,t,0),this.openeditdti=!0}editDtiRange(e,t){1*e.min>=1*e.max?this.err.dti.rangeValidate=!0:(this.err.dti.rangeValidate=!1,this.editDtiRangeMidCombinationCheck(e,{index:t.index,maxValue:t.editMax})?this.err.dti.edit=!0:(this.err.dti.edit=!1,this.editDtiColumn(1*e.min,1*e.max,{index:t.index,maxValue:t.editMax}),t.editMax=0,this.openeditdti=!1))}editDtiRangeMidCombinationCheck(e,t){var r=this;let n=function a(){let p=0;for(let d=t.index-1;d>=0;d--)if(r.dtiRanges[d].active){p=r.dtiRanges[d].dtiMax;break}return p}()>=1*e.min,i=t.index+1!=this.dtiRanges.length&&!!function s(p){let d=0,u=r.dtiRanges.length;for(let o=t.index+1;o<u;o++)if(r.dtiRanges[o].active&&r.dtiRanges[o].dtiMax!=t.maxValue){d=Number(r.dtiRanges[o].dtiMin);break}return 0!=d&&p>=d}(1*e.max);return n||i}editDtiColumn(e,t,r){let n=r.index;for(;this.dtiRanges[n].dtiMax!=r.maxValue;)n+=1;this.dtiRanges[n].active&&(this.dtiRanges[n].dtiMin=e,this.dtiRanges[n].dtiMax=t)}addDtiNumericMatch(e){this.verifyLastMaxDTIRange(e.min),this.err.dti.range=!!this.dtiCombineNumericCheck(e)}verifyLastMaxDTIRange(e){let t=this.getLastMaxDtiRange();this.err.dti.modify=t>=e}getLastMaxDtiRange(){let e;e=this.dtiRanges.length;let t=0;for(let r=e;r>0;r--)if(this.dtiRanges[r-1].rowcells[0].active){t=this.dtiRanges[r-1].dtiMax;break}return t}rangeCompare(e,t,r,n){let i=[];for(let a=0;a<t.length;a++)i.push(n>=t[a]&&n<=e[a]),i.push(r>=t[a]&&r<=e[a]);return-1!=i.indexOf(!0)}getRateTierSelected(){this._commonService.getSelectedTierList(this.getSelectedTierList())}getSelectedTierList(){for(;0!=this.selectedRateTier.length;)this.selectedRateTier.pop();for(let e=0;e<this.dtiRanges.length;e++)if(this.dtiRanges[e].active)for(let t=0;t<this.dtiRanges[e].rowcells.length;t++)if(this.dtiRanges[e].rowcells[t].active){let r=this.dtiRanges[e].rowcells[t].value;this.selectedRateTier.push(new O(r))}return this.selectedRateTier}actionOnClose(){this.err={dti:{range:!1,rangeValidate:!1,edit:!1,modify:!1},fico:{range:!1,rangeValidate:!1,modify:!1,edit:!1}},this.range=new R(0,0,0),this.err.highFicoRange=!1}handleError(e){return this.tierTermSpinner.tierMaintenance=!1,this.dtiFicoSpinner.rangeMaintenance=!1,(0,A.$)(e||"Server Error")}clearErrors(){this.err.libor=!1,this.err.index=!1,this.err.inactive=!1,this.err.warning=!1,this.err.decimal=!1,this.err.invalid=!1,this.err.dti.rangeValidate=!1,this.err.dti.edit=!1,this.err.fico.rangeValidate=!1,this.err.fico.edit=!1}ngOnDestroy(){for(var e=0;e<this.subscriptionIds.length;e++)this.subscriptionIds[e]&&this.subscriptionIds[e].unsubscribe()}static{this.ctorParameters=()=>[{type:T},{type:v.n},{type:k},{type:I},{type:x.d},{type:H.SKi}]}};W=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"variable",template:'<div class="mt-5">\r\n\t<div class="mb-3 ld-form-cus">
1\r\n\t\t<label for="fname" class="borrower-labels">Product\r\n            </label>\r\n\t\t<div class="d-flex justify-content-between">\r\n\t\t\t<select class="form-control select-b-input-box product-select" [(ngModel)]="product" (change)="onChange()" name="pname">\r\n\t\t\t\t<option *ngFor="let item of productList" [ngValue]="item">{{item.name}}</option>\r\n\t\t\t</select>\r\n\t\t\t<button type="button" class="button-new-css position-relative" (click)="exportTemplate()" [disabled]="!product">\r\n\t\t\t\tExport Template\r\n\t\t\t</button>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n\x3c!-- <tier-term [rateType]="rate"></tier-term>\r\n<dti-fico [rateType]="rate"></dti-fico> --\x3e\r\n\r\n\x3c!--Variable Table Margin Maintenance--\x3e\r\n<div class="variable-margin" *ngIf="rateType !== \'FIXED\'">\r\n  <div>\r\n    <div class="row position-relative">\r\n      <div class="col-lg-12">\r\n        <div class="margin-heading sub-headings">\r\n          <h4>Margin Maintenance</h4>\r\n          <div class="libor-index">\r\n            <div class="libor-container position-relative">\r\n              <div *ngIf="err.libor" \r\n              class="ra-err-blk index-err-blk position-absolute cus-left">\r\n                Libor message is not valid\r\n              </div>\r\n              <label *ngIf="variableIndexRate.indexValue == 0.2" for="libor">LIBOR</label>\r\n              <label *ngIf="variableIndexRate.indexValue != 0.2" for="libor">PRIME</label>\r\n              <input type="text" id="libor" class="index-box" [(ngModel)]="variableIndexRate.liborMessage" (keyup)="patternMatch(\'LIBOR\', variableIndexRate.liborMessage)" name="liborMessage" placeholder="LIBOR"\r\n                maxlength="35">\r\n            </div>\r\n            <div class="index-container position-relative">\r\n              <div *ngIf="err.index" \r\n              class="ra-err-blk index-err-blk position-absolute">\r\n                Enter only 2.2 long numeric\r\n              </div>\r\n              <label for="index">Index</label>\r\n              <input type="text" id="index" class="index-box" [(ngModel)]="variableIndexRate.indexValue" (keyup)="patternMatch(\'INDEX\', variableIndexRate.indexValue)"\r\n                name="index" placeholder="Index" maxlength="5">\r\n                \x3c!-- (change)="updateIndexRate(variableIndexRate.indexValue)" name="index" placeholder="Index" maxlength="5"> --\x3e\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <form class="w-100" #variableForm="ngForm">\r\n      <div class="">\r\n        <table class="col-sm-12 rate-table">\r\n          <thead>\r\n            <tr>\r\n              <th class="border-cell tier-cell" width="16%"></th>\r\n              <th class="border-cell" [attr.colspan]="termsList.length">Term</th>\r\n            </tr>\r\n            <tr class="term-columns-header-row">\r\n              <th class="border-cell tier-cell" width="16%">Tier</th>\r\n              <th class="border-cell" *ngFor="let term of termsList">\r\n                {{term}} Months\r\n              </th>\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            <ng-container *ngFor="let margin of marginRates; let rowindex = index">\r\n              <tr *ngIf="margin.active == 1">\r\n                <td class="border-cell">\r\n                  T{{margin.tierName}}\r\n                </td>\r\n                <input type="hidden" \r\n                [(ngModel)]="margin.rateType" \r\n                name="rateType" />\r\n                <td class="border-cell position-relative" \r\n                *ngFor="let term of margin.terms; let cellindex = index">\r\n                  <input type="hidden" [(ngModel)]="term.id" name="id" />\r\n                  <div>\r\n                    \x3c!-- ust1171: update the rate through template --\x3e\r\n                    <input type="text" class=" table-cell" [(ngModel)]="term.value" #value="ngModel" maxlength="5" (blur)="patternMatch(\'DECIMAL\', term.value)"\r\n                      (change)="updateVariableRate(term.value, cellindex, rowindex)" [ngModelOptions]="{standalone: true}" disabled></div>\r\n                </td>\r\n              </tr>\r\n            </ng-container>\r\n          </tbody>\r\n        </table>\r\n      </div>\r\n    </form>\r\n    <div *ngIf="err.decimal" \r\n    class="ra-err-blk mm-err-blk position-absolute">\r\n      Enter only 2.2 long numeric\r\n    </div>\r\n  </div>\r\n</div>\r\n<div class="tier-block variable-tier" *ngIf="rateType !== \'FIXED\'">\r\n  <div class="row">\r\n    <div class="col-lg-12">\r\n      <div class="row">\r\n        <div class="col-lg-12">\r\n          <div class="sub-headings">\r\n            <h4>Tier Maintenance</h4>\r\n            <button class="btn dti-edit-btn ms-0" (click)="addTier()">\r\n              Add Tier\r\n            </button>\r\n            <button class="btn dti-edit-btn" (click)="removeItem()" [disabled]="!tierRates.length">\r\n              Delete Last Tier\r\n            </button>\r\n          </div>\r\n        </div>\r\n      </div>\r\n      <div class="">\r\n        <table class="col-sm-12 rate-table">\r\n          <thead>\r\n            <tr>\r\n              <th class="border-cell tier-cell" width="16%"></th>\r\n              <th class="border-cell" [attr.colspan]="termsList.length">Term</th>\r\n            </tr>\r\n            <tr class="term-columns-header-row">\r\n              <th class="border-cell tier-cell" width="16%">Tier</th>\r\n              <th class="border-cell" *ngFor="let term of termsList">\r\n                {{term}} Months\r\n              </th>\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            <ng-container *ngFor="let item of tierRates; let i = index">\r\n              <tr *ngIf="item.active == 1">\r\n                <td class="border-cell">\r\n                  T{{item.tierName}}\r\n                </td>\r\n                <input type="hidden" [(ngModel)]="item.rateType" name="rateType" />\r\n                <td *ngFor="let term of item.terms" class="border-cell position-relative">\r\n                  <input type="hidden" [(ngModel)]="term.id" name="id" />\r\n                  <div>\r\n                    <input type="text" class="table-cell" [(ngModel)]="term.value" (blur)="patternMatch(\'DECIMAL\', term.value)" #rate="ngModel" [ngModelOptions]="{standalone: true}" [disabled]="(item.uiEnable != null && item.uiEnable === true)?false:true">\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </ng-container>\r\n          </tbody>\r\n        </table>\r\n        <div *ngIf="err.inactive" class="ra-err-blk status-err-blk text-end">\r\n          Cannot change status as the value is used in the DTI vs FICO range table.\r\n        </div>\r\n        <div *ngIf="err.warning" class="ra-err-blk status-err-blk text-end">\r\n          Tier is selected in below table, cannot make it Inactive.\r\n        </div>\r\n        <div *ngIf="err.invalid" class="ra-err-blk status-err-blk text-end">\r\n          Invalid tier is selected in below table.\r\n        </div>\r\n      </div>\r\n      <div class="tier-save-row">\r\n        <button class="btn dti-edit-btn position-relative" value="save" [disabled]="err.decimal || err.index || err.libor || err.warning || tierTermSpinner.tierMaintenance" 
1(click)="updateTierData()">\r\n          Save\r\n          <span *ngIf="tierTermSpinner.tierMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n\x3c!-- ===================== DTI / FICO Range Maintenance ===================== --\x3e\r\n<div class="dti-wrap" \r\n*ngIf="rateType === \'FIXED\'">\r\n  <div>\r\n    <div class="row">\r\n      <div class="col-lg-12">\r\n        <div class="sub-headings">\r\n          <h4>DTI / FICO Range Maintenance </h4>\r\n          <button class="btn dti-edit-btn ml-0" \r\n          (click)="adddtiRange()"\r\n          [disabled]="!tiersList.length"\r\n          style="display: none;">\r\n            Add DTI Range\r\n          </button>\r\n          <button class="btn dti-edit-btn" \r\n          (click)="addficoRange()"\r\n          [disabled]="!dtiRanges.length"\r\n          style="display: none;">\r\n            Add Fico Range\r\n          </button>\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <div class="dti-table-container table-responsive">\r\n      <table class="col-12 rate-table ra-rate-table padded-cell">\r\n        <thead>\r\n          <tr>\r\n            <th class="border-cell header-cell" \r\n            rowspan="2" width="16%">\r\n              DTI Range\r\n            </th>\r\n            <th class="border-cell header-cell" \r\n            [attr.colspan]="rangeList.length">\r\n              FICO Range\r\n            </th>\r\n          </tr>\r\n          <tr>\r\n            <th class="border-cell padded-cell" \r\n            *ngFor="let range of rangeList; let rowindex = index">\r\n              <span class="edit-icon" style="display: none;"\r\n              (click)="editFico(range, rowindex, editFicoModel)">\r\n              </span>\r\n              <span class="delete-icon" style="display: none;"\r\n              (click)="deleteFico(rowindex, range, ficoDeleteConfirmation)">\r\n              </span>\r\n              <span class="range-one-start">{{range}}</span>\r\n            </th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          <tr *ngFor="let range of dtiRanges; let rowindex = index">\r\n            <td class="border-cell padded-cell" \r\n            [hidden]="!range.active">\r\n              <div>\r\n                <span class="edit-icon" style="display: none;"\r\n                (click)="editDti(range.dtiMin, range.dtiMax, rowindex, editDtiModel)">\r\n                </span>\r\n                <span class="delete-icon" style="display: none;"\r\n                (click)="deleteDti(rowindex, dtiDeleteConfirmation)">\r\n                </span>\r\n                <span class="dti-range-one-start">\r\n                  {{range.dtiMin}}\r\n                  </span> - \r\n                  <span class="dti-range-one-end">\r\n                    {{range.dtiMax}}\r\n                  </span>\r\n              </div>\r\n            </td>\r\n            <ng-container *ngFor="let rowcell of range.rowcells; let ind = index;">\r\n              <td class="border-cell padded-cell"\r\n              [hidden]="rowcell.active==0">\r\n                <select style="display: none;"\r\n                [(ngModel)]="rowcell.value" \r\n                name="value" \r\n                (change)="getRateTierSelected($event.target.value)">\r\n                  <option *ngFor="let cell of tiersList" \r\n                  value="{{cell.value}}" \r\n                  [hidden]="!cell.active" >\r\n                    T{{cell.value}}\r\n                  </option>\r\n                </select>\r\n                T{{rowcell.value}}\r\n              </td>\r\n            </ng-container>\r\n            <ng-container *ngIf="range.rowcells && (range.rowcells.length < rangeList.length)">\r\n              <td *ngFor="let x of createRange(rangeList.length - range.rowcells.length)"\r\n              class="border-cell padded-cell">\r\n                -\r\n              </td>\r\n            </ng-container>\r\n          </tr>\r\n        </tbody>\r\n      </table>\r\n    </div>\r\n    <div class="row" style="display: none;">\r\n      <div class="col-sm-12">\r\n        <button class="btn button-new-css tier-save-btn position-relative" value="save" [disabled]="dtiFicoSpinner.rangeMaintenance"  (click)="submit()">
1\r\n          Save\r\n          <span *ngIf="dtiFicoSpinner.rangeMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>      \r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n\x3c!--Variable Table --\x3e\r\n<div class="dti-wrap" \r\n*ngIf="rateType !== \'FIXED\'">\r\n  <div>\r\n    <div class="row">\r\n      <div class="col-lg-12">\r\n        <div class="sub-headings">\r\n          <h4>DTI / FICO Range Maintenance</h4>\r\n          <button class="btn dti-edit-btn ms-0" \r\n          (click)="adddtiRange()"\r\n          [disabled]="!tiersList.length"\r\n          style="display: none;">\r\n            Add DTI Range</button>\r\n          <button class="btn dti-edit-btn" \r\n          (click)="addficoRange()"\r\n          [disabled]="!dtiRanges.length"\r\n          style="display: none;">\r\n            Add Fico Range\r\n          </button>\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <div class="dti-table-container table-responsive">\r\n      <table class="col-12 rate-table ra-rate-table padded-cell">\r\n        <thead>\r\n          <tr>\r\n            <th class="border-cell header-cell" \r\n            rowspan="2" width="16%">\r\n              DTI Range\r\n            </th>\r\n            <th class="border-cell header-cell" \r\n            [attr.colspan]="rangeList.length">\r\n              FICO Range\r\n            </th>\r\n          </tr>\r\n          <tr>\r\n            <th class="border-cell padded-cell" \r\n            *ngFor="let range of rangeList; let rowindex = index">\r\n              <span class="edit-icon" style="display: none;"\r\n              (click)="editFico(range, rowindex, editFicoModel)">\r\n              </span>\r\n              <span class="delete-icon" style="display: none;"\r\n              (click)="deleteFico(rowindex, range, ficoDeleteConfirmation)">\r\n              </span>\r\n              <span class="range-one-start">\r\n                {{range}}\r\n              </span>\r\n            </th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          <tr *ngFor="let range of dtiRanges; let rowindex = index">\r\n            <td class="border-cell padded-cell" \r\n            [hidden]="!range.active">\r\n              <div>\r\n                <span class="edit-icon" style="display: none;"\r\n                (click)="editDti(range.dtiMin, range.dtiMax, rowindex, editDtiModel)">\r\n                </span>\r\n                <span class="delete-icon" style="display: none;"\r\n                (click)="deleteDti(rowindex, dtiDeleteConfirmation)">\r\n                </span>\r\n                <span class="dti-range-one-start">\r\n                  {{range.dtiMin}}\r\n                </span> - \r\n                <span class="dti-range-one-end">\r\n                  {{range.dtiMax}}\r\n                </span>\r\n              </div>\r\n            </td>\r\n            <ng-container *ngFor="let rowcell of range.rowcells;">\r\n              <td class="border-cell padded-cell" \r\n              [hidden]="rowcell.active==0">\r\n                <select [(ngModel)]="rowcell.value" style="display: none;"\r\n                name="value" \r\n                (change)="getRateTierSelected($event.target.value)">\r\n                  <option *ngFor="let cell of tiersList" \r\n                  value="{{cell.value}}" \r\n                  [hidden]="!cell.active" >\r\n                    T{{cell.value}}\r\n                  </option>\r\n                </select>\r\n                T{{rowcell.value}}\r\n              </td>\r\n            </ng-container>\r\n            <ng-container *ngIf="range.rowcells && (range.rowcells.length < rangeList.length)">\r\n              <td *ngFor="let x of createRange(rangeList.length - range.rowcells.length)"\r\n              class="border-cell padded-cell">\r\n                -\r\n              </td>\r\n            </ng-container>\r\n          </tr>\r\n        </tbody>\r\n      </table>\r\n    </div>\r\n    <div class="row" style="display: none;">\r\n      <div class="col-sm-12">\r\n        <button class="btn button-new-css tier-save-btn position-relative" value="save"  [disabled]="dtiFicoSpinner.rangeMaintenance" 
1(click)="submit()">\r\n          Save\r\n          <span *ngIf="dtiFicoSpinner.rangeMaintenance">\r\n            <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls-2x"></i>\r\n          </span>\r\n        </button>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n\x3c!--Popup Models --\x3e\r\n\x3c!--ADD DTI RANGE Models --\x3e\r\n<p-dialog header="Add DTI Range" [(visible)]="opendti" [draggable]= false [closeOnEscape]= true [dismissableMask]= true (onHide)="actionOnClose()" closeIcon="rate-modal-close" [closable]= true class="rate-modal" [modal]=true  position="top" #addDtiModel>\r\n  <div class="modal-body">\r\n  <form #addDtiRangeForm="ngForm" class="form-inline">\r\n    <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.dti.range && !err.dti.modify" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 2.2 character long numeric\r\n            </div>\r\n            <div *ngIf="err.dti.modify && !err.dti.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous DTI column.\r\n            </div>\r\n            <div *ngIf="err.dti.modify && err.dti.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous DTI column and Please enter 2.2 character long numeric\r\n            </div>\r\n            <div *ngIf="err.dti.rangeValidate" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <input type="hidden" [(ngModel)]="range.id" name="id">\r\n            <div class="row">\r\n            <div class="col-md-3 offset-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="addDtiNumericMatch(range)"\r\n                 maxlength="5" \r\n                 [(ngModel)]="range.min" \r\n                 maxlength="5" \r\n                 name="min" placeholder="Min" \r\n                 #min="ngModel">\r\n              </div>\r\n            </div>\r\n            <div class="col-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="addDtiNumericMatch(range)"\r\n                maxlength="5" \r\n                [(ngModel)]="range.max" \r\n                maxlength="5" name="max" \r\n                placeholder="Max" #max="ngModel">\r\n              </div>\r\n            </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n    </form>\r\n  </div>\r\n  <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" \r\n    type="button" \r\n    [disabled]="err.dti.range||\r\n    err.dti.modify" \r\n    (click)="addNewDtiRange(addDtiRangeForm.value, addDtiModel, (!dtiRanges.length ? addFicoModel : null))">\r\n      Submit\r\n    </button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--EDIT DTI RANGE MODEL--\x3e\r\n<p-dialog header="Edit DTI Range" [(visible)]="openeditdti" [draggable]= false [closeOnEscape]= true [dismissableMask]= true closeIcon="rate-modal-close" (onHide)="actionOnClose()" [closable]= true class="rate-modal" [modal]=true  position="top" #editDtiModel >\r\n  <div class="modal-body">\r\n    <form #editDtiRangeForm="ngForm" \r\n    class="form-inline">\r\n      <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.dti.range" \r\n            class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 2.2 character long numeric\r\n            </div>\r\n            <div *ngIf="err.dti.edit" \r\n            class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Range is not acceptable.Please don\'t overlap with last and next range.\r\n            </div>\r\n            <div *ngIf="err.dti.rangeValidate" \r\n            class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <input type="hidden" [(ngModel)]="range.id" name="id">\r\n          <div class="row">\r\n            <div class="col-md-3 offset-md-3">\r\n              <div class="mb-3">
1\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" class="form-control b-input-box" \r\n                id="fname" (blur)="clearErrors()" \r\n                (change)="editDtiNumericMatch(range)"\r\n                  [(ngModel)]="range.min" \r\n                  maxlength="5" name="min" \r\n                  placeholder="Min">\r\n              </div>\r\n            </div>\r\n            <div class="col-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" class="form-control b-input-box" \r\n                id="fname" \r\n                (blur)="clearErrors()" \r\n                (change)="editDtiNumericMatch(range)"\r\n                [(ngModel)]="range.max" maxlength="5" name="max" \r\n                placeholder="Max">\r\n              </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </form>\r\n    </div>\r\n    <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" type="button" \r\n    [disabled]="err.dti.range" \r\n    (click)="editDtiRange(editDtiRangeForm.value, editDtiModel)">Submit</button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--ADD FICO RANGE Models --\x3e\r\n<p-dialog header="Add FICO Range" [(visible)]="openfico" [draggable]= false (onHide)="actionOnClose()" closeIcon="rate-modal-close" [closeOnEscape]="(dtiRanges.length == 1 && \r\n!(dtiRanges[0].rowcells && dtiRanges[0].rowcells.length)) ? false : true" [closable]="(dtiRanges.length == 1 && \r\n!(dtiRanges[0].rowcells && dtiRanges[0].rowcells.length)) ? false : true" class="rate-modal" [modal]=true  position="top">\r\n<div class="modal-body">\r\n    <form #addficoRangeForm="ngForm" class="form-inline">\r\n      <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.highFicoRange && !err.fico.range && !err.fico.modify" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Min value cannot start at 850 and Max value cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.range && !err.fico.modify && !err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric.\r\n            </div>\r\n            <div *ngIf="err.fico.modify && !err.fico.range && !err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous FICO column.\r\n            </div>\r\n            <div *ngIf="err.fico.modify && err.fico.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous FICO column & Please enter 4 character long numeric.\r\n            </div>\r\n            <div *ngIf="err.fico.modify && err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please modify the higher range in the previous FICO column & cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.range && err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric & cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.rangeValidate" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <input type="hidden" \r\n            [(ngModel)]="range.id" \r\n            name="id">\r\n            <div class="row">\r\n            <div class="col-md-3 offset-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="addFicoNumericMatch(range)"\r\n                [(ngModel)]="range.min" \r\n                maxlength="4" name="min" \r\n                placeholder="Min">\r\n              </div>\r\n            </div>\r\n            <div class="col-md-3">\r\n              <div class="mb-3">
1\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" class="form-control b-input-box" \r\n                id="fname" \r\n                [(ngModel)]="range.max" \r\n                (blur)="addFicoNumericMatch(range)"\r\n                name="max" maxlength="4" placeholder="Max">\r\n              </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </form>\r\n    </div>\r\n    <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" \r\n    type="button" \r\n    [disabled]="err.fico.range||\r\n    err.fico.modify||\r\n    err.highFicoRange"\r\n    (click)="addNewFicoRange(addficoRangeForm.value, addFicoModel)">Submit</button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--EDIT FICO RANGE MODEL--\x3e\r\n<p-dialog header="Edit FICO Range" [(visible)]="openeditfico" [draggable]= false [closeOnEscape]= true (onHide)="actionOnClose()" [dismissableMask]= true [closable]= true closeIcon="rate-modal-close" class="rate-modal" [modal]=true  position="top" #editFicoModel>\r\n  <div class="modal-body">\r\n    <form #editFicoRangeForm="ngForm" \r\n    class="form-inline">\r\n      <div class="modal-body">\r\n        <div class="row">\r\n          <div class="col-lg-12 position-relative">\r\n            <div *ngIf="err.fico.edit" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Range is not acceptable. Please don\'t overlap with last and next range.\r\n            </div>\r\n            <div *ngIf="err.fico.rangeValidate" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter valid Range\r\n            </div>\r\n            <div *ngIf="err.highFicoRange && !err.fico.range" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Min value cannot start at 850 and Max value cannot exceed 850.\r\n            </div>\r\n            <div *ngIf="err.fico.range  && !err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric.\r\n            </div>\r\n            <div *ngIf="err.fico.range && err.highFicoRange" class="ra-err-blk position-absolute email-pop-error-txt">\r\n              Please enter 4 character long numeric & cannot exceed 850.\r\n            </div>\r\n            <input type="hidden" [(ngModel)]="range.id" name="id">\r\n            <div class="row">\r\n            <div class="col-lg-3 offset-md-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Min</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="editFicoNumericMatch(range)"\r\n                maxlength="4" \r\n                [(ngModel)]="range.min" \r\n                name="min" placeholder="Min">\r\n              </div>\r\n            </div>\r\n            <div class="col-lg-3">\r\n              <div class="mb-3">\r\n                <label for="fname" class="borrower-labels">Max</label>\r\n                <input type="text" \r\n                class="form-control b-input-box" id="fname" \r\n                (change)="clearErrors()" \r\n                (blur)="editFicoNumericMatch(range)"\r\n                maxlength="4" \r\n                [(ngModel)]="range.max" \r\n                name="max" placeholder="Max">\r\n              </div>\r\n            </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </form>\r\n    </div>\r\n    <p-footer>\r\n    <button class="button-new-css get-rate-btn email-pop-up-submit-btn float-end" \r\n    type="button" \r\n    [disabled]="err.fico.range|| err.highFicoRange" \r\n    (click)="editFicoRange(editFicoRangeForm.value, editFicoModel)">\r\n      Submit\r\n    </button>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n\x3c!--FICO DELETE CONFIRMATION MODEL--\x3e\r\n<p-dialog  [(visible)]="opendelfico" [draggable]= false [closeOnEscape]= true (onHide)="actionOnClose()" [dismissableMask]= true closeIcon="rate-modal-close" [closable]= true class="rate-modal delete-modal" [modal]=true  position="top" #ficoDeleteConfirmation>\r\n  <p-header>\r\n    Are you sure want to delete. \r\n</p-header> \r\n<p>Please ensure that you save changes before exiting the Rate Maintenance page</p>\r\n    <div *ngIf="!ficoDeleteConfirmation.canDelete" class="ra-err-blk position-absolute email-pop-error-txt">\r\n      You cannot delete last FICO range. You can edit only.\r\n    </div>\r\n    <p-footer>\r\n    <div class="text-center modal-body">\r\n      <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n      type="button"\r\n      [disabled]="!ficoDeleteConfirmation.canDelete"\r\n      (click)="deleteFicoRange(ficoDeleteConfirmation)">Yes</button>\r\n      <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n      type="button" \r\n      (click)="ficoDeleteConfirmation.close()">No</button>\r\n    </div>\r\n  </p-footer>\r\n</p-dialog>\r\n\r\n  \x3c!--DTI DELETE CONFIRMATION MODEL--\x3e\r\n  <p-dialog  [(visible)]="opendeldti" [draggable]= fal
1se [closeOnEscape]= true (onHide)="actionOnClose()" [dismissableMask]= true closeIcon="rate-modal-close" [closable]= true class="rate-modal delete-modal"  [modal]=true  position="top" #dtiDeleteConfirmation>\r\n    <p-header>\r\n      Are you sure want to delete. \r\n  </p-header> \r\n    <p>Please ensure that you save changes before exiting the Rate Maintenance page</p>\r\n      <div *ngIf="!dtiDeleteConfirmation.canDelete" class="ra-err-blk position-absolute email-pop-error-txt">\r\n        You cannot delete last DTI range. You can edit only.\r\n      </div>\r\n      <p-footer>\r\n      <div class="text-center modal-body">\r\n        <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n        type="button" \r\n        [disabled]="!dtiDeleteConfirmation.canDelete"\r\n        (click)="deleteDtiModel(dtiDeleteConfirmation)">Yes</button>\r\n        <button class="button-new-css get-rate-btn email-pop-up-submit-btn" \r\n        type="button" \r\n        (click)="dtiDeleteConfirmation.close()">No</button>\r\n      </div>\r\n    </p-footer>\r\n  </p-dialog>',standalone:!1,styles:[$e()]}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[T,v.n,k,I,x.d,H.SKi])],W);let q=class{constructor(e,t,r){this.fb=e,this.executorService=t,this._sharedService=r,this.adjustments=[],this.productAdjustments=[],this.arithmeticList=["-","+"],this.applicantList={Borrower:"B",Cosigner:"C",Both:"BOTH"},this.typeOperatorMap={},this.operatorList=[],this.valueList=[],this.productList=[],this.rateTypes=[],this.termMonths=[],this.searchValue="",this.isSchoolParameterSelected=!1,this.isApplyingAdjustment=!1}get applicantListArray(){return Object.keys(this.applicantList).map(e=>({key:e,value:this.applicantList[e]}))}get typeOperatorMapArray(){return this.typeOperatorMap&&"object"==typeof this.typeOperatorMap?Object.keys(this.typeOperatorMap).map(e=>({key:e,value:this.typeOperatorMap[e]})):[]}ngOnInit(){this.adjustments=[],this.spinner=!1,this.initializeForms()}initializeForms(){this.adjustmentEvalForm=this.fb.group({name:["",c.k0.compose([c.k0.required,
1c.k0.maxLength(30),c.k0.pattern("^[A-Za-z0-9][A-Za-z0-9 ]+$")])],borrowerType:["",c.k0.compose([c.k0.required])],parameterName:["",c.k0.compose([c.k0.required])],operator:["",c.k0.compose([c.k0.required])],value:["",c.k0.compose([c.k0.required,c.k0.minLength(1),c.k0.maxLength(50)])],maxValue:["",c.k0.compose([c.k0.pattern(/^-?[0-9]{1,2}(\.[0-9]{1,2})?$/)])],arithmetic:["",c.k0.compose([c.k0.required])],adjustedValue:["",c.k0.compose([c.k0.required,c.k0.pattern(/^-?[0-9]{1,2}(\.[0-9]{1,2})?$/)])]},{validator:e=>"B/W"==e.controls.operator.value?c.k0.required(e.controls.maxValue):(e.controls.maxValue.reset(null,{onlySelf:!0,emitEvent:!1}),"Length of Employment"==e.controls.parameterName.value?e.controls.value.setValidators(c.k0.compose([c.k0.required,c.k0.minLength(1),c.k0.maxLength(50),c.k0.pattern(/^[0-9]{1,10}$/)])):"Annual Income"==e.controls.parameterName.value?e.controls.value.setValidators(c.k0.compose([c.k0.required,c.k0.minLength(1),c.k0.maxLength(50),c.k0.pattern(/^[0-9]{1,10}(\.[0-9]{1,2})?$/)])):e.controls.value.setValidators(c.k0.compose([c.k0.required,
1c.k0.minLength(1),c.k0.maxLength(50)])),null)}),this.adjustmentForm=this.fb.group({productName:["",c.k0.compose([c.k0.required])],rateType:["",c.k0.compose([c.k0.required])],termMonths:["",c.k0.compose([c.k0.required])],adjustmentName:["",c.k0.compose([c.k0.required])]}),this.getAdjustmentParams(),this.getAllAdjustments(),this.getAllProductAdjustments(),this.getProductParams()}getAdjustmentParams(){this.executorService.query("/adjustments/parameters","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this._sharedService.showLoader(!1),this.typeOperatorMap=e})}getAllAdjustments(){this.executorService.query("/adjustments","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this._sharedService.showLoader(!1),this.adjustments=e})}searchAdjustments(){let e;for(var t=0;t<this.adjustments.length;t++)e=this.adjustments[t].name,this.adjustments[t].hidden=-1==e.search(new RegExp(this.searchValue.trim(),"i"))}getAllProductAdjustments(){this.executorService.query("/products/adjustments ","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this._sharedService.showLoader(!1),this.productAdjustments=e})}getProductParams(){this.executorService.query("/products","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this._sharedService.showLoader(!1),this.productList=e})}clearAdjustmentEvalForm(){this.adjustmentEvalForm.reset({name:"",borrowerType:"",parameterName:"",operator:"",value:"",maxValue:"",arithmetic:"",adjustedValue:""},{onlySelf:!0,emitEvent:!1}),this.operatorList=[],this.valueList=[]}clearAdjustmentForm(){this.adjustmentForm.reset({productName:"",rateType:"",termMonths:"",adjustmentName:""},{onlySelf:!0,emitEvent:!1})}parameterChanged(){let e=this.adjustmentEvalForm,t=e.get("parameterName").value;e.get("operator").setValue(""),e.get("value").setValue("");const r=this.typeOperatorMap[t];this.operatorList=r&&r.operators||[],this.valueList=r&&r.allowedValues||[],"School"===t?(e.get("borrowerType").setValue("B"),this.isSchoolParameterSelected=!0):this.isSchoolParameterSelected=!1}productChanged(){let e=this.adjustmentForm,t=e.get("productName").value;e.get("rateType").setValue(""),e.get("termMonths").setValue("");for(var r=0;r<this.productList.length;r++)this.productList[r].id==t&&(this.rateTypes=this.productList[r].rateTypes.slice(0),this.rateTypes.splice(0,0,"All"),this.termMonths=this.productList[r].termMonths.slice(0),this.termMonths.splice(0,0,"All"));this.operatorList=this.typeOperatorMap[t]?this.typeOperatorMap[t]:[]}itemChecked(e,t){t.target.checked?e.selected=!0:e.selected=!1}deleteItems(e){var t=this;let r,n;e?(r="/products/adjustments",n=t.productAdjustments):(r="/adjustments",n=t.adjustments);let i=[],a=[];for(var s=0;s<n.length;s++)n[s].selected&&(a.push(n[s].id),i.push(s));if(!i.length)return t._sharedService.showAlert({message:"Please select item(s) to delete."}),!1;this._sharedService.showConfirm({message:"Are you sure you want to delete the item(s)?",uid:"MODAL_ADJ_DELETE",confirmCB:function(u){!function p(){if(!e){let u=function d(u){let o="";for(var g=0;g<t.productAdjustments.length;g++)-1!==u.indexOf(t.productAdjustments[g].adjustmentId)&&-1==o.indexOf(t.productAdjustments[g].adjustmentName)&&(o+=o?",":"",o+=t.productAdjustments[g].adjustmentName);return o}(a);if(u)return t._sharedService.showAlert({message:u+" is used in products. Therefore we cannot delete the adjustment(s)."}),!1}t.executorService.query(r,"DELETE",a).pipe((0,b.W)(u=>t.handleError(u))).subscribe(u=>{i.sort(function(E,F){return E-F});for(var o=0;o<i.length;o++){var g=i[o]-o;n.splice(g,1)}})}()}})}onAdjEvalSubmit(e){if(!this.checkDuplicateName(e.name))return this._sharedService.showAlert({message:"Please ensure that adjustment name is unique."}),!1;let t={id:null,name:e.name,parameterName:e.parameterName,operator:e.operator,borrowerType:e.borrowerType,value:e.value,maxValue:e.maxValue,arithmetic:e.arithmetic,adjustedValue:e.adjustedValue};this.executorService.query("/adjustments","POST",t).pipe((0,b.W)(r=>this.handleError(r)),(0,f.T)(r=>r)).subscribe(r=>{this._sharedService.showLoader(!1),r&&r.id&&(this.adjustments.push(r),this.searchAdjustments(),this.clearAdjustmentEvalForm())})}onAdjustmentSubmit(e){if(this.isApplyingAdjustment)return;this.isApplyingAdjustment=!0;let t={id:null,productId:e.productName,rateType:e.rateType,termMonths:e.termMonths,adjustmentId:e.adjustmentName,productName:"",adjustmentName:""};this.executorService.query("/products/"+t.productId+"/adjustments","POST",t).pipe((0,b.W)(r=>this.handleError(r)),(0,f.T)(r=>r)).subscribe(r=>{this.isApplyingAdjustment=!1,r&&r.id&&(this.productAdjustments.push(r),this.clearAdjustmentForm(
1))})}checkDuplicateName(e){for(var t=0;t<this.adjustments.length;t++)if(this.adjustments[t].name.toUpperCase()===e.toUpperCase())return!1;return!0}compareMaxValueandValue(){const e=this.adjustmentEvalForm.controls;return""===e.maxValue.value||null===e.maxValue.value?e.maxValue.setErrors({required:!0}):Number(e.value.value)>=Number(e.maxValue.value)?e.maxValue.setErrors({invalidMaxValue:!0}):void 0}handleError(e){return this._sharedService.showLoader(!1),this.spinner=!1,this.isApplyingAdjustment=!1,console.error("An error occurred",e),Promise.reject(e.message||e)}static{this.ctorParameters=()=>[{type:c.ok},{type:v.n},{type:x.d}]}};q=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"adjustment",template:'<section class="adjustment-section">\r\n\t<div class="row">\r\n\t\t<div class="col-lg-12">\r\n\t\t\t<div class="mt-5">\r\n\t\t\t\t<h4>Adjustment Evaluation</h4>\r\n\t\t\t</div>\r\n\t\t\t<form scrollToFirstInvalid [formGroup]="adjustmentEvalForm"\r\n\t\t\tautocomplete="off" class=""\r\n\t\t\t(ngSubmit)="onAdjEvalSubmit(adjustmentEvalForm.value)">\r\n\t\t\t\t<div class="row">\r\n\t\t\t\t\t<div class="col-lg-4">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus">\r\n\t\t\t\t\t\t\t<label for="aname" class="borrower-labels">Adjustment Name</label>\r\n\t\t\t\t\t\t\t<input type="text" class="form-control b-input-box"\r\n\t\t\t\t\t\t\tminlength="2"\r\n\t\t\t\t\t\t\tmaxlength="30"\r\n\t\t\t\t\t\t\tformControlName="name"\r\n\t\t\t\t\t\t\tplaceholder="Adjustment Name"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentEvalForm.get(\'name\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentEvalForm.get(\'name\').touched}"\r\n\t\t\t\t\t\t\tvalidateText>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'name\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentEvalForm.get(\'name\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tAdjustment Name is required.\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="col-lg-2">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus" >\r\n\t\t\t\t\t\t\t<label for="fname"\r\n\t\t\t\t\t\t\tclass="borrower-labels">Applicant\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t<select class="form-control select-b-input-box"\r\n\t\t\t\t\t\t\tname="applicant"\r\n\t\t\t\t\t\t\tformControlName="borrowerType"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentEvalForm.get(\'borrowerType\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentEvalForm.get(\'borrowerType\').touched}">\r\n\t\t\t\t\t\t\t\t<option [disabled]=isSchoolParameterSelected value="">Please Select</option>\r\n\t\t\t\t\t\t\t\t<option [disabled]=isSchoolParameterSelected *ngFor="let item of applicantListArray" [ngValue]="item.value">{{item.key}}</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'borrowerType\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentEvalForm.get(\'borrowerType\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tPlease select a valid applicant\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="col-lg-2">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus" >\r\n\t\t\t\t\t\t\t<label for="fname"\r\n\t\t\t\t\t\t\tclass="borrower-labels">Item Type\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t<select class="form-control select-b-input-box"\r\n\t\t\t\t\t\t\tname="iType"\r\n\t\t\t\t\t\t\t(change)="parameterChanged()"\r\n\t\t\t\t\t\t\tformControlName="parameterName"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentEvalForm.get(\'parameterName\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentEvalForm.get(\'parameterName\').touched}">\r\n\t\t\t\t\t\t\t\t<option value="">Please Select</option>\r\n\t\t\t\t\t\t\t\t<option *ngFor="let item of typeOperatorMapArray" [ngValue]="item.key">{{item.key}}</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'parameterName\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentEvalForm.get(\'parameterName\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tPlease select an item type\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="col-lg-2">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus" >
1\r\n\t\t\t\t\t\t\t<label for="fname"\r\n\t\t\t\t\t\t\tclass="borrower-labels">Operator\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t<select class="form-control select-b-input-box"\r\n\t\t\t\t\t\t\tformControlName="operator"\r\n\t\t\t\t\t\t\tname="r-operator"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentEvalForm.get(\'operator\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentEvalForm.get(\'operator\').touched}">\r\n\t\t\t\t\t\t\t\t<option value="">Select</option>\r\n\t\t\t\t\t\t\t\t<option *ngFor="let item of operatorList" [ngValue]="item">{{item}}</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'operator\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentEvalForm.get(\'operator\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tPlease select a valid operator\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="col-lg-1 ps-0">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus">\r\n\t\t\t\t\t\t\t<label for="fname" class="borrower-labels">Value</label>\r\n\t\t\t\t\t\t\t\x3c!-- Dropdown: shown when the selected Item Type has configured allowed values --\x3e\r\n\t\t\t\t\t\t\t<select *ngIf="valueList.length > 0"\r\n\t\t\t\t\t\t\t\tclass="form-control select-b-input-box"\r\n\t\t\t\t\t\t\t\tformControlName="value"\r\n\t\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentEvalForm.get(\'value\').invalid &&\r\n\t\t\t\t\t\t\t\t\tadjustmentEvalForm.get(\'value\').touched}">\r\n\t\t\t\t\t\t\t\t<option value="">Select</option>\r\n\t\t\t\t\t\t\t\t<option *ngFor="let v of valueList" [ngValue]="v">{{v}}</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t\x3c!-- Free-text: shown for all other Item Types --\x3e\r\n\t\t\t\t\t\t\t<input *ngIf="valueList.length === 0"\r\n\t\t\t\t\t\t\t\ttype="text" class="form-control b-input-box"\r\n\t\t\t\t\t\t\t\tminlength="1"\r\n\t\t\t\t\t\t\t\tmaxlength="50"\r\n\t\t\t\t\t\t\t\tformControlName="value"\r\n\t\t\t\t\t\t\t\tplaceholder="Value"\r\n\t\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentEvalForm.get(\'value\').invalid &&\r\n\t\t\t\t\t\t\t\t\tadjustmentEvalForm.get(\'value\').touched}"\r\n\t\t\t\t\t\t\t\tvalidateText>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'value\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentEvalForm.get(\'value\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tValue is required.\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="col-lg-1 ps-0"\r\n\t\t\t\t\t*ngIf="adjustmentEvalForm.get(\'operator\').value === \'B/W\'">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus">\r\n\t\t\t\t\t\t\t<label for="adj-max-val" class="borrower-labels">Max. Value</label>\r\n\t\t\t\t\t\t\t<input type="text" class="form-control b-input-box"\r\n\t\t\t\t\t\t\tid="adj-max-val"\r\n\t\t\t\t\t\t\tformControlName="maxValue"\r\n\t\t\t\t\t\t\tplaceholder="Max Value" (blur) = "compareMaxValueandValue()"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentEvalForm.get(\'maxValue\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentEvalForm.get(\'maxValue\').touched}">\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'maxValue\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentEvalForm.get(\'maxValue\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tMax value is required.\r\n\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'maxValue\').hasError(\'pattern\') &&\r\n\t\t\t\t\t\tadjustmentEvalForm.get(\'maxValue\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\tPlease enter valid Max value.\r\n\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'maxValue\').hasError(\'invalidMaxValue\') &&\r\n\t\t\t\t\t\tadjustmentEvalForm.get(\'maxValue\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\tPlease enter value greater than value field.\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class="row mt-3">\r\n\t\t\t\t\t<div class="col-lg-2">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus" >
1\r\n\t\t\t\t\t\t\t<label for="fname"\r\n\t\t\t\t\t\t\tclass="borrower-labels">Arithmetic\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t<select class="form-control select-b-input-box"\r\n\t\t\t\t\t\t\tformControlName="arithmetic"\r\n\t\t\t\t\t\t\tname="arithmetic-value"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentEvalForm.get(\'arithmetic\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentEvalForm.get(\'arithmetic\').touched}">\r\n\t\t\t\t\t\t\t\t<option value="">Select</option>\r\n\t\t\t\t\t\t\t\t<option *ngFor="let item of arithmeticList" [ngValue]="item">{{item}}</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'arithmetic\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentEvalForm.get(\'arithmetic\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tPlease select a valid arithmetic\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="col-lg-2">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus" >\r\n\t\t\t\t\t\t\t<label for="fname"\r\n\t\t\t\t\t\t\tclass="borrower-labels">Adj Value (%)\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t<input type="text" class="form-control b-input-box"\r\n\t\t\t\t\t\t\tminlength="1"\r\n\t\t\t\t\t\t\tmaxlength="25"\r\n\t\t\t\t\t\t\tformControlName="adjustedValue"\r\n\t\t\t\t\t\t\tplaceholder="Adj Value"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentEvalForm.get(\'adjustedValue\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentEvalForm.get(\'adjustedValue\').touched}">\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'adjustedValue\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentEvalForm.get(\'adjustedValue\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tAdjusted value is required.\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentEvalForm.get(\'adjustedValue\').hasError(\'pattern\') &&\r\n\t\t\t\t\t\t\tadjustmentEvalForm.get(\'adjustedValue\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tAdjusted value should be of minimum 2 digits \r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="col-lg-2">\r\n\t\t\t\t\t\t<button\r\n\t\t\t\t\t\tclass="button-new-css b-btns-cls margin-t-30 position-relative"\r\n\t\t\t\t\t\t[disabled]="adjustmentEvalForm.invali
1d"\r\n\t\t\t\t\t\ttype="submit">\r\n\t\t\t\t\t\t\tAdd\r\n\t\t\t\t\t\t</button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t\t<div class="row mt-3">\r\n\t\t\t\t<div class="col-lg-12">\r\n\t\t\t\t\t<h4>Adjustment Search</h4>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class="col-lg-3">\r\n\t\t\t\t\t<div class="mb-3 ld-form-cus position-relative">\r\n\t\t\t\t\t\t<i class="fa fa-search fa-2x position-absolute search-icon-adj" aria-hidden="true"></i>\r\n\t\t\t\t\t\t<input type="text" class="form-control b-input-box search-input-adj"\r\n\t\t\t\t\t\t\tminlength="2"\r\n\t\t\t\t\t\t\tmaxlength="25"\r\n\t\t\t\t\t\t\tid="adj-search"\r\n\t\t\t\t\t\t\t[(ngModel)]="searchValue"\r\n\t\t\t\t\t\t\tplaceholder="Adjustment Search">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class="col-lg-3">\r\n\t\t\t\t\t<button\tclass="button-new-css b-btns-cls position-relative"\r\n\t\t\t\t\ttype="button"\r\n\t\t\t\t\t[disabled]="!adjustments.length"\r\n\t\t\t\t\t(click)="searchAdjustments()">\r\n\t\t\t\t\t\tSearch\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class="row">\r\n\t\t\t\t<div class="col-lg-12">\r\n\t\t\t\t\t<div class="table-responsive">\r\n\t\t\t\t\t\t<table class="table table-striped rate-admin-adjustment-table cus-table-fix " [ngClass]="{\'table-min-width\': adjustments.length > 0}">\r\n\t\t\t\t\t\t\t<h4 *ngIf="adjustments.length == 0">No Data Found.</h4>\r\n\t\t\t\t\t\t\t<thead>\r\n\t\t\t\t\t\t\t\t<tr class="upload-head-sec"\r\n\t\t\t\t\t\t\t\t*ngIf="adjustments.length > 0">\r\n\t\t\t\t\t\t\t\t\t<th class="upload-head-blk w-50-px">Select </th>\r\n\t\t\t\t\t\t\t\t\t<th class="upload-head-blk">Adjustment Name</th>\r\n\t\t\t\t\t\t\t\t\t<th class="upload-head-blk">Applicant</th>\r\n\t\t\t\t\t\t\t\t\t<th class="upload-head-blk">Item Type</th>\r\n\t\t\t\t\t\t\t\t\t<th class="upload-head-blk">Operator</th>\r\n\t\t\t\t\t\t\t\t\t<th class="upload-head-blk">Value</th>\r\n\t\t\t\t\t\t\t\t\t<th class="upload-head-blk">High value</th>\r\n\t\t\t\t\t\t\t\t\t<th class="upload-head-blk">Arithmetic</th>\r\n\t\t\t\t\t\t\t\t\t<th class="upload-head-blk">Adj Value</th>\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</thead>\r\n\t\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t\t<ng-container *ngFor="let item of adjustments; let i=index">\r\n\t\t\t\t\t\t\t\t\t<tr *ngIf="!item.hidden">\r\n\t\t\t\t\t\t\t\t\t\t<td\r\n\t\t\t\t\t\t\t\t\t\tclass="doc-upload-td text-center w-50-px">\r\n\t\t\t\t\t\t\t\t\t\t\t<input type="checkbox"\r\n\t\t\t\t\t\t\t\t\t\t\t(change)="itemChecked(item, $event)"\r\n\t\t\t\t\t\t\t\t\t\t\tclass="cus-checkbox-style basic-info-check m-0" id="adj-checkbox">\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class="doc-upload-td brk-word">{{item.name}}</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class="doc-upload-td">{{item.borrowerType}}</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class="doc-upload-td brk-word">{{item.parameterName}}</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class="doc-upload-td">{{item.operator}}</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class="doc-upload-td brk-word">{{item.value}}</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class="doc-upload-td brk-word">{{item.maxValue}}</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class="doc-upload-td">{{item.arithmetic}}</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class="doc-upload-td">{{item.adjustedValue}}%</td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t</ng-container>\r\n\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class="col-lg-12 text-end">\r\n\t\t\t\t\t<button *ngIf="adjustments.length"\r\n\t\t\t\t\tclass="button-new-css b-btns-cls margin-t-30 position-relative"\r\n\t\t\t\t\ttype="button"\r\n\t\t\t\t\t(click)="deleteItems()">\r\n\t\t\t\t\t\tDelete\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<hr>\r\n\t\t\t<div class="b-sub-sec-for-fields">\r\n\t\t\t\t<h4>Apply Adjustments</h4>\r\n\t\t\t</div>\r\n\t\t\t<form scrollToFirstInvalid [formGroup]="adjustmentForm"\r\n\t\t\tautocomplete="off" class=""\r\n\t\t\t(ngSubmit)="onAdjustmentSubmit(adjustmentForm.value)">\r\n\t\t\t\t<div class="row m-0 adj-wrapper">\r\n\t\t\t\t\t<div class="float-start pe-3 adj-select">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus" >
1\r\n\t\t\t\t\t\t\t<label for="fname"\r\n\t\t\t\t\t\t\tclass="borrower-labels">Product Name\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t<select class="form-control select-b-input-box"\r\n\t\t\t\t\t\t\tformControlName="productName"\r\n\t\t\t\t\t\t\t(change)="productChanged()"\r\n\t\t\t\t\t\t\tname="pname"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentForm.get(\'productName\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentForm.get(\'productName\').touched}">\r\n\t\t\t\t\t\t\t\t<option value="">Please Select</option>\r\n\t\t\t\t\t\t\t\t<option *ngFor="let item of productList" [ngValue]="item.id">{{item.name}}</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentForm.get(\'productName\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentForm.get(\'productName\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tProduct Name is required.\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="float-start pe-3 adj-select">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus" >\r\n\t\t\t\t\t\t\t<label for="fname"\r\n\t\t\t\t\t\t\tclass="borrower-labels">Interest Type\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t<select class="form-control select-b-input-box"\r\n\t\t\t\t\t\t\tformControlName="rateType"\r\n\t\t\t\t\t\t\tname="amType"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentForm.get(\'rateType\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentForm.get(\'rateType\').touched}">\r\n\t\t\t\t\t\t\t\t<option value="">Please Select</option>\r\n\t\t\t\t\t\t\t\t<option *ngFor="let item of rateTypes" [ngValue]="item">{{item}}</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentForm.get(\'rateType\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentForm.get(\'rateType\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tInterest Type is required.\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="float-start pe-3 adj-select">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus" >\r\n\t\t\t\t\t\t\t<label for="fname"\r\n\t\t\t\t\t\t\tclass="borrower-labels">Loan Term\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t<select class="form-control select-b-input-box"\r\n\t\t\t\t\t\t\tformControlName="termMonths"\r\n\t\t\t\t\t\t\tname="loanTerm"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentForm.get(\'termMonths\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentForm.get(\'termMonths\').touched}">\r\n\t\t\t\t\t\t\t\t<option value="">Please Select</option>\r\n\t\t\t\t\t\t\t\t<option *ngFor="let item of termMonths" [ngValue]="item">{{item}}</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentForm.get(\'termMonths\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentForm.get(\'termMonths\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tLoan Term is required.\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="float-start pe-3 adj-select">\r\n\t\t\t\t\t\t<div class="mb-3 ld-form-cus" >\r\n\t\t\t\t\t\t\t<label for="fname"\r\n\t\t\t\t\t\t\tclass="borrower-labels">Adjustment Name\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t<select class="form-control select-b-input-box"\r\n\t\t\t\t\t\t\tformControlName="adjustmentName"\r\n\t\t\t\t\t\t\tname="adjTerm"\r\n\t\t\t\t\t\t\t[ngClass]="{\'has-error\': adjustmentForm.get(\'adjustmentName\').invalid &&\r\n\t\t\t\t\t\t\t\tadjustmentForm.get(\'adjustmentName\').touched}">\r\n\t\t\t\t\t\t\t\t<option value="">Please Select</option>\r\n\t\t\t\t\t\t\t\t<option *ngFor="let item of adjustments" [ngValue]="item.id">{{item.name}}</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div *ngIf="adjustmentForm.get(\'adjustmentName\').hasError(\'required\') &&\r\n\t\t\t\t\t\t\tadjustmentForm.get(\'adjustmentName\').touched" class="gr-err-blk cus-common-err-msg position-absolute">\r\n\t\t\t\t\t\t\tAdjustment Name is required.\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class="pull-right text-end">\r\n\t\t\t\t\t\t<button\r\n\t\t\t\t\t\tclass="button-new-css b-btns-cls margin-t-30 position-relative"\r\n\t\t\t\t\t\t[disabled]="adju
1stmentForm.invalid || isApplyingAdjustment"\r\n\t\t\t\t\t\ttype="submit">\r\n\t\t\t\t\t\t\tAdd\r\n\t\t\t\t\t\t\t<i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls" *ngIf="isApplyingAdjustment"></i>\r\n\t\t\t\t\t\t</button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t\t<div class="row">\r\n\t\t\t\t<div class="col-lg-12">\r\n\t\t\t\t\t<div class="table-responsive">\r\n\t\t\t\t\t<table class="table table-striped cus-table-fix rate-admin-adjustment-table" [ngClass]="{\'table-min-width\': productAdjustments.length > 0 }">\r\n\t\t\t\t\t\t<h4 *ngIf="productAdjustments.length == 0">No Data Found.</h4>\r\n\t\t\t\t\t\t<thead>\r\n\t\t\t\t\t\t\t<tr class="upload-head-sec"\r\n\t\t\t\t\t\t\t*ngIf="productAdjustments.length > 0">\r\n\t\t\t\t\t\t\t\t<td class="upload-head-blk w-50-px">Select </td>\r\n\t\t\t\t\t\t\t\t<td class="upload-head-blk">Product Name</td>\r\n\t\t\t\t\t\t\t\t<td class="upload-head-blk">Amortization Type</td>\r\n\t\t\t\t\t\t\t\t<td class="upload-head-blk">Loan Term</td>\r\n\t\t\t\t\t\t\t\t<td class="upload-head-blk">Adjustment Name</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</thead>\r\n\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t<tr *ngFor="let item of productAdjustments; let i=index">\r\n\t\t\t\t\t\t\t\t<td\r\n\t\t\t\t\t\t\t\tclass="doc-upload-td text-center w-50-px">\r\n\t\t\t\t\t\t\t\t\t<input type="checkbox"\r\n\t\t\t\t\t\t\t\t\t(change)="itemChecked(item, $event)"\r\n\t\t\t\t\t\t\t\t\tclass="cus-checkbox-style basic-info-check m-0">\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class="doc-upload-td">{{item.productName}}</td>\r\n\t\t\t\t\t\t\t\t<td class="doc-upload-td">{{item.rateType}}</td>\r\n\t\t\t\t\t\t\t\t<td class="doc-upload-td brk-word">{{item.termMonths}}</td>\r\n\t\t\t\t\t\t\t\t<td class="doc-upload-td">{{item.adjustmentName}}</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t\t</div>\t\t\t\t\t\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class="col-lg-12 text-end">\r\n\t\t\t\t\t<button\r\n\t\t\t\t\tclass="button-new-css b-btns-cls margin-t-30 position-relative"\r\n\t\t\t\t\ttype="button"\r\n\t\t\t\t\t(click)="deleteItems(true)">\r\n\t\t\t\t\t\tDelete\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</section>\r\n',standalone:!1}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[c.ok,v.n,x.d])],q);var de=h(3318),et=h(1557);let le=class{constructor(e,t){this.executorService=e,this._sharedService=t,this.sizeLimit=8388608,this.dateFormat=et.w.appDateFormat,this.url=this.executorService.getCompleteURL("/housingexpenses"),this.access_token=this.executorService.getAccessToken(),this.uploader=new D.l0({url:this.url+"/files",headers:[{name:"Authorization",value:"Bearer "+this.access_token}],authToken:this.getCookie("XSRF-TOKEN"),authTokenHeader:"X-XSRF-TOKEN",maxFileSize:this.sizeLimit,filters:[{name:"extension",fn:r=>"csv"===r.name.slice(r.name.lastIndexOf(".")+1).toLowerCase()}]}),this.expenseData=[]}ngOnInit(){this.selectedItem={},this.getHousingData(),this.setupUploadHandlers()}setupUploadHandlers(){this.uploader.onSuccessItem=(e,t,r,n)=>{let i="string"==typeof t?JSON.parse(t):t;i&&i.error?(this._sharedService.showAlert({message:i.error}),this.uploader.clearQueue()):i&&(this.expenseData[this.selectedItem.index]=Object.assign({},i)),setTimeout(()=>{this.uploader.clearQueue()},3e3)},this.uploader.onErrorItem=(e,t,r,n)=>{alert("Upload failed!"),this.uploader.clearQueue()}}getHousingData(){this.executorService.query("/housingexpenses/files","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe({next:e=>{Array.isArray(e)?this.expenseData=e:this.expenseData=e&&"object"==typeof e&&(e.data||e.files||e.result)||[],this._sharedService.showLoader(!1)},error:e=>{console.error("Error loading housing expense data:",e),this.expenseData=[],this._sharedService.showLoader(!1)}})}uploadDocument(){let e=this.uploader.queue.length,t=this.uploader.queue[e-1];t.url=t.url+"/"+this.selectedItem.type;this.executorService.uploadDocument(this.uploader,t,this.url+"/files/"+this.selectedItem.type,this.getCookie("XSRF-TOKEN"),this.sizeLimit,null,[{name:"extension",fn:n=>"csv"===n.name.slice(n.name.lastIndexOf(".")+1).toLowerCase()}])}viewDocument(e){let t=this.url+"/files/"+e+"/file";this.executorService.openInAWindow(t)}getCookie(e){var r=("; "+document.cookie).split("; "+e+"=");if(2==r.length)return decodeURIComponent(r.pop().split(";").shift())}selectItem(e,t){this.uploader.clearQueue(),this.uploader.cancelAll(),Object.assign(this.selectedItem,e),this.selectedItem.index=t}onFileSelected(e,t,r){const n=e.target;if(!n.files||0===n.files.length)return;const i=n.files[0];this.validateFile(i)?(this.selectItem(t,r),this.uploader.addToQueue([i]),this.uploadDocument()):n.value=""}
1validateFile(e){return e.size<=0?(alert("Empty file cannot be uploaded"),!1):e.size>this.sizeLimit?(alert("File size should not exceed 8 MB"),!1):"csv"===e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()||(alert("Only CSV files allowed"),!1)}handleError(e){return this._sharedService.showLoader(!1),this.spinner=!1,console.error("An error occurred",e),Promise.reject(e.message||e)}static{this.ctorParameters=()=>[{type:v.n},{type:x.d}]}};le=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"housing-exp",template:'\x3c!-- *******************************************************************************\r\n* This program contains trade secrets or otherwise confidential information *\r\n* owned by TAVANT Technologies. It may not be reproduced, published or\r\n* disclosed to others without TAVANT Technologies authorization. Access to\r\n* and use of this information is strictly limited and controlled by TAVANT\r\n* Technologies. Copyright 2017\r\n****************************************************************************** --\x3e\r\n\r\n<section class="adjustment-section">\r\n    <div class="row">\r\n        <div class="col-lg-12">\r\n            <div class="mt-5">\r\n                <h4>Housing Expense</h4>\r\n                <hr class="mt-0">\r\n            </div>\r\n            <div class="table-responsive">\r\n                <table class="table table-striped rate-admin-adjustment-table cus-table-fix" [ngClass]="{\'table-min-width\': expenseData.length > 0}">\r\n                    <thead *ngIf="expenseData.length > 0">\r\n                        <tr class="upload-head-sec">\r\n                            <td class="upload-head-blk">Category </td>\r\n                            <td class="upload-head-blk">File Name</td>\r\n                            <td class="upload-head-blk"> Last Updated</td>\r\n                            <td class="upload-head-blk">Updated By</td>\r\n                            <td class="upload-head-blk">Action</td>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody *ngIf="expenseData.length > 0">\r\n                        <tr *ngFor="let item of expenseData; let i=index">\r\n                            <td class="doc-upload-td">{{item.typeDisplayText}}</td>\r\n                            <td class="doc-upload-td brk-word w-space-normal">\r\n                                <a href="javascript:void(0)" (click)="viewDocument(item.type)" class="w-space-normal">\r\n                                    {{item.fileName}}\r\n                                </a>\r\n                            </td>\r\n                            <td class="doc-upload-td brk-word">{{item.updatedDate | date: dateFormat}}</td>\r\n                            <td class="doc-upload-td w-space-normal">{{item.updatedBy}}</td>\r\n                            <td class="doc-upload-td">\r\n                                <div *ngIf="!(selectedItem.index === i && uploader.queue.length)">\r\n                                    <label class="button-new-css upload-btn-cus m-0" [for]="\'fileInput_\' + i">\r\n                                        Upload\r\n                                    </label>\r\n                                    <input \r\n                                        [id]="\'fileInput_\' + i" \r\n                                        type="file" \r\n                                        class="hide" \r\n                                        (change)="onFileSelected($event, item, i)" \r\n                                        accept=".csv">\r\n                                </div>\r\n                                <div class="doc-porgress-blk" *ngIf="selectedItem.index === i && uploader.queue.length">\r\n                                    <div class="housing-progress-bar position-relative">\r\n                                        <ngb-progressbar type="primary" [value]="uploader.queue[uploader.queue.length-1].progress"></ngb-progressbar>\r\n                                        <div class="position-absolute prog-per-val">\r\n                                            {{uploader.queue[uploader.queue.length-1].progress}}%\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</section>\r\n',standalone:!0,imports:[M.MD,c.YN,c.X1,de.UN]}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n,x.d])],le);var it=h(6693);let X=class{constructor(e,t){this.executorService=e,this._sharedService=t,this.paymentFactors=[]}ngOnInit(){this.getPaymentFactors()}getPaymentFactors(){this.executorService.query("/api/tradelines","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this._sharedService.showLoader(!1),this.paymentFactors=e})}adjustedValueChanged(e){let t=e.adjustmentFactor;/^-?[0-9]{1,2}(\.[0-9]{1,2}
1)?$/.test(t)?t=(0,it.ZV)(t):(t=0,e.invalid=!0,setTimeout(()=>{delete e.invalid},3e3)),e.adjustmentFactor=t}savePaymentFactors(){this.executorService.query("/api/tradelines","PUT",this.paymentFactors).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this._sharedService.showLoader(!1),e&&(this.paymentFactors=e)})}handleError(e){return this._sharedService.showLoader(!1),this.spinner=!1,console.error("An error occurred",e),Promise.reject(e.message||e)}static{this.ctorParameters=()=>[{type:v.n},{type:x.d}]}};X=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"pay-factors",template:'\x3c!-- *******************************************************************************\r\n* This program contains trade secrets or otherwise confidential information *\r\n* owned by TAVANT Technologies. It may not be reproduced, published or\r\n* disclosed to others without TAVANT Technologies authorization. Access to\r\n* and use of this information is strictly limited and controlled by TAVANT\r\n* Technologies. Copyright 2017\r\n****************************************************************************** --\x3e\r\n\r\n<section class="adjustment-section">\r\n    <div class="row">\r\n        <div class="col-lg-12">\r\n            <div class="mt-5">\r\n                <h4>Payment Factors</h4>\r\n                <hr class="mt-0">\r\n            </div>\r\n            <div class="table-responsive">\r\n                <table class="table table-striped cus-table-fix rate-admin-adjustment-table" [ngClass]="{\'table-min-width\': paymentFactors.length > 0 }">\r\n                    <thead thead *ngIf="paymentFactors.length > 0">\r\n                        <tr class="upload-head-sec">\r\n                            <td class="upload-head-blk w-50">Trade Lines </td>\r\n                            <td class="upload-head-blk">Adjustment Factor</td>\r\n                            <td class="upload-head-blk">Current/Original Balance</td>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr *ngFor="let item of paymentFactors; let i=index">\r\n                            <td class="doc-upload-td w-50 brk-word">{{ item.name }}</td>\r\n                            <td class="doc-upload-td row">\r\n                                <div class="col-lg-5">\r\n                                    <input type="text" type="text" class="form-control b-input-box m-0" [(ngModel)]="item.adjustmentFactor" (change)="adjustedValueChanged(item)"  id="adj-factor" placeholder="Values" name="pname">\r\n                                </div>\r\n                                <div class="col-lg-2 p-0 mt-1">\r\n                                    %\r\n                                </div>\r\n                                <div class="col-lg-12 cus-common-err-msg" *ngIf="item.invalid">\r\n                                    Minimum 2 digits.\r\n                                </div>\r\n                            </td>\r\n                            <td class="doc-upload-td">\r\n                                <div class="col-lg-6">\r\n                                    <select #selectedOption [(ngModel)]="item.balanceType" class="form-control select-b-input-box m-0">\r\n                                        <option value="O">Original</option>\r\n                                        <option value="C">Current</option>\r\n                                    </select>\r\n                                </div>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n            <div class="row">\r\n                <div class="col-lg-12 text-end">\r\n                    <button class="button-new-css b-btns-cls margin-t-30 position-relative" type="button" (click)="savePaymentFactors()">\r\n                        Save\r\n                    </button>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</section>\r\n',standalone:!1}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n,x.d])],X);let $=class{constructor(e,t,r){this.executorService=e,this._sharedService=t,this.fb=r,this.sizeLimit=8388608,this.url=this.executorService.getCompleteURL("/adverseAction/files"),this.access_token=this.executorService.getAccessToken(),this.uploader=new D.l0({url:this.url,headers:[{name:"Authorization",value:"Bearer "+this.access_token}],authToken:this.getCookie("XSRF-TOKEN"),authTokenHeader:"X-XSRF-TOKEN",maxFileSize:this.sizeLimit,filters:[{name:"extension",fn:n=>"csv"===n.name.slice(n.name.lastIndexOf(".")+1).toLowerCase()}]})}ngOnInit(){this.initForm()}getCookie(e){var r=("; "+document.cookie).split("; "+e+"=");if(2==r.length)return decodeURIComponent(r.pop().split(";").shift())}initForm(e){this.uploadForm=this.fb.group({file:[""],name:[{value:"",disabled:!0},c.k0.compose([c.k0.required])]}),this.initUploadOptions()}initUploadOptions(){var e=this;this.uploader.onBuildItemForm=(t,r)=>{let n=e.uploadForm.value;r.append("fileName",n.name)},this.uploader.onCompleteItem=(t,r,n,i)=>{},this.uploader.onSuccessItem=(t,r,n,i)=>{let a="string"==typeof r?JSON.parse(r):r;a&&(this.adverseUploadInProcess=!1,"SUCCESS"==a.type?this.message=a.data:"ERROR"==a.type&&(this.message=a.error))},this.uploader.onErrorItem=(t,r,n,i)=>{alert("Upload failed!")},this.uploader.onAfterAddingFile=t=>{if(t.file.size<=0)return this.uploader.clearQueue(),this.uploader.cancelAll(),alert("Empty file cannot be uploaded"),!1;e.uploadForm.get("name").setValue(t.file.name)},this.uploader.onWhenAddingFileFailed=(t,r,n)=>{switch(r.name){case"mimeType":alert("File of types .pdf,.tif,.jpeg,.jpg,.gif,.bmp,.png can be uploaded");break;case"fileSize":alert("File size should not exceed 8 MB");break;case"queueLimit":break;case"extension":alert("Only CSV files allowed")}}}handleUpload(){this.adverseUploadInProcess=!0;let e=this.uploader.queue.length,t=this.uploader.queue[e-1];this.executorService.uploadDocument(this.uploader,t,this.url,this.getCookie("XSRF-TOKEN"),this.sizeLimit,null,[{name:"extension",fn:n=>"csv"===n.name.slice(n.name.lastIndexOf(".")+1).toLowerCase()}])}static{this.ctorParameters=()=>[{type:v.n},{type:x.d},{type:c.ok}]}};$=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"adverseAction",template:'<form \r\n[formGroup]="uploadForm">\r\n    <div class="row">\r\n        <div class="col-lg-5">\r\n            <div class="mb-3 ld-form-cus">\r\n                <label for="name" class="borrower-labels">\r\n                </label>\r\n                <input type="text" class="form-control b-input-box"\r\n                    id="filename" placeholder="File Name" formControlName="name">\r\n            </div>\r\n            <div class="col-lg-12 text-start cus-common-err-msg">{{message}}</div>\r\n        </div>\r\n        <div class="col-lg-4 text-start me-0">\r\n            <div class="mb-3 ld-form-cus browse-btn-upload-blk d-flex align-items-center">\r\n                <label class="button-new-css browse-btn" for="fileSelectId">\r\n                    Browse\r\n                </label>\r\n                <input id="fileSelectId" \r\n                type="file" class="hide"\r\n                ng2FileSelect\r\n                [uploader]="uploader"\r\n                formControlName="file"\r\n                placeholder="Browse"    \r\n                accept=".csv">\r\n                <button  type="button" class="button-new-css upload-btn-cus position-relative"\r\n                    (click)="handleUpload()"\r\n                    [disabled]="!uploadForm.valid || uploader.queue.length < 1 || adverseUploadInProcess">
1\r\n                    Upload\r\n                    <span *ngIf="adverseUploadInProcess">\r\n                        <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls f-18"></i>\r\n                    </span>\r\n                </button>\r\n                <div class="doc-porgress-blk" *ngIf="uploader.queue.length">\r\n                    <div>\r\n                        <ngb-progressbar type="primary" [value]="uploader.queue[uploader.queue.length-1].progress"></ngb-progressbar>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</form>\r\n\r\n\r\n',standalone:!1}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n,x.d,c.ok])],$);let G=class{constructor(e,t,r){this.executorService=e,this._sharedService=t,this.fb=r,this.sizeLimit=8388608,this.url=this.executorService.getCompleteURL("/SMSOptout/files"),this.access_token=this.executorService.getAccessToken(),this.uploader=new D.l0({url:this.url,headers:[{name:"Authorization",value:"Bearer "+this.access_token}],authToken:this.getCookie("XSRF-TOKEN"),authTokenHeader:"X-XSRF-TOKEN",maxFileSize:this.sizeLimit,filters:[{name:"extension",fn:n=>"csv"===n.name.slice(n.name.lastIndexOf(".")+1).toLowerCase()}]})}ngOnInit(){this.initForm()}getCookie(e){var r=("; "+document.cookie).split("; "+e+"=");if(2==r.length)return decodeURIComponent(r.pop().split(";").shift())}initForm(e){this.uploadForm=this.fb.group({file:[""],name:[{value:"",disabled:!0},c.k0.compose([c.k0.required])]}),this.initUploadOptions()}initUploadOptions(){var e=this;this.uploader.onBuildItemForm=(t,r)=>{let n=e.uploadForm.value;r.append("fileName",n.name)},this.uploader.onCompleteItem=(t,r,n,i)=>{},this.uploader.onSuccessItem=(t,r,n,i)=>{let a="string"==typeof r?JSON.parse(r):r;a&&(this.adverseUploadInProcess=!1,"SUCCESS"==a.type?this.message=a.data:"ERROR"==a.type&&(this.message=a.error))},this.uploader.onErrorItem=(t,r,n,i)=>{alert("Upload failed!")},this.uploader.onAfterAddingFile=t=>{if(t.file.size<=0)return this.uploader.clearQueue(),this.uploader.cancelAll(),alert("Empty file cannot be uploaded"),!1;e.uploadForm.get("name").setValue(t.file.name)},this.uploader.onWhenAddingFileFailed=(t,r,n)=>{switch(r.name){case"mimeType":alert("File of types .pdf,.tif,.jpeg,.jpg,.gif,.bmp,.png can be uploaded");break;case"fileSize":alert("File size should not exceed 8 MB");break;case"queueLimit":break;case"extension":alert("Only CSV files allowed")}}}handleUpload(){this.adverseUploadInProcess=!0;let e=this.uploader.queue.length,t=this.uploader.queue[e-1];this.executorService.uploadDocument(this.uploader,t,this.url,this.getCookie("XSRF-TOKEN"),this.sizeLimit,null,[{name:"extension",fn:n=>"csv"===n.name.slice(n.name.lastIndexOf(".")+1).toLowerCase()}])}static{this.ctorParameters=()=>[{type:v.n},{type:x.d},{type:c.ok}]}};G=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"SMSOpt-out",template:'<form \r\n[formGroup]="uploadForm">\r\n    <div class="row">\r\n        <div class="col-lg-5">\r\n            <div class="mb-3 ld-form-cus">\r\n                <label for="name" class="borrower-labels">\r\n                </label>\r\n                <input type="text" class="form-control b-input-box"\r\n                    id="filename" placeholder="File Name" formControlName="name">\r\n            </div>\r\n            <div class="col-lg-12 text-start cus-common-err-msg">{{message}}</div>\r\n        </div>\r\n        <div class="col-lg-4 text-start me-0">\r\n            <div class="mb-3 ld-form-cus browse-btn-upload-blk d-flex align-items-center">\r\n                <label class="button-new-css browse-btn" for="fileSelectId">\r\n                    Browse\r\n                </label>\r\n                <input id="fileSelectId" \r\n                type="file" class="hide"\r\n                ng2FileSelect\r\n                [uploader]="uploader"\r\n                formControlName="file"\r\n                placeholder="Browse"    \r\n                accept=".csv">\r\n                <button type="button" class="button-new-css upload-btn-cus position-relative"\r\n                    (click)="handleUpload()"\r\n                    [disabled]="!uploadForm.valid || uploader.queue.length < 1 || adverseUploadInProcess">
1\r\n                    Upload\r\n                    <span *ngIf="adverseUploadInProcess">\r\n                        <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls f-18"></i>\r\n                    </span>\r\n                </button>\r\n                <div class="doc-porgress-blk" *ngIf="uploader.queue.length">\r\n                    <div>\r\n                        <ngb-progressbar type="primary" [value]="uploader.queue[uploader.queue.length-1].progress"></ngb-progressbar>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</form>\r\n\r\n\r\n',standalone:!1}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n,x.d,c.ok])],G);var mt=h(7995),gt=h.n(mt);let K=class{constructor(e,t){this.executorService=e,this._sharedService=t,this.creditReportConfig=[],this.submitting=!1}ngOnInit(){this.user=this._sharedService.getUser(),this.getCreditReportConfig()}getCreditReportConfig(){this.executorService.query("/creditReportConfig","GET",{}).pipe((0,b.W)(e=>this.handleError(e)),(0,f.T)(e=>e)).subscribe(e=>{this.creditReportConfig=e,this.creditReportConfig.forEach(t=>{this.selectedCreditService="EQUIFAX_ENABLE"===t.name?"false"===t.value?"C":"E":this.selectedCreditService,this.ficoModelSoftpull="FICO_MODEL_SOFTPULL"===t.name?t.value:this.ficoModelSoftpull,this.ficoModelHardpull="FICO_MODEL_HARDPULL"===t.name?t.value:this.ficoModelHardpull})})}saveCreditReportConfig(e){let t,r;this.submitting=!this.submitting,"crediService"===e?(t="EQUIFAX_ENABLE",this.configButton="EQUIFAX_ENABLE"):"ficoModelSoftpull"===e?(t="FICO_MODEL_SOFTPULL",this.configButton="FICO_MODEL_SOFTPULL"):"ficoModelHardpull"===e?(t="FICO_MODEL_HARDPULL",this.configButton="FICO_MODEL_HARDPULL"):t="N/A",r="EQUIFAX_ENABLE"===t?"E"===this.selectedCreditService?"true":"false":"FICO_MODEL_SOFTPULL"===t?this.ficoModelSoftpull:"FICO_MODEL_HARDPULL"===t?this.ficoModelHardpull:"N/A",this.executorService.query("/creditReportConfig/","PUT",{name:t,value:r,updated_by:this.user.userID}).pipe((0,b.W)(n=>this.handleError(n)),(0,f.T)(n=>n)).subscribe(n=>{setTimeout(()=>{this.submitting=!this.submitting,this.configButton=null},3e3),this.creditReportConfig=n,this.creditReportConfig.forEach(i=>{this.selectedCreditService="EQUIFAX_ENABLE"===i.name?"false"===i.value?"C":"E":this.selectedCreditService,this.ficoModelSoftpull="FICO_MODEL_SOFTPULL"===i.name?i.value:this.ficoModelSoftpull,this.ficoModelHardpull="FICO_MODEL_HARDPULL"===i.name?i.value:this.ficoModelHardpull})})}handleError(e){return this.submitting=!this.submitting,Promise.reject(e.message||e)}static{this.ctorParameters=()=>[{type:v.n},{type:x.d}]}};K=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"app-credit-report-config",template:'\x3c!-- *******************************************************************************\r\n* This program contains trade secrets or otherwise confidential information *\r\n* owned by TAVANT Technologies. It may not be reproduced, published or\r\n* disclosed to others without TAVANT Technologies authorization. Access to\r\n* and use of this information is strictly limited and controlled by TAVANT\r\n* Technologies. Copyright 2017\r\n****************************************************************************** --\x3e\r\n\r\n<section class="adjustment-section">\r\n    <form>\r\n    <div class="row">\r\n        <div class="col-lg-12">\r\n            <div class="mt-5">\r\n                <h4>Credit service provider</h4>\r\n                <hr class="mt-0">\r\n            </div>\r\n\r\n            <div class="form-check form-check-inline">\r\n                <label>\r\n                  <input type="radio" class="form-check-label" name="crediService" value="E" [(ngModel)]="selectedCreditService"> Equifax\r\n                </label>\r\n            </div>\r\n            <div class="form-check form-check-inline">\r\n                <label>\r\n                  <input type="radio" class="form-check-input" name="crediService" value="C" [(ngModel)]="selectedCreditService"> Credco\r\n                </label>\r\n            </div>\r\n\r\n            <div class="row">\r\n                <div class="col-lg-12 text-end">\r\n                    <button class="button-new-css b-btns-cls margin-t-30 position-relative" type="button" (click)="saveCreditReportConfig(\'crediService\')" [disabled]="submitting">\r\n                        Save\r\n                    </button>\r\n                    <div *ngIf="submitting && configButton===\'EQUIFAX_ENABLE\'">\r\n                        <p class="success-red">Credit service provider updated successfully</p>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    </form>\r\n\r\n\r\n    \r\n\r\n    <div class="row">\r\n        <div class="col-lg-12">\r\n            <div class="mt-5">\r\n                <h4>FICO Model Soft Pull</h4>\r\n                <hr class="mt-0">\r\n            </div>\r\n\r\n            <div class="mb-3 col-md-3">\r\n                <div class="row">\r\n                <div class="col-sm">\r\n                    <input type="text" class="form-control b-input-box" name="ficoModelSoftpull" [(ngModel)]="ficoModelSoftpull">\r\n                </div>\r\n                <div class="col-sm-1 highdeg">
1\r\n                    <span class="info-icon highdeg-info" >\r\n                        <a class="email-info-icon"></a>\r\n                    </span>\r\n                    <div class="highdeg-info-content highdeg-content">\r\n                        <p>Equifax only.</p>\r\n                        <div class="highdeg-tooltip"></div>\r\n                    </div>\r\n                </div>\r\n            </div>               \r\n            </div>\r\n\r\n            <div class="row">\r\n                <div class="col-lg-12 text-end">\r\n                    <button class="button-new-css b-btns-cls margin-t-30 position-relative" type="button" (click)="saveCreditReportConfig(\'ficoModelSoftpull\')" [disabled]="submitting">\r\n                        Save\r\n                    </button>\r\n                    <div *ngIf="submitting && configButton===\'FICO_MODEL_SOFTPULL\'">\r\n                        <p class="success-red">FICO Model for Softpull updated successfully</p>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n\r\n    <div class="row">\r\n        <div class="col-lg-12">\r\n            <div class="mt-5">\r\n                <h4>FICO Model Hard Pull</h4>\r\n                <hr class="mt-0">\r\n            </div>\r\n\r\n            <div class="mb-3 col-md-3">\r\n                <div class="row">\r\n                <div class="col-sm">\r\n                    <input type="text" class="form-control b-input-box" name="ficoModelHardpull" [(ngModel)]="ficoModelHardpull">\r\n                </div>\r\n                <div class="col-sm-1 highdeg">\r\n                    <span class="info-icon highdeg-info" >\r\n                        <a class="email-info-icon"></a>\r\n                    </span>\r\n                    <div class="highdeg-info-content highdeg-content">\r\n                        <p>Equifax only.</p>\r\n                        <div class="highdeg-tooltip"></div>\r\n                    </div>\r\n                </div>\r\n            </div>               \r\n            </div>\r\n\r\n            <div class="row">\r\n                <div class="col-lg-12 text-end">\r\n                    <button class="button-new-css b-btns-cls margin-t-30 position-relative" type="button" (click)="saveCreditReportConfig(\'ficoModelHardpull\')" [disabled]="submitting">\r\n                        Save\r\n                    </button>\r\n                    <div *ngIf="submitting && configButton===\'FICO_MODEL_HARDPULL\'">\r\n                        <p class="success-red">FICO Model for Hardpull updated successfully</p>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</section>\r\n\r\n',standalone:!1,styles:[gt()]}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n,x.d])],K);var xt=h(5991),wt=h.n(xt);let Z=class{get showProgressBar(){return this._showProgressBar}set showProgressBar(e){this._showProgressBar=e}constructor(e,t,r,n){this.executorService=e,this._sharedService=t,this.fb=r,this.http=n,this.selectedFile=null,this.uploadProgress=0,this.displayFileName="",this._showProgressBar=!1,this.sizeLimit=8388608,this.url=this.executorService.getCompleteURL("/admin/tier/tierRateUpdate/files"),this.access_token=this.executorService.getAccessToken()}ngOnInit(){this.initForm()}getCookie(e){var r=("; "+document.cookie).split("; "+e+"=");return 2==r.length?decodeURIComponent(r.pop().split(";").shift()):""}initForm(e){this.uploadForm=this.fb.group({file:[""],name:["",c.k0.compose([c.k0.required])]}),this.uploadForm.get("name").disable()}onFileSelected_Native(e){const t=e.target.files;if(!t||0===t.length)return this.selectedFile=null,this.displayFileName="",this.showProgressBar=!1,this.uploadForm.get("name").setValue(""),void this.uploadForm.get("name").disable();const r=t[0];return r.size<=0?(alert("Empty file cannot be uploaded"),this.selectedFile=null,this.displayFileName="",this.showProgressBar=!1,this.uploadForm.get("name").setValue(""),void(e.target.value="")):r.size>this.sizeLimit?(alert("File size should not exceed 8 MB"),this.selectedFile=null,this.displayFileName="",this.showProgressBar=!1,this.uploadForm.get("name").setValue(""),void(e.target.value="")):"csv"!==r.name.slice(r.name.lastIndexOf(".")+1).toLowerCase()?(alert("Only CSV files allowed"),this.selectedFile=null,this.displayFileName="",this.showProgressBar=!1,this.uploadForm.get("name").setValue(""),void(e.target.value="")):(this.selectedFile=r,this.displayFileName=r.name,this.showProgressBar=!0,this.uploadForm.get("name").enable(),this.uploadForm.get("name").setValue(r.name),this.uploadForm.get("name").updateV
1alueAndValidity(),this.message=null,void(this.uploadProgress=0))}handleImport_Native(){if(!this.selectedFile||!this.isNativeFormValid)return;this.message=null,this.csvUploadInProcess=!0,this.uploadProgress=0;const e=new FormData,t=this.uploadForm.get("name").value||this.selectedFile.name;e.append("file",this.selectedFile,this.selectedFile.name),e.append("fileName",t);const r=new y.Lr({"X-XSRF-TOKEN":this.getCookie("XSRF-TOKEN")||""});this.http.post(this.url,e,{headers:r,withCredentials:!0,reportProgress:!0,observe:"events"}).pipe((0,f.T)(n=>{switch(n.type){case y.hv.UploadProgress:n.total&&(this.uploadProgress=Math.round(100*n.loaded/n.total));break;case y.hv.Response:return n.body}return null}),(0,b.W)(n=>(this.handleUploadError_Native(n),(0,A.$)(()=>n)))).subscribe({next:n=>{n&&this.handleUploadSuccess_Native(n)},error:()=>{},complete:()=>{this.csvUploadInProcess=!1}})}handleUploadSuccess_Native(e){try{if("SUCCESS"===e.type){const t=e.data||e.message||"File uploaded successfully!";this.message=t,alert(t),this.clearFileSelection_Native()}else if("ERROR"===e.type){const t=e.error||e.data||e.message||"Upload failed. Please try again.";this.message=t,alert(t)}else{const t=e.message||e.data||"File uploaded successfully!";this.message=t,alert(t),this.clearFileSelection_Native()}}catch(t){console.error("Error parsing server response:",t),alert("Upload completed but could not parse server response."),this.clearFileSelection_Native()}}handleUploadError_Native(e){this.csvUploadInProcess=!1,this.uploadProgress=0,this.showProgressBar=!1;try{let t="Upload failed!";if(e.error){const r="string"==typeof e.error?JSON.parse(e.error):e.error;r.error?t=r.error.message||r.error:r.message&&(t=r.message)}if("Upload failed!"===t)switch(e.status){case 0:t="Network error. Please check your connection.";break;case 400:t="Bad request. Please check the file format and content.";break;case 401:t="Unauthorized. Please login again.";break;case 403:t="Access denied. You don't have permission to upload files.";break;case 413:t="File size too large. Maximum size is 8 MB.";break;case 500:t="Server error. Please try again later.";break;default:e.status&&(t=`Upload failed with status ${e.status}`)}this.message=t,alert(t)}catch(t){console.error("Error parsing error response:",t);const r=e.status?`Upload failed with status ${e.status}`:"Upload failed!";this.message=r,alert(r)}}clearFileSelection_Native(){this.selectedFile=null,this.displayFileName="",this.uploadProgress=0,this.showProgressBar=!1,this.uploadForm.reset(),this.uploadForm.get("name").setValue(""),this.uploadForm.get("name").disable();const e=document.getElementById("fileSelectId");e&&(e.value="")}get isNativeFormValid(){const e=null!==this.selectedFile,t=this.uploadForm.get("name").value&&""!==this.uploadForm.get("name").value.trim();return e&&t}static{this.ctorParameters=()=>[{type:v.n},{type:x.d},{type:c.ok},{type:y.Qq}]}};Z=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"tierRateUpload",template:'<form [formGroup]="uploadForm">\r\n    <div class="row">\r\n        <div class="col-lg-5">\r\n            <div class="mb-3 ld-form-cus">\r\n                <label for="name" class="borrower-labels">\r\n                    Ratesheet CSV File\r\n                </label>\r\n                <input type="text" class="form-control b-input-box"\r\n                    id="filename" \r\n                    placeholder="File Name" \r\n                    [value]="displayFileName"\r\n                    readonly>\r\n            </div>\r\n            <div class="col-lg-12 text-left cus-common-err-msg">{{message}}</div>\r\n        </div>\r\n        <div class="col-lg-4 text-left mr-0">\r\n            <div class="mb-3 ld-form-cus browse-btn-upload-blk">\r\n                <label class="button-new-css browse-btn" for="fileSelectId">\r\n                    Browse\r\n                </label>\r\n                \r\n                \x3c!-- Native HttpClient implementation (Active) --\x3e\r\n                <input id="fileSelectId" \r\n                    type="file" \r\n                    class="hide"\r\n                    accept=".csv"\r\n                    (change)="onFileSelected_Native($event)">\r\n                \r\n                <button type="button" \r\n                    class="button-new-css upload-btn-cus position-relative"\r\n                    (click)="handleImport_Native()"\r\n                    [disabled]="!isNativeFormV
1alid || csvUploadInProcess">\r\n                    Import\r\n                    <span *ngIf="csvUploadInProcess">\r\n                        <i class="fa fa-spinner fa-spin fa-3x fa-fw position-absolute cus-spinner-cls f-18"></i>\r\n                    </span>\r\n                </button>\r\n                \r\n                \x3c!-- Custom Progress Bar (Native HttpClient Implementation) --\x3e\r\n                <div class="custom-progress-container" [hidden]="!showProgressBar">\r\n                    <div class="custom-progress-bar">\r\n                        <div class="custom-progress-fill" [style.width.%]="uploadProgress"></div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</form>\r\n',standalone:!1,styles:[wt()]}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n,x.d,c.ok,y.Qq])],Z);var Ft=h(7673);let Y=class{constructor(e,t,r){this.executorService=e,this._sharedService=t,this.fb=r,this.uploadInProcess=!1,this.subscriptions=[],this.sizeLimit=8388608,this.url=this.executorService.getCompleteURL("/docgen/upload"),this.access_token=this.executorService.getAccessToken(),this.allowedDocNames=[],this.loadError=!1,this.uploader=new D.l0({url:this.url,itemAlias:"file",removeAfterUpload:!0,headers:[{name:"Authorization",value:"Bearer "+this.access_token}],authToken:this.getCookie("XSRF-TOKEN"),authTokenHeader:"X-XSRF-TOKEN",maxFileSize:this.sizeLimit,filters:[{name:"extension",fn:n=>n.name.toLowerCase().endsWith(".pdf")},{name:"mimeType",fn:n=>{const i=(n.type||"").toLowerCase();return"application/pdf"===i||"application/octet-stream"===i}}]})}ngOnInit(){this.initForm(),this.loadAllowedDocNames()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}getCookie(e){const r=("; "+document.cookie).split("; "+e+"=");return 2===r.length?decodeURIComponent(r.pop().split(";").shift()):""}initForm(){this.uploadForm=this.fb.group({file:[""],docName:["",c.k0.required],name:[{value:"",disabled:!0},c.k0.required]}),this.initUploadOptions()}loadAllowedDocNames(){this.executorService.query("/application/allowedDocumentNames","GET",{}).pipe((0,b.W)(e=>(this.handleError(e),(0,Ft.of)(null)))).subscribe(e=>{Array.isArray(e)?this.allowedDocNames=e:e?.data&&Array.isArray(e.data)?this.allowedDocNames=e.data:this.allowedDocNames=[]})}handleError(e){this.loadError=!0,console.error("File names loading failed.",e),alert("Unable to load allowed document names. Please try again later.")}initUploadOptions(){const e=this;this.uploader.onBuildItemForm=(t,r)=>{const n=e.uploadForm.get("docName")?.value;r.append("docName",n),r.append("fileName",t.file.name)},this.uploader.onCompleteItem=()=>{this.uploadInProcess=!1},this.uploader.onSuccessItem=(t,r)=>{const n=("string"==typeof r?r:String(r)).trim().toUpperCase();this.message="SUCCESS"===n?"SUCCESS":"ERROR",alert(this.message)},this.uploader.onErrorItem=(t,r,n)=>{this.message="ERROR",alert("ERROR"),console.error("Upload failed",{status:n,response:r})}}getBaseName(e){if(!e)return"";const t=e.lastIndexOf(".");return t>0?e.substring(0,t):e}onFileSelected(e){const t=e.target;if(!t.files||0===t.files.length)return;const r=t.files[0];this.validateFile(r)?(this.uploader.addToQueue([r]),this.uploadForm.get("name")?.setValue(r.name),this.message=""):t.value=""}validateFile(e){if(!e.size||e.size<=0)return alert("Empty file cannot be uploaded."),!1;if(e.size>this.sizeLimit)return alert("File size should not exceed 8 MB."),!1;if(!e.name.toLowerCase().endsWith(".pdf"))return alert("Only PDF files allowed."),!1;const r=(e.type||"").toLowerCase();return"application/pdf"===r||"application/octet-stream"===r||(alert("Only PDF files can be uploaded."),!1)}handleUpload(){if(0===this.uploader.queue.length)return void alert("Please select a PDF file to upload.");const e=this.uploadForm.get("docName")?.value;if(!e)return void alert("Please select a document name before uploading.");const t=this.uploader.queue[this.uploader.queue.length-1],r=t.file.name;if(this.getBaseName(r)!==e)return void alert(`File name is different. Expected: ${e}.pdf, Selected: ${r}`);this.uploadInProcess=!0;this.executorService.uploadDocument(this.uploader,t,this.url,this.getCookie("XSRF-TOKEN"),this.sizeLimit,null,[{name:"extension",fn:a=>a.name.toLowerCase().endsWith(".pdf")}])}static{this.ctorParameters=()=>[{type:v.n},{type:x.d},{type:c.ok}]}};Y=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.uAl)({selector:"Document-upload-config",template:'\x3c!-- Status message --\x3e\r\n<div *ngIf="message" class="upload-message">{{ message }}</div>\r\n\r\n\x3c!-- 1) Select predefined document name --\x3e\r\n<div class="mb-3">\r\n    <label for="docNameSelect">Select document name</label>\r\n    <select id="docNameSelect" class="form-control form-control-sm" [formControl]="uploadForm.get(\'docName\')">\r\n        <option value="" disabled selected>Select...</option>\r\n        <option *ngFor="let name of allowedDocNames" [value]="name">\r\n            {{ name }}.pdf\r\n        </option>\r\n    </select>\r\n</div>\r\n\r\n\x3c!-- 2) Browse a PDF --\x3e\r\n<div class="mb-3 mt-2">\r\n    <label class="btn btn-primary btn-sm" for="pdfFileInput">Browse PDF</label>\r\n    <input \r\n        id="pdfFileInput" \r\n        type="file" \r\n        (change)="onFileSelected($event)" \r\n        accept="application/pdf,.pdf"\r\n        style="display:none" />\r\n</div>\r\n\r\n\x3c!-- Show selected file name --\x3e\r\n<div class="mt-2">\r\n    <input type="text" class="form-control form-control-sm" [formControl]="uploadForm.get(\'name\')"\r\n        placeholder="Selected file name" disabled />\r\n</div>\r\n\r\n\x3c!-- 3) Upload button --\x3e\r\n<button class="btn btn-success btn-sm mt-2" (click)="handleUpload()" [disabled]="\r\n    uploadInProcess ||\r\n    uploader.queue.length === 0 ||\r\n    !uploadForm.get(\'docName\').value\r\n  ">\r\n    {{ uploadInProcess ? \'Uploading...\' : \'Upload PDF\' }}\r\n</button>\r\n',standalone:!1}),function(l,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(l,e)}("design:paramtypes",[v.n,x.d,c.ok])],Y);const Et=[{path:"",component:P,canActivate:[h(9318).q],children:[{path:"",component:j},{path:"fixed",component:j},{path:"variable",component:W},{path:"adjustments",component:q},{path:"housingexpense",component:le},{path:"paymentfactors",component:X},{path:"securitization",component:se},{path:"adverseAction",component:$},{path:"SMSOpt-out",component:G},{path:"credit-report-config",component:K},{path:"tierRateUpload",component:Z},{path:"discount",loadChildren:()=>h.e("src_app_discount_discount_module_ts").then(h.bind(h,1330)).then(l=>l.DiscountModule)},{path:"Document-upload-config",component:Y}]}],Ct=Ve.iI.forChild(Et);var St=h(2796);let oe=class{};oe=function(l,e,t,r){var a,n=arguments.length,i=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(l,e,t,r);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}([(0,m.UQu)({imports:[M.MD,Ct,c.YN,c.X1,ce.Ph,St.ed,D.eB,pe.G,de.UN],declarations:[U,Q,z,ae,P,j,W,q,$,Z,G,X,K,Y],exports:[U,z,P],providers:[T,I,k,v.n]})],oe)},6227(w,S,h){var m=h(8564),c=h(8557)(m);c.push([w.id,".rate-admin-modern {\n  background: var(--app-color-neutrals-gray-lightest, #F5F5F5);\n  min-height: 100vh;\n  padding-top: 94px;\n}\n\n.rate-admin-modern__header-content {\n  max-width: 100%;\n  margin: var(--spacing-extra-large, 24px) var(--spacing-xl, 32px);\n}\n\n.rate-admin-modern__tabs-wrapper {\n  padding: 0px var(--spacing-xl, 32px) 0px var(--spacing-xl, 32px);\n}\n\n.rate-admin-modern__title-row {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: var(--spacing-extra-large, 24px);\n  margin-bottom: 0;\n  background-color: var(--white, #ffffff);\n  padding: var(--spacing-kendo-3, 12px) var(--spacing-medium, 16px) var(--spacing-kendo-3, 12px) var(--spacing-small, 8px);\n}\n\n.rate-admin-modern__title {\n  font-size: 24px;\n  font-weight: 600;\n  color: var(--black, #000000);\n  margin: 0;\n  display: flex;\n  align-items: center;\n  gap: var(--spacing-kendo-3, 12px);\n  flex-shrink: 0;\n}\n\n.rate-admin-modern__back-arrow {\n  cursor: pointer;\n  display: inline-flex;\n  align-items: center;\n  width: 24px;\n  height: 24px;\n}
1\n\n.rate-admin-modern__checkbox-label {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  cursor: pointer;\n  -webkit-user-select: none;\n          user-select: none;\n  margin: 0;\n  flex-shrink: 0;\n  white-space: nowrap;\n}\n\n.rate-admin-modern__checkbox {\n  width: 18px;\n  height: 18px;\n  border: 2px solid #d1d5db;\n  border-radius: 3px;\n  cursor: pointer;\n  accent-color: var(--app-color-primary-blue, #0066B2);\n}\n\n.rate-admin-modern__checkbox-text {\n  font-size: 14px;\n  font-weight: 500;\n  color: var(--footer-foreground, #272829);\n}\n\n.rate-admin-modern__tabs {\n  display: flex;\n  align-items: center;\n  gap: 16px;\n  overflow-x: auto;\n  overflow-y: visible;\n  -webkit-overflow-scrolling: touch;\n  flex-wrap: wrap;\n}\n.rate-admin-modern__tabs::-webkit-scrollbar {\n  height: var(--spacing-extra-small, 4px);\n}\n.rate-admin-modern__tabs::-webkit-scrollbar-track {\n  background: transparent;\n}\n.rate-admin-modern__tabs::-webkit-scrollbar-thumb {\n  background: #d1d5db;\n  border-radius: 2px;\n}\n\n.rate-admin-modern__tab {\n  border-radius: var(--app-border-radius-extra-small, var(--border-radius-extra-small, 4px));\n  border: 1px solid var(--app-color-primary-blue, var(--primary-blue-color, #1779BA));\n  background: var(--app-color-neutrals-white, var(--white, #FFF));\n  padding: var(--Small, var(--spacing-small, 8px)) var(--Large, var(--spacing-large, 20px));\n  color: var(--app-color-neutrals-gray-dark, var(--gray-dark, #535459));\n  text-align: center;\n  font-size: var(--app-font-size-body-small, var(--font-size-body-small, 14px));\n  font-weight: var(--app-font-weight-semibold, var(--font-weight-semibold, 600));\n  font-family: var(--primary-font);\n  line-height: 1.2;\n  cursor: pointer;\n  white-space: nowrap;\n  text-decoration: none;\n  transition: all 0.2s ease;\n  display: inline-block;\n}\n.rate-admin-modern__tab:hover {\n  background-color: var(--gray-dark, #535459) !important;\n  color: var(--white, #FFF) !important;\n  font-weight: var(--fw-normal, 400) !important;\n}\n.rate-admin-modern__tab--active {\n  background: var(--app-color-primary-blue, var(--primary-blue-color, #1779BA));\n  color: var(--white, #ffffff) !important;\n  border-color: var(--app-color-primary-blue, var(--primary-blue-color, #1779BA));\n  font-weight: 600;\n}\n.rate-admin-modern__tab--active:hover {\n  background: var(--app-color-primary-blue, var(--primary-blue-color, #1779BA)) !important;\n  color: var(--white, #ffffff) !important;\n  border-color: var(--app-color-primary-blue, var(--primary-blue-color, #1779BA));\n}\n\n.rate-admin-modern__content {\n  padding: var(--spacing-extra-large, 24px) var(--spacing-xl, 32px) var(--spacing-xl, 32px) var(--spacing-xl, 32px);\n  max-width: 100%;\n  margin: 0;\n}\n\n/* Responsive adjustments */\n@media (max-width: 1024px) {\n  .rate-admin-modern {\n    padding-top: 94px;\n  }\n  .rate-admin-modern__header-content {\n    padding: var(--spacing-large, 20px) var(--spacing-extra-large, 24px);\n  }\n  .rate-admin-modern__tabs-wrapper {\n    padding: var(--spacing-medium, 16px) var(--spacing-extra-large, 24px);\n  }\n  .rate-admin-modern__content {\n    padding: var(--spacing-large, 20px) var(--spacing-extra-large, 24px) var(--spacing-extra-large, 24px) var(--spacing-extra-large, 24px);\n  }\n  .rate-admin-modern__tabs {\n    gap: 8px;\n  }\n  .rate-admin-modern__tab {\n    padding: 8px 16px;\n    font-size: 13px;\n  }\n}\n@media (max-width: 768px) {\n  .rate-admin-modern {\n    padding-top: 94px;\n  }\n  .rate-admin-modern__header-content {\n    padding: var(--spacing-medium, 16px);\n  }\n  .rate-admin-modern__tabs-wrapper {\n    padding: var(--spacing-kendo-3, 12px) var(--spacing-medium, 16px) var(--spacing-medium, 16px) var(--spacing-medium, 16px);\n  }\n  .rate-admin-modern__title-row {\n    flex-direction: column;\n    align-items: flex-start;\n    gap: var(--spacing-kendo-3, 12px);\n    margin-bottom: 0;\n  }\n  .rate-admin-modern__title {\n    font-size: 22px;\n    width: 100%;\n  }\n  .rate-admin-modern__checkbox-label {\n    width: 100%;\n  }\n  .rate-admin-modern__tabs {\n    gap: 8px;\n  }\n  .rate-admin-modern__tab {\n    padding: 8px 12px;\n    font-size: 12px;\n  }
1\n  .rate-admin-modern__content {\n    padding: var(--spacing-medium, 16px) var(--spacing-medium, 16px) var(--spacing-extra-large, 24px) var(--spacing-medium, 16px);\n  }\n}\n@media (max-width: 480px) {\n  .rate-admin-modern {\n    padding-top: 59px;\n  }\n  .rate-admin-modern__back-arrow {\n    font-size: 18px;\n  }\n  .rate-admin-modern__title {\n    font-size: 20px;\n  }\n  .rate-admin-modern__header-content {\n    padding: var(--spacing-kendo-3, 12px) var(--spacing-medium, 16px);\n  }\n  .rate-admin-modern__tabs-wrapper {\n    padding: var(--spacing-kendo-3, 12px) var(--spacing-medium, 16px);\n  }\n  .rate-admin-modern__content {\n    padding: var(--spacing-kendo-3, 12px) var(--spacing-medium, 16px) var(--spacing-large, 20px) var(--spacing-medium, 16px);\n  }\n}\n/* Responsive adjustments */\n@media (max-width: 1024px) {\n  .rate-admin-modern__header-content {\n    padding: 0 var(--spacing-extra-large, 24px);\n  }\n  .rate-admin-modern__content {\n    padding-left: var(--spacing-extra-large, 24px);\n    padding-right: var(--spacing-extra-large, 24px);\n  }\n  .rate-admin-modern__tabs {\n    gap: 0;\n  }\n  .rate-admin-modern__tab {\n    padding: 12px 16px;\n    font-size: 14px;\n  }\n}\n@media (max-width: 768px) {\n  .rate-admin-modern__header-content {\n    padding: 0 var(--spacing-medium, 16px);\n  }\n  .rate-admin-modern__top-bar {\n    flex-direction: column;\n    align-items: flex-start;\n    gap: var(--spacing-kendo-3, 12px);\n  }\n  .rate-admin-modern__contact {\n    width: 100%;\n    justify-content: space-between;\n  }\n  .rate-admin-modern__title {\n    font-size: 24px;\n  }\n  .rate-admin-modern__tab {\n    padding: 10px 12px;\n    font-size: 13px;\n  }\n  .rate-admin-modern__content {\n    padding-left: var(--spacing-medium, 16px);\n    padding-right: var(--spacing-medium, 16px);\n    padding-top: 240px;\n  }\n}\n@media (max-width: 480px) {\n  .rate-admin-modern__content {\n    padding-top: 280px;\n  }\n}",""]),w.exports=c.toString()},7995(w,S,h){var m=h(8564),c=h(8557)(m);c.push([w.id,".highdeg .highdeg-info {\n  top: 0;\n  right: 0;\n}\n.highdeg .info-icon:hover + .highdeg-info-content {\n  display: inline-block;\n}\n.highdeg .highdeg-info-content {\n  top: -80px;\n  right: 0;\n  box-shadow: 0px 0px 10px #afca31;\n}\n.highdeg .highdeg-info-content.highdeg-content {\n  display: none;\n  background-color: white;\n  padding: 2px 5px;\n  width: 300px;\n  font-size: 14px;\n  position: absolute;\n  z-index: 50;\n  border: 2px solid #96b528;\n  border-radius: 4px;\n  font-size: 16px;\n}\n\n.success-red {\n  color: #f67c58 !important;\n}",""]),w.exports=c.toString()},8551(w,S,h){var m=h(8564),c=h(8557)(m);c.push([w.id,".dti-wrap {\n  margin-bottom: 75px;\n  clear: both;\n  /* Remove Bootstrap grid gutters inside this page section so overall padding stays 32px */\n}\n.dti-wrap .row {\n  margin-left: 0;\n  margin-right: 0;\n}\n.dti-wrap .col-lg-12,\n.dti-wrap .col-sm-12 {\n  padding-left: 0;\n  padding-right: 0;\n}\n.dti-wrap .sub-headings {\n  background-color: transparent;\n  border-bottom: none;\n  margin-top: 0;\n  margin-bottom: var(--spacing-small, 8px);\n  padding-bottom: 0;\n}\n.dti-wrap .dti-table-container {\n  background-color: var(--white, #ffffff);\n  padding: 0;\n}\n.dti-wrap table.ra-rate-table {\n  background-color: var(--white, #ffffff);\n  border-collapse: collapse;\n  margin: 0;\n  width: 100%;\n}\n.dti-wrap table.ra-rate-table thead {\n  background-color: var(--white, #ffffff);\n}\n.dti-wrap table.ra-rate-table th {\n  color: var(--black);\n  font-weight: var(--font-weight-semibold, 600);\n  font-size: var(--font-size-body-small, 14px);\n  text-align: center;\n  background-color: var(--white, #ffffff);\n  border: none;\n  border-bottom: none;\n}\n.dti-wrap table.ra-rate-table td {\n  background-color: var(--white, #ffffff);\n  color: var(--gray);\n  border: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n  text-align: center;\n}\n.dti-wrap table.ra-rate-table tbody tr,\n.dti-wrap table.ra-rate-table tbody tr:nth-child(odd),\n.dti-wrap table.ra-rate-table tbody tr:nth-child(even) {\n  background-color: var(--white, #ffffff);\n}\n.dti-wrap table.ra-rate-table tbody tr:nth-child(odd) .table-cell,\n.dti-wrap table.ra-rate-table tbody tr:nth-child(even) .table-cell {\n  background-color: var(--white, #ffffff);\n}\n.dti-wrap table.ra-rate-table .border-cell {\n  background-color: var(--white, #ffffff);\n  border-left: none;
1\n  border-right: none;\n  border-top: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n}\n.dti-wrap table.ra-rate-table thead tr:first-child th {\n  border-bottom: none;\n}\n.dti-wrap table.ra-rate-table thead tr:first-child .border-cell {\n  border-bottom: none;\n}\n.dti-wrap table.ra-rate-table thead tr:first-child th[rowspan] {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n}\n.dti-wrap table.ra-rate-table thead tr:last-child th {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n}\n.dti-wrap .header-cell {\n  font-family: var(--primary-font, \"Figtree\");\n  font-weight: var(--font-weight-semibold, 600);\n  font-size: var(--font-size-body-small, 14px);\n  color: var(--black);\n}\n.dti-wrap .edit-icon {\n  position: relative;\n  top: 2px;\n  display: inline-block;\n  width: 21px;\n  height: 20px;\n  background: url('/seb/webapp/edit.6ea53a4efbb967f3.png') no-repeat;\n  cursor: pointer;\n  background-size: 100%;\n  background-position-y: 4px;\n}\n.dti-wrap .delete-icon {\n  position: relative;\n  top: 2px;\n  display: inline-block;\n  width: 15px;\n  height: 21px;\n  background: url('/seb/webapp/delete_icon.e2206bdf3f669c0f.png') no-repeat;\n  cursor: pointer;\n  background-size: 100%;\n  background-position-y: 3px;\n}",""]),w.exports=c.toString()},5523(w,S,h){var m=h(8564),c=h(8557)(m);c.push([w.id,".tier-cell {\n  padding: 10px 5px;\n}\n\n:host {\n  display: block;\n}\n\n/* Remove Bootstrap grid gutters inside this page section so overall padding stays 32px */\n.row {\n  margin-left: 0;\n  margin-right: 0;\n}\n\n.col-lg-12,\n.col-sm-12 {\n  padding-left: 0;\n  padding-right: 0;\n}\n\n.table-cell {\n  border: none;\n  background-color: white;\n  text-align: center;\n}\n\ninput[type=text].table-cell {\n  margin-bottom: 0px;\n}\n\n.rate-table {\n  border-collapse: collapse;\n  margin-bottom: 0;\n}\n.rate-table thead {\n  background-color: #f1f1f1;\n}\n.rate-table th {\n  color: var(--black);\n  font-weight: 600;\n  font-size: 14px;\n  text-align: center;\n  background-color: white;\n  padding: 16px 8px;\n  border: none;\n  border-bottom: none;\n}\n.rate-table td {\n  background-color: white;\n  color: var(--gray);\n  border: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n  padding: 16px 8px;\n}\n.rate-table tbody tr,\n.rate-table tbody tr:nth-child(odd),\n.rate-table tbody tr:nth-child(even) {\n  background-color: white;\n}\n.rate-table tbody tr:nth-child(odd) .table-cell,\n.rate-table tbody tr:nth-child(even) .table-cell {\n  background-color: white;\n}\n.rate-table .border-cell {\n  background-color: white;\n  border-left: none;\n  border-right: none;\n  border-top: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n}\n.rate-table thead tr:first-child th {\n  border-bottom: none;\n}\n.rate-table thead tr:first-child .border-cell {\n  border-bottom: none;\n}\n.rate-table thead tr:last-child th {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n}\n.rate-table thead tr.term-columns-header-row th,\n.rate-table thead tr.term-columns-header-row th.border-cell {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6) !important;\n}\n.rate-table tbody tr:last-child td {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n}\n\n.tier-table-container {\n  background-color: white;\n  padding: 0;\n  margin-top: 0;\n}\n\n.tier-save-row {\n  display: flex;\n  justify-content: flex-end;\n  margin: 24px 0;\n}\n.tier-save-row .tier-save-btn {\n  float: none;\n  margin: 0;\n}\n\n.tier-block {\n  background-color: transparent;\n  padding: 0;\n}\n.tier-block .sub-headings {\n  background-color: transparent;\n  border-bottom: none;\n  margin-top: 0;\n  margin-bottom: 24px;\n  padding-bottom: 0;\n}\n.tier-block h4 {\n  margin-bottom: 10px;\n}\n\n.variable-margin {\n  background-color: transparent;\n  padding: 0;\n}\n\n.status-err-blk {\n  bottom: 60px;\n  right: 15px;\n}\n\n.tm-err-blk {\n  bottom: 60px;\n  right: 123px;\n}\n\n.mm-err-blk {\n  bottom: 0;\n  right: 15px;\n}\n\n.margin-heading {\n  padding-bottom: 0px;\n}\n.margin-heading h4 {\n  display: inline-block;\n  margin-top: 35px;\n}\n.margin-heading .libor-index {\n  float: right;\n}\n.margin-heading .libor-index input {\n  height: 42px;\n  border: 1px solid rgb(226, 226, 226);\n  color: rgb(127, 127, 127);\n  width: 100%;\n  background-color: rgb(245, 245, 245);\n  padding: 0 8px;\n}\n.margin-heading .libor-index .libor-container {\n  margin-right: 20px;\n  display: inline-block;\n}\n.margin-heading .libor-index .index-err-blk {\n  top: 70px;\n  right: 0;\n}\n.margin-heading .libor-index .cus-left {\n  left: 0;\n}\n.margin-heading .libor-index .index-container {\n  display: inline-block;\n}\n.margin-heading .libor-index .index-container label {\n  width: 100%;\n}\n\n.tier-row-data {\n  border-right: 1px solid #e2e2e2 !important;\n}\n\n.tier-row-header {\n  border-top: 1px solid #e2e2e2 !important;\n}\n\n/* ===================== DTI / FICO Range Maintenance ===================== */\n.dti-wrap {\n  margin-bottom: 75px;\n  clear: both;\n  /* Remove Bootstrap grid gutters inside this page section so overall padding stays 32px */\n}\n.dti-wrap .row {\n  margin-left: 0;\n  margin-right: 0;\n}
1\n.dti-wrap .col-lg-12,\n.dti-wrap .col-sm-12 {\n  padding-left: 0;\n  padding-right: 0;\n}\n.dti-wrap .sub-headings {\n  background-color: transparent;\n  border-bottom: none;\n  margin-top: 0;\n  margin-bottom: var(--spacing-small, 8px);\n  padding-bottom: 0;\n}\n.dti-wrap .dti-table-container {\n  background-color: var(--white, #ffffff);\n  padding: 0;\n}\n.dti-wrap table.ra-rate-table {\n  background-color: var(--white, #ffffff);\n  border-collapse: collapse;\n  margin: 0;\n  width: 100%;\n}\n.dti-wrap table.ra-rate-table thead {\n  background-color: var(--white, #ffffff);\n}\n.dti-wrap table.ra-rate-table th {\n  color: var(--black);\n  font-weight: var(--font-weight-semibold, 600);\n  font-size: var(--font-size-body-small, 14px);\n  text-align: center;\n  background-color: var(--white, #ffffff);\n  border: none;\n  border-bottom: none;\n}\n.dti-wrap table.ra-rate-table td {\n  background-color: var(--white, #ffffff);\n  color: var(--gray);\n  border: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n  text-align: center;\n}\n.dti-wrap table.ra-rate-table tbody tr,\n.dti-wrap table.ra-rate-table tbody tr:nth-child(odd),\n.dti-wrap table.ra-rate-table tbody tr:nth-child(even) {\n  background-color: var(--white, #ffffff);\n}\n.dti-wrap table.ra-rate-table tbody tr:nth-child(odd) .table-cell,\n.dti-wrap table.ra-rate-table tbody tr:nth-child(even) .table-cell {\n  background-color: var(--white, #ffffff);\n}\n.dti-wrap table.ra-rate-table .border-cell {\n  background-color: var(--white, #ffffff);\n  border-left: none;\n  border-right: none;\n  border-top: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n}\n.dti-wrap table.ra-rate-table thead tr:first-child th {\n  border-bottom: none;\n}\n.dti-wrap table.ra-rate-table thead tr:first-child .border-cell {\n  border-bottom: none;\n}\n.dti-wrap table.ra-rate-table thead tr:first-child th[rowspan] {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n}\n.dti-wrap table.ra-rate-table thead tr:last-child th {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n}\n.dti-wrap .header-cell {\n  font-family: var(--primary-font, \"Figtree\");\n  font-weight: var(--font-weight-semibold, 600);\n  font-size: var(--font-size-body-small, 14px);\n  color: var(--black);\n}\n.dti-wrap .edit-icon {\n  position: relative;\n  top: 2px;\n  display: inline-block;\n  width: 21px;\n  height: 20px;\n  background: url('/seb/webapp/edit.6ea53a4efbb967f3.png') no-repeat;\n  cursor: pointer;\n  background-size: 100%;\n  background-position-y: 4px;\n}\n.dti-wrap .delete-icon {\n  position: relative;\n  top: 2px;\n  display: inline-block;\n  width: 15px;\n  height: 21px;\n  background: url('/seb/webapp/delete_icon.e2206bdf3f669c0f.png') no-repeat;\n  cursor: pointer;\n  background-size: 100%;\n  background-position-y: 3px;\n}",""]),w.exports=c.toString()},5991(w,S,h){var m=h(8564),c=h(8557)(m);c.push([w.id,'.custom-progress-container {\n  margin-top: 15px;\n  width: 100%;\n}\n\n.custom-progress-bar {\n  width: 100%;\n  height: 25px;\n  background-color: var(--gray-lightest);\n  border-radius: 4px;\n  overflow: hidden;\n  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);\n  border: 1px solid var(--gray-light);\n  position: relative;\n}\n\n.custom-progress-fill {\n  height: 100%;\n  background: linear-gradient(90deg, var(--success-color) 0%, var(--status-success) 100%);\n  transition: width 0.3s ease;\n  border-radius: 3px;\n  position: relative;\n}\n.custom-progress-fill::before {\n  content: "";\n  position: absolute;\n  top: 0;\n  left: -100%;\n  width: 100%;\n  height: 100%;\n  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);\n  animation: shine 1.5s infinite;\n}\n\n@keyframes shine {\n  0% {\n    left: -100%;\n  }\n  100% {\n    left: 100%;\n  }\n}\n.custom-progress-container[hidden] {\n  display: none;\n}',""]),w.exports=c.toString()},7815(w,S,h){var m=h(8564),c=h(8557)(m);c.push([w.id,".tier-cell {\n  padding: 10px 5px;\n}\n\n:host {\n  display: block;\n}\n\n/* Remove Bootstrap grid gutters inside this page section so overall padding stays 32px */\n.row {\n  margin-left: 0;\n  margin-right: 0;\n}\n\n.col-lg-12,\n.col-sm-12 {\n  padding-left: 0;\n  padding-right: 0;\n}\n\n.table-cell {\n  border: none;\n  background-color: white;\n  text-align: center;\n}\n\ninput[type=text].table-cell {\n  margin-bottom: 0px;\n}\n\n.rate-table {\n  border-collapse: collapse;\n  margin-bottom: 0;\n}\n.rate-table thead {\n  background-color: #f1f1f1;\n}\n.rate-table th {\n  color: var(--black);\n  font-weight: 600;\n  font-size: 14px;\n  text-align: center;\n  background-color: white;\n  padding: 16px 8px;\n  border: none;\n  border-bottom: none;\n}\n.rate-table td {\n  background-color: white;\n  color: var(--gray);\n  border: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n  padding: 16px 8px;\n}\n.rate-table tbody tr,\n.rate-table tbody tr:nth-child(odd),\n.rate-table tbody tr:nth-child(even) {\n  background-color: white;\n}\n.rate-table tbody tr:nth-child(odd) .table-cell,\n.rate-table tbody tr:nth-child(even) .table-cell {\n  background-color: white;\n}\n.rate-table .border-cell {\n  background-color: white;\n  border-left: none;
1\n  border-right: none;\n  border-top: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n}\n.rate-table thead tr:first-child th {\n  border-bottom: none;\n}\n.rate-table thead tr:first-child .border-cell {\n  border-bottom: none;\n}\n.rate-table thead tr:last-child th {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n}\n.rate-table thead tr.term-columns-header-row th,\n.rate-table thead tr.term-columns-header-row th.border-cell {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6) !important;\n}\n.rate-table tbody tr:last-child td {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n}\n\n.tier-table-container {\n  background-color: white;\n  padding: 0;\n  margin-top: 0;\n}\n\n.tier-save-row {\n  display: flex;\n  justify-content: flex-end;\n  margin: 24px 0;\n}\n.tier-save-row .tier-save-btn {\n  float: none;\n  margin: 0;\n}\n\n.tier-block {\n  background-color: transparent;\n  padding: 0;\n}\n.tier-block .sub-headings {\n  background-color: transparent;\n  border-bottom: none;\n  margin-top: 0;\n  margin-bottom: 24px;\n  padding-bottom: 0;\n}\n.tier-block h4 {\n  margin-bottom: 10px;\n}\n\n.variable-margin {\n  background-color: transparent;\n  padding: 0;\n}\n\n.status-err-blk {\n  bottom: 60px;\n  right: 15px;\n}\n\n.tm-err-blk {\n  bottom: 60px;\n  right: 123px;\n}\n\n.mm-err-blk {\n  bottom: 0;\n  right: 15px;\n}\n\n.margin-heading {\n  padding-bottom: 0px;\n}\n.margin-heading h4 {\n  display: inline-block;\n  margin-top: 35px;\n}\n.margin-heading .libor-index {\n  float: right;\n}\n.margin-heading .libor-index input {\n  height: 42px;\n  border: 1px solid rgb(226, 226, 226);\n  color: rgb(127, 127, 127);\n  width: 100%;\n  background-color: rgb(245, 245, 245);\n  padding: 0 8px;\n}\n.margin-heading .libor-index .libor-container {\n  margin-right: 20px;\n  display: inline-block;\n}\n.margin-heading .libor-index .index-err-blk {\n  top: 70px;\n  right: 0;\n}\n.margin-heading .libor-index .cus-left {\n  left: 0;\n}\n.margin-heading .libor-index .index-container {\n  display: inline-block;\n}\n.margin-heading .libor-index .index-container label {\n  width: 100%;\n}\n\n.tier-row-data {\n  border-right: 1px solid #e2e2e2 !important;\n}\n\n.tier-row-header {\n  border-top: 1px solid #e2e2e2 !important;\n}",""]),w.exports=c.toString()},3321(w,S,h){var m=h(8564),c=h(8557)(m);c.push([w.id,".tier-cell {\n  padding: 10px 5px;\n}\n\n:host {\n  display: block;\n}\n\n/* Remove Bootstrap grid gutters inside this page section so overall padding stays 32px */\n.row {\n  margin-left: 0;\n  margin-right: 0;\n}\n\n.col-lg-12,\n.col-sm-12 {\n  padding-left: 0;\n  padding-right: 0;\n}\n\n.table-cell {\n  border: none;\n  background-color: white;\n  text-align: center;\n}\n\ninput[type=text].table-cell {\n  margin-bottom: 0px;\n}\n\n.rate-table {\n  border-collapse: collapse;\n  margin-bottom: 0;\n}\n.rate-table thead {\n  background-color: #f1f1f1;\n}\n.rate-table th {\n  color: var(--black);\n  font-weight: 600;\n  font-size: 14px;\n  text-align: center;\n  background-color: white;\n  padding: 16px 8px;\n  border: none;\n  border-bottom: none;\n}\n.rate-table td {\n  background-color: white;\n  color: var(--gray);\n  border: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n  padding: 16px 8px;\n}\n.rate-table tbody tr,\n.rate-table tbody tr:nth-child(odd),\n.rate-table tbody tr:nth-child(even) {\n  background-color: white;\n}\n.rate-table tbody tr:nth-child(odd) .table-cell,\n.rate-table tbody tr:nth-child(even) .table-cell {\n  background-color: white;\n}\n.rate-table .border-cell {\n  background-color: white;\n  border-left: none;\n  border-right: none;\n  border-top: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n}\n.rate-table thead tr:first-child th {\n  border-bottom: none;\n}\n.rate-table thead tr:first-child .border-cell {\n  border-bottom: none;\n}\n.rate-table thead tr:last-child th {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n}\n.rate-table thead tr.term-columns-header-row th,\n.rate-table thead tr.term-columns-header-row th.border-cell {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6) !important;\n}\n.rate-table tbody tr:last-child td {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, #E5E0E6);\n}\n\n.tier-table-container {\n  background-color: white;\n  padding: 0;\n  margin-top: 0;\n}\n\n.tier-save-row {\n  display: flex;\n  justify-content: flex-end;\n  margin: 24px 0;\n}\n.tier-save-row .tier-save-btn {\n  float: none;\n  margin: 0;\n}\n\n.tier-block {\n  background-color: transparent;\n  padding: 0;\n}\n.tier-block .sub-headings {\n  background-color: transparent;\n  border-bottom: none;\n  margin-top: 0;\n  margin-bottom: 24px;\n  padding-bottom: 0;\n}\n.tier-block h4 {\n  margin-bottom: 10px;\n}\n\n.variable-margin {\n  background-color: transparent;\n  padding: 0;\n}\n\n.status-err-blk {\n  bottom: 60px;\n  right: 15px;\n}\n\n.tm-err-blk {\n  bottom: 60px;\n  right: 123px;\n}\n\n.mm-err-blk {\n  bottom: 0;\n  right: 15px;\n}\n\n.margin-heading {\n  padding-bottom: 0px;\n}\n.margin-heading h4 {\n  display: inline-block;\n  margin-top: 35px;\n}\n.margin-heading .libor-index {\n  float: right;\n}\n.margin-heading .libor-index input {\n  height: 42px;\n  border: 1px solid rgb(226, 226, 226);\n  color: rgb(127, 127, 127);\n  width: 100%;\n  background-color: rgb(245, 245, 245);\n  padding: 0 8px;\n}\n.margin-heading .libor-index .libor-container {\n  margin-right: 20px;\n  display: inline-block;\n}\n.margin-heading .libor-index .index-err-blk {\n  top: 70px;\n  right: 0;\n}\n.margin-heading .libor-index .cus-left {\n  left: 0;\n}\n.margin-heading .libor-index .index-container {\n  display: inline-block;\n}\n.margin-heading .libor-index .index-container label {\n  width: 100%;\n}\n\n.tier-row-data {\n  border-right: 1px solid #e2e2e2 !important;\n}\n\n.tier-row-header {\n  border-top: 1px solid #e2e2e2 !important;\n}\n\n/* ===================== DTI / FICO Range Maintenance ===================== */\n.dti-wrap {\n  margin-bottom: 75px;\n  clear: both;\n  /* Remove Bootstrap grid gutters inside this page section so overall padding stays 32px */\n}\n.dti-wrap .row {\n  margin-left: 0;\n  margin-right: 0;\n}
1\n.dti-wrap .col-lg-12,\n.dti-wrap .col-sm-12 {\n  padding-left: 0;\n  padding-right: 0;\n}\n.dti-wrap .sub-headings {\n  background-color: transparent;\n  border-bottom: none;\n  margin-top: 0;\n  margin-bottom: var(--spacing-small, 8px);\n  padding-bottom: 0;\n}\n.dti-wrap .dti-table-container {\n  background-color: var(--white, #ffffff);\n  padding: 0;\n}\n.dti-wrap table.ra-rate-table {\n  background-color: var(--white, #ffffff);\n  border-collapse: collapse;\n  margin: 0;\n  width: 100%;\n}\n.dti-wrap table.ra-rate-table thead {\n  background-color: var(--white, #ffffff);\n}\n.dti-wrap table.ra-rate-table th {\n  color: var(--black);\n  font-weight: var(--font-weight-semibold, 600);\n  font-size: var(--font-size-body-small, 14px);\n  text-align: center;\n  background-color: var(--white, #ffffff);\n  border: none;\n  border-bottom: none;\n}\n.dti-wrap table.ra-rate-table td {\n  background-color: var(--white, #ffffff);\n  color: var(--gray);\n  border: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n  text-align: center;\n}\n.dti-wrap table.ra-rate-table tbody tr,\n.dti-wrap table.ra-rate-table tbody tr:nth-child(odd),\n.dti-wrap table.ra-rate-table tbody tr:nth-child(even) {\n  background-color: var(--white, #ffffff);\n}\n.dti-wrap table.ra-rate-table tbody tr:nth-child(odd) .table-cell,\n.dti-wrap table.ra-rate-table tbody tr:nth-child(even) .table-cell {\n  background-color: var(--white, #ffffff);\n}\n.dti-wrap table.ra-rate-table .border-cell {\n  background-color: var(--white, #ffffff);\n  border-left: none;\n  border-right: none;\n  border-top: none;\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n}\n.dti-wrap table.ra-rate-table thead tr:first-child th {\n  border-bottom: none;\n}\n.dti-wrap table.ra-rate-table thead tr:first-child .border-cell {\n  border-bottom: none;\n}\n.dti-wrap table.ra-rate-table thead tr:first-child th[rowspan] {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n}\n.dti-wrap table.ra-rate-table thead tr:last-child th {\n  border-bottom: 1px solid var(--app-color-neutrals-gray-light, var(--gray-light, #E5E0E6));\n}\n.dti-wrap .header-cell {\n  font-family: var(--primary-font, \"Figtree\");\n  font-weight: var(--font-weight-semibold, 600);\n  font-size: var(--font-size-body-small, 14px);\n  color: var(--black);\n}\n.dti-wrap .edit-icon {\n  position: relative;\n  top: 2px;\n  display: inline-block;\n  width: 21px;\n  height: 20px;\n  background: url('/seb/webapp/edit.6ea53a4efbb967f3.png') no-repeat;\n  cursor: pointer;\n  background-size: 100%;\n  background-position-y: 4px;\n}\n.dti-wrap .delete-icon {\n  position: relative;\n  top: 2px;\n  display: inline-block;\n  width: 15px;\n  height: 21px;\n  background: url('/seb/webapp/delete_icon.e2206bdf3f669c0f.png') no-repeat;\n  cursor: pointer;\n  background-size: 100%;\n  background-position-y: 3px;\n}",""]),w.exports=c.toString()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.