(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{"2ybs":function(e,t,i){"use strict";i.r(t),i.d(t,"LogsPercentileDataModule",(function(){return R}));var r=i("ofXK"),n=i("YhMU"),a=i("PDQ2"),s=i("fXoL"),o=i("hpMP"),l=i("OIwC"),c=i("9Rqc"),d=i("P4I5"),h=i("6oX4"),u=i("arFO"),y=i("3Pt+");let p=(()=>{class e{constructor(e,t,i,r,n){this.keywordDefinition=e,this.dataService=t,this.scenUtilsService=i,this.schData=r,this.scenarioHttpService=n,this.percentileDataOptions=[],this.enableDisKeywordList={PERCENTILE_REPORT:!1},this.screenKeywordList=Object.keys(this.enableDisKeywordList)}canDeactivate(){try{if(0==this.validateAndSetKeywordArray())return!1}catch(e){}return!0}setDataInConf(){return!0}ngOnInit(){if(this.saveSubscription=this.scenUtilsService.$saveGroupbasedSetting.subscribe(e=>{this.validateAndSetKeywordArray()&&this.scenUtilsService.saveComponentData(0,{})}),this.percentileDataOptions=[{label:"Select Time",value:null},{label:"1 minute",value:60},{label:"10 minutes",value:600}],this.arrKeywordData=this.keywordDefinition.chkAndGetKeywrdDataWithAdditionalKeys(this.screenKeywordList),this.keywordDefinition.isArrKeywordDataEmpty(this.arrKeywordData,this.screenKeywordList)){this.keywordDefinition.setRequestKeywordListInBody(this.screenKeywordList,"");let e=this.keywordDefinition.getRequestJsonParm();this.getKeywordData(e),null==this.arrKeywordData&&(this.arrKeywordData={})}else this.fillDataInComp()}getKeywordData(e){this.scenarioHttpService.getDefaultKeywordData(e).subscribe(e=>{if(!(e instanceof a.J))return e instanceof a.H?(this.keywordDefinition.setArrKeywordData(this.arrKeywordData,e.data,this.keywordDefinition.mergeKeywordData),void this.fillDataInComp()):void 0},e=>{console.log(e.error)})}fillDataInComp(){try{let e=Object.keys(this.arrKeywordData);for(let t=0;t<e.length;t++){let i=e[t],r=this.arrKeywordData[i],a=r[n.c.DATA];if(this.enableDisKeywordList[i]=this.dataService.isCompEnable(this.dataService.getScenMode(),r,i),null==a)continue;if(null==a[n.b])continue;let s=a[n.b][0];if(null!=s&&"PERCENTILE_REPORT"==i)if("0"==s[0])this.txtPctInterval=null;else if(this.valPctGenInterval=null==s[1]?0:s[1],"2"==s[1]){let e=s[2]/1e3;this.txtPctInterval=null==s[2]?600:e}}}catch(e){console.log("Exception",e)}}validateAndSetKeywordArray(){if(0==this.validateAndSetPercentile())return!1;for(let e=0;e<this.screenKeywordList.length;e++)this.schData.saveKeywordData[this.screenKeywordList[e]]=this.arrKeywordData[this.screenKeywordList[e]].data;return!0}validateAndSetPercentile(){let e=[];if(null!=this.txtPctInterval){if(e.push(1),e.push(2),this.txtPctInterval<0)return this.scenUtilsService.errorMessage("Specified interval minutes should be greater than equal to 0"),!1;if(this.txtPctInterval<=0)return this.scenUtilsService.errorMessage("Specified interval seconds should be greater than 0"),!1;e.push(1e3*this.txtPctInterval)}else e.push(0);return this.setArrayWithKeyWord("PERCENTILE_REPORT",e),!0}setArrayWithKeyWord(e,t){let i=this.arrKeywordData[e].data;null!=i[n.b]?(i[n.b]=[],i[n.b].push(t)):i[n.b]=[t]}ngOnDestroy(){this.saveSubscription&&this.saveSubscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(s["\u0275\u0275directiveInject"](o.a),s["\u0275\u0275directiveInject"](l.a),s["\u0275\u0275directiveInject"](c.a),s["\u0275\u0275directiveInject"](d.a),s["\u0275\u0275directiveInject"](h.a))},e.\u0275cmp=s["\u0275\u0275defineComponent"]({type:e,selectors:[["app-logs-percentile-data"]],decls:5,vars:3,consts:[[1,"w-100-p","p-grid","p-align-center"],[1,"p-col-3"],[1,"p-col-2"],["styleClass","w-100-p","placeholder","Select Time",3,"options","disabled","ngModel","ngModelChange"]],template:function(e,t){1&e&&(s["\u0275\u0275elementStart"](0,"div",0),s["\u0275\u0275elementStart"](1,"div",1),s["\u0275\u0275text"](2,"Generate percentile data for every"),s["\u0275\u0275elementEnd"](),s["\u0275\u0275elementStart"](3,"div",2),s["\u0275\u0275elementStart"](4,"p-dropdown",3),s["\u0275\u0275listener"]("ngModelChange",(function(e){return t.txtPctInterval=e})),s["\u0275\u0275elementEnd"](),s["\u0275\u0275elementEnd"](),s["\u0275\u0275elementEnd"]()),2&e&&(s["\u0275\u0275advance"](4),s["\u0275\u0275property"]("options",t.percentileDataOptions)("disabled",t.enableDisKeywordList.PERCENTILE_REPORT)("ngModel",t.txtPctInterval))},directives:[u.a,y.w,y.z],styles:[""],encapsulation:2}),e})();var v=i("tyNb"),w=i("NCSE"),b=i("jIHw"),f=i("URcr"),D=i("5o1E"),K=i("7kUa"),I=i("lVkt"),g=i("rEr+"),m=i("QIUk"),S=i("Ji6n"),E=i("FMpt"),P=i("LuMj"),L=i("ImVz"),C=i("xlun");const A=[{path:"",component:p,canDeactivate:[i("zCgc").a]}];let R=(()=>{class e{}return e.\u0275mod=s["\u0275\u0275defineNgModule"]({type:e}),e.\u0275inj=s["\u0275\u0275defineInjector"]({factory:function(t){return new(t||e)},imports:[[r.c,w.b,y.p,u.b,b.c,f.b,D.b,K.b,I.b,g.t,m.b,S.b,E.a,P.b,L.b,C.b,v.m.forChild(A)]]}),e})()}}]);