(()=>{vare,n,r,a={33199:(e,n,r)=>{"use strict";vara=r(85471),i=r(53334),s=r(88837),o=r(18740),l=r(82182),d=r(42740),c=r(31126),u=r(63814),h=r(21777),f=r(65043);functionm(t){conste=t.getFullYear(),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0");return"".concat(e,"-").concat(n,"-").concat(r)}varp=r(32981),A=r(85168),y=r(35947);constT=(0,y.YK)().setApp("dav").detectUser().build(),g={name:"AbsenceForm",components:{NcButton:o.A,NcTextField:l.A,NcTextArea:d.A,NcDateTimePickerNative:c.A},data(){const{firstDay:t,lastDay:e,status:n,message:r}=(0,p.C)("dav","absence",{});return{loading:!1,status:null!=n?n:"",message:null!=r?r:"",firstDay:t?newDate(t):newDate,lastDay:e?newDate(e):null}},computed:{valid(){vart,e;constn=newDate(null===(t=this.firstDay)||void0===t?void0:t.getTime()),r=newDate(null===(e=this.lastDay)||void0===e?void0:e.getTime());returnnull==n||n.setHours(0,0,0,0),null==r||r.setHours(0,0,0,0),!!this.firstDay&&!!this.lastDay&&!!this.status&&!!this.message&&r>=n}},methods:{resetForm(){this.status="",this.message="",this.firstDay=newDate,this.lastDay=null},asyncsaveForm(){if(this.valid){this.loading=!0;try{awaitf.Ay.post((0,u.KT)("/apps/dav/api/v1/outOfOffice/{userId}",{userId:(0,h.HW)().uid}),{firstDay:m(this.firstDay),lastDay:m(this.lastDay),status:this.status,message:this.message}),(0,A.Te)(this.$t("dav","Absence saved"))}catch(t){(0,A.Qg)(this.$t("dav","Failed to save your absence settings")),T.error("Could not save absence",{error:t})}finally{this.loading=!1}}},asyncclearAbsence(){this.loading=!0;try{awaitf.Ay.delete((0,u.KT)("/apps/dav/api/v1/outOfOffice/{userId}",{userId:(0,h.HW)().uid})),this.resetForm(),(0,A.Te)(this.$t("dav","Absence cleared"))}catch(t){(0,A.Qg)(this.$t("dav","Failed to clear your absence settings")),T.error("Could not clear absence",{error:t})}finally{this.loading=!1}}}};varS=r(85072),_=r.n(S),v=r(97825),E=r.n(v),b=r(77659),C=r.n(b),D=r(55056),x=r.n(D),U=r(10540),w=r.n(U),Y=r(41113),O=r.n(Y),B=r(55095),M={};M.styleTagTransform=O(),M.setAttributes=x(),M.insert=C().bind(null,"head"),M.domAPI=E(),M.insertStyleElement=w(),_()(B.A,M),B.A&&B.A.locals&&B.A.locals;vark=r(14486);constI=(0,k.A)(g,(function(){vart=this,e=t._self._c;returne("form",{staticClass:"absence",on:{submit:function(e){returne.preventDefault(),t.saveForm.apply(null,arguments)}}},[e("div",{staticClass:"absence__dates"},[e("NcDateTimePickerNative",{staticClass:"absence__dates__picker",attrs:{id:"absence-first-day",label:t.$t("dav","First day"),required:!0},model:{value:t.firstDay,callback:function(e){t.firstDay=e},expression:"firstDay"}}),t._v(" "),e("NcDateTimePickerNative",{staticClass:"absence__dates__picker",attrs:{id:"absence-last-day",label:t.$t("dav","Last day (inclusive)"),required:!0},model:{value:t.lastDay,callback:function(e){t.lastDay=e},expression:"lastDay"}})],1),t._v(" "),e("NcTextField",{attrs:{value:t.status,label:t.$t("dav","Short absence status"),required:!0},on:{"update:value":function(e){t.status=e}}}),t._v(" "),e("NcTextArea",{attrs:{value:t.message,label:t.$t("dav","Long absence Message"),required:!0},on:{"update:value":function(e){t.message=e}}}),t._v(" "),e("div",{staticClass:"absence__buttons"},[e("NcButton",{attrs:{disabled:t.loading||!t.valid,type:"primary","native-type":"submit"}},[t._v("\n\t\t\t"+t._s(t.$t("dav","Save"))+"\n\t\t")]),t._v(" "),e("NcButton",{attrs:{disabled:t.loading||!t.valid,type:"error"},on:{click:t.clearAbsence}},[t._v("\n\t\t\t"+t._s(t.$t("dav","Disable absence"))+"\n\t\t")])],1)],1)}),[],!1,null,"716172ba",null).exports;varN=r(69761),P={};P.styleTagTransform=O(),P.setAttributes=x(),P.insert=C().bind(null,"head"),P.domAPI=E(),P.insertStyleElement=w(),_()(N.A,P),N.A&&N.A.locals&&N.A.locals;varz=r(79759),L=r(96078),W=r(46447);classR{staticfromString(t){returnnewR(t)}constructor(t){this.value=t}icaltype="binary";decodeValue(){returnthis._b64_decode(this.value)}setEncodedValue(t){this.value=this._b64_encode(t)}_b64_encode(t){lete,n,r,a,i,s,o,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c