import{a as le,b as ve}from"./chunk-SADKIAAT.js";import{a as re,b as fe}from"./chunk-MBRDXADW.js";import{a as ae,b as Se}from"./chunk-LBARZOQF.js";import{a as se,b as ye}from"./chunk-JGD4Z3FB.js";import{a as ne,b as ie,c as oe}from"./chunk-UGQXGBKF.js";import{C as j,E as G,b as N,f as P,g as R,i as L,m as Y,n as q,w as A}from"./chunk-TCUK52QT.js";import{a as ee,b as Ce}from"./chunk-JU5LF7AN.js";import{d as K,e as Q,f as X}from"./chunk-AFLM5QFV.js";import{a as $,b as ge}from"./chunk-LFKM2JDJ.js";import{P as te,Q as _e}from"./chunk-JE2X3YFA.js";import{Ii as w,Ji as he}from"./chunk-GDJMZZ4C.js";import{Ha as J,La as pe}from"./chunk-2XIOYYFS.js";import{a as me,b as Z,c as de}from"./chunk-YTY7HHO3.js";import{Ab as a,Cc as _,Fb as k,Gc as h,Hc as p,Ia as U,Ja as c,Ka as u,Kc as f,Qb as I,Rd as H,Ta as T,Wb as E,Xc as O,Zc as x,_c as D,dd as S,ed as y,fd as v,jc as C,kd as z,mc as W,rc as B,ud as m,vd as d,wc as r,xc as s,yc as F}from"./chunk-4HFZZ7HS.js";import{e as V,h as ue}from"./chunk-SZAW6ZBW.js";function xe(n,i){if(n&1){let t=_();r(0,"div",5)(1,"label"),x(2),m(3,"translate"),s(),r(4,"input",10),v("ngModelChange",function(e){c(t);let l=p();return y(l.currentConnection.name,e)||(l.currentConnection.name=e),u(e)}),s()()}if(n&2){let t=p();a(2),D(d(3,3,"lblConnection")),a(2),C("readonly",!0),S("ngModel",t.currentConnection.name)}}function De(n,i){if(n&1){let t=_();r(0,"div",5)(1,"label"),x(2),m(3,"translate"),s(),r(4,"dvl-datepicker",11),v("ngModelChange",function(e){c(t);let l=p();return y(l.expirationDate,e)||(l.expirationDate=e),u(e)}),h("onSelectEvent",function(){c(t);let e=p();return u(e.verifyExpirationDate())}),s()()}if(n&2){let t=p();a(2),D(d(3,5,"lblExpirationDate")),a(2),S("ngModel",t.expirationDate),C("maxDate",t.todayDate)("showIcon",!0)("dateFormat",t.currentUserService.displayPrimeDateFormat)}}function Me(n,i){if(n&1){let t=_();r(0,"dvl-button",12),m(1,"translate"),h("onClick",function(){c(t);let e=p();return u(e.updateStatus())}),s(),r(2,"dvl-button",13),m(3,"translate"),h("onClick",function(){c(t);let e=p();return u(e.cancelStatus())}),s()}if(n&2){let t=p(),o=O(3);f("label",d(1,3,"lblOk")),C("disabled",o.invalid||t.currentStatus===t.ConnectionStatusBehavior.Expired&&t.expirationDate.valueOf()>t.todayDate.valueOf()),a(2),f("label",d(3,5,"lblCancel"))}}var M,we,Ke,be=V(()=>{H();he();M=ue(me());Se();X();ge();G();ye();oe();ve();fe();Ce();H();_e();de();X();pe();G();oe();we=()=>({width:"500px"});Ke=(()=>{class n{constructor(t,o){this.currentUserService=t,this.translatorService=o,this.onCancel=new T,this.onUpdate=new T,this.expirationDate=new Date,this.todayDate=new Date,this.errorSummaryMessages=[],this.ConnectionStatusBehavior=w}ngOnChanges(t){t.currentConnection&&(this.checkExpiration(),this.currentMessage=this.currentConnection.statusMessage)}addUserDateStatusMessage(){let t=this.currentStatus===w.Expired?this.expirationDate:this.todayDate;this.currentMessage==null&&(this.currentMessage=""),this.currentMessage+=`
`+this.currentUserService.currentUsername+" : "+(0,M.default)(t).format("M/D/YYYY")}cancelStatus(){this.onCancel.emit(null)}updateStatus(){this.currentConnection&&!this.currentConnection.isRoot?(this.currentStatus===w.Expired&&(this.currentConnection.expiration=(0,M.default)(this.expirationDate).utc().format()),this.currentConnection.status=this.currentStatus,this.currentConnection.statusMessage=this.currentMessage):this.currentConnection&&this.currentConnection.isRoot?this.currentConnection.root.forceDefaultStatusMessage=this.currentMessage:this.currentDatasourceSettings&&(this.currentDatasourceSettings.forceDefaultStatusMessage=this.currentMessage),this.currentMessage==null&&(this.currentMessage=""),this.onUpdate.emit(this.currentConnection)}checkExpiration(){this.currentConnection.expiration&&(this.expirationDate=(0,M.default)(this.currentConnection.expiration).toDate(),this.verifyExpirationDate())}verifyExpirationDate(){this.errorSummaryMessages=[],this.currentStatus===w.Expired&&this.expirationDate.valueOf()>this.todayDate.valueOf()&&this.errorSummaryMessages.push(ae.setMessageSummary(this.translatorService.translate("ExpirationDateMustBeAnteriorOrEqualToTheCurrentDate")))}static{this.\u0275fac=function(o){return new(o||n)(k(te),k(Z))}}static{this.\u0275cmp=I({type:n,selectors:[["dvls-connection-status"]],inputs:{currentConnection:"currentConnection",currentDatasourceSettings:"currentDatasourceSettings",currentStatus:"currentStatus",showDialog:"showDialog"},outputs:{onCancel:"onCancel",onUpdate:"onUpdate"},features:[U],decls:17,vars:20,consts:[["currentForm","ngForm"],["minimizeIcon","di dvl-icon-minimize","maximizeIcon","di dvl-icon-expand","styleClass","tabview-dialog","closeIcon","di dvl-icon-close",3,"visibleChange","onHide","header","visible","draggable","maximizable","modal"],["autocomplete","off"],[3,"messages"],[1,"grid","gap-4","dialog-scroll-content"],[1,"col-span-12","form-group"],["pInputTextarea","","name","messageStatus","id","","cols","30","rows","5",1,"form-control",3,"ngModelChange","ngModel"],[1,"col-span-6","form-group"],["type","button","variant","primary",3,"onClick","label"],["pTemplate","footer"],["pInputText","","name","connection",1,"form-control",3,"ngModelChange","readonly","ngModel"],["name","expirationDate","appendTo","body","icon","di dvl-icon-calendar","inputStyleClass","form-control","required","",3,"ngModelChange","onSelectEvent","ngModel","maxDate","showIcon","dateFormat"],["size","md","variant","primary",3,"onClick","label","disabled"],["size","md","variant","tertiary",3,"onClick","label"]],template:function(o,e){if(o&1){let l=_();r(0,"p-dialog",1),m(1,"translate"),v("visibleChange",function(g){return c(l),y(e.showDialog,g)||(e.showDialog=g),u(g)}),h("onHide",function(){return c(l),u(e.cancelStatus())}),r(2,"form",2,0),F(4,"sd-message-summary",3),r(5,"div",4),E(6,xe,5,5,"div",5)(7,De,5,7,"div",5),r(8,"div",5)(9,"label"),x(10),m(11,"translate"),s(),r(12,"textarea",6),v("ngModelChange",function(g){return c(l),y(e.currentMessage,g)||(e.currentMessage=g),u(g)}),s()(),r(13,"div",7)(14,"dvl-button",8),m(15,"translate"),h("onClick",function(){return c(l),u(e.addUserDateStatusMessage())}),s()()()(),E(16,Me,4,7,"ng-template",9),s()}o&2&&(W(z(19,we)),f("header",d(1,13,"lblConnectionStatusMessage")),S("visible",e.showDialog),C("draggable",!1)("maximizable",!0)("modal",!0),a(4),C("messages",e.errorSummaryMessages),a(2),B(e.currentConnection&&!e.currentConnection.isRoot?6:-1),a(),B(!(e.currentConnection!=null&&e.currentConnection.isRoot)&&e.currentStatus===e.ConnectionStatusBehavior.Expired?7:-1),a(3),D(d(11,15,"lblMessage")),a(2),S("ngModel",e.currentMessage),a(2),f("label",d(15,17,"lblIncludeUserAndDate")))},dependencies:[Q,K,J,$,j,q,N,P,R,A,Y,L,se,ie,ne,le,re,ee],encapsulation:2})}}return n})()});var ce,Te=V(()=>{ce=class{constructor(i){this.workingCopy=i}get selectedWeekDays(){return this.workingCopy.selectedDayOfWeek}set selectedWeekDays(i){this.workingCopy.selectedDayOfWeek=i}get timeBasedUsageDays(){return this.workingCopy.timeBasedUsageDays}set timeBasedUsageDays(i){this.workingCopy.timeBasedUsageDays=i}get timeBasedUsageHours(){return this.workingCopy.timeBasedUsageHours}set timeBasedUsageHours(i){this.workingCopy.timeBasedUsageHours=i}get startTime(){return this.workingCopy.timeBasedUsageStartTime}set startTime(i){this.workingCopy.timeBasedUsageStartTime=i}get endTime(){return this.workingCopy.timeBasedUsageEndTime}set endTime(i){this.workingCopy.timeBasedUsageEndTime=i}}});export{Ke as a,be as b,ce as c,Te as d};
