import{f as q}from"./chunk-RHHSGDHT.js";import{c as N,e as u,h as L,i as A,j as R,l as C,n as V,s as G,v as B}from"./chunk-UKMXE22B.js";import{a as H}from"./chunk-NFNGTYHU.js";import{Ca as I,Ja as E,Sa as F,X as P,Xa as T,e as O,ub as j,wa as D}from"./chunk-H6CVDF3D.js";import{$b as l,Fa as f,Ib as v,Nb as x,Pa as b,Pb as s,Qa as g,Rc as S,Zb as i,_b as r,ac as _,bc as w,dc as k,ic as h,jc as c,sc as M,tc as p,xb as d,yb as a}from"./chunk-GVONH462.js";import{j as y}from"./chunk-N3VKLXFR.js";function U(o,z){if(o&1){let e=k();_(0),i(1,"div",4)(2,"form",5)(3,"div",6),l(4,"input",7),r(),i(5,"div",8),l(6,"ng-select",9),r()()(),i(7,"div",10)(8,"button",11),h("click",function(){b(e);let n=c();return g(n.bsModalRef.hide())}),p(9,"Cancel"),r(),i(10,"button",12),h("click",function(){b(e);let n=c();return g(n.createDashboard())}),p(11,"Continue"),r()(),w()}if(o&2){let e=c();d(2),s("formGroup",e.dashboardForm),d(4),s("items",e.reportCategoriesList),d(4),s("disabled",!e.dashboardForm.valid)}}function $(o,z){o&1&&(i(0,"div",4),l(1,"ha-preloader",13),r())}var ae=(()=>{class o extends F{router;facadeService;appService;skillsCommonService;bsModalRef;entityTypeCodeId=E.DASHBOARDS;isLoading=!0;projectId;reportCategoriesList=[];dashboardForm;constructor(e,t,n,m,K){super(),this.router=e,this.facadeService=t,this.appService=n,this.skillsCommonService=m,this.bsModalRef=K}ngOnInit(){return y(this,null,function*(){let e=yield this.skillsCommonService.getEntityStaticData();this.reportCategoriesList=e.reportCategories[this.entityTypeCodeId],this.subscriptions.add(this.facadeService.selectedProject$.subscribe(t=>{this.projectId=t.storeid,this.dashboardForm=new R({dashboardName:new C("",[u.required]),reportCategory:new C(null,[u.required])}),this.isLoading=!1}))})}createDashboard(){this.appService.setPreloader(!0),this.bsModalRef.hide();let e={headerdata:[{entitytypecodeid:this.EntityTypesList.DASHBOARDS,reportcategorytypecodeid:this.dashboardForm.get("reportCategory")?.value,keyid:0,name:this.dashboardForm.get("dashboardName")?.value,filterenableindicator:!0,description:null,versionname:"my first version",statuscodeid:this.StatusTypesList.ACTIVE,groupid:1,versionid:1,internalversionid:1,actiontypecodeid:this.ActionTypesList.CREATE,storagelevelcodeid:null,defaultentitydescriptionid:null,dashboardtypecodeid:17001}],buildobjects:[]};this.subscriptions.add(this.skillsCommonService.addOrUpdateEntity(this.projectId,e).subscribe(t=>{this.router.navigate(["/project",this.projectId,"dashboards",this.dashboardForm.get("reportCategory")?.value,"edit",t.entityKeyId,"0"],{state:{editFlag:!0}})}).add(()=>this.appService.setPreloader(!1)))}static \u0275fac=function(t){return new(t||o)(a(P),a(D),a(I),a(T),a(H))};static \u0275cmp=f({type:o,selectors:[["app-create-dashboard-dialog"]],features:[v],decls:6,vars:2,consts:[["preloader",""],[1,"modal-header"],[1,"modal-title"],[4,"ngIf","ngIfElse"],[1,"modal-body","create-dashboard-modal"],[1,"dashboard-header",3,"formGroup"],[1,"dashboard-name","form-group"],["type","text","placeholder","Dashboard Name","formControlName","dashboardName",1,"form-control"],[1,"dashboard-category","form-group"],["bindLabel","name","bindValue","refcodeid","placeholder","Category","appendTo","body","formControlName","reportCategory",3,"items"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"py-5"]],template:function(t,n){if(t&1&&(i(0,"div",1)(1,"h4",2),p(2,"Create Dashboard"),r()(),x(3,U,12,3,"ng-container",3)(4,$,2,0,"ng-template",null,0,S)),t&2){let m=M(5);d(3),s("ngIf",!n.isLoading)("ngIfElse",m)}},dependencies:[O,V,N,L,A,G,B,j,q],styles:[".ha-scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;height:6px}.ha-scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e2e2e2}.ha-scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#707070}.ha-scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}@-moz-document url-prefix(){.ha-scrollbar{scrollbar-width:thin;scrollbar-color:#707070 #e2e2e2}}.scrollonhover[_ngcontent-%COMP%]{overflow:auto;visibility:hidden}.scrollonhover[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent;border-radius:10px}.scrollonhover[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;height:6px;background:transparent}.scrollonhover[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:10px;border:4px rgba(5,24,58,0) solid;background:#05183a66}@-moz-document url-prefix(){.scrollonhover{scrollbar-width:thin;scrollbar-color:rgba(5,24,58,.4) #f1f1f1}}.scrollonhover[_ngcontent-%COMP%]:hover, .scrollonhover[_ngcontent-%COMP%]:focus, .scrollonhover[_ngcontent-%COMP%]   .scrollbox-content[_ngcontent-%COMP%]{visibility:visible;transition:all .5s;-webkit-transition:all .5s}.align-content-center[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-direction:column}.gap-1[_ngcontent-%COMP%]{gap:4px}@media only screen and (-webkit-min-device-pixel-ratio: 1.25),only screen and (-o-min-device-pixel-ratio: 5/4),only screen and (min-resolution: 120dpi),only screen and (min-resolution: 1.25dppx),only screen and (min-width: 1199.98px) and (max-width: 1599.98px){.gap-1[_ngcontent-%COMP%]{gap:2px}}.gap-2[_ngcontent-%COMP%]{gap:8px}@media only screen and (-webkit-min-device-pixel-ratio: 1.25),only screen and (-o-min-device-pixel-ratio: 5/4),only screen and (min-resolution: 120dpi),only screen and (min-resolution: 1.25dppx),only screen and (min-width: 1199.98px) and (max-width: 1599.98px){.gap-2[_ngcontent-%COMP%]{gap:4px}}.gap-3[_ngcontent-%COMP%]{gap:10px}@media only screen and (-webkit-min-device-pixel-ratio: 1.25),only screen and (-o-min-device-pixel-ratio: 5/4),only screen and (min-resolution: 120dpi),only screen and (min-resolution: 1.25dppx),only screen and (min-width: 1199.98px) and (max-width: 1599.98px){.gap-3[_ngcontent-%COMP%]{gap:6px}}.gap-4[_ngcontent-%COMP%]{gap:15px}@media only screen and (-webkit-min-device-pixel-ratio: 1.25),only screen and (-o-min-device-pixel-ratio: 5/4),only screen and (min-resolution: 120dpi),only screen and (min-resolution: 1.25dppx),only screen and (min-width: 1199.98px) and (max-width: 1599.98px){.gap-4[_ngcontent-%COMP%]{gap:10px}}[_nghost-%COMP%]{display:block;margin-top:-2px}[_nghost-%COMP%]   .ha-info[_ngcontent-%COMP%]{color:#01a89e}"]})}return o})();export{ae as a};
