import{a as Y,b as me}from"./chunk-ZTZZCUEG.js";import{a as X,b as le}from"./chunk-ZB6RYYHS.js";import{a as Q,b as re}from"./chunk-WE5LAP5N.js";import{a as K,b as ae}from"./chunk-43YDQPPD.js";import{C as j,E as N,g as O,i as R,n as A}from"./chunk-K7KAWBRR.js";import{d as G,e as L,f as U}from"./chunk-2Z3VA76N.js";import{a as J,b as se}from"./chunk-CMGJXTS5.js";import{a as H,b as ne}from"./chunk-3AUKOF45.js";import{Ha as W,La as oe}from"./chunk-5YPL7P3G.js";import{Bb as _,Dc as b,Gb as S,Hc as p,Ic as o,J as c,Ka as s,La as a,Lc as z,Rb as D,Sd as F,Vb as q,Xb as h,Yc as C,ed as V,fd as E,g as x,gd as M,ha as P,ia as f,kc as r,ld as B,na as te,nc as I,oa as ie,sc as k,ta as w,vd as d,wd as g,x as u,xc as l,yc as m,zc as T}from"./chunk-XJKQ67XR.js";import{e as v}from"./chunk-SZAW6ZBW.js";var Z,$=v(()=>{te();F();Z=(()=>{class i{constructor(){this.editRequestSource=new x,this.editRequest=this.editRequestSource.asObservable()}edit(e){this.editRequestSource.next(e)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=w({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});function ge(i,ee){if(i&1){let e=b();l(0,"sd-submit-button",6),d(1,"translate"),p("onClick",function(){s(e);let n=o(2);return a(n.save())}),m(),l(2,"sd-cancel-button",7),d(3,"translate"),p("onClick",function(){s(e);let n=o(2);return a(n.cancel())}),m()}if(i&2){o();let e=C(3);r("disabled",!e.dirty||e.form.invalid)("label",g(1,5,"lblSave"))("parent",e),_(2),r("label",g(3,7,"lblCancel"))("parent",e)}}function ue(i,ee){if(i&1){let e=b();l(0,"p-dialog",2),d(1,"translate"),M("visibleChange",function(n){s(e);let y=o();return E(y.displayDialog,n)||(y.displayDialog=n),a(n)}),p("onHide",function(){s(e);let n=o();return a(n.cancel())}),l(2,"form",3,0),T(4,"dps-pam-settings",4),m(),h(5,ge,4,9,"ng-template",5),m()}if(i&2){let e=C(3),t=o();I(B(14,de)),z("header",g(1,12,"lblDefaultSettings")),V("visible",t.displayDialog),r("draggable",!1)("maximizable",!0)("modal",!0)("focusOnShow",!1),_(4),r("target",t.requestParams==null?null:t.requestParams.target)("settings",t.settings)("form",e)("mdColSize",12)}}var de,ke,fe=v(()=>{ie();ne();U();se();me();le();re();N();F();$();ae();U();oe();N();de=()=>({width:"650px",height:"780px"});ke=(()=>{class i extends H{constructor(e,t){super(),this.pamSystemSettingsEditService=e,this.pamSettingsService=t,this.displayDialog=!1}ngOnInit(){this.subscribeToEditRequest()}save(){this.callActionAccept()}cancel(){this.callActionCancel()}callActionAccept(e=!0){this.pamSettingsService.setSettings(this.settings).pipe(f(this.destroyed$),c(t=>!!t),u(t=>!!t)).subscribe(()=>{this.requestParams&&this.requestParams.accept&&(this.requestParams.accept(),this.requestParams=null),e&&(this.displayDialog=!1)})}callActionCancel(e=!0){this.requestParams&&this.requestParams.cancel&&(this.requestParams.cancel(),this.requestParams=null),e&&(this.displayDialog=!1)}subscribeToEditRequest(){this.pamSystemSettingsEditService.editRequest.pipe(c(e=>e.key===this.key),P(e=>this.getSettings(e)),c(e=>!!e.settings),f(this.destroyed$)).subscribe(e=>{this.settings=e.settings,this.requestParams=e.request,this.displayDialog=!0})}getSettings(e){return this.pamSettingsService.getSettings(!0).pipe(u(t=>({settings:t,request:e})))}static{this.\u0275fac=function(t){return new(t||i)(S(Z),S(K))}}static{this.\u0275cmp=D({type:i,selectors:[["dvl-pam-system-settings-dialog"]],features:[q],decls:1,vars:1,consts:[["form","ngForm"],["closeIcon","di dvl-icon-close","minimizeIcon","di dvl-icon-minimize","maximizeIcon","di dvl-icon-expand",3,"header","visible","style","draggable","maximizable","modal","focusOnShow"],["closeIcon","di dvl-icon-close","minimizeIcon","di dvl-icon-minimize","maximizeIcon","di dvl-icon-expand",3,"visibleChange","onHide","header","visible","draggable","maximizable","modal","focusOnShow"],["autocomplete","off","novalidate","",1,"full-height"],[3,"target","settings","form","mdColSize"],["pTemplate","footer"],[3,"onClick","disabled","label","parent"],[3,"onClick","label","parent"]],template:function(t,n){t&1&&h(0,ue,6,15,"p-dialog",1),t&2&&k(n.displayDialog?0:-1)},dependencies:[L,G,W,J,Y,X,Q,j,A,O,R],styles:["[_nghost-%COMP%]     .p-dialog .p-dialog-content{overflow:auto}@supports not selector(::-webkit-scrollbar){[_nghost-%COMP%]     .p-dialog .p-dialog-content{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color) var(--scrollbar-background-color)}}"]})}}return i})()});export{Z as a,$ as b,ke as c,fe as d};
