import{a as ce,b as ve}from"./chunk-JQYQFR5I.js";import{a as ue,b as we}from"./chunk-5I5VK67P.js";import{a as le,c as ye}from"./chunk-VM2L5ERO.js";import{D as ae,E as fe}from"./chunk-I7GW4F3B.js";import{a as se,b as Se}from"./chunk-6POW7SSJ.js";import{cb as oe,gb as re,q as Z,r as $,s as ee,zb as _e}from"./chunk-V2ECYACM.js";import{C as J,E as K,b as R,f as L,g as Y,i as q,m as A,n as j,w as G}from"./chunk-JPHJ3OD7.js";import{n as te,o as ne,p as ie}from"./chunk-ZBM6BFOI.js";import{ij as w,jj as he}from"./chunk-BPZQKZKD.js";import{Ha as X,La as Ce}from"./chunk-5E3JCGAH.js";import{a as de,b as Q,c as ge}from"./chunk-YBNTOQCK.js";import{Ad as g,Db as k,Dc as _,Ea as c,Fa as u,Hc as h,Jb as E,Jc as m,Qb as W,Tc as z,Wa as I,Wb as F,Wc as H,Yc as D,Zc as M,be as P,cd as f,dd as S,ed as y,id as v,mc as B,oc as V,pd as N,tc as p,uc as a,vc as l,wc as O,yb as s,zd as d}from"./chunk-WL5U2YIT.js";import{e as U,h as me}from"./chunk-ADEKKGI2.js";function De(r,e){if(r&1){let i=_();a(0,"div",5)(1,"label"),D(2),d(3,"translate"),l(),a(4,"input",10),y("ngModelChange",function(n){c(i);let t=m();return S(t.currentConnection.name,n)||(t.currentConnection.name=n),u(n)}),l()()}if(r&2){let i=m();s(2),M(g(3,3,"lblConnection")),s(2),p("readonly",!0),f("ngModel",i.currentConnection.name)}}function Me(r,e){if(r&1){let i=_();a(0,"div",5)(1,"label"),D(2),d(3,"translate"),l(),a(4,"dvl-datepicker",11),y("ngModelChange",function(n){c(i);let t=m();return S(t.expirationDate,n)||(t.expirationDate=n),u(n)}),h("onSelectEvent",function(){c(i);let n=m();return u(n.verifyExpirationDate())}),l()()}if(r&2){let i=m();s(2),M(g(3,5,"lblExpirationDate")),s(2),f("ngModel",i.expirationDate),p("maxDate",i.todayDate)("showIcon",!0)("dateFormat",i.currentUserService.displayPrimeDateFormat)}}function be(r,e){if(r&1){let i=_();a(0,"dvl-button",12),d(1,"translate"),h("onClick",function(){c(i);let n=m();return u(n.updateStatus())}),l(),a(2,"dvl-button",13),d(3,"translate"),h("onClick",function(){c(i);let n=m();return u(n.cancelStatus())}),l()}if(r&2){let i=m(),o=z(3);p("label",v(g(1,5,"lblOk")))("disabled",o.invalid||i.currentStatus===i.ConnectionStatusBehavior.Expired&&i.expirationDate.valueOf()>i.todayDate.valueOf()),s(2),p("label",v(g(3,7,"lblCancel")))}}var b,xe,Ke,Te=U(()=>{P();he();b=me(de());ve();ie();Se();K();we();ee();_e();ye();P();fe();ge();ie();Ce();K();ee();xe=()=>({width:"500px"});Ke=(()=>{let e=class e{constructor(o,n){this.currentUserService=o,this.translatorService=n,this.onCancel=new k,this.onUpdate=new k,this.expirationDate=new Date,this.todayDate=new Date,this.errorSummaryMessages=[],this.ConnectionStatusBehavior=w}ngOnChanges(o){o.currentConnection&&(this.checkExpiration(),this.currentMessage=this.currentConnection.statusMessage)}addUserDateStatusMessage(){let o=this.currentStatus===w.Expired?this.expirationDate:this.todayDate;this.currentMessage==null&&(this.currentMessage=""),this.currentMessage+=`
`+this.currentUserService.currentUsername+" : "+(0,b.default)(o).format("M/D/YYYY")}cancelStatus(){this.onCancel.emit(null)}updateStatus(){this.currentConnection&&!this.currentConnection.isRoot?(this.currentStatus===w.Expired&&(this.currentConnection.expiration=(0,b.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,b.default)(this.currentConnection.expiration).toDate(),this.verifyExpirationDate())}verifyExpirationDate(){this.errorSummaryMessages=[],this.currentStatus===w.Expired&&this.expirationDate.valueOf()>this.todayDate.valueOf()&&this.errorSummaryMessages.push(ce.setMessageSummary(this.translatorService.translate("ExpirationDateMustBeAnteriorOrEqualToTheCurrentDate")))}};e.\u0275fac=function(n){return new(n||e)(E(ae),E(Q))},e.\u0275cmp=W({type:e,selectors:[["dvls-connection-status"]],inputs:{currentConnection:"currentConnection",currentDatasourceSettings:"currentDatasourceSettings",currentStatus:"currentStatus",showDialog:"showDialog"},outputs:{onCancel:"onCancel",onUpdate:"onUpdate"},features:[I],decls:17,vars:22,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(n,t){if(n&1){let x=_();a(0,"p-dialog",1),d(1,"translate"),y("visibleChange",function(C){return c(x),S(t.showDialog,C)||(t.showDialog=C),u(C)}),h("onHide",function(){return c(x),u(t.cancelStatus())}),a(2,"form",2,0),O(4,"sd-message-summary",3),a(5,"div",4),B(6,De,5,5,"div",5),B(7,Me,5,7,"div",5),a(8,"div",5)(9,"label"),D(10),d(11,"translate"),l(),a(12,"textarea",6),y("ngModelChange",function(C){return c(x),S(t.currentMessage,C)||(t.currentMessage=C),u(C)}),l()(),a(13,"div",7)(14,"dvl-button",8),d(15,"translate"),h("onClick",function(){return c(x),u(t.addUserDateStatusMessage())}),l()()()(),F(16,be,4,9,"ng-template",9),l()}n&2&&(H(N(21,xe)),p("header",v(g(1,15,"lblConnectionStatusMessage"))),f("visible",t.showDialog),p("draggable",!1)("maximizable",!0)("modal",!0),s(4),p("messages",t.errorSummaryMessages),s(2),V(t.currentConnection&&!t.currentConnection.isRoot?6:-1),s(),V(!(t.currentConnection!=null&&t.currentConnection.isRoot)&&t.currentStatus===t.ConnectionStatusBehavior.Expired?7:-1),s(3),M(g(11,17,"lblMessage")),s(2),f("ngModel",t.currentMessage),s(2),p("label",v(g(15,19,"lblIncludeUserAndDate"))))},dependencies:[ne,te,X,J,j,R,L,Y,G,A,q,ue,$,Z,re,le,oe,se],encapsulation:2});let r=e;return r})()});var pe,ke=U(()=>{pe=class{constructor(e){this.workingCopy=e}get selectedWeekDays(){return this.workingCopy.selectedDayOfWeek}set selectedWeekDays(e){this.workingCopy.selectedDayOfWeek=e}get timeBasedUsageDays(){return this.workingCopy.timeBasedUsageDays}set timeBasedUsageDays(e){this.workingCopy.timeBasedUsageDays=e}get timeBasedUsageHours(){return this.workingCopy.timeBasedUsageHours}set timeBasedUsageHours(e){this.workingCopy.timeBasedUsageHours=e}get startTime(){return this.workingCopy.timeBasedUsageStartTime}set startTime(e){this.workingCopy.timeBasedUsageStartTime=e}get endTime(){return this.workingCopy.timeBasedUsageEndTime}set endTime(e){this.workingCopy.timeBasedUsageEndTime=e}}});export{Ke as a,Te as b,pe as c,ke as d};
