mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
2 lines
224 KiB
JavaScript
2 lines
224 KiB
JavaScript
(function(){var e={41993:function(e){function t(e){return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=function(){return[]},t.resolve=t,t.id=41993,e.exports=t},46700:function(e,t,s){var a={"./af":63906,"./af.js":63906,"./ar":40902,"./ar-dz":3853,"./ar-dz.js":3853,"./ar-kw":20299,"./ar-kw.js":20299,"./ar-ly":96825,"./ar-ly.js":96825,"./ar-ma":66379,"./ar-ma.js":66379,"./ar-sa":87700,"./ar-sa.js":87700,"./ar-tn":2059,"./ar-tn.js":2059,"./ar.js":40902,"./az":76043,"./az.js":76043,"./be":7936,"./be.js":7936,"./bg":34078,"./bg.js":34078,"./bm":14014,"./bm.js":14014,"./bn":29554,"./bn-bd":17114,"./bn-bd.js":17114,"./bn.js":29554,"./bo":6529,"./bo.js":6529,"./br":65437,"./br.js":65437,"./bs":19647,"./bs.js":19647,"./ca":59951,"./ca.js":59951,"./cs":26113,"./cs.js":26113,"./cv":37965,"./cv.js":37965,"./cy":35858,"./cy.js":35858,"./da":33515,"./da.js":33515,"./de":62831,"./de-at":6263,"./de-at.js":6263,"./de-ch":51127,"./de-ch.js":51127,"./de.js":62831,"./dv":4510,"./dv.js":4510,"./el":68616,"./el.js":68616,"./en-au":24595,"./en-au.js":24595,"./en-ca":73545,"./en-ca.js":73545,"./en-gb":79609,"./en-gb.js":79609,"./en-ie":43727,"./en-ie.js":43727,"./en-il":93302,"./en-il.js":93302,"./en-in":46305,"./en-in.js":46305,"./en-nz":39128,"./en-nz.js":39128,"./en-sg":84569,"./en-sg.js":84569,"./eo":50650,"./eo.js":50650,"./es":26358,"./es-do":64214,"./es-do.js":64214,"./es-mx":38639,"./es-mx.js":38639,"./es-us":30232,"./es-us.js":30232,"./es.js":26358,"./et":47279,"./et.js":47279,"./eu":15515,"./eu.js":15515,"./fa":27981,"./fa.js":27981,"./fi":37090,"./fi.js":37090,"./fil":79208,"./fil.js":79208,"./fo":2799,"./fo.js":2799,"./fr":23463,"./fr-ca":2213,"./fr-ca.js":2213,"./fr-ch":52848,"./fr-ch.js":52848,"./fr.js":23463,"./fy":41468,"./fy.js":41468,"./ga":88163,"./ga.js":88163,"./gd":2898,"./gd.js":2898,"./gl":76312,"./gl.js":76312,"./gom-deva":20682,"./gom-deva.js":20682,"./gom-latn":49178,"./gom-latn.js":49178,"./gu":31400,"./gu.js":31400,"./he":52795,"./he.js":52795,"./hi":17009,"./hi.js":17009,"./hr":46506,"./hr.js":46506,"./hu":69565,"./hu.js":69565,"./hy-am":93864,"./hy-am.js":93864,"./id":5626,"./id.js":5626,"./is":36649,"./is.js":36649,"./it":90151,"./it-ch":95348,"./it-ch.js":95348,"./it.js":90151,"./ja":79830,"./ja.js":79830,"./jv":33751,"./jv.js":33751,"./ka":63365,"./ka.js":63365,"./kk":85980,"./kk.js":85980,"./km":99571,"./km.js":99571,"./kn":25880,"./kn.js":25880,"./ko":16809,"./ko.js":16809,"./ku":96773,"./ku.js":96773,"./ky":65505,"./ky.js":65505,"./lb":50553,"./lb.js":50553,"./lo":51237,"./lo.js":51237,"./lt":91563,"./lt.js":91563,"./lv":61057,"./lv.js":61057,"./me":96495,"./me.js":96495,"./mi":83096,"./mi.js":83096,"./mk":43874,"./mk.js":43874,"./ml":46055,"./ml.js":46055,"./mn":87747,"./mn.js":87747,"./mr":17113,"./mr.js":17113,"./ms":8687,"./ms-my":7948,"./ms-my.js":7948,"./ms.js":8687,"./mt":14532,"./mt.js":14532,"./my":4655,"./my.js":4655,"./nb":56961,"./nb.js":56961,"./ne":2512,"./ne.js":2512,"./nl":48448,"./nl-be":72936,"./nl-be.js":72936,"./nl.js":48448,"./nn":49031,"./nn.js":49031,"./oc-lnc":5174,"./oc-lnc.js":5174,"./pa-in":30118,"./pa-in.js":30118,"./pl":93448,"./pl.js":93448,"./pt":33518,"./pt-br":62447,"./pt-br.js":62447,"./pt.js":33518,"./ro":70817,"./ro.js":70817,"./ru":10262,"./ru.js":10262,"./sd":58990,"./sd.js":58990,"./se":43842,"./se.js":43842,"./si":37711,"./si.js":37711,"./sk":80756,"./sk.js":80756,"./sl":3772,"./sl.js":3772,"./sq":6187,"./sq.js":6187,"./sr":40732,"./sr-cyrl":75713,"./sr-cyrl.js":75713,"./sr.js":40732,"./ss":99455,"./ss.js":99455,"./sv":69770,"./sv.js":69770,"./sw":80959,"./sw.js":80959,"./ta":36459,"./ta.js":36459,"./te":25302,"./te.js":25302,"./tet":67975,"./tet.js":67975,"./tg":71294,"./tg.js":71294,"./th":2385,"./th.js":2385,"./tk":24613,"./tk.js":24613,"./tl-ph":58668,"./tl-ph.js":58668,"./tlh":58190,"./tlh.js":58190,"./tr":74506,"./tr.js":74506,"./tzl":63440,"./tzl.js":63440,"./tzm":69852,"./tzm-latn":42350,"./tzm-latn.js":42350,"./tzm.js":69852,"./ug-cn":70730,"./ug-cn.js":70730,"./uk":40099,"./uk.js":40099,"./ur":72100,"./ur.js":72100,"./uz":96002,"./uz-latn":26322,"./uz-latn.js":26322,"./uz.js":96002,"./vi":14207,"./vi.js":14207,"./x-pseudo":24674,"./x-pseudo.js":24674,"./yo":10570,"./yo.js":10570,"./zh-cn":73644,"./zh-cn.js":73644,"./zh-hk":22591,"./zh-hk.js":22591,"./zh-mo":89503,"./zh-mo.js":89503,"./zh-tw":88080,"./zh-tw.js":88080};function i(e){var t=l(e);return s(t)}function l(e){if(!s.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=l,e.exports=i,i.id=46700},66246:function(e,t,s){"use strict";s.d(t,{$t:function(){return Br}});var a=s(49242),i=s(74973);async function l(){const e=await s.e(3657).then(s.t.bind(s,33657,23));e.load({google:{families:["Roboto:100,300,400,500,700,900&display=swap"]}})}var n=s(38685),o=(s(29773),(0,n.Rd)()),r=(s(57658),s(96149));function d(){const e=r.CX["import"]("formats/link");e.PROTOCOL_WHITELIST.push("smb","fmp","radar","rdar","sms","\\");class t extends e{static sanitize(t){const s=super.sanitize(t);if(!s||"about:blank"===s)return s;const a=e.PROTOCOL_WHITELIST,i=a.some((e=>s.startsWith(e)));return i?s:`https://${s}`}}r.CX.register("formats/link",t,!0)}var u=s(73752),c=s.n(u),m=s(73396),h=s(97718),p=s(29271);function v(e,t,s,a,i,l){const n=(0,m.up)("router-view"),o=(0,m.up)("Z-team-modal"),r=(0,m.up)("Z-delete-team-modal"),d=(0,m.up)("Z-task-modal"),u=(0,m.up)("Z-delete-task-modal"),c=(0,m.up)("Z-delete-timeBlock-modal"),v=(0,m.up)("Z-delete-blocker-modal"),k=(0,m.up)("Z-delete-master-task-modal"),f=(0,m.up)("Z-complete-task-modal"),g=(0,m.up)("Z-complete-master-task-modal"),b=(0,m.up)("Z-task-add-time-modal"),_=(0,m.up)("Z-blocker-modal"),w=(0,m.up)("Z-master-task-modal"),y=(0,m.up)("Z-delete-team-member-modal"),D=(0,m.up)("Z-show-menu-modal"),M=(0,m.up)("Z-unable-to-edit-office-task-modal"),T=(0,m.up)("Z-unable-to-complete-task-modal");return(0,m.wg)(),(0,m.iD)(m.HY,null,[(0,m.Wm)(h.q,null,{default:(0,m.w5)((()=>[(0,m.Wm)(p.O,null,{default:(0,m.w5)((()=>[(0,m.Wm)(n)])),_:1})])),_:1}),(0,m.Wm)(o,{ref:"z-team-modal",onUpdate:l.onTeamUpdate},null,8,["onUpdate"]),(0,m.Wm)(r,{ref:"z-delete-team-modal",onUpdate:l.onTeamUpdate},null,8,["onUpdate"]),(0,m.Wm)(d,{ref:"z-task-modal",onOnSubtaskEdited:l.onTaskEdited},null,8,["onOnSubtaskEdited"]),(0,m.Wm)(u,{ref:"z-delete-task-modal",onOnSubtaskDeleted:l.onTaskDeleted},null,8,["onOnSubtaskDeleted"]),(0,m.Wm)(c,{ref:"z-delete-timeblock-modal",onOnSubtaskEdited:l.onTaskEdited},null,8,["onOnSubtaskEdited"]),(0,m.Wm)(v,{ref:"z-delete-blocker-modal",onOnBlockerDeleted:l.onBlockerDeleted},null,8,["onOnBlockerDeleted"]),(0,m.Wm)(k,{ref:"z-delete-master-task-modal",onOnMastertaskDeleted:l.onMasterTaskDeleted},null,8,["onOnMastertaskDeleted"]),(0,m.Wm)(f,{ref:"z-complete-task-modal",onOnSubtaskEdited:l.onTaskEdited},null,8,["onOnSubtaskEdited"]),(0,m.Wm)(g,{ref:"z-complete-master-task-modal",onMasterTaskEdited:l.onMasterTaskEdited},null,8,["onMasterTaskEdited"]),(0,m.Wm)(b,{ref:"z-task-add-time-modal"},null,512),(0,m.Wm)(_,{ref:"z-blocker-modal"},null,512),(0,m.Wm)(w,{ref:"z-master-task-modal",onMasterTaskEdited:l.onMasterTaskEdited},null,8,["onMasterTaskEdited"]),(0,m.Wm)(y,{ref:"z-delete-team-member-modal"},null,512),(0,m.Wm)(D,{ref:"z-show-menu-modal"},null,512),(0,m.Wm)(M,{ref:"z-unable-to-edit-office-task-modal"},null,512),(0,m.Wm)(T,{ref:"z-unable-to-complete-task-modal"},null,512)],64)}var k=s(87139),f=s(67312),g=s(75039),b=s(91334),_=s(33601),w=s(53289);const y={class:"d-flex justify-space-between align-center"};function D(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",y,[(0,m._)("h1",null,[(0,m.Uk)(" Ste si istý, že chcete zmazať tím "),(0,m._)("b",null,(0,k.zw)(l.team.name),1),(0,m.Uk)("? ")]),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,m.w5)((()=>[(0,m.Wm)(f.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.deleteTeam()),disabled:l.isDeleting},{default:(0,m.w5)((()=>[(0,m.Uk)("ÁNO")])),_:1},8,["disabled"]),(0,m.Wm)(f.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.closeModal()),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var M={mounted(){window.addEventListener("keydown",this.handleKeyDown)},methods:{handleKeyDown(e){27===e.keyCode&&(this.visible=!1)}}},T={mixins:[M],emits:["update"],data(){return{visible:!1,team:null,isDeleting:!1}},methods:{async showModal({team:e}){this.team=e,this.visible=!0},closeModal(){this.visible=!1},async deleteTeam(){if(!this.isDeleting){this.isDeleting=!0;try{await this.$axios.delete_auth(`v1/teams/${this.team.id}`),this.visible=!1,this.$emit("update",this.team),this.$store.commit("tm/delete_team",this.team)}catch(e){this.$toast.error(this.$parseError(e))}finally{this.isDeleting=!1}}}}},$=s(40089);const C=(0,$.Z)(T,[["render",D]]);var j=C,E=s(60988),x=s(45869);const W={class:"d-flex justify-space-between align-center modal-header"};function S(e,t,s,i,l,n){const o=(0,m.up)("W-loadable");return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[4]||(t[4]=e=>l.visible=e),"max-width":"750","max-height":"90%",height:"700px",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(o,{content:l.team,class:"h-100"},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,{height:"100%",class:"d-flex flex-column"},{default:(0,m.w5)((()=>[(0,m._)("div",W,[(0,m._)("h1",null,(0,k.zw)(l.team.id?"Upraviť tím":"Vytvoriť tím"),1),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"d-flex flex-column modal-content"},{default:(0,m.w5)((()=>[(0,m.Wm)(x.hw,{class:(0,k.C_)(["modal-input",{error:l.v$.team.name.$errors.length}]),label:"Názov tímu",variant:"solo",hint:l.v$.team.name.$errors?l.errorUtils.parseErrors(l.v$.team.name.$errors):null,modelValue:l.team.name,"onUpdate:modelValue":t[1]||(t[1]=e=>l.team.name=e)},null,8,["class","hint","modelValue"]),((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(l.team.employees,((e,t)=>((0,m.wg)(),(0,m.iD)("div",{class:"relative w-100",key:e.id},[(0,m.Wm)(x.hw,{class:"modal-input",disabled:"",label:"Zamestanec",variant:"solo",modelValue:l.team.employees[t]._fullName,"onUpdate:modelValue":e=>l.team.employees[t]._fullName=e},null,8,["modelValue","onUpdate:modelValue"]),(0,m.Wm)(w.t,{class:"remove-input",onClick:(0,a.iM)((e=>l.team.employees.splice(t,1)),["stop"]),icon:"mdi-close",size:"small"},null,8,["onClick"])])))),128)),(0,m.Wm)(E.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:l.employeeSelect,"onUpdate:modelValue":t[2]||(t[2]=e=>l.employeeSelect=e),label:"Priradený",class:(0,k.C_)([{error:l.v$.team.employees.$errors.length},"modal-input"]),items:n.employeesOptions,"item-title":"_fullName","item-value":"id",variant:"solo",clearable:"",ref:"autocomplete"},null,8,["custom-filter","modelValue","class","items"])])),_:1}),(0,m.Wm)(f.T,{class:"button primary block",onClick:t[3]||(t[3]=e=>n.save())},{default:(0,m.w5)((()=>[(0,m.Uk)((0,k.zw)(l.team.id?"UPRAVIŤ":"VYTVORIŤ"),1)])),_:1})])),_:1})])),_:1},8,["content"])])),_:1},8,["modelValue"])}var O=s(33053),V=s(69117),z=s(7648),A=s(34407),U=s(20065),Z=s(83299);const I=e=>e.length;var F={mixins:[Z.Z,M],emits:["close","update"],data(){return{visible:!1,v$:(0,O.ZP)(),errorUtils:z.Z,employeeSelect:null,team:null}},computed:{...(0,U.Se)("tm",["enrichedEmployees"]),employeesOptions(){const e=this.team.employees.map((e=>e.id));return this.enrichedEmployees.filter((t=>!e.includes(t.id)))}},validations(){return{team:{name:{required:V.C1},employees:{atLeastOne:I}}}},methods:{async showModal({team:e=null}){this.visible=!0,this.team=null,this.$nextTick((()=>this.v$.$reset()));try{if(e?.id){const t=await this.$axios.get_auth_data(`v1/teams/${e.id}`);this.team=this._enrichTeam(t)}else this.team={employees:[]}}catch(t){this.$toast.error(this.$parseError(t))}},closeModal(){this.visible=!1,this.$emit("close",this.team)},async save(){if(await this.v$.$validate())try{if(this.team.id){const{team:e}=await this.$axios.put_auth(`v1/teams/${this.team.id}`,this.team),t=await this.$axios.get_auth_data(`v1/teams/${e.id}`);this.$store.commit("tm/update_team",t)}else{const{team:e}=await this.$axios.post_auth("v1/teams",this.team),t=await this.$axios.get_auth_data(`v1/teams/${e.id}`);this.$store.commit("tm/save_team",t)}this.closeModal()}catch(e){this.$toast.error(this.$parseError(e))}},_enrichTeam(e){return e.employees=A.Z.enrichEmployees(e.employees),e}},watch:{employeeSelect(e){if(!e)return;const t=this.enrichedEmployees.find((t=>t.id==e));this.team.employees.push(t),this.employeeSelect=null,this.$refs.autocomplete.search=""}}};const H=(0,$.Z)(F,[["render",S]]);var P=H;const L={class:"d-flex justify-space-between align-center"};function N(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",L,[(0,m._)("h1",null,[(0,m.Uk)("Ste si istý, že chcete zmazať sub task z mastertasku "),(0,m._)("b",null,(0,k.zw)(l.subtask.project_code),1),(0,m.Uk)("?")]),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"mb-15"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,m.w5)((()=>[(0,m.Wm)(f.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.deleteTask()),disabled:l.isDeleting},{default:(0,m.w5)((()=>[(0,m.Uk)("ÁNO")])),_:1},8,["disabled"]),(0,m.Wm)(f.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.closeModal()),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var Y={mixins:[M],emits:["on-subtask-deleted"],data(){return{visible:!1,subtask:null,isDeleting:!1}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0},closeModal(){this.visible=!1},async deleteTask(){if(!this.isDeleting){this.isDeleting=!0;try{await this.$axios.delete_auth(`v1/subtasks/${this.subtask.id}`),this.$store.commit("tm/delete_subtask",this.subtask),this.closeModal(),this.$emit("on-subtask-deleted",this.subtask)}catch(e){this.$toast.error(this.$parseError(e))}finally{this.isDeleting=!1}}}}};const q=(0,$.Z)(Y,[["render",N]]);var B=q;const R=e=>((0,m.dD)("data-v-4aa4bee3"),e=e(),(0,m.Cn)(),e),K={class:"d-flex justify-space-between align-center"},J=R((()=>(0,m._)("h4",{class:"mt-3"},"Vyberte časový úsek, ktorý chcete odstrániť",-1)));function G(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[1]||(t[1]=e=>l.visible=e),"max-width":"500",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",K,[J,(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(l.subtask.timeblocks,((e,t)=>((0,m.wg)(),(0,m.iD)("div",{key:e.id,class:"d-flex align-center justify-center mb-3 mt-3"},[(0,m._)("p",{class:(0,k.C_)(["task-badge rounded-pill",{"strike-through":e.is_finished}])},(0,k.zw)(l.tmUtils.formatDateTime(e.start))+" - "+(0,k.zw)(l.tmUtils.formatDateTime(e.end)),3),(0,m.Wm)(w.t,{onClick:(0,a.iM)((s=>l.subtask.id?n.deleteTimeblock(e):n.deleteTimeblockWithoutId(t)),["stop"]),class:"close-icon circle-border cursor-pointer ml-3 text-red",icon:"mdi-close",size:"medium"},null,8,["onClick"])])))),128))])),_:1})])),_:1},8,["modelValue"])}var X={mixins:[M],emits:["on-subtask-edited"],data(){return{visible:!1,subtask:null,isDeleting:!1,tmUtils:A.Z}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0},closeModal(){this.visible=!1},async deleteTimeblock({id:e}){const t=JSON.parse(JSON.stringify(this.subtask));t.timeblocks=t.timeblocks.filter((t=>t.id!=e)),t.deadline&&(t.deadline=A.Z.formatDateTimeForBackend(t.deadline)),this._update(t)},deleteTimeblockWithoutId(e){this.$emit("delete-timeblock")},async _update(e){try{const t=e.timesheets.map((e=>(delete e.employee_name,e))),{subtask:s}=await this.$axios.put_auth(`v1/subtasks/${e.id}`,{...e,timesheets:t});this.closeModal(),this.$events.emit("on-subtask-edited",s)}catch(t){this.$toast.error(t.message||t)}}}};const Q=(0,$.Z)(X,[["render",G],["__scopeId","data-v-4aa4bee3"]]);var ee=Q;const te=e=>((0,m.dD)("data-v-551d0bf6"),e=e(),(0,m.Cn)(),e),se={class:"d-flex justify-space-between align-center modal-header"},ae={class:"splitted-inputs"},ie=te((()=>(0,m._)("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"},null,-1))),le=te((()=>(0,m._)("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"},null,-1))),ne=[ie,le],oe=["onClick"],re=te((()=>(0,m._)("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"},null,-1))),de=te((()=>(0,m._)("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"},null,-1))),ue=[re,de],ce={key:2,class:"timeblocks w-100"},me={class:"end-button w-100"},he={class:"splitted-time-inputs w-100"},pe={class:"w-100 modal-input"},ve={class:"d-flex justify-space-between align-center"},ke={class:"d-flex justify-space-between align-center modal-header border-bottom pb-4"},fe={class:"d-flex justify-start"},ge=["src"],be=["src"],_e={class:"w-100"},we={class:"d-flex justify-start align-center mt-8"};function ye(e,t,i,l,n,o){const r=(0,m.up)("Datepicker"),d=(0,m.up)("A-timeblock"),u=(0,m.up)("QuillEditor"),c=(0,m.up)("Z-files-upload"),h=(0,m.up)("Z-task-readonly-info"),p=(0,m.up)("W-loadable");return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:n.visible,"onUpdate:modelValue":t[22]||(t[22]=e=>n.visible=e),"max-width":"750","max-height":"90%",height:"700px",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(p,{content:n.subtask,class:"h-100"},{default:(0,m.w5)((()=>[n.editMode?((0,m.wg)(),(0,m.j4)(g._,{key:0,height:"100%",class:"d-flex flex-column scrolling"},{default:(0,m.w5)((()=>[(0,m._)("div",se,[(0,m._)("h1",null,(0,k.zw)(n.subtask?.id?"Upraviť sub task":"Vytvoriť sub task"),1),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>o.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"d-flex flex-column modal-content"},{default:(0,m.w5)((()=>[(0,m.Wm)(x.hw,{modelValue:n.subtask.project_code,"onUpdate:modelValue":t[1]||(t[1]=e=>n.subtask.project_code=e),label:"Kód projektu",value:n.subtask.project_code,onFocus:e.onInputFocus,class:"modal-input",variant:"solo",disabled:""},null,8,["modelValue","value","onFocus"]),(0,m.Wm)(E.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:n.subtask.master_task_id,"onUpdate:modelValue":t[2]||(t[2]=e=>n.subtask.master_task_id=e),label:"Master task",class:(0,k.C_)([{error:n.v$.subtask.master_task_id.$errors.length},"modal-input"]),items:e.mastertasks,"item-title":e=>e.name+" ["+e.project_code+"]","item-value":"id",variant:"solo",clearable:"",onFocus:e.onInputFocus},null,8,["custom-filter","modelValue","class","items","item-title","onFocus"]),(0,m.Wm)(x.hw,{modelValue:n.subtask.title,"onUpdate:modelValue":t[3]||(t[3]=e=>n.subtask.title=e),onFocus:e.onInputFocus,class:"modal-input",label:"Názov subtasku",variant:"solo"},null,8,["modelValue","onFocus"]),(0,m._)("div",ae,[(0,m._)("div",{onClick:t[5]||(t[5]=e=>o.openDatepicker("datepicker-01")),class:"datepicker-wrapper"},[(0,m.Wm)(r,{modelValue:n.subtask.deadline,"onUpdate:modelValue":t[4]||(t[4]=e=>n.subtask.deadline=e),onOpen:e.onDateOpen,ref:"datepicker-01","auto-apply":!0,"min-date":new Date,class:(0,k.C_)(["modal-input left datepicker-input",{error:n.v$.subtask.deadline.$errors?.length}]),format:"dd.MM.yyyy",locale:"sk","select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Deadline",validations:n.v$.subtask.deadline},null,8,["modelValue","onOpen","min-date","class","validations"])]),(0,m.Wm)(x.hw,{class:(0,k.C_)(["modal-input right",{error:n.v$.subtask._deadline_time.$errors.length}]),variant:"solo",modelValue:n.subtask._deadline_time,"onUpdate:modelValue":t[6]||(t[6]=e=>n.subtask._deadline_time=e),label:"Čas","append-inner-icon":"mdi-clock-outline",type:"time",onFocus:e.onInputFocus,hint:n.v$.subtask._deadline_time.$errors?n.errorUtils.parseErrors(n.v$.subtask._deadline_time.$errors):null},null,8,["modelValue","onFocus","class","hint"])]),n.subtask.id?((0,m.wg)(),(0,m.iD)(m.HY,{key:0},[(0,m._)("div",{class:(0,k.C_)(["employee-wrapper",{"hide-arrow":n.subtask.employee_id}])},[n.subtask.employee_id?((0,m.wg)(),(0,m.iD)("svg",{key:0,version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon dp__clear_icon dp__input_icons","data-test":"clear-icon",onClick:t[7]||(t[7]=(0,a.iM)((e=>{o.handleOnRemoveEmployee(),n.subtask.employee_id=null,n.subtask.employee=null}),["prevent"]))},ne)):(0,m.kq)("",!0),(0,m.Wm)(E.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:n.subtask.employee_id,"onUpdate:modelValue":[t[8]||(t[8]=e=>n.subtask.employee_id=e),t[9]||(t[9]=e=>n.employeeValidations[0]?n.employeeValidations[0].employee=!1:null)],label:"Priradený",items:e.enrichedEmployees,"item-title":"_fullName","item-value":"id",variant:"solo",class:(0,k.C_)(["modal-input",{error:n.employeeValidations[0]?.employee}])},null,8,["custom-filter","modelValue","items","class"])],2),(0,m.Wm)(x.hw,{modelValue:n.subtask.duration,"onUpdate:modelValue":[t[10]||(t[10]=e=>n.subtask.duration=e),t[11]||(t[11]=e=>n.employeeValidations[0]?n.employeeValidations[0].duration=!1:null)],class:(0,k.C_)(["modal-input",{error:n.employeeValidations[0]?.duration}]),variant:"solo",type:"number",label:"Časový odhad","append-inner-icon":"mdi-clock-outline",onFocus:e.onInputFocus},null,8,["modelValue","class","onFocus"])],64)):((0,m.wg)(!0),(0,m.iD)(m.HY,{key:1},(0,m.Ko)(n.subtask.employees,((t,s)=>((0,m.wg)(),(0,m.iD)("div",{key:`employee-${s}`,class:(0,k.C_)(["splitted-inputs remove-employee",{"hide-arrow":t?.id}])},[(0,m.Wm)(E.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:t.id,"onUpdate:modelValue":[e=>t.id=e,e=>n.employeeValidations[s]?n.employeeValidations[s].employee=!1:null],label:"Priradený",items:e.enrichedEmployees,"item-title":"_fullName","item-value":"id",variant:"solo",class:(0,k.C_)(["modal-input left",{error:n.employeeValidations[s]?.employee}])},null,8,["custom-filter","modelValue","onUpdate:modelValue","items","class"]),t.id?((0,m.wg)(),(0,m.iD)("svg",{key:0,version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon dp__clear_icon dp__input_icons","data-test":"clear-icon",onClick:(0,a.iM)((e=>{o.handleOnRemoveEmployee(),t.id=null}),["prevent"])},ue,8,oe)):(0,m.kq)("",!0),(0,m.Wm)(x.hw,{modelValue:t.duration,"onUpdate:modelValue":[e=>t.duration=e,e=>n.employeeValidations[s]?n.employeeValidations[s].duration=!1:null],class:(0,k.C_)(["modal-input right",{error:n.employeeValidations[s]?.duration}]),variant:"solo",type:"number",label:"Časový odhad","append-inner-icon":"mdi-clock-outline",onFocus:e.onInputFocus},null,8,["modelValue","onUpdate:modelValue","class","onFocus"])],2)))),128)),n.subtask.id?((0,m.wg)(!0),(0,m.iD)(m.HY,{key:3},(0,m.Ko)(n.subtask.timeblocks,((e,t)=>((0,m.wg)(),(0,m.iD)("div",{key:t,class:"timeblock w-100"},[(0,m.Wm)(r,{"model-value":e.start.substring(0,10),format:"dd.MM.yyyy",locale:"sk","select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Dátum","auto-apply":!0,"enable-time-picker":!1,readonly:"",class:"mb-5 modal-input"},null,8,["model-value"]),(0,m._)("div",he,[(0,m.Wm)(x.hw,{value:e.start.substring(11,16),type:"time",variant:"solo","bg-color":"white",label:"Začiatok"},null,8,["value"]),(0,m.Wm)(x.hw,{value:e.end.substring(11,16),type:"time",variant:"solo","bg-color":"white",label:"Koniec"},null,8,["value"])])])))),128)):((0,m.wg)(),(0,m.iD)("div",ce,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.timeblocks,((t,s)=>((0,m.wg)(),(0,m.j4)(d,{key:s,onUpdateTimeblock:e=>o.updateTimeblock(e,s),onRemoveTimeblock:e=>o.removeTimeblock(s),timeblock:t,deletable:s>0,editable:"",ref_for:!0,ref:`timetable-${s}`,"prevent-input-focus":e.preventInputFocus,"on-input-focus":e.onInputFocus,"on-date-open":e.onDateOpen},null,8,["onUpdateTimeblock","onRemoveTimeblock","timeblock","deletable","prevent-input-focus","on-input-focus","on-date-open"])))),128)),(0,m._)("div",me,[(0,m._)("button",{onClick:t[12]||(t[12]=e=>n.timeblocks.push({date:null,starts_at_time:null,ends_at_time:null}))}," Pridať časový blok ")])])),(0,m._)("div",pe,[(0,m.Wm)(u,{ref:"description",modelValue:n.subtask.description,"onUpdate:modelValue":t[13]||(t[13]=e=>n.subtask.description=e),placeholder:"Popis",theme:"snow",class:"rich-text-editor",onInput:t[14]||(t[14]=e=>n.subtask.description=e.srcElement.innerHTML)},null,8,["modelValue"])]),(0,m.Wm)(c,{class:"mt-15 files",files:n.subtask.files,onFilesUploaded:o.filesUploaded,"is-saving":n.isSaving},null,8,["files","onFilesUploaded","is-saving"])])),_:1}),n.isSaving?((0,m.wg)(),(0,m.j4)(f.T,{key:1,class:"button primary disabled",disabled:""},{default:(0,m.w5)((()=>[(0,m.Uk)((0,k.zw)(e.$t("Ukladám...")),1)])),_:1})):((0,m.wg)(),(0,m.j4)(f.T,{key:0,class:"button primary",onClick:t[15]||(t[15]=e=>o.save())},{default:(0,m.w5)((()=>[(0,m.Uk)((0,k.zw)(n.subtask.id?"UPRAVIŤ":"VYTVORIŤ"),1)])),_:1}))])),_:1})):((0,m.wg)(),(0,m.j4)(g._,{key:1,height:"100%",class:"d-flex flex-column scrolling"},{default:(0,m.w5)((()=>[(0,m._)("div",ve,[(0,m._)("div",null,[(0,m._)("p",null,(0,k.zw)(n.subtask._master_task.project_code),1),(0,m._)("h1",null,(0,k.zw)(n.subtask._master_task.name),1)]),(0,m.Wm)(w.t,{onClick:t[16]||(t[16]=(0,a.iM)((e=>o.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"pb-5"})]),(0,m._)("div",ke,[(0,m._)("h1",null,(0,k.zw)(n.subtask.title),1),(0,m._)("div",fe,[(0,m._)("img",{class:"icon",src:s(60666),alt:"pencil-icon",onClick:t[17]||(t[17]=(0,a.iM)(((...e)=>o.toggleEditMode&&o.toggleEditMode(...e)),["stop"]))},null,8,ge),(0,m._)("img",{class:"icon trash",src:s(27484),alt:"trash-icon",onClick:t[18]||(t[18]=(0,a.iM)((e=>o.openDeleteTaskModal(n.subtask)),["stop"]))},null,8,be)])]),(0,m.Wm)(b.h,{class:"d-flex flex-column modal-content"},{default:(0,m.w5)((()=>[(0,m._)("div",_e,[(0,m.Wm)(h,{subtask:n.subtask,onCloseModal:o.closeModal,onUpdateSubtask:o.updateSubtask},null,8,["subtask","onCloseModal","onUpdateSubtask"]),(0,m._)("div",we,[n.subtask.is_finished?((0,m.wg)(),(0,m.j4)(f.T,{key:1,class:"button secondary",onClick:t[20]||(t[20]=(0,a.iM)((e=>o.showCompleteTaskModal()),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("Znovu otvoriť")])),_:1})):((0,m.wg)(),(0,m.j4)(f.T,{key:0,class:"done-btn",onClick:t[19]||(t[19]=(0,a.iM)((e=>o.showCompleteTaskModal()),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("Dokončiť")])),_:1})),(0,m.Wm)(f.T,{class:"button secondary",onClick:t[21]||(t[21]=e=>o.closeModal())},{default:(0,m.w5)((()=>[(0,m.Uk)("Uložiť zmeny")])),_:1})])])])),_:1})])),_:1}))])),_:1},8,["content"])])),_:1},8,["modelValue"])}var De=s(63972),Me=s(87103);const Te={class:"w-100 d-flex align-center"},$e={key:0,class:"m-2 d-flex align-center flex-wrap"},Ce={key:0,class:"d-flex align-center"},je=["src"];function Ee(e,t,i,l,n,o){return(0,m.wg)(),(0,m.iD)("div",Te,[(0,m._)("input",{type:"file",multiple:"",name:"file",id:"fileInput",class:"hidden-input",accept:"*",onChange:t[0]||(t[0]=(...e)=>o.onChange&&o.onChange(...e)),ref:"fileUpload"},null,544),(0,m.Wm)(f.T,{class:"upload-btn",onClick:t[1]||(t[1]=t=>e.$refs.fileUpload.click())},{default:(0,m.w5)((()=>[(0,m.Wm)(w.t,{class:"mx-1",icon:"mdi-cloud-upload-outline"}),(0,m.Uk)("NAHRAŤ ")])),_:1}),n.uploadedFiles?((0,m.wg)(),(0,m.iD)("div",$e,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.uploadedFiles,(e=>((0,m.wg)(),(0,m.iD)("div",{key:e.name,class:"mx-2"},[(0,m.Wm)(Me.v,{class:"mt-2"},{default:(0,m.w5)((()=>[(0,m.Uk)((0,k.zw)(e.name)+" ",1),(0,m.Wm)(w.t,{class:"mx-1",icon:"mdi-paperclip"}),(0,m._)("p",null,(0,k.zw)((e.size/1048576).toFixed(2))+" MB",1),(0,m.Wm)(w.t,{size:"small",icon:"mdi-close",onClick:(0,a.iM)((t=>o.remove(n.uploadedFiles.indexOf(e))),["stop"])},null,8,["onClick"])])),_:2},1024)])))),128)),i.isSaving?((0,m.wg)(),(0,m.iD)("div",Ce,[i.isSaving?((0,m.wg)(),(0,m.iD)("img",{key:0,class:"gif-loader",src:s(14214),alt:"Loading..."},null,8,je)):(0,m.kq)("",!0)])):(0,m.kq)("",!0)])):(0,m.kq)("",!0)])}var xe={emit:["files-uploaded"],props:{files:{type:Array,default:()=>[]},isSaving:{type:Boolean,required:!1}},data(){return{uploadedFiles:[]}},created(){this.uploadedFiles=this.files},methods:{onChange(){const e=[...this.$refs.fileUpload.files],t=52428800,s=e.filter((e=>e.size>t));s.length>0?this.$toast.error("File is too large. Maximum file size is 50 MB."):(this.uploadedFiles=[...this.uploadedFiles,...e],this.$emit("files-uploaded",this.uploadedFiles),this.$refs.fileUpload.value="")},remove(e){this.uploadedFiles.splice(e,1)}}};const We=(0,$.Z)(xe,[["render",Ee],["__scopeId","data-v-a2a40214"]]);var Se=We,Oe=s(16824),Ve=s(68521),ze=s(74286);const Ae={class:"d-flex align-center"},Ue=(0,m._)("p",{class:"mx-3"},"Trvanie",-1),Ze={key:0,class:"d-flex align-center mb-3"},Ie=(0,m._)("p",{class:"task-badge rounded-pill"},"Pridať záznam",-1),Fe={class:"d-flex justify-space-between align-center"},He=(0,m._)("h1",null,"Pridať dátum",-1),Pe={class:"d-flex justify-space-between align-center"},Le={class:"text-red"},Ne=(0,m._)("br",null,null,-1),Ye={class:"text-black"};function qe(e,t,s,i,l,n){const o=(0,m.up)("Datepicker");return(0,m.wg)(),(0,m.iD)(m.HY,null,[(0,m.Wm)(Oe.o,{"no-gutters":""},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",Ae,[(0,m.Wm)(w.t,{icon:"mdi-calendar-week",size:"large"}),Ue])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[n.isOffice365Task?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",Ze,[(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=e=>l.showModal=!0),class:"add-date cursor-pointer mr-2",icon:"mdi-plus",size:"medium"}),Ie])),((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(s.timeblocks,((e,t)=>((0,m.wg)(),(0,m.iD)("div",{key:e.id,class:"d-flex align-center mb-3"},[n.isOffice365Task?(0,m.kq)("",!0):((0,m.wg)(),(0,m.j4)(w.t,{key:0,onClick:(0,a.iM)((a=>s.subtask.id?n.deleteTimeblock(e):n.deleteTimeblockWithoutId(t)),["stop"]),class:"circle-border cursor-pointer mr-2",icon:"mdi-minus",size:"medium"},null,8,["onClick"])),(0,m._)("p",{class:(0,k.C_)(["task-badge rounded-pill",{"strike-through":e.is_finished}])},(0,k.zw)(l.tmUtils.formatDateTime(e.start))+" - "+(0,k.zw)(l.tmUtils.formatDateTime(e.end)),3),n.isOffice365Task?(0,m.kq)("",!0):(0,m.wy)(((0,m.wg)(),(0,m.j4)(w.t,{key:1,onClick:(0,a.iM)((t=>n.toggleTimeblockIsFinished(e)),["stop"]),class:(0,k.C_)(["circle-border cursor-pointer ml-2",{completed:e.is_finished}]),icon:"mdi-check",size:"medium"},null,8,["onClick","class"])),[[a.F8,s.subtask.id]])])))),128))])),_:1})])),_:1})])),_:1}),(0,m.Wm)(_.B,{"max-width":"750",modelValue:l.showModal,"onUpdate:modelValue":t[6]||(t[6]=e=>l.showModal=e),persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",Fe,[He,(0,m.Wm)(w.t,{onClick:t[1]||(t[1]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex flex-column modal-content"},{default:(0,m.w5)((()=>[(0,m.Wm)(o,{modelValue:l.form.date,"onUpdate:modelValue":t[2]||(t[2]=e=>l.form.date=e),format:"dd.MM.yyyy",locale:"sk","select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Dátum","auto-apply":!0,"enable-time-picker":!1,class:(0,k.C_)(["mb-5 modal-input",{error:l.v$.form.date.$errors.length}])},null,8,["modelValue","class"]),(0,m.Wm)(x.hw,{modelValue:l.form.starts_at_time,"onUpdate:modelValue":t[3]||(t[3]=e=>l.form.starts_at_time=e),type:"time",variant:"solo","bg-color":"white",hint:l.v$.form.starts_at_time.$errors?l.errorUtils.parseErrors(l.v$.form.starts_at_time.$errors):null,class:(0,k.C_)([{error:l.v$.form.starts_at_time.$errors.length},"mb-1 modal-input"]),label:"Začiatok"},null,8,["modelValue","hint","class"]),(0,m.Wm)(x.hw,{modelValue:l.form.ends_at_time,"onUpdate:modelValue":t[4]||(t[4]=e=>l.form.ends_at_time=e),type:"time",variant:"solo","bg-color":"white",hint:l.v$.form.ends_at_time.$errors?l.errorUtils.parseErrors(l.v$.form.ends_at_time.$errors):null,class:(0,k.C_)([{error:l.v$.form.ends_at_time.$errors.length},"modal-input"]),label:"Koniec"},null,8,["modelValue","hint","class"])])),_:1}),(0,m.Wm)(f.T,{onClick:t[5]||(t[5]=e=>n.submit()),class:"button primary mt-5"},{default:(0,m.w5)((()=>[(0,m.Uk)("Potvrdiť")])),_:1})])),_:1})])),_:1},8,["modelValue"]),(0,m.Wm)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[10]||(t[10]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",Pe,[(0,m._)("h1",Le,[(0,m.Uk)("Ste si istý, že chcete pridať timeblock po deadline "),Ne,(0,m.Uk)(),(0,m._)("b",Ye,"z mastertasku "+(0,k.zw)(s.subtask?.project_code)+" ?",1)]),(0,m.Wm)(w.t,{onClick:t[7]||(t[7]=(0,a.iM)((e=>l.visible=!1),["stop"])),icon:"mdi-close",size:"large",class:"mb-15"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,m.w5)((()=>[(0,m.Wm)(f.T,{class:"button primary half",variant:"flat",onClick:t[8]||(t[8]=(0,a.iM)((e=>n.confirmSubmit()),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("ÁNO")])),_:1}),(0,m.Wm)(f.T,{class:"button primary half outline",onClick:t[9]||(t[9]=(0,a.iM)((e=>l.visible=!1),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])],64)}var Be=s(36797),Re=s.n(Be),Ke=s(15941),Je={mixins:[M],emits:["update-subtask"],components:{Datepicker:De.Z},props:{timeblocks:{type:Array,required:!0},subtask:{type:Object,required:!0}},data(){return{v$:(0,O.ZP)(),errorUtils:z.Z,tmUtils:A.Z,showModal:!1,visible:!1,form:{date:null,starts_at_time:"09:00",ends_at_time:"16:00"}}},validations(){return{form:{date:{required:V.C1},starts_at_time:{required:V.C1},ends_at_time:{required:V.C1}}}},computed:{...(0,U.Se)("tm",["mastertasks"]),isOffice365Task(){return"office365"==this.subtask.type}},methods:{async submit(){if(!await this.v$.$validate())return;const e=JSON.parse(JSON.stringify(this.subtask)),t=this.form.starts_at_time.split(":"),s=this.form.ends_at_time.split(":"),a=Re()(this.form.date).hours(parseInt(t[0])).minutes(parseInt(t[1])).toISOString(),i=Re()(this.form.date).hours(parseInt(s[0])).minutes(parseInt(s[1])).toISOString();e?.timeblocks||(e.timeblocks=[]),e?.timesheets||(e.timesheets=[]),e?.is_finished||(e.is_finished=0),e.timeblocks.push({end:A.Z.formatDateTimeForBackend(i),id:null,is_finished:0,start:A.Z.formatDateTimeForBackend(a)}),e.deadline&&(e.deadline=A.Z.formatDateTimeForBackend(this._mergeDeadlineTimeDate()));const l=this.isAfterDeadline();l?this.visible=!0:e.id?this._update(e):this.$emit("update-unfinished-subtask",e)},async confirmSubmit(){const e=JSON.parse(JSON.stringify(this.subtask)),t=this.form.starts_at_time.split(":"),s=this.form.ends_at_time.split(":"),a=Re()(this.form.date).hours(parseInt(t[0])).minutes(parseInt(t[1])).toISOString(),i=Re()(this.form.date).hours(parseInt(s[0])).minutes(parseInt(s[1])).toISOString();if(e?.timeblocks||(e.timeblocks=[]),e?.timesheets||(e.timesheets=[]),e?.is_finished||(e.is_finished=0),e.timeblocks.push({end:A.Z.formatDateTimeForBackend(i),id:null,is_finished:0,start:A.Z.formatDateTimeForBackend(a)}),e.deadline&&(e.deadline=A.Z.formatDateTimeForBackend(this._mergeDeadlineTimeDate())),!e.id)return this.$emit("update-unfinished-subtask",e),void this.closeModal();this.visible=!1,this._update(e)},async toggleTimeblockIsFinished(e){Ke.log("toggleTimeblockIsFinished 5",this.subtask);const t=JSON.parse(JSON.stringify(this.subtask)),s=JSON.parse(JSON.stringify(e));s.is_finished=1==s.is_finished?0:1;try{const{data:e}=await this.$axios.put_auth(`v1/timeblocks/${s.id}`,s);t.timeblocks=t.timeblocks.map((t=>t.id==e.id?e:t)),this.$events.emit("on-subtask-edited",t),this.$emit("update-subtask",t),s.is_finished&&this.$events.emit("show-task-add-time-modal",{subtask:t})}catch(a){this.$toast.error(a.message||a)}},async deleteTimeblock({id:e}){const t=JSON.parse(JSON.stringify(this.subtask));t.timeblocks=t.timeblocks.filter((t=>t.id!=e)),t.deadline&&(t.deadline=A.Z.formatDateTimeForBackend(this._mergeDeadlineTimeDate())),this._update(t)},deleteTimeblockWithoutId(e){this.$emit("delete-timeblock")},async _update(e){try{const t=e.timesheets.map((e=>(delete e.employee_name,e))),{subtask:s}=await this.$axios.put_auth(`v1/subtasks/${e.id}`,{...e,timesheets:t});this.closeModal(),this.$events.emit("on-subtask-edited",s)}catch(t){this.$toast.error(t.message||t)}},isAfterDeadline(){const e=this.getDeadline(this.subtask);if(!e)return;const t=Re()(this.form.date),s=Re()(e),[a,i]=this.form.ends_at_time.split(":").map(Number);return t.hours(a),t.minutes(i),t.isAfter(s)},getDeadline(e){return e?.deadline?e.deadline:e.master_task_deadline},_mergeDeadlineTimeDate(){const e=new Date(this.subtask.deadline),t=this.subtask._deadline_time.split(":");return e.setHours(parseInt(t[0])),e.setMinutes(parseInt(t[1])),e},closeModal(){this.form={date:null,starts_at_time:"09:00",ends_at_time:"16:00"},this.showModal=!1,this.$nextTick((()=>this.v$.$reset()))}}};const Ge=(0,$.Z)(Je,[["render",qe]]);var Xe=Ge,Qe={data(){return{preventInputFocus:!1}},methods:{setFocusEvent(){document.querySelectorAll(".v-autocomplete input").forEach((e=>{e.addEventListener("focus",this.onInputFocus)}))},onDateFocus(e){void 0==e&&(this.preventInputFocus=!0)},onDateOpen(e){void 0==e&&(this.preventInputFocus=!0)},onInputFocus(e){setTimeout((()=>{this.preventInputFocus&&(e.target.blur(),this.preventInputFocus=!1)}),100)}}},et={computed:{employeesOptions(){const e=[...this.mastertask.employees].map((e=>e.id));return this.enrichedEmployees.filter((t=>!e.includes(t.id)))||[]},projectsOptions(){const e=/[^a-zA-Z0-9 ]/g,t=this.projectCodeSearch?this.projectCodeSearch.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(e,""):"",s=this.projects.filter((s=>{const a=s.code.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(e,"");return a.toLowerCase().includes(t.toLowerCase())}));let a=s?.length?s.slice(0,10):this.projects.slice(0,10);if(!this.mastertask?.project_id)return a;const i=this.projects.find((e=>e.id==this.mastertask?.project_id));return a=a.filter((e=>e.id!=i.id)),[...a,i]}},methods:{onEmployeeSelected(e){const t=this.enrichedEmployees.find((t=>t.id==e));this.mastertask.employees.push(t),this.showAddEmployeeInput=!1},onEmployeeDurationChanged(){let e=0;this.mastertask.employees=this.mastertask.employees.map((t=>("string"==typeof t.duration?(e+=parseFloat(t.duration),t.duration=parseFloat(t.duration),t.invalid=!1):"number"==typeof t.duration&&(e+=t.duration,t.invalid=!1),t))),this.mastertask.duration=e}},watch:{"mastertask.team_id"(e){if(!e)return;const t=this.teams.find((t=>t.id==e));t&&(this.mastertask.team=JSON.parse(JSON.stringify(t)),this.mastertask.employees=[...this.mastertask.team.employees])}}},tt=s(66154);function st(e,t,s,a,i,l){const n=(0,m.up)("A-mastertask-name"),o=(0,m.up)("A-mastertask-status"),r=(0,m.up)("A-task-deadline"),d=(0,m.up)("A-task-timeblocks"),u=(0,m.up)("Z-created-by"),c=(0,m.up)("A-task-assigned-employee"),h=(0,m.up)("A-task-planned-time"),p=(0,m.up)("A-task-remaining-time"),v=(0,m.up)("A-task-spent-time"),k=(0,m.up)("A-task-description"),f=(0,m.up)("Z-files");return(0,m.wg)(),(0,m.iD)(m.HY,null,[(0,m.Wm)(n,{name:s.subtask._master_task.name,id:s.subtask.master_task_id,color:s.subtask._master_task.color,onCloseModal:t[0]||(t[0]=t=>e.$emit("close-modal"))},null,8,["name","id","color"]),(0,m.Wm)(o,{isFinished:s.subtask.is_finished},null,8,["isFinished"]),(0,m.Wm)(r,{subtask:s.subtask},null,8,["subtask"]),(0,m.Wm)(d,{timeblocks:s.subtask.timeblocks,subtask:s.subtask,onUpdateSubtask:t[1]||(t[1]=t=>e.$emit("update-subtask",t))},null,8,["timeblocks","subtask"]),(0,m.Wm)(u,{"employee-id":s.subtask.created_by},null,8,["employee-id"]),(0,m.Wm)(c,{employee:s.subtask._employee},null,8,["employee"]),(0,m.Wm)(h,{hours:s.subtask.duration},null,8,["hours"]),(0,m.Wm)(p,{hours:s.subtask.duration-s.subtask.spent_time},null,8,["hours"]),(0,m.Wm)(v,{hours:s.subtask.spent_time,subtask:s.subtask},null,8,["hours","subtask"]),(0,m.Wm)(k,{description:s.subtask.description,"mastertask-description":s.subtask.master_task_description},null,8,["description","mastertask-description"]),(0,m.Wm)(f,{files:s.subtask.files},null,8,["files"])],64)}const at={class:"d-flex align-center"},it=(0,m._)("p",{class:"mx-3"},"Mastertask",-1);function lt(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",at,[(0,m.Wm)(w.t,{icon:"mdi-link",size:"large"}),it])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("p",{class:"task-badge px-4 py-2 rounded-pill hover",onClick:t[0]||(t[0]=e=>l.openMastertask()),style:(0,k.j5)({backgroundColor:s.color})},(0,k.zw)(s.name),5)])),_:1})])),_:1})])),_:1})}var nt={emits:["close-modal"],props:{name:{type:String,required:!0},id:{type:Number,required:!0},color:{type:String,required:!0}},methods:{openMastertask(){this.$emit("close-modal"),this.$events.emit("show-mastertask-modal",{mastertask:{id:this.id},editMode:!1})}}};const ot=(0,$.Z)(nt,[["render",lt]]);var rt=ot;const dt={class:"d-flex align-center"},ut=(0,m._)("p",{class:"mx-3"},"Status",-1),ct={key:0,class:"status-badge px-4 py-2 rounded-pill"},mt={key:1,class:"status-badge px-4 py-2 rounded-pill"};function ht(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",dt,[(0,m.Wm)(w.t,{icon:"mdi-drag-vertical",size:"large"}),ut])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[s.isFinished?((0,m.wg)(),(0,m.iD)("p",ct,"Ukončený")):((0,m.wg)(),(0,m.iD)("p",mt,"Neukončený"))])),_:1})])),_:1})])),_:1})}var pt={props:{isFinished:{type:Number,default:()=>0}}};const vt=(0,$.Z)(pt,[["render",ht]]);var kt=vt;const ft={class:"d-flex align-center"},gt=(0,m._)("p",{class:"mx-3"},"Vytvoril",-1),bt={class:"employee-selected-avatar d-flex justify-center align-center"},_t={class:"ml-2"};function wt(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",ft,[(0,m.Wm)(w.t,{icon:"mdi-account-star-outline",size:"large"}),gt])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3 d-flex align-center"},{default:(0,m.w5)((()=>[(0,m._)("p",bt,(0,k.zw)(l.employee?l.employee._initials:"?"),1),(0,m._)("p",_t,(0,k.zw)(l.employee?l.employee._fullName:e.$t("Unasigned")),1)])),_:1})])),_:1})])),_:1})}var yt={props:{employeeId:{type:[Number],required:!1}},computed:{...(0,U.Se)("tm",["enrichedEmployees"]),employee(){return this.enrichedEmployees.find((e=>e.id==this.employeeId))}}};const Dt=(0,$.Z)(yt,[["render",wt]]);var Mt=Dt;const Tt={class:"d-flex align-center"},$t=(0,m._)("p",{class:"mx-3"},"Priradený",-1),Ct={class:"employee-selected-avatar d-flex justify-center align-center"},jt=["innerHTML"];function Et(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",Tt,[(0,m.Wm)(w.t,{icon:"mdi-account-outline",size:"large"}),$t])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3 d-flex align-center"},{default:(0,m.w5)((()=>[(0,m._)("p",Ct,(0,k.zw)(s.employee.name.charAt(0)+s.employee.surname.charAt(0)),1),(0,m._)("p",{class:"ml-2",innerHTML:`${s.employee.name} ${s.employee.surname}`},null,8,jt)])),_:1})])),_:1})])),_:1})}var xt={props:{employee:{type:Object,required:!0}}};const Wt=(0,$.Z)(xt,[["render",Et]]);var St=Wt;const Ot={class:"d-flex align-center"},Vt=(0,m._)("p",{class:"mx-3"},"Naplánovaný čas",-1);function zt(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",Ot,[(0,m.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),Vt])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("p",null,(0,k.zw)(s.hours)+" h",1)])),_:1})])),_:1})])),_:1})}var At={props:{hours:{type:Number,required:!0}}};const Ut=(0,$.Z)(At,[["render",zt]]);var Zt=Ut;const It=e=>((0,m.dD)("data-v-f216d188"),e=e(),(0,m.Cn)(),e),Ft={class:"d-flex align-center"},Ht=It((()=>(0,m._)("p",{class:"mx-3"},"Odpracovaný čas",-1))),Pt={class:"d-flex align-center mb-3"},Lt=It((()=>(0,m._)("p",{class:"task-badge rounded-pill"},"Pridať záznam",-1))),Nt={class:"d-flex align-center flex-start width-100"},Yt={class:"task-badge rounded-pill"},qt={class:"ml-5"},Bt={class:"d-flex justify-space-between align-center"},Rt=It((()=>(0,m._)("h1",null,"Pridať odpracovaný čas",-1)));function Kt(e,t,s,i,l,n){return(0,m.wg)(),(0,m.iD)(m.HY,null,[(0,m.Wm)(Oe.o,{"no-gutters":""},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",Ft,[(0,m.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),Ht])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("p",null,(0,k.zw)(s.hours)+" h",1)])),_:1}),(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",Pt,[(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=e=>l.showModal=!0),class:"add-date cursor-pointer mr-2",icon:"mdi-plus",size:"medium"}),Lt]),s.subtask.timesheets.length?((0,m.wg)(!0),(0,m.iD)(m.HY,{key:0},(0,m.Ko)(s.subtask.timesheets,(e=>((0,m.wg)(),(0,m.iD)("div",{key:e.id,class:"d-flex align-center mb-3"},[(0,m.Wm)(w.t,{onClick:(0,a.iM)((t=>n.deleteTimesheet(e)),["stop"]),class:"circle-border cursor-pointer mr-2",icon:"mdi-minus",size:"medium"},null,8,["onClick"]),(0,m._)("div",Nt,[(0,m._)("p",Yt,(0,k.zw)(e.time),1),(0,m._)("p",qt,(0,k.zw)(e.employee_name)+" ("+(0,k.zw)(e.timestamp)+")",1)])])))),128)):(0,m.kq)("",!0)])),_:1})])),_:1})])),_:1}),(0,m.Wm)(_.B,{"max-width":"750",modelValue:l.showModal,"onUpdate:modelValue":t[4]||(t[4]=e=>l.showModal=e),persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",Bt,[Rt,(0,m.Wm)(w.t,{onClick:t[1]||(t[1]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(x.hw,{modelValue:l.form.hours,"onUpdate:modelValue":t[2]||(t[2]=e=>l.form.hours=e),variant:"solo","bg-color":"white",type:"number",hint:l.v$.form.hours.$errors?l.errorUtils.parseErrors(l.v$.form.hours.$errors):null,class:(0,k.C_)([{error:l.v$.form.hours.$errors.length},"mb-2"]),label:"Odpracovaný čas"},null,8,["modelValue","hint","class"])])),_:1}),(0,m.Wm)(f.T,{onClick:t[3]||(t[3]=e=>n.submit()),class:"button primary mt-5"},{default:(0,m.w5)((()=>[(0,m.Uk)("Potvrdiť")])),_:1})])),_:1})])),_:1},8,["modelValue"])],64)}var Jt=s(15941),Gt={mixins:[M],props:{hours:{type:Number,required:!0},subtask:{type:Object,required:!0}},data(){return{moment:Re(),v$:(0,O.ZP)(),errorUtils:z.Z,showModal:!1,form:{hours:null}}},validations(){return{form:{hours:{required:V.C1,numeric:V.uR,minValue:(0,V.uv)(.1)}}}},computed:{...(0,U.Se)("auth",["user"])},methods:{async submit(){if(!await this.v$.$validate())return;const e=JSON.parse(JSON.stringify(this.subtask));e.timesheets.push({id:null,employee_id:this.user.id,time:"string"==typeof this.form.hours?parseFloat(this.form.hours):this.form.hours}),e.deadline&&(e.deadline=A.Z.formatDateTimeForBackend(this._mergeDeadlineTimeDate())),this._update(e)},async deleteTimesheet({id:e}){const t=JSON.parse(JSON.stringify(this.subtask));t.timesheets=t.timesheets.filter((t=>t.id!=e)),t.deadline&&(t.deadline=A.Z.formatDateTimeForBackend(this._mergeDeadlineTimeDate())),this._update(t)},closeModal(){this.form={hours:null},this.showModal=!1,this.$nextTick((()=>this.v$.$reset()))},async _update(e){try{e.timesheets=e.timesheets.map((e=>(delete e.employee_name,e)));const{subtask:t}=await this.$axios.put_auth(`v1/subtasks/${e.id}`,e);this.closeModal(),this.$events.emit("on-subtask-edited",t)}catch(t){this.$toast.error(t.message||t)}},_mergeDeadlineTimeDate(){const e=new Date(this.subtask.deadline);Jt.log("a-task-spent-time",this.subtask);const t=this.subtask._deadline_time.split(":");return e.setHours(parseInt(t[0])),e.setMinutes(parseInt(t[1])),e}}};const Xt=(0,$.Z)(Gt,[["render",Kt],["__scopeId","data-v-f216d188"]]);var Qt=Xt;const es={class:"d-flex align-center"},ts=(0,m._)("p",{class:"mx-3"},"Zostávajúci čas",-1);function ss(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center border-bottom"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",es,[(0,m.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),ts])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("p",null,(0,k.zw)(s.hours.toFixed(2))+" h",1)])),_:1})])),_:1})])),_:1})}var as={props:{hours:{type:Number,required:!0}}};const is=(0,$.Z)(as,[["render",ss]]);var ls=is,ns=s(80678);const os={class:"d-flex align-center"},rs=(0,m._)("p",{class:"mx-3"},"Deadline",-1);function ds(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",os,[(0,m.Wm)(w.t,{icon:"mdi-calendar-week",size:"large"}),rs])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[s.subtask.deadline?((0,m.wg)(),(0,m.iD)("p",{key:0,class:(0,k.C_)(""+(i.tmUtils.isAfter(s.subtask.deadline)?"text-black":"text-red-darken-4"))},(0,k.zw)(i.tmUtils.formatDate(s.subtask.deadline))+" "+(0,k.zw)(l.deadlineTime),3)):((0,m.wg)(),(0,m.j4)(ns.N,{key:1,text:"Deadline z Mastertasku",location:"end"},{activator:(0,m.w5)((({props:e})=>[(0,m._)("span",(0,m.dG)({class:"cursor-pointer"},e),(0,k.zw)(l.getMasterTaskDeadline(s.subtask))+"*",17)])),_:1}))])),_:1})])),_:1})])),_:1})}var us={props:{subtask:{type:[String,Object,null],required:!0}},computed:{...(0,U.Se)("tm",["mastertasks"]),deadlineTime(){const e=this.subtask?._deadline_time;return e?Re()(e,"HH:mm:ss").format("HH:mm"):""}},data(){return{tmUtils:A.Z}},methods:{getMasterTaskDeadline(e){return e?.deadline?e.deadline:e.master_task_deadline}}};const cs=(0,$.Z)(us,[["render",ds]]);var ms=cs;const hs={key:0,class:"px-5 py-5 border-bottom"},ps=(0,m._)("p",null,"Popis zadania",-1),vs=["innerHTML"],ks={key:1,class:"px-5 py-5 border-bottom"},fs=(0,m._)("p",null,"Popis mastertasku",-1),gs=["innerHTML"];function bs(e,t,s,a,i,l){return(0,m.wg)(),(0,m.iD)(m.HY,null,[s.description?((0,m.wg)(),(0,m.iD)("div",hs,[ps,(0,m._)("section",{innerHTML:i.preparedDescription,class:"description-detail px-2 py-2 w-100 rounded mt-2"},null,8,vs)])):(0,m.kq)("",!0),s.mastertaskDescription?((0,m.wg)(),(0,m.iD)("div",ks,[fs,(0,m._)("section",{innerHTML:i.preparedMastertaskDescription,class:"description-detail px-2 py-2 w-100 rounded mt-2"},null,8,gs)])):(0,m.kq)("",!0)],64)}var _s=s(46215),ws=s.n(_s);const ys=(0,_s.useToast)();function Ds(){const e=window.navigator.platform,t=["Macintosh","MacIntel","MacPPC","Mac68K"],s=["Win32","Win64","Windows","WinCE"];return-1!==t.indexOf(e)?"mac":(s.indexOf(e),"win")}function Ms(e){if(!e)return e;const t=Ds();return"mac"===t?(e=e.replace(/\\\\/g,"smb://"),e=e=e.replace(/(smb:\/\/[^\s<>"()]+)/g,(function(e){return'<a href="'+e.replace(/\\/g,"/")+'">'+e.replace(/\\/g,"/")+"</a>"}))):(e=e.replace(/smb:\/\//g,"\\\\"),e=e.replace(/(\\\\[^\s<>"()]+)/g,(function(e){return e=e.replaceAll("/","\\"),'<span style="cursor: pointer; text-decoration: underline" onclick="'+Ts(e)+'">'+e+"</span>"}))),e}function Ts(e){return`\n\t\tif (navigator.clipboard && navigator.clipboard.writeText) {\n\t\t\tnavigator.clipboard.writeText('${e.replace(/\\/g,"\\\\")}').then(() => {\n\t\t\t\twindow.toast.success('Link copied to clipboard!')\n\t\t\t}).catch(err => {\n\t\t\t\twindow.toast.error('Failed to copy link to clipboard!')\n\t\t\t});\n\t\t} else {\n\t\t\tconst input = document.createElement('input');\n\t\t\tinput.style.position = 'fixed';\n\t\t\tinput.style.opacity = 0;\n\t\t\tinput.style.pointerEvents = 'none';\n\t\t\tinput.value = '${e.replace(/\\/g,"\\\\")}';\n\t\t\tdocument.body.appendChild(input);\n\t\t\tinput.select();\n\t\t\tinput.focus();\n\t\t\tdocument.execCommand('copy');\n\t\t\tdocument.body.removeChild(input);\n\t\t\twindow.toast.success('Link copied to clipboard!')\n\t\t}\n\t`}window.toast=ys;var $s={props:{description:{type:String||null,default:()=>null},mastertaskDescription:{type:String||null,default:()=>null}},data(){return{copiedIndices:[],preparedDescription:"",preparedMastertaskDescription:""}},mounted(){this.preparedDescription=Ms(this.description),this.preparedMastertaskDescription=Ms(this.mastertaskDescription)}};const Cs=(0,$.Z)($s,[["render",bs]]);var js=Cs;const Es=e=>((0,m.dD)("data-v-f01fa1ac"),e=e(),(0,m.Cn)(),e),xs=Es((()=>(0,m._)("p",{class:"mt-5"},"Prílohy",-1))),Ws={class:"w-100 d-flex align-center"},Ss=["onClick"],Os={key:0,class:"d-flex align-center"},Vs=["src"],zs=Es((()=>(0,m._)("p",{class:"ml-2"},"Súbor sa sťahuje, počkajte prosím",-1)));function As(e,t,a,i,l,n){const o=(0,m.up)("W-loadable");return(0,m.wg)(),(0,m.iD)(m.HY,null,[xs,(0,m._)("div",Ws,[(0,m.Wm)(o,{content:a.files,emptyMessage:"Žiadne prílohy neboli nahraté"},{default:(0,m.w5)((()=>[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(a.files,((e,t)=>((0,m.wg)(),(0,m.iD)("div",{key:e.id,class:(0,k.C_)(["d-flex align-center flex-wrap",[0===t?"ml-0":"ml-2"]])},[(0,m.Wm)(Me.v,{class:"mt-2"},{default:(0,m.w5)((()=>[(0,m._)("p",{onClick:t=>n.downloadFile(e),class:"cursor-pointer"},(0,k.zw)(e.name),9,Ss),(0,m.Wm)(w.t,{class:"mx-1",icon:"mdi-paperclip"}),(0,m._)("p",null,(0,k.zw)((e.file_size/1048576).toFixed(2))+" MB",1)])),_:2},1024),e.isLoading?((0,m.wg)(),(0,m.iD)("div",Os,[(0,m._)("img",{class:"gif-loader",src:s(14214),alt:"Loading..."},null,8,Vs),zs])):(0,m.kq)("",!0)],2)))),128))])),_:1},8,["content"])])],64)}var Us={props:{files:{type:Array,default:()=>[]}},data(){return{isLoading:!1}},methods:{async downloadFile(e){e.isLoading=!0;try{const t=await fetch(e.path),s=await t.blob();tt.saveAs(s,e.name)}catch(t){this.$toast.error(this.$parseError(t))}finally{e.isLoading=!1}}}};const Zs=(0,$.Z)(Us,[["render",As],["__scopeId","data-v-f01fa1ac"]]);var Is=Zs,Fs={emits:["close-modal","update-subtask"],components:{ZFiles:Is,AMastertaskName:rt,AMastertaskStatus:kt,ATaskTimeblocks:Xe,ZCreatedBy:Mt,ATaskAssignedEmployee:St,ATaskPlannedTime:Zt,ATaskSpentTime:Qt,ATaskRemainingTime:ls,ATaskDescription:js,ATaskDeadline:ms},props:{subtask:{type:Object,required:!0}}};const Hs=(0,$.Z)(Fs,[["render",st]]);var Ps=Hs;const Ls={class:"timeblock w-100"},Ns={key:0,class:"x-button"},Ys={class:"splitted-time-inputs"};function qs(e,t,s,a,i,l){const n=(0,m.up)("Datepicker");return(0,m.wg)(),(0,m.iD)("div",Ls,[s.deletable&&s.editable?((0,m.wg)(),(0,m.iD)("div",Ns,[(0,m._)("button",{onClick:t[0]||(t[0]=t=>e.$emit("removeTimeblock")),class:"x-button"},"x")])):(0,m.kq)("",!0),(0,m._)("div",{onClick:t[1]||(t[1]=e=>l.openDatepicker("datepicker")),class:"datepicker-wrapper",ref:"datepicker-wrapper"},[(0,m.Wm)(n,{"model-value":s.timeblock.date,ref:"datepicker",onOpen:s.onDateOpen,"onUpdate:modelValue":l.updateDate,format:"dd.MM.yyyy",locale:"sk","select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Dátum","auto-apply":!0,"enable-time-picker":!1,class:"mb-5 modal-input datepicker-input"},null,8,["model-value","onOpen","onUpdate:modelValue"])],512),(0,m._)("div",Ys,[(0,m.Wm)(x.hw,{value:s.timeblock.starts_at_time,onInput:l.updateStartTime,onFocus:s.onInputFocus,class:(0,k.C_)({error:i.v$?.timeblock.starts_at_time.$errors.length}),type:"time",variant:"solo","bg-color":"white",label:"Začiatok"},null,8,["value","onInput","onFocus","class"]),(0,m.Wm)(x.hw,{value:s.timeblock.ends_at_time,onInput:l.updateEndTime,onFocus:s.onInputFocus,class:(0,k.C_)({error:i.v$?.timeblock.ends_at_time.$errors.length}),type:"time",variant:"solo","bg-color":"white",label:"Koniec"},null,8,["value","onInput","onFocus","class"])])])}var Bs={components:{Datepicker:De.Z},props:{timeblock:{type:Object,required:!0},deletable:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},preventInputFocus:{type:Boolean,default:!1},onInputFocus:{type:Function,default:()=>({})},onDateOpen:{type:Function,default:()=>({})}},data(){return{v$:(0,O.ZP)()}},validations(){return{timeblock:{starts_at_time:{required:(0,V.CF)(this.timeblock.date)},ends_at_time:{required:(0,V.CF)(this.timeblock.date)}}}},methods:{async openDatepicker(e){this.$refs[e].openMenu()},updateDate(e){const t={...this.timeblock};e&&(t.date=e),this.$emit("updateTimeblock",t)},updateStartTime(e){const t={...this.timeblock};t.starts_at_time=e.target.value,this.$emit("updateTimeblock",t)},updateEndTime(e){const t={...this.timeblock};t.ends_at_time=e.target.value,this.$emit("updateTimeblock",t)}}};const Rs=(0,$.Z)(Bs,[["render",qs],["__scopeId","data-v-2c730af8"]]);var Ks=Rs,Js=s(15941),Gs={emits:["close","refresh"],mixins:[Qe,et,Z.Z,M],components:{ZTaskReadonlyInfo:Ps,ATimeblock:Ks,ZFilesUpload:Se,Datepicker:De.Z,QuillEditor:r.Bn},data(){return{tmUtils:A.Z,editMode:!1,visible:!1,subtask:null,isSaving:!1,errorUtils:z.Z,v$:(0,O.ZP)(),employeeValidations:[],showDatePicker:!1,selectedNewDate:[],timeblocks:[{date:null,starts_at_time:null,ends_at_time:null}],wasFormValidationTriggered:!1}},computed:{...(0,U.Se)("tm",["mastertasks","enrichedEmployees"])},validations(){return{subtask:{master_task_id:{required:V.C1},deadline:{required:V.C1},_deadline_time:{required:V.C1}}}},mounted(){this.$events.on("add-timeblock",(e=>{this.subtask?.timeblocks||(this.subtask.timeblocks=[]),this.subtask?.timesheets||(this.subtask.timesheets=[]),this.subtask?.is_finished||(this.subtask.is_finished=0),this.subtask.timeblocks.push(e)})),this.$events.on("on-subtask-edited",(e=>{if(e?.id!==this.subtask?.id)return;const t=JSON.parse(JSON.stringify(e)),s=t.deadline?.split(" ")||[];t.deadline=s[0],t._deadline_time=s[1],this.subtask=this._enrichTask(t),Js.log("2",this.subtask),this.$forceUpdate()})),this.$events.on("on-subtask-deleted",(e=>{e?.id==this.subtask?.id&&this.closeModal()}))},methods:{toggleEditMode(){if("office365"==this.subtask.type)return this.$events.emit("show-unable-to-edit-office-task-modal",{mode:"edit"});this.editMode=!this.editMode},openDatepicker(e){this.$refs[e].openMenu()},updateTimeblock(e,t){this.timeblocks[t]=e},removeTimeblock(e){this.timeblocks.splice(e,1)},async showModal({subtask:e,editMode:t=!1,mastertask:s={}}){this.isSaving=!1,this.subtask=null,this.visible=!0,this.timeblocks=[{date:null,starts_at_time:null,ends_at_time:null}],this.$nextTick((()=>{this.v$.$reset(),this.setFocusEvent()}));try{if(e?.id){const s=await this.$axios.get_auth_data(`v1/subtasks/${e.id}`);if(!s.deadline)return this.editMode=t||!s.id,this.subtask=this._enrichTask(s);const a=s.deadline.split(" ");s.deadline=a[0],s._deadline_time=a[1],this.subtask=this._enrichTask(s)}else{const t=localStorage.getItem("subtaskData");try{if(!t)throw new Error("subtaskData is null or undefined");{const e=JSON.parse(t);if(this.subtask=e,"object"!==typeof this.subtask||null===this.subtask)throw new Error("Parsed subtask is not an object");this.$nextTick((()=>{this.$refs["description"]?.setHTML(this.subtask.description||"")}))}}catch(a){Js.error("Error parsing subtaskData:",a),this.subtask={master_task:s,employees:[{}],_deadline_time:"17:00"}}if(e?.deadline&&e._deadline_time&&e.employee_id){const t=this.enrichedEmployees.find((t=>t.id==e.employee_id));this.subtask.employees=[t],this.subtask.deadline=e.deadline,this.subtask._deadline_time=e._deadline_time}e?.master_task_id&&e?.project_code&&(this.subtask.master_task_id=e.master_task_id,this.subtask.project_code=e.project_code)}this.editMode=t||!this.subtask.id}catch(a){this.$toast.error(this.$parseError(a))}},deleteTimeblock(e){this.subtask.timeblocks.splice(e,1)},closeModal(){this.visible=!1,this.$router.replace({name:this.$route.name})},async validateAllFields(){const e=await this._validateEmployees(),t=!!this.subtask?.id||await this._validateTimeblocks();if(await this.v$.$validate()&&e&&t)return!0},async handleOnRemoveEmployee(){this.wasFormValidationTriggered&&setTimeout((async()=>{this.validateAllFields()}),100)},async save(){if(this.wasFormValidationTriggered=!0,await this.validateAllFields()){this.subtask.description=this.$refs["description"].getHTML(),this._mergeDeadlineTimeDate();try{if(this.isSaving=!0,this.subtask.deadline=Re()(this.subtask.deadline).format("YYYY-MM-DD HH:mm:SS"),this.subtask?.id){const e=this.subtask.timesheets.map((e=>(delete e.employee_name,e))),{subtask:t}=await this.$axios.patch_auth_form(`v1/subtasks/${this.subtask.id}`,{...this.subtask,timesheets:e});localStorage.removeItem("subtaskData"),this.$store.commit("tm/update_subtask",t),this.$events.emit("on-subtask-edited",this.subtask)}else{const e=this.subtask.employees.filter((e=>e.id&&e.duration));e.forEach((e=>{e.timeblocks=this.timeblocks.filter((e=>e.date)).map((e=>({start:`${Re()(e.date).format("YYYY-MM-DD")} ${e.starts_at_time}:00`,end:`${Re()(e.date).format("YYYY-MM-DD")} ${e.ends_at_time}:00`,id:null})))}));const t={...this.subtask,employees:e};delete t._master_task;const{subtasks:s}=await this.$axios.post_auth(`v1/mastertasks/${this.subtask.master_task_id}/subtasks`,t);localStorage.removeItem("subtaskData"),this.subtask.id=s[0].id,s.forEach((e=>{this.$store.commit("tm/update_subtask",e),this.$events.emit("on-subtask-edited",this.subtask)})),this.$events.emit("task-created"),this.$events.emit("close-both-modals")}this.closeModal()}catch(e){this.$toast.error(this.$parseError(e))}finally{this.isSaving=!1}}},openDeleteTaskModal(e){if("office365"==e.type)return this.$events.emit("show-unable-to-edit-office-task-modal",{mode:"delete"});this.$events.emit("show-delete-task-modal",{subtask:e})},showCompleteTaskModal(){this.$events.emit("show-complete-task-modal",{subtask:this.subtask}),this.subtask.deadline&&(this.subtask.deadline=A.Z.formatDateTimeForBackend(this.subtask.deadline))},filesUploaded(e){this.subtask.files=e},updateSubtask(e){this.subtask=e},_mergeDeadlineTimeDate(){const e=new Date(this.subtask.deadline);Js.log("z-task-modal",this.subtask);const t=this.subtask._deadline_time.split(":");e.setHours(parseInt(t[0])),e.setMinutes(parseInt(t[1])),this.subtask.deadline=e},_validateEmployees(){return new Promise((e=>{if(this.employeeValidations=[],this.subtask.id)this.subtask.employee_id&&this.subtask.duration||(this.employeeValidations[0]={employee:!this.subtask.employee_id,duration:!this.subtask.duration});else{let e=!1;this.subtask.employees.forEach(((t,s)=>{t.id||t.duration?(t.id||t.duration)&&(this.employeeValidations[s]={employee:!t.id,duration:!t.duration},t.id&&t.duration&&(e=!0)):0!==s||e||(this.employeeValidations[s]={employee:!0,duration:!0})}))}const t=this.employeeValidations.some((e=>e.duration||e.employee));e(!t)}))},async _validateTimeblocks(){let e=!1;for(let t=0;t<this.timeblocks.length;t++){const s=this.$refs[`timetable-${t}`];e=await s[0].v$.$validate()||e}return e},_enrichTask(e){return{...e,_created_by:this.enrichedEmployees.find((t=>t.id==e.created_by)),_employee:this.enrichedEmployees.find((t=>t.id==e.employee_id)),_master_task:this.mastertasks.find((t=>t.id==e.master_task_id))}}},watch:{"subtask.employee_id"(e,t){e&&t&&(this.subtask.timeblocks=[],this.subtask._employee=this.enrichedEmployees.find((e=>e.id==this.subtask.employee_id)))},"subtask.employees":{handler(){if(!this.subtask?.employees)return;const e=this.subtask.employees[this.subtask.employees.length-1];(e?.id||e?.duration)&&this.subtask.employees.push({})},deep:!0},"subtask.master_task_id"(e){e&&(this.subtask._master_task=this.mastertasks.find((e=>e.id==this.subtask.master_task_id)),this.subtask.project_code=this.subtask._master_task?.project_code||null)},editMode(){this.$nextTick((()=>{this.$refs["description"]?.setHTML(this.subtask.description||"")}))},subtask:{handler(e){if(this.editMode&&!this.subtask?.id){const t=e?.employees?.filter((e=>e?.id||e?.duration))||[{}],s={...e,employees:t&&t.length>0?t:[{}]};Js.log("subtaskData",s),localStorage.setItem("subtaskData",JSON.stringify(s))}},deep:!0}}};const Xs=(0,$.Z)(Gs,[["render",ye],["__scopeId","data-v-551d0bf6"]]);var Qs=Xs;const ea={class:"d-flex justify-space-between align-center"};function ta(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",ea,[(0,m._)("h1",null,[(0,m.Uk)("Ste si istý, že chcete zmazať "),(0,m._)("b",null,(0,k.zw)(l.blocker.name),1),(0,m.Uk)("?")]),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"mb-15"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,m.w5)((()=>[(0,m.Wm)(f.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.deleteBlocker()),disabled:l.isDeleting},{default:(0,m.w5)((()=>[(0,m.Uk)("ÁNO")])),_:1},8,["disabled"]),(0,m.Wm)(f.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.closeModal()),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var sa={mixins:[M],emits:["on-blocker-deleted"],data(){return{visible:!1,blocker:null,isDeleting:!1}},methods:{async showModal({blocker:e}){this.blocker=e,this.visible=!0},closeModal(){this.visible=!1},async deleteBlocker(){if(!this.isDeleting){this.isDeleting=!0;try{await this.$axios.delete_auth(`v1/blockers/${this.blocker.id}`),this.$emit("on-blocker-deleted",this.blocker),this.closeModal()}catch(e){this.$toast.error(this.$parseError(e))}finally{this.isDeleting=!1}}}}};const aa=(0,$.Z)(sa,[["render",ta]]);var ia=aa;const la={class:"d-flex justify-space-between align-center"};function na(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",la,[(0,m._)("h1",null,[(0,m.Uk)("Ste si istý, že chcete "+(0,k.zw)(l.subtask.is_finished?"znovu otvoriť":"dokončiť")+" sub task, z mastertasku ",1),(0,m._)("b",null,(0,k.zw)(l.subtask?.master_task?.name||l.subtask.master_task),1),(0,m.Uk)("?")]),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,m.w5)((()=>[(0,m.Wm)(f.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.complete())},{default:(0,m.w5)((()=>[(0,m.Uk)("ÁNO")])),_:1}),(0,m.Wm)(f.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>l.visible=!1),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var oa={mixins:[M],emits:["close","on-subtask-edited"],data(){return{visible:!1,subtask:null}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0},async complete(){try{const e={...this.subtask,is_finished:this.subtask.is_finished?0:1,timesheets:this.subtask.timesheets.map((e=>(delete e.employee_name,e)))},{subtask:t}=await this.$axios.put_auth(`v1/subtasks/${e.id}`,e);this.visible=!1,this.$emit("on-subtask-edited",t)}catch(e){this.$toast.error(this.$parseError(e))}},closeModal(){this.visible=!1}}};const ra=(0,$.Z)(oa,[["render",na]]);var da=ra;const ua={class:"d-flex justify-space-between align-center"};function ca(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",ua,[(0,m._)("h1",null,[(0,m.Uk)("Ste si istý, že chcete "+(0,k.zw)(l.mastertask.is_finished?"znovu otvoriť":"dokončiť")+" ",1),(0,m._)("b",null,(0,k.zw)(l.mastertask?.name),1),(0,m.Uk)("?")]),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>l.visible=!1),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,m.w5)((()=>[(0,m.Wm)(f.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.complete())},{default:(0,m.w5)((()=>[(0,m.Uk)("ÁNO")])),_:1}),(0,m.Wm)(f.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>l.visible=!1),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var ma={mixins:[M],emits:["close","master-task-edited"],data(){return{visible:!1,mastertask:null}},methods:{async showModal({mastertask:e}){this.mastertask=e,this.visible=!0},async complete(){try{const e={...this.mastertask,is_finished:this.mastertask.is_finished?0:1},{mastertask:t}=await this.$axios.put_auth(`v1/mastertasks/${e.id}`,e);this.visible=!1,this.$emit("master-task-edited",t),this.$events.emit("close-both-modals")}catch(e){this.$toast.error(this.$parseError(e))}}}};const ha=(0,$.Z)(ma,[["render",ca]]);var pa=ha;const va={class:"d-flex justify-space-between align-center"},ka=(0,m._)("h1",null,"Pridať odpracovaný čas",-1);function fa(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{"max-width":"750",modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",va,[ka,(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(x.hw,{modelValue:l.form.hours,"onUpdate:modelValue":t[1]||(t[1]=e=>l.form.hours=e),variant:"solo","bg-color":"white",type:"number",hint:l.v$.form.hours.$errors?l.errorUtils.parseErrors(l.v$.form.hours.$errors):null,class:(0,k.C_)([{error:l.v$.form.hours.$errors.length},"mb-2"]),label:"Odpracovaný čas"},null,8,["modelValue","hint","class"])])),_:1}),(0,m.Wm)(f.T,{onClick:t[2]||(t[2]=e=>n.submit()),class:"button primary mt-5"},{default:(0,m.w5)((()=>[(0,m.Uk)("Potvrdiť")])),_:1})])),_:1})])),_:1},8,["modelValue"])}var ga={mixins:[M],emits:["close","on-subtask-edited"],data(){return{v$:(0,O.ZP)(),errorUtils:z.Z,visible:!1,subtask:null,form:{hours:null}}},validations(){return{form:{hours:{required:V.C1,numeric:V.uR,minValue:(0,V.uv)(.1)}}}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0,this.form.hours=null,this.$nextTick((()=>this.v$.$reset()))},async submit(){if(!await this.v$.$validate())return;this.subtask.deadline&&(this.subtask.deadline=A.Z.formatDateTimeForBackend(this.subtask.deadline)),this.subtask.timesheets.push({id:null,employee_id:this.subtask.employee_id,time:"string"==typeof this.form.hours?parseFloat(this.form.hours):this.form.hours});const e={...this.subtask,timesheets:this.subtask.timesheets.map((e=>(delete e.employee_name,e)))};try{const{subtask:t}=await this.$axios.put_auth(`v1/subtasks/${this.subtask.id}`,e);this.closeModal(),this.$events.emit("on-subtask-edited",t)}catch(t){this.$toast.error(t.message||t)}},closeModal(){this.visible=!1,this.v$.$reset()}}};const ba=(0,$.Z)(ga,[["render",fa]]);var _a=ba;const wa={class:"d-flex justify-space-between align-center modal-header"};function ya(e,t,s,i,l,n){const o=(0,m.up)("Datepicker"),r=(0,m.up)("W-loadable");return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[7]||(t[7]=e=>l.visible=e),"max-width":"750","max-height":"90%",height:"700px",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(r,{content:l.blocker,class:"h-100"},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,{height:"100%",class:"d-flex flex-column"},{default:(0,m.w5)((()=>[(0,m._)("div",wa,[(0,m._)("h1",null,(0,k.zw)(l.blocker.id?"Upraviť":"Vytvoriť")+" blocker",1),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"d-flex flex-column modal-content"},{default:(0,m.w5)((()=>[(0,m.Wm)(x.hw,{onFocus:e.onInputFocus,class:(0,k.C_)(["modal-input",{error:l.v$.blocker.name.$errors.length}]),label:"Názov blockeru",hint:l.v$.blocker.name.$errors?l.errorUtils.parseErrors(l.v$.blocker.name.$errors):null,modelValue:l.blocker.name,"onUpdate:modelValue":t[1]||(t[1]=e=>l.blocker.name=e),variant:"solo"},null,8,["onFocus","class","hint","modelValue"]),(0,m.Wm)(E.f,{"custom-filter":e.customFilter,"match-any":!0,clearable:"",label:"Vyhľadať zamestnanca",items:[...e.enrichedEmployees],"item-title":"_fullName","item-value":"id",variant:"solo",class:"modal-input",modelValue:l.blocker.employee_id,"onUpdate:modelValue":t[2]||(t[2]=e=>l.blocker.employee_id=e)},null,8,["custom-filter","items","modelValue"]),(0,m.Wm)(o,{class:(0,k.C_)(["modal-input mb-5",{error:l.v$.datepicker.$errors?.length}]),modelValue:l.datepicker,"onUpdate:modelValue":t[3]||(t[3]=e=>l.datepicker=e),"auto-apply":!0,format:"dd.MM.yyyy",locale:"sk",validations:l.v$.datepicker,"select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Dátum","enable-time-picker":!1,ref:"datepicker"},null,8,["modelValue","class","validations"]),(0,m.Wm)(x.hw,{modelValue:l.starts_at_time,"onUpdate:modelValue":t[4]||(t[4]=e=>l.starts_at_time=e),type:"time",variant:"solo","bg-color":"white",hint:l.v$.starts_at_time.$errors?l.errorUtils.parseErrors(l.v$.starts_at_time.$errors):null,class:(0,k.C_)([{error:l.v$.starts_at_time.$errors.length},"mb-1 modal-input"]),label:"Začiatok"},null,8,["modelValue","hint","class"]),(0,m.Wm)(x.hw,{modelValue:l.ends_at_time,"onUpdate:modelValue":t[5]||(t[5]=e=>l.ends_at_time=e),type:"time",variant:"solo","bg-color":"white",hint:l.v$.ends_at_time.$errors?l.errorUtils.parseErrors(l.v$.ends_at_time.$errors):null,class:(0,k.C_)([{error:l.v$.ends_at_time.$errors.length},"modal-input"]),label:"Koniec"},null,8,["modelValue","hint","class"])])),_:1}),(0,m.Wm)(f.T,{class:"button primary",onClick:t[6]||(t[6]=e=>n.save())},{default:(0,m.w5)((()=>[(0,m.Uk)((0,k.zw)(l.blocker.id?"UPRAVIŤ":"VYTVORIŤ"),1)])),_:1})])),_:1})])),_:1},8,["content"])])),_:1},8,["modelValue"])}var Da={mixins:[Qe,Z.Z,M],emits:["close"],components:{Datepicker:De.Z},data(){return{visible:!1,v$:(0,O.ZP)(),errorUtils:z.Z,blocker:null,datepicker:null,starts_at_time:null,ends_at_time:null,employee:null}},computed:{...(0,U.Se)("tm",["enrichedEmployees"]),...(0,U.Se)("auth",["user"])},validations(){return{blocker:{name:{required:V.C1},start:{required:V.C1},end:{required:V.C1}},starts_at_time:{required:V.C1},ends_at_time:{required:V.C1},datepicker:{required:V.C1}}},methods:{async showModal({blocker:e}){this.visible=!0,this.blocker=null,this.datepicker=null,this.starts_at_time=null,this.ends_at_time=null,this.$nextTick((()=>{this.setFocusEvent(),this.v$.$reset()}));try{e?.id?(e=await this.$axios.get_auth_data(`v1/blockers/${e.id}`),this.starts_at_time=Re()(e.start).format("HH:mm"),this.ends_at_time=Re()(e.end).format("HH:mm"),this.datepicker=new Date(e.start),e.employee_id=e.employee.id,this.blocker=e):(this.blocker={start:null,employee_id:this.user.id},e.starts_at_time&&e.datepicker&&e.employee_id&&(this.datepicker=e.datepicker,this.starts_at_time=e.starts_at_time,this.blocker.employee_id=e.employee_id))}catch(t){this.$toast.error(this.$parseError(t))}},async save(){if(await this.v$.$validate())try{if(this.blocker.id){const{blocker:e}=await this.$axios.put_auth(`v1/blockers/${this.blocker.id}`,this.blocker);this.blocker=e}else{const{blocker:e}=await this.$axios.post_auth("v1/blockers",this.blocker);this.blocker=e}this.$events.emit("on-blocker-edited",this.blocker),this.$events.emit("blocker-created"),this.closeModal()}catch(e){this.$toast.error(this.$parseError(e))}},closeModal(){this.$refs["datepicker"].clearValue(),this.visible=!1,this.$emit("close",this.blocker)},onEmployeeSelected({key:e}){this.blocker.employee=this.enrichedEmployees.find((t=>t.id==e))},_syncDatesTimes(){if(!this.starts_at_time||!this.ends_at_time||!this.datepicker)return;const e=this.starts_at_time.split(":"),t=this.ends_at_time.split(":");this.blocker.start=Re()(this.datepicker).set({hours:parseInt(e[0]),minutes:parseInt(e[1])}).format("YYYY-MM-DD HH:mm"),this.blocker.end=Re()(this.datepicker).set({hours:parseInt(t[0]),minutes:parseInt(t[1])}).format("YYYY-MM-DD HH:mm")}},watch:{ends_at_time(){this._syncDatesTimes()},starts_at_time(){this._syncDatesTimes()},datepicker(){this._syncDatesTimes()}}};const Ma=(0,$.Z)(Da,[["render",ya]]);var Ta=Ma;const $a={class:"d-flex justify-space-between align-center"};function Ca(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",$a,[(0,m._)("h1",null,[(0,m.Uk)("Ste si istý, že chcete zmazať "),(0,m._)("b",null,(0,k.zw)(l.mastertask.name),1),(0,m.Uk)("?")]),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"mb-15"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,m.w5)((()=>[(0,m.Wm)(f.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.deleteMasterTask()),disabled:l.isDeleting},{default:(0,m.w5)((()=>[(0,m.Uk)("ÁNO")])),_:1},8,["disabled"]),(0,m.Wm)(f.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.closeModal()),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var ja={mixins:[M],emits:["on-mastertask-deleted"],data(){return{visible:!1,mastertask:null,isDeleting:!1}},methods:{async showModal({mastertask:e}){this.mastertask=e,this.visible=!0},closeModal(){this.visible=!1},async deleteMasterTask(){if(!this.isDeleting){this.isDeleting=!0;try{await this.$axios.delete_auth(`v1/mastertasks/${this.mastertask.id}`),this.$emit("on-mastertask-deleted",this.mastertask),this.closeModal()}catch(e){this.$toast.error(this.$parseError(e))}finally{this.isDeleting=!1}}}}};const Ea=(0,$.Z)(ja,[["render",Ca]]);var xa=Ea,Wa=s(10240);const Sa={class:"d-flex justify-space-between align-center modal-header"},Oa={class:"splitted-inputs"},Va={class:"employee-select-avatar d-flex justify-center align-center"},za={class:"employee-select-avatar d-flex justify-center align-center"},Aa={class:"d-flex justify-space-between align-center"},Ua={class:"d-flex justify-space-between align-center modal-header border-bottom pb-4"},Za={class:"d-flex justify-start"},Ia=["src"],Fa=["src"],Ha={class:"w-100"},Pa={class:"d-flex justify-start align-center mt-8"},La={class:"d-flex align-center"};function Na(e,t,i,l,n,o){const r=(0,m.up)("Datepicker"),d=(0,m.up)("QuillEditor"),u=(0,m.up)("Z-files-upload"),c=(0,m.up)("A-mastertask-description"),h=(0,m.up)("A-tasks-table"),p=(0,m.up)("W-loadable");return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:n.visible,"onUpdate:modelValue":t[17]||(t[17]=e=>n.visible=e),"max-width":"750","max-height":"90%",height:"700px",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(p,{content:n.mastertask,class:"h-100"},{default:(0,m.w5)((()=>[n.editMode?((0,m.wg)(),(0,m.j4)(g._,{key:0,height:"100%",class:"d-flex flex-column scrolling"},{default:(0,m.w5)((()=>[(0,m._)("div",Sa,[(0,m._)("h1",null,(0,k.zw)(n.mastertask?.id?"Upraviť master task":"Vytvoriť master task"),1),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>o.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"d-flex flex-column modal-content"},{default:(0,m.w5)((()=>[(0,m.Wm)(E.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:n.mastertask.project_id,"onUpdate:modelValue":t[1]||(t[1]=e=>n.mastertask.project_id=e),label:e.$t("Project code"),class:(0,k.C_)([{error:n.v$.mastertask.project_id.$errors.length},"modal-input"]),items:e.projectsOptions,"item-title":"code","item-value":"id",variant:"solo",clearable:"","onUpdate:search":t[2]||(t[2]=e=>n.projectCodeSearch=e)},null,8,["custom-filter","modelValue","label","class","items"]),(0,m.Wm)(x.hw,{modelValue:n.mastertask.name,"onUpdate:modelValue":t[3]||(t[3]=e=>n.mastertask.name=e),onFocus:e.onInputFocus,class:(0,k.C_)(["modal-input",{error:n.v$.mastertask.name.$errors.length}]),label:"Názov mastertasku",variant:"solo",hint:n.v$.mastertask.name.$errors?n.errorUtils.parseErrors(n.v$.mastertask.name.$errors):null},null,8,["modelValue","onFocus","class","hint"]),(0,m._)("div",Oa,[(0,m.Wm)(r,{modelValue:n.mastertask.deadline,"onUpdate:modelValue":t[4]||(t[4]=e=>n.mastertask.deadline=e),"auto-apply":!0,onFocus:e.onDateFocus,"min-date":new Date,class:(0,k.C_)(["modal-input left",{error:n.v$.mastertask.deadline.$errors?.length}]),format:"dd.MM.yyyy",locale:"sk","select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Dátum",validations:n.v$.mastertask.deadline},null,8,["modelValue","onFocus","min-date","class","validations"]),(0,m.Wm)(x.hw,{class:(0,k.C_)(["modal-input right",{error:n.v$.mastertask._deadline_time.$errors.length}]),variant:"solo",modelValue:n.mastertask._deadline_time,"onUpdate:modelValue":t[5]||(t[5]=e=>n.mastertask._deadline_time=e),label:"Čas","append-inner-icon":"mdi-clock-outline",type:"time",onFocus:e.onInputFocus,hint:n.v$.mastertask._deadline_time.$errors?n.errorUtils.parseErrors(n.v$.mastertask._deadline_time.$errors):null},null,8,["modelValue","onFocus","class","hint"])]),(0,m.Wm)(x.hw,{modelValue:n.mastertask.estimated_duration,"onUpdate:modelValue":t[6]||(t[6]=e=>n.mastertask.estimated_duration=e),onFocus:e.onInputFocus,class:(0,k.C_)(["modal-input",{error:n.v$.mastertask.estimated_duration.$errors.length}]),variant:"solo",type:"number",label:"Nacenené hodiny",hint:n.v$.mastertask.estimated_duration.$errors?n.errorUtils.parseErrors(n.v$.mastertask.estimated_duration.$errors):null},null,8,["modelValue","onFocus","class","hint"]),(0,m.Wm)(x.hw,{modelValue:n.mastertask.duration,"onUpdate:modelValue":t[7]||(t[7]=e=>n.mastertask.duration=e),onFocus:e.onInputFocus,class:"modal-input",variant:"solo",type:"number",label:`${n.mastertask.duration} h`,disabled:!0},null,8,["modelValue","onFocus","label"]),(0,m.Wm)(Wa.r,{modelValue:n.mastertask.team_id,"onUpdate:modelValue":t[8]||(t[8]=e=>n.mastertask.team_id=e),onFocus:e.onInputFocus,class:(0,k.C_)(["modal-input border-select",{error:n.v$.mastertask.employees.$errors.length}]),label:"Tím",variant:"solo",items:e.teams,"item-value":"id","item-title":"name",disabled:!!n.mastertask.id,clearable:!0},null,8,["modelValue","onFocus","class","items","disabled"]),n.mastertask.id?((0,m.wg)(!0),(0,m.iD)(m.HY,{key:1},(0,m.Ko)(n.mastertask._allEmployees,(e=>((0,m.wg)(),(0,m.j4)(x.hw,{key:e.id,class:"modal-input",label:`${e.name} ${e.surname}`,variant:"solo",placeholder:"h",modelValue:e.duration,"onUpdate:modelValue":t=>e.duration=t,type:"number",disabled:!0},{default:(0,m.w5)((()=>[(0,m._)("p",za,(0,k.zw)(e?.name.charAt(0)+e?.surname.charAt(0)),1),(0,m.Wm)(w.t,{onClick:(0,a.iM)((t=>o.removeEmployee(e)),["stop"]),class:"remove-input",icon:"mdi-close-circle",size:"default"},null,8,["onClick"])])),_:2},1032,["label","modelValue","onUpdate:modelValue"])))),128)):((0,m.wg)(!0),(0,m.iD)(m.HY,{key:0},(0,m.Ko)(n.mastertask.employees,((t,s)=>((0,m.wg)(),(0,m.j4)(x.hw,{key:t.id,onFocus:e.onInputFocus,class:(0,k.C_)(["modal-input",{error:t.invalid}]),label:`${t.name} ${t.surname}`,variant:"solo",placeholder:"h",modelValue:n.mastertask.employees[s].duration,"onUpdate:modelValue":e=>n.mastertask.employees[s].duration=e,type:"number",min:"1",onInput:e.onEmployeeDurationChanged},{default:(0,m.w5)((()=>[(0,m._)("p",Va,(0,k.zw)(t?.name.charAt(0)+t?.surname.charAt(0)),1),(0,m.Wm)(w.t,{onClick:(0,a.iM)((e=>o.removeEmployee(t)),["stop"]),class:"remove-input",icon:"mdi-close-circle",size:"default"},null,8,["onClick"])])),_:2},1032,["onFocus","class","label","modelValue","onUpdate:modelValue","onInput"])))),128)),n.showAddEmployeeInput?((0,m.wg)(),(0,m.j4)(E.f,{key:2,"custom-filter":e.customFilter,"match-any":!0,label:e.$t("Search for employee"),class:(0,k.C_)([{error:n.v$.mastertask.project_id.$errors.length},"modal-input"]),items:e.employeesOptions,"item-title":"_fullName","item-value":"id",variant:"solo",clearable:"","onUpdate:modelValue":e.onEmployeeSelected},null,8,["custom-filter","label","class","items","onUpdate:modelValue"])):(0,m.kq)("",!0),(0,m.Wm)(f.T,{disabled:!!n.mastertask.id,class:(0,k.C_)(["w-100 mb-5 button secondary",{error:n.v$.mastertask.project_id.$errors.length}]),onClick:t[9]||(t[9]=e=>n.showAddEmployeeInput=!0)},{default:(0,m.w5)((()=>[(0,m.Wm)(w.t,{class:"mx-1",icon:"mdi-plus"}),(0,m.Uk)("Pridať zamestnanca ")])),_:1},8,["disabled","class"]),(0,m._)("div",{class:(0,k.C_)(["w-100 modal-input",{error:n.v$.mastertask.description.$errors.length}])},[(0,m.Wm)(d,{ref:"description",modelValue:n.mastertask.description,"onUpdate:modelValue":t[10]||(t[10]=e=>n.mastertask.description=e),placeholder:"Popis",theme:"snow",class:"rich-text-editor",onKeyup:o.onQuillEditorInput},null,8,["modelValue","onKeyup"])],2),(0,m.Wm)(u,{class:"mt-15 files",files:n.mastertask.files,onFilesUploaded:o.filesUploaded,"is-saving":n.isSaving},null,8,["files","onFilesUploaded","is-saving"])])),_:1}),n.isSaving?((0,m.wg)(),(0,m.j4)(f.T,{key:1,class:"button primary disabled",disabled:""},{default:(0,m.w5)((()=>[(0,m.Uk)((0,k.zw)(e.$t("Ukladám...")),1)])),_:1})):((0,m.wg)(),(0,m.j4)(f.T,{key:0,class:"button primary",onClick:t[11]||(t[11]=e=>o.save())},{default:(0,m.w5)((()=>[(0,m.Uk)((0,k.zw)(n.mastertask.id?"ULOŽIŤ":"VYTVORIŤ"),1)])),_:1}))])),_:1})):((0,m.wg)(),(0,m.j4)(g._,{key:1,height:"100%",class:"d-flex flex-column scrolling"},{default:(0,m.w5)((()=>[(0,m._)("div",Aa,[(0,m._)("p",null,(0,k.zw)(n.mastertask.project_code),1),(0,m.Wm)(w.t,{onClick:t[12]||(t[12]=(0,a.iM)((e=>o.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"pb-5"})]),(0,m._)("div",Ua,[(0,m._)("h1",null,(0,k.zw)(n.mastertask.name),1),(0,m._)("div",Za,[n.mastertask.is_finished?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("img",{key:0,class:"icon",src:s(60666),alt:"pencil-icon",onClick:t[13]||(t[13]=(0,a.iM)((e=>n.editMode=!n.editMode),["stop"]))},null,8,Ia)),(0,m._)("img",{class:"icon trash",src:s(27484),alt:"trash-icon",onClick:t[14]||(t[14]=(0,a.iM)((e=>o.openDeleteMasterTaskModal(n.mastertask)),["stop"]))},null,8,Fa)])]),(0,m.Wm)(b.h,{class:"d-flex flex-column modal-content"},{default:(0,m.w5)((()=>[(0,m._)("div",Ha,[(0,m.Wm)(c,{mastertask:n.mastertask},null,8,["mastertask"]),(0,m._)("div",Pa,[(0,m.Wm)(f.T,{class:"button primary",onClick:t[15]||(t[15]=e=>o.toggleIsFinished(n.mastertask))},{default:(0,m.w5)((()=>[(0,m.Uk)((0,k.zw)(n.mastertask.is_finished?"Otvoriť mastertask":"Ukončiť mastertask"),1)])),_:1})]),(0,m.Wm)(h,{subtasks:n.mastertask.subtasks},null,8,["subtasks"]),(0,m._)("div",La,[(0,m.Wm)(f.T,{class:"subtask-btn w-100",onClick:t[16]||(t[16]=e=>o.addTask())},{default:(0,m.w5)((()=>[(0,m.Wm)(w.t,{class:"mx-1",icon:"mdi-plus"}),(0,m.Uk)("Pridať sub task")])),_:1})])])])),_:1})])),_:1}))])),_:1},8,["content"])])),_:1},8,["modelValue"])}var Ya=s(4413);const qa={class:"px-5 py-5"},Ba={key:0,class:"w-25"},Ra={key:1,class:"w-50"},Ka={class:"d-flex align-center"},Ja={class:"employee-selected-avatar d-flex justify-center align-center"},Ga={class:"ml-2 line-clamp"},Xa={key:0,class:"text-light-green"},Qa={key:1},ei={class:"task-action"},ti={class:"d-flex justify-start align-center"},si=["src","onClick"],ai=["src"],ii=["src","onClick"],li=["src","onClick"],ni=["src","onClick"],oi=["src","onClick"];function ri(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(Ya.Y,{class:"mt-7 mb-5"},{default:(0,m.w5)((()=>[(0,m._)("tbody",qa,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.enrichedtasks,(e=>((0,m.wg)(),(0,m.iD)("tr",{key:e.id},[e?.title?((0,m.wg)(),(0,m.iD)("td",Ba,(0,k.zw)(e.title),1)):((0,m.wg)(),(0,m.iD)("td",Ra,(0,k.zw)(e?.master_task),1)),(0,m._)("td",Ka,[(0,m._)("p",Ja,(0,k.zw)(e._employeeInitials),1),(0,m._)("p",Ga,(0,k.zw)(e._employeeFullName),1)]),(0,m._)("td",null,[e.is_finished?((0,m.wg)(),(0,m.iD)("p",Xa,"Ukončený")):(0,m.kq)("",!0),e.is_finished?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("p",Qa,"Neukončený"))]),(0,m._)("td",ei,[(0,m._)("div",ti,["office365"==s.subtasks.type?((0,m.wg)(),(0,m.iD)(m.HY,{key:0},[(0,m._)("img",{class:"pencil-icon ml-2",src:l.eye,alt:"pencil-icon",onClick:(0,a.iM)((t=>n.openTaskModal(e)),["stop"])},null,8,si),(0,m._)("img",{class:"office-icon",src:l.office365},null,8,ai)],64)):((0,m.wg)(),(0,m.iD)(m.HY,{key:1},[e.is_finished?((0,m.wg)(),(0,m.iD)("img",{key:0,class:"pencil-icon is-finished",src:l.checkmark,alt:"checkmark-icon",onClick:(0,a.iM)((t=>n.clickCompleteTask(e)),["stop"])},null,8,ii)):(0,m.kq)("",!0),e.is_finished?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("img",{key:1,class:"pencil-icon",src:l.checkmark,alt:"checkmark-icon",onClick:(0,a.iM)((t=>n.clickCompleteTask(e)),["stop"])},null,8,li)),(0,m._)("img",{class:"pencil-icon ml-2",src:l.eye,alt:"pencil-icon",onClick:(0,a.iM)((t=>n.openTaskModal(e)),["stop"])},null,8,ni),(0,m._)("img",{class:"trash-icon",src:l.bin,alt:"trash-icon",onClick:(0,a.iM)((t=>n.openDeleteTaskModal(e)),["stop"])},null,8,oi)],64))])])])))),128))])])),_:1})}var di=s(65687),ui={props:{subtasks:{type:Array,required:!0}},data(){return{checkmark:di.d2,bin:di.Ly,eye:di.iy,office365:di.QS}},computed:{...(0,U.Se)("tm",["enrichedEmployees"]),enrichedtasks(){return this.subtasks.map((e=>{const t=this.enrichedEmployees.find((t=>t.id==e.employee_id));return{...e,_employeeInitials:t?t._initials:"?",_employeeFullName:t?t._fullName:""}}))}},methods:{openDeleteTaskModal(e){this.$events.emit("show-delete-task-modal",{subtask:e})},openTaskModal(e){this.$events.emit("show-subtask-modal",{subtask:e,editMode:!1})},async clickCompleteTask(e){this.$events.emit("show-complete-task-modal",{subtask:e})}}};const ci=(0,$.Z)(ui,[["render",ri],["__scopeId","data-v-753dec0e"]]);var mi=ci;function hi(e,t,s,a,i,l){const n=(0,m.up)("Z-status"),o=(0,m.up)("Z-deadline"),r=(0,m.up)("Z-created-by"),d=(0,m.up)("Z-team"),u=(0,m.up)("Z-estimated-duration"),c=(0,m.up)("Z-planned-time"),h=(0,m.up)("Z-remaining-time"),p=(0,m.up)("Z-spent-time"),v=(0,m.up)("Z-description"),k=(0,m.up)("Z-files");return(0,m.wg)(),(0,m.iD)(m.HY,null,[(0,m.Wm)(n,{status:s.mastertask.is_finished},null,8,["status"]),(0,m.Wm)(o,{deadline:s.mastertask.deadline},null,8,["deadline"]),(0,m.Wm)(r,{"employee-id":s.mastertask.created_by},null,8,["employee-id"]),(0,m.Wm)(d,{team:s.mastertask.team,employees:s.mastertask._allEmployees||s.mastertask.employees},null,8,["team","employees"]),(0,m.Wm)(u,{hours:s.mastertask.estimated_duration},null,8,["hours"]),(0,m.Wm)(c,{hours:s.mastertask.duration},null,8,["hours"]),(0,m.Wm)(h,{hours:s.mastertask.duration-s.mastertask.time_worked},null,8,["hours"]),(0,m.Wm)(p,{hours:s.mastertask.time_worked,"is-exceeded":s.mastertask.time_worked>s.mastertask.duration},null,8,["hours","is-exceeded"]),(0,m.Wm)(v,{description:s.mastertask.description},null,8,["description"]),(0,m.Wm)(k,{files:s.mastertask.files},null,8,["files"])],64)}const pi={class:"d-flex align-center"},vi=(0,m._)("p",{class:"mx-3"},"Deadline",-1);function ki(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",pi,[(0,m.Wm)(w.t,{icon:"mdi-calendar-week",size:"large"}),vi])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("p",{class:(0,k.C_)(""+(i.tmUtils.isAfter(s.deadline)?"text-black":"text-red-darken-4"))},(0,k.zw)(i.tmUtils.formatDateTime(s.deadline)),3)])),_:1})])),_:1})])),_:1})}var fi={props:{deadline:{type:String,required:!0}},data(){return{tmUtils:A.Z}}};const gi=(0,$.Z)(fi,[["render",ki]]);var bi=gi;const _i={key:0,class:"px-5 py-5 border-bottom"},wi=(0,m._)("p",null,"Popis zadania",-1),yi=["innerHTML"],Di={key:1,class:"px-5 py-5 border-bottom"},Mi=(0,m._)("p",null,"Popis mastertasku",-1),Ti=["innerHTML"];function $i(e,t,s,a,i,l){return(0,m.wg)(),(0,m.iD)(m.HY,null,[s.description?((0,m.wg)(),(0,m.iD)("div",_i,[wi,(0,m._)("section",{innerHTML:i.preparedDescription,class:"description-detail px-2 py-2 w-100 rounded mt-2"},null,8,yi)])):(0,m.kq)("",!0),s.inheritedDescription?((0,m.wg)(),(0,m.iD)("div",Di,[Mi,(0,m._)("section",{innerHTML:i.preparedInheritedDescription,class:"description-detail px-2 py-2 w-100 rounded mt-2"},null,8,Ti)])):(0,m.kq)("",!0)],64)}var Ci={props:{description:{type:String||null,default:()=>null},inheritedDescription:{type:String||null,default:()=>null}},data(){return{copiedIndices:[],preparedDescription:"",preparedInheritedDescription:""}},mounted(){this.preparedDescription=Ms(this.description),this.preparedInheritedDescription=Ms(this.inheritedDescription)}};const ji=(0,$.Z)(Ci,[["render",$i]]);var Ei=ji;const xi={class:"d-flex align-center"},Wi=(0,m._)("p",{class:"mx-3"},"Naplánovaný čas",-1);function Si(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",xi,[(0,m.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),Wi])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("p",null,(0,k.zw)(s.hours)+" h",1)])),_:1})])),_:1})])),_:1})}var Oi={props:{hours:{type:Number,required:!0}}};const Vi=(0,$.Z)(Oi,[["render",Si]]);var zi=Vi;const Ai={class:"d-flex align-center"},Ui=(0,m._)("p",{class:"mx-3"},"Zostávajúci čas",-1);function Zi(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center border-bottom"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",Ai,[(0,m.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),Ui])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("p",null,(0,k.zw)(s.hours)+" h",1)])),_:1})])),_:1})])),_:1})}var Ii={props:{hours:{type:Number,required:!0}}};const Fi=(0,$.Z)(Ii,[["render",Zi]]);var Hi=Fi;const Pi={class:"d-flex align-center"},Li=(0,m._)("p",{class:"mx-3"},"Odpracovaný čas",-1);function Ni(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":""},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",Pi,[(0,m.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),Li])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("p",{class:(0,k.C_)(s.isExceeded?"text-red-darken-4":"text-black")},(0,k.zw)(s.hours)+" h",3)])),_:1})])),_:1})])),_:1})}var Yi={props:{hours:{type:Number,required:!0},isExceeded:{type:Boolean,required:!0}}};const qi=(0,$.Z)(Yi,[["render",Ni]]);var Bi=qi;const Ri={class:"d-flex align-center"},Ki=(0,m._)("p",{class:"mx-3"},"Status",-1),Ji={key:0,class:"status-badge px-4 py-2 rounded-pill"},Gi={key:1,class:"status-badge px-4 py-2 rounded-pill"};function Xi(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",Ri,[(0,m.Wm)(w.t,{icon:"mdi-drag-vertical",size:"large"}),Ki])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[1==s.status?((0,m.wg)(),(0,m.iD)("p",Ji,"Ukončený")):0==s.status?((0,m.wg)(),(0,m.iD)("p",Gi,"Neukončený")):(0,m.kq)("",!0)])),_:1})])),_:1})])),_:1})}var Qi={props:{status:{type:Number,required:!0}}};const el=(0,$.Z)(Qi,[["render",Xi]]);var tl=el;const sl={class:"d-flex align-center"},al=(0,m._)("p",{class:"mx-3"},"Tím",-1),il={class:"task-badge px-4 py-2 rounded-pill flex-shrink-0"},ll={class:"employee-selected-avatar d-flex justify-center align-center"},nl={class:"ml-2"},ol=(0,m._)("div",{class:"mb-4"},null,-1),rl=(0,m._)("p",{class:"task-badge px-4 py-2 rounded-pill flex-shrink-0"},"Nepriradený",-1),dl={class:"employee-selected-avatar d-flex justify-center align-center"},ul={class:"ml-2"};function cl(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":""},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",sl,[(0,m.Wm)(w.t,{icon:"mdi-account-multiple-outline",size:"large"}),al])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3 d-flex flex-wrap flex-column"},{default:(0,m.w5)((()=>[s.team?((0,m.wg)(),(0,m.iD)(m.HY,{key:0},[(0,m._)("p",il,(0,k.zw)(s.team.name),1),((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(l.enrichedEmployeesInTeam,(e=>((0,m.wg)(),(0,m.iD)("div",{class:"d-flex align-center flex-shrink-0 mt-2 task-badge px-4 py-2 rounded-pill",key:e.id},[(0,m._)("p",ll,(0,k.zw)(e._initials),1),(0,m._)("p",nl,(0,k.zw)(e._fullName),1)])))),128)),ol],64)):(0,m.kq)("",!0),rl,((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(l.enrichedEmployeesOutsideTeam,(e=>((0,m.wg)(),(0,m.iD)("div",{class:"d-flex align-center flex-shrink-0 mt-2 task-badge px-4 py-2 rounded-pill",key:e.id},[(0,m._)("p",dl,(0,k.zw)(e._initials),1),(0,m._)("p",ul,(0,k.zw)(e._fullName),1)])))),128))])),_:1})])),_:1})])),_:1})}var ml={props:{team:{type:Object,required:!1},employees:{type:Array,required:!0}},computed:{enrichedEmployeesInTeam(){return this.team?.employees?A.Z.enrichEmployees(this.team.employees):[]},enrichedEmployeesOutsideTeam(){if(!this.team)return A.Z.enrichEmployees(this.employees);const e=this.employees.filter((e=>!this.team.employees.find((t=>t.id==e.id))));return A.Z.enrichEmployees(e)}}};const hl=(0,$.Z)(ml,[["render",cl]]);var pl=hl;const vl={class:"d-flex align-center"},kl=(0,m._)("p",{class:"mx-3"},"Nacenené hodiny",-1);function fl(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(Oe.o,{"no-gutters":"",class:"align-center"},{default:(0,m.w5)((()=>[(0,m.Wm)(Ve.D,{cols:"5"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("div",vl,[(0,m.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),kl])])),_:1})])),_:1}),(0,m.Wm)(Ve.D,{cols:"7"},{default:(0,m.w5)((()=>[(0,m.Wm)(ze.C,{class:"py-3"},{default:(0,m.w5)((()=>[(0,m._)("p",null,(0,k.zw)(s.hours||0)+" h",1)])),_:1})])),_:1})])),_:1})}var gl={props:{hours:{type:[Number,void 0]}}};const bl=(0,$.Z)(gl,[["render",fl]]);var _l=bl,wl={components:{ZCreatedBy:Mt,ZDeadline:bi,ZDescription:Ei,ZFiles:Is,ZPlannedTime:zi,ZRemainingTime:Hi,ZSpentTime:Bi,ZStatus:tl,ZTeam:pl,ZEstimatedDuration:_l},props:{mastertask:{type:Object,required:!0}}};const yl=(0,$.Z)(wl,[["render",hi]]);var Dl=yl,Ml=s(15941),Tl={emits:["master-task-edited","close"],mixins:[Qe,et,Z.Z,M],components:{AMastertaskDescription:Dl,ATasksTable:mi,Datepicker:De.Z,ZFilesUpload:Se,QuillEditor:r.Bn},data(){return{deadline:null,editMode:!1,visible:!1,errorUtils:z.Z,v$:(0,O.ZP)(),mastertask:null,isSaving:!1,showAddEmployeeInput:!1,date:null,projectCodeSearch:null}},computed:{...(0,U.Se)("tm",["teams","projects","enrichedEmployees"]),enrichedSubtasks(){return this.mastertask?.subtasks?this.mastertask.subtasks.map((e=>{const t=this.enrichedEmployees.find((t=>t.id==e.employee_id));return{...e,_initials:t?t.name.charAt(0)+t.surname.charAt(0):"?",_fullName:t?`${t.name} ${t.surname}`:""}})).filter((e=>null!==e)):null}},validations(){const e=e=>!!(e&&e.length&&e.replace(/<[^>]*>/g,"").length);return{mastertask:{employees:{required:V.C1,minLength:(0,V.Ei)(1),$each:{duration:{required:V.C1}}},project_id:{required:V.C1},name:{required:V.C1},description:{quillEditorRequired:e},deadline:{required:V.C1},estimated_duration:{required:V.C1},_deadline_time:{required:V.C1}}}},mounted(){this.$events.on("close-both-modals",this.closeBothModals),this.$events.on("master-task:team-member-deleted",(({teamId:e,memberId:t})=>{this.mastertask.team_id==e&&(this.mastertask.employees=this.mastertask.employees.filter((e=>e.id!=t)))})),this.$events.on("on-mastertask-deleted",(e=>{e?.id==this.mastertask?.id&&this.closeModal()})),this.$events.on("on-subtask-deleted",(e=>{this.mastertask&&(this.mastertask.subtasks=this.mastertask.subtasks.filter((t=>t.id!=e.id)))})),this.$events.on("on-subtask-edited",(e=>{this.mastertask?.subtasks&&(this.mastertask.subtasks.find((t=>t.id==e.id))?this.mastertask.subtasks=this.mastertask.subtasks.map((t=>t.id==e.id?e:t)):this.mastertask.subtasks.push(e))}))},beforeUnmount(){this.$events.off("on-mastertask-deleted"),this.$events.off("on-subtask-deleted"),this.$events.off("on-subtask-edited"),this.$events.off("master-task:team-member-deleted"),this.$events.off("close-both-modals",this.closeBothModals)},methods:{closeBothModals(){this.$emit("close"),this.visible=!1},removeEmployee({id:e}){this.mastertask.employees=this.mastertask.employees.filter((t=>t.id!=e))},removeMemberAlert(e){const t=this.mastertask.team;this.$events.emit("show-delete-team-member-modal",{member:e,team:t})},async loadMastertask(e){try{this.mastertask=await this.$axios.get_auth_data(`v1/mastertasks/${e}`);const t=this.projects.find((e=>e.code==this.mastertask.project_code));this.mastertask.project_id=t?.id||null,this.mastertask.team_id=this.mastertask.team?.id||null,this.mastertask._allEmployees=this.mastertask.subtasks.map((({employee_id:e,duration:t})=>{const s=this.enrichedEmployees.find((({id:t})=>t==e));return s?(s.duration=t,s):null})).filter((e=>null!==e))}catch(t){this.$toast.error(t.message||t)}},async showModal({mastertask:e,editMode:t=!1}){this.isSaving=!1,this.editMode=null,this.visible=!0,this.mastertask=null,this.$nextTick((()=>{this.setFocusEvent(),this.v$.$reset()}));try{if(e?.id)await this.loadMastertask(e.id);else{const e=localStorage.getItem("mastertaskData");try{if(!e)throw new Error("mastertaskData is null or undefined");{const t=JSON.parse(e);if(this.mastertask=t,"object"!==typeof this.mastertask||null===this.mastertask)throw new Error("Parsed mastertask is not an object");this.$nextTick((()=>{this.$refs["description"]?.setHTML(this.mastertask.description||"")}))}}catch(s){Ml.error("Error parsing mastertaskData:",s),this.mastertask={employees:[],duration:0,_deadline_time:"17:00"}}}this.editMode=t||!this.mastertask.id}catch(s){this.$toast.error(s.message||s)}},toggleIsFinished(){this.$events.emit("show-complete-master-task-modal",{mastertask:this.mastertask})},async save(){this.mastertask.id&&(this.mastertask.employees=this.mastertask.employees.map((e=>{const{duration:t}=this.mastertask.subtasks.find((({employee_id:t})=>t==e.id))||{};return e.duration=t,e})));const e=await this.v$.$validate(),t=await this._validateEmployees();if(e&&t){this.$refs["description"]&&(this.mastertask.description=this.$refs["description"].getHTML()),this._mergeDeadlineTimeDate();try{this.isSaving=!0,this.mastertask.deadline=Re()(this.mastertask.deadline).format("YYYY-MM-DD HH:MM:SS"),this.mastertask.id?await this.$axios.patch_auth_form(`v1/mastertasks/${this.mastertask.id}`,this.mastertask):await this.$axios.post_auth_data("v1/mastertasks",this.mastertask),localStorage.removeItem("mastertaskData"),this.$emit("master-task-edited",this.mastertask),this.closeModal()}catch(s){this.$toast.error(this.$parseError(s))}finally{this.isSaving=!1}}},filesUploaded(e){this.mastertask.files=e},closeModal(){this.visible=!1},openDeleteMasterTaskModal(e){this.$events.emit("show-delete-master-task-modal",{mastertask:e})},addTask(){this.$events.emit("show-subtask-modal",{subtask:{master_task_id:this.mastertask.id,project_code:this.mastertask.project_code}})},onQuillEditorInput(){this.mastertask.description=this.$refs["description"].getHTML()},_mergeDeadlineTimeDate(){const e=new Date(this.mastertask.deadline);Ml.log("z-master-task-modal",this.subtask);const t=this.mastertask._deadline_time.split(":");e.setHours(parseInt(t[0])),e.setMinutes(parseInt(t[1])),this.mastertask.deadline=e},_validateEmployees(){let e=!0;return this.mastertask.employees=this.mastertask.employees.map((t=>(t.duration||(t.invalid=!0,e=!1),t))),e}},watch:{editMode(){this.$nextTick((()=>{if(this.$refs["description"]?.setHTML(this.mastertask.description||""),!this.mastertask?.id)return;const e=new Date(this.mastertask.deadline),t=e.getHours(),s=e.getMinutes();this.mastertask._deadline_time=`${t.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`}))},mastertask:{handler(e){this.editMode&&!this.mastertask?.id&&localStorage.setItem("mastertaskData",JSON.stringify(e))},deep:!0},"mastertask.team_id":{handler(e,t){if(this.editMode&&!e&&t){const e=this.teams.find((e=>e.id==t))?.employees.map((e=>e?.id))||[],s=this.mastertask.employees.filter((t=>!e.includes(t?.id)));this.mastertask.employees=s}},deep:!0},"$route.query":{handler(e,t){t?.subtask?.length&&this.mastertask?.id&&this.loadMastertask(this.mastertask.id)},deep:!0}}};const $l=(0,$.Z)(Tl,[["render",Na],["__scopeId","data-v-4b1eca40"]]);var Cl=$l,jl=s(41888),El=s(89234);const xl=(0,m._)("h1",{class:"text-h5"}," Chcete túto osobu odstrániť z tímu? ",-1);function Wl(e,t,s,a,i,l){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:i.visible,"onUpdate:modelValue":t[2]||(t[2]=e=>i.visible=e),"max-width":"500",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[xl,(0,m.Wm)(jl.Z,null,{default:(0,m.w5)((()=>[(0,m.Uk)((0,k.zw)(i.member.name+" "+i.member.surname)+" bude odstránený/á z teamu.",1)])),_:1}),(0,m.Wm)(b.h,null,{default:(0,m.w5)((()=>[(0,m.Wm)(f.T,{class:"button secondary",variant:"text",onClick:t[0]||(t[0]=e=>l.closeModal())},{default:(0,m.w5)((()=>[(0,m.Uk)(" Zrušiť ")])),_:1}),(0,m.Wm)(El.C),(0,m.Wm)(f.T,{class:"button primary",variant:"text",onClick:t[1]||(t[1]=e=>l.deleteMember())},{default:(0,m.w5)((()=>[(0,m.Uk)(" Áno ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var Sl={mixins:[M],data(){return{visible:!1,member:null,team:null}},methods:{async showModal({member:e,team:t}){this.member=e,this.team=t,this.visible=!0},closeModal(){this.visible=!1},async deleteMember(){this.team.employees=[...this.team.employees].filter((e=>e.id!==this.member.id));try{if(this.team.id){const{team:e}=await this.$axios.put_auth(`v1/teams/${this.team.id}`,this.team);this.$store.commit("tm/update_team",e)}else{const{team:e}=await this.$axios.post_auth("v1/teams",this.team);this.$store.commit("tm/save_team",e)}this.$events.emit("master-task:team-member-deleted",{teamId:this.team.id,memberId:this.member.id}),this.closeModal()}catch(e){this.$toast.error(this.$parseError(e))}},_enrichTeam(e){return e.employees=A.Z.enrichEmployees(e.employees),e}}};const Ol=(0,$.Z)(Sl,[["render",Wl]]);var Vl=Ol;const zl={class:"d-flex justify-space-between align-center"},Al=(0,m._)("h1",null,"Vytvoriť",-1);function Ul(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",zl,[Al,(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m.Wm)(b.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,m.w5)((()=>[(0,m.Wm)(f.T,{class:"button primary half outline",onClick:t[1]||(t[1]=(0,a.iM)((e=>n.createTask()),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("SUB TASK")])),_:1}),(0,m.Wm)(f.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.createBlocker()),["stop"]))},{default:(0,m.w5)((()=>[(0,m.Uk)("BLOCKER")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var Zl={emits:["update","data"],props:["data"],mixins:[M],data(){return{visible:!1,localData:null}},mounted(){this.$events.on("blocker-created",(()=>{this.closeModal()})),this.$events.on("task-created",(()=>{this.closeModal()}))},methods:{async showModal(e){this.localData=e,this.visible=!0},closeModal(){this.visible=!1},createTask(){this.$events.emit("show-subtask-modal",{subtask:{deadline:this.localData.date,_deadline_time:this.localData.time,employee_id:this.localData.employee},onTaskCreated:()=>{this.closeModal()}})},createBlocker(){this.$events.emit("show-blocker-modal",{blocker:{starts_at_time:this.localData.time,datepicker:this.localData.date,employee_id:this.localData.employee},onBlockerCreated:()=>{this.closeModal()}})}}};const Il=(0,$.Z)(Zl,[["render",Ul]]);var Fl=Il;const Hl={class:"d-flex justify-space-between align-center"},Pl={key:0},Ll={key:1};function Nl(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[1]||(t[1]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",Hl,["edit"===s.mode?((0,m.wg)(),(0,m.iD)("h1",Pl,"Sub Task zosynchronizovaný z Office365 sa nedá upravovat. Upravte ho vo svojom kalendári a pockajte na zosynchronizovanie s Task Managerom")):"delete"===s.mode?((0,m.wg)(),(0,m.iD)("h1",Ll,"Sub Task zosynchronizovaný z Office365 sa nedá zmazať. Zmažte ho vo svojom kalendári a pockajte na zosynchronizovanie s Task Managerom")):(0,m.kq)("",!0),(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})])])),_:1})])),_:1},8,["modelValue"])}var Yl=s(15941),ql={mixins:[M],emits:["close","on-subtask-edited"],props:{mode:{type:String,default:"edit"}},data(){return{visible:!1,subtask:null}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0},async complete(){Yl.log("complete")},closeModal(){this.visible=!1}}};const Bl=(0,$.Z)(ql,[["render",Nl]]);var Rl=Bl;const Kl=e=>((0,m.dD)("data-v-3c7fa7bc"),e=e(),(0,m.Cn)(),e),Jl={class:"d-flex justify-space-between align-center"},Gl=Kl((()=>(0,m._)("h1",null,"Sub Task má nedokončené úlohy",-1))),Xl={class:"card-content"},Ql={class:"card-actions"};function en(e,t,s,i,l,n){return(0,m.wg)(),(0,m.j4)(_.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,m.w5)((()=>[(0,m.Wm)(g._,null,{default:(0,m.w5)((()=>[(0,m._)("div",Jl,[Gl,(0,m.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,m._)("div",Xl,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(l.subtask?.timeblocks,(e=>((0,m.wg)(),(0,m.iD)("div",{key:e.id,class:"d-flex align-center mb-3"},[(0,m._)("p",{class:(0,k.C_)(["task-badge rounded-pill",{"strike-through":e.is_finished}])},(0,k.zw)(l.tmUtils.formatDateTime(e.start))+" - "+(0,k.zw)(l.tmUtils.formatDateTime(e.end)),3),(0,m.Wm)(w.t,{onClick:(0,a.iM)((t=>n.handleFinishTimeblock(e)),["stop"]),class:(0,k.C_)(["finish-icon circle-border cursor-pointer ml-2",{disabled:l.loadingTimeblocks[e.id]||l.loadingCloseAll,finished:e.is_finished}]),icon:"mdi-check",size:"medium"},null,8,["onClick","class"])])))),128))]),(0,m._)("div",Ql,[(0,m.Wm)(f.T,{onClick:t[1]||(t[1]=e=>n.closeModal()),class:"button secondary"},{default:(0,m.w5)((()=>[(0,m.Uk)("Zrušiť")])),_:1}),(0,m.Wm)(f.T,{onClick:t[2]||(t[2]=e=>n.handleFinishAllTimeblocks()),loading:l.loadingCloseAll,class:"button primary"},{default:(0,m.w5)((()=>[(0,m.Uk)("Uzatvoriť všetky")])),_:1},8,["loading"])])])),_:1})])),_:1},8,["modelValue"])}var tn=s(15941),sn={mixins:[M],emits:["close","on-subtask-edited"],props:{mode:{type:String,default:"edit"}},data(){return{tmUtils:A.Z,visible:!1,subtask:null,loadingTimeblocks:{},loadingCloseAll:!1}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0},async complete(){tn.log("complete")},closeModal(){this.visible=!1},async handleFinishTimeblock(e){const t=JSON.parse(JSON.stringify(this.subtask));try{this.loadingTimeblocks[e.id]=!0,await this.$axios.put_auth(`v1/timeblocks/${e.id}`,{...e,is_finished:1}),e.is_finished=1;const s=t.timeblocks.every((e=>e.is_finished));s&&(await this._finishSubtask(),this.$store.dispatch("tm/removeOngoingSubtask",this.subtask.id)),this.$events.emit("on-subtask-edited",t),this.closeModal()}catch(s){this.$toast.error(s.message||s)}finally{this.loadingTimeblocks[e.id]=!1}},async handleFinishAllTimeblocks(){this.loadingCloseAll=!0;try{const e=this.subtask.timeblocks.map((e=>this.$axios.put_auth(`v1/timeblocks/${e.id}`,{...e,is_finished:1})));await Promise.all(e),this.subtask.timeblocks=this.subtask.timeblocks.map((e=>(e.is_finished=1,e))),await this._finishSubtask(),this.$store.dispatch("tm/removeOngoingSubtask",this.subtask.id),this.$events.emit("on-subtask-edited",this.subtask),this.closeModal()}catch(e){this.$toast.error(e.message||e)}finally{this.loadingCloseAll=!1}},async _finishSubtask(){const e={...this.subtask,is_finished:1,timesheets:this.subtask.timesheets.map((e=>(delete e.employee_name,e)))};return this.$axios.put_auth(`v1/subtasks/${e.id}`,e)}}};const an=(0,$.Z)(sn,[["render",en],["__scopeId","data-v-3c7fa7bc"]]);var ln=an,nn={components:{ZDeleteTeamModal:j,ZTeamModal:P,ZDeleteTaskModal:B,ZDeleteBlockerModal:ia,ZTaskModal:Qs,ZMasterTaskModal:Cl,ZCompleteTaskModal:da,ZTaskAddTimeModal:_a,ZBlockerModal:Ta,ZDeleteMasterTaskModal:xa,ZDeleteTeamMemberModal:Vl,ZShowMenuModal:Fl,ZCompleteMasterTaskModal:pa,ZDeleteTimeBlockModal:ee,ZUnableToEditOfficeTaskModal:Rl,ZUnableToCompleteTaskModal:ln},mounted(){this.$events.on("show-menu-modal",(e=>{this.$refs["z-show-menu-modal"].showModal(e)})),this.$events.on("show-delete-team-modal",(({team:e})=>{this.$refs["z-delete-team-modal"].showModal({team:e})})),this.$events.on("show-team-modal",(({team:e})=>{this.$refs["z-team-modal"].showModal({team:e})})),this.$events.on("show-delete-task-modal",(({subtask:e})=>{this.$refs["z-delete-task-modal"].showModal({subtask:e})})),this.$events.on("show-delete-timeblock-modal",(({subtask:e})=>{this.$refs["z-delete-timeblock-modal"].showModal({subtask:e})})),this.$events.on("show-delete-blocker-modal",(({blocker:e})=>{this.$refs["z-delete-blocker-modal"].showModal({blocker:e})})),this.$events.on("show-delete-master-task-modal",(({mastertask:e})=>{this.$refs["z-delete-master-task-modal"].showModal({mastertask:e})})),this.$events.on("show-delete-team-member-modal",(({member:e,team:t})=>{this.$refs["z-delete-team-member-modal"].showModal({member:e,team:t})})),this.$events.on("show-subtask-modal",(({subtask:e,editMode:t,mastertask:s})=>{if(e&&e.id){const t=e.id;this.$router.push({query:{subtask:t}})}this.$refs["z-task-modal"].showModal({subtask:e,editMode:t,mastertask:s})})),this.$events.on("show-mastertask-modal",(({mastertask:e,editMode:t})=>{if(e&&e.id){const t=e.id;this.$router.push({query:{mastertask:t}})}this.$refs["z-master-task-modal"].showModal({mastertask:e,editMode:t})})),this.$events.on("show-complete-task-modal",(({subtask:e})=>{this.$refs["z-complete-task-modal"].showModal({subtask:e})})),this.$events.on("show-complete-master-task-modal",(({mastertask:e})=>{this.$refs["z-complete-master-task-modal"].showModal({mastertask:e})})),this.$events.on("show-blocker-modal",(({blocker:e={}})=>{this.$refs["z-blocker-modal"].showModal({blocker:e})})),this.$events.on("show-task-add-time-modal",(({subtask:e})=>{this.$refs["z-task-add-time-modal"].showModal({subtask:e})})),this.$events.on("on-subtask-edited",(()=>{this.$store.dispatch("tm/reloadSubtasks")})),this.$events.on("on-mastertask-edited",(()=>{this.$store.dispatch("tm/reloadMastertasks")})),this.$events.on("on-mastertask-deleted",(()=>{this.$store.dispatch("tm/reloadMastertasks")})),this.$events.on("show-unable-to-edit-office-task-modal",(({mode:e})=>{this.$refs["z-unable-to-edit-office-task-modal"].showModal({mode:e})})),this.$events.on("show-unable-to-complete-task-modal",(({subtask:e})=>{this.$refs["z-unable-to-complete-task-modal"].showModal({subtask:e})})),this._showModalsAfterInicialization()},methods:{onTeamUpdate(e){this.$events.emit("on-team-update",e)},onTaskDeleted(e){this.$events.emit("on-subtask-deleted",e)},onBlockerDeleted(e){this.$events.emit("on-blocker-deleted",e)},onTaskEdited(e){this.$events.emit("on-subtask-edited",e)},onMasterTaskDeleted(e){this.$events.emit("on-mastertask-deleted",e)},onMasterTaskEdited(e){this.$events.emit("on-mastertask-edited",e)},_showModalsAfterInicialization(e=0){setTimeout((()=>e>50?this.$router.push({name:this.$route.name}):this.$store.getters["tm/isInitialized"]?this.$route.query["mastertask"]?this.$events.emit("show-mastertask-modal",{mastertask:{id:this.$route.query["mastertask"]},editMode:!1}):this.$route.query["subtask"]?this.$events.emit("show-subtask-modal",{subtask:{id:this.$route.query["subtask"]},editMode:!1}):void 0:this._showModalsAfterInicialization(e+1)),300)}}};const on=(0,$.Z)(nn,[["render",v]]);var rn=on,dn=s(22483),un=(0,U.MT)({state:{},getters:{},mutations:{},actions:{},modules:{}});const cn=[{path:"",redirect:"/auth"},{path:"/auth/",component:()=>s.e(9033).then(s.bind(s,99033)),children:[{path:"",redirect:"/auth/login"},{path:"/auth/login",name:"Login",component:()=>s.e(1097).then(s.bind(s,21097)),meta:{requiresAuth:!1}},{path:"/auth/forgot-password",name:"Forgot password",component:()=>s.e(924).then(s.bind(s,40924)),meta:{requiresAuth:!1}},{path:"/auth/forgot-success",name:"Forgot success",component:()=>s.e(8731).then(s.bind(s,28731)),meta:{requiresAuth:!1}},{path:"/auth/reset-password",name:"Reset password",component:()=>s.e(4518).then(s.bind(s,54518)),meta:{requiresAuth:null}}]},{path:"/app",component:()=>s.e(2612).then(s.bind(s,32612)),children:[{path:"",redirect:"/app/dashboard"},{path:"/app/dashboard",redirect:"/app/dashboard/tasks",children:[{path:"/app/dashboard/tasks",name:"Dashboard - Tasks",meta:{title:"Sub Tasks",requiresAuth:!0},component:()=>Promise.all([s.e(4578),s.e(8059)]).then(s.bind(s,53440))},{path:"/app/dashboard/teams",name:"Dashboard - Teams",meta:{title:"Teams Overview",requiresAuth:!0},component:()=>Promise.all([s.e(4578),s.e(5456)]).then(s.bind(s,63124))},{path:"/app/dashboard/projects",name:"Dashboard - Projects",meta:{title:"Projects overview",requiresAuth:!0},component:()=>s.e(3862).then(s.bind(s,3862))},{path:"/app/overview/unscheduled",name:"Overview - Unscheduled tasks",meta:{title:"Unscheduled Sub Tasks",requiresAuth:!0},component:()=>s.e(9407).then(s.bind(s,89407))},{path:"/app/overview/ongoing",name:"Overview - Ongoing tasks",meta:{title:"Ongoing Sub Tasks",requiresAuth:!0},component:()=>s.e(2885).then(s.bind(s,72885))},{path:"/app/overview/teams",name:"Overview - Teams",meta:{title:"Teams",requiresAuth:!0},component:()=>s.e(7073).then(s.bind(s,97073))},{path:"/app/dashboard/user",name:"Dashboard - User",meta:{title:"Profile",requiresAuth:!0},component:()=>s.e(907).then(s.bind(s,20907))},{path:"/app/search",name:"Search",meta:{title:"Search Results",requiresAuth:!0},component:()=>s.e(4392).then(s.bind(s,44392))}]}]},{path:"/:catchAll(.*)",name:"404",component:()=>s.e(188).then(s.bind(s,60188)),meta:{requiresAuth:null}}],mn=(0,dn.p7)({history:(0,dn.r5)("/"),routes:cn});mn.beforeEach(((e,t,s)=>{const a=un.getters["auth/isLoggedIn"];return!0===e.meta.requiresAuth?a?s():s({name:"Login"}):!1===e.meta.requiresAuth&&a?s({name:"Dashboard - Tasks"}):s()}));var hn=mn,pn=s(34311),vn=s(15941);pn.Z.defaults.baseURL="https://tm.jandl.sk/api/";var kn={async get(e,t){return pn.Z.get(e,t).then((e=>e.data)).catch((e=>Promise.reject(e)))},async get_auth(e,t){return t=this._config(t),pn.Z.get(e,t).then((e=>e.data)).catch((e=>Promise.reject(e)))},async get_data(e,t){return pn.Z.get(e,t).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async get_auth_data(e,t){return t=this._config(t),pn.Z.get(e,t).then((e=>Promise.resolve(e.data.data))).catch((e=>Promise.reject(e.response||e)))},async post(e,t=null,s){return pn.Z.post(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async post_auth(e,t=null,s){return s=this._config(s),pn.Z.post(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async post_data(e,t=null,s){return pn.Z.post(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async post_auth_data(e,t=null,s){return s=this._config(s),pn.Z.post(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async delete(e,t){return pn.Z["delete"](e,t).then((e=>e.data)).catch((e=>Promise.reject(e)))},async delete_auth(e,t){return t=this._config(t),pn.Z["delete"](e,t).then((e=>e.data)).catch((e=>Promise.reject(e)))},async delete_data(e,t){return pn.Z["delete"](e,t).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async delete_auth_data(e,t){return t=this._config(t),pn.Z["delete"](e,t).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async patch(e,t=null,s){return pn.Z.patch(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async patch_auth(e,t=null,s){return s=this._config(s),pn.Z.patch(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async patch_data(e,t=null,s){return pn.Z.patch(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async patch_auth_data(e,t=null,s){return s=this._config(s),pn.Z.patch(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async put(e,t=null,s){return pn.Z.put(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async put_auth(e,t=null,s){return s=this._config(s),pn.Z.put(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async put_data(e,t=null,s){return pn.Z.put(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async put_auth_data(e,t=null,s){return s=this._config(s),pn.Z.put(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},_config(e){return e&&vn.error("NOT IMPLEMENTED"),un.getters["auth/token"]?{headers:{Authorization:`Bearer ${un.getters["auth/token"]}`}}:{headers:{}}}},fn={install:(e,t)=>{t&&!0===t.disabled||(e.config.globalProperties.$axios=kn)}},gn=s(82482);const bn=e=>Object.entries(e).map((e=>e.map(encodeURIComponent).join("="))).join("&");function _n(e){let t=e;return t=t.replace(/\//g,"\\/"),t=t.replace(/\./g,"\\."),t=t.replace(/\([^)]+\)/g,"[^/]+"),t}var wn=s(15941);class yn{constructor(){(0,gn.Z)(this,"_mocks",{}),pn.Z.interceptors.request.use(this._redirectRequestToMock.bind(this)),this._mocks={}}mock(e){for(const t in e){let s=e[t];!1!==s&&(s={},s.name=t,s.url=t.split(" ")[1],s.reUrl||(s.reUrl=_n(s.url)),s.matchMethod||(s.matchMethod=t.split(" ")[0].toLowerCase()),this._mocks[t]=s)}}_redirectRequestToMock(e){const t=e.url.replace(/https?:\/\/[^/?]+/,"");let s;for(const a in this._mocks){const i=this._mocks[a];if(e.method==i.matchMethod&&t.match(i.reUrl)){s=i;break}}if(s){s.fname||(s.fname={VUE_APP_WAXIOS_URL:"https://tm.jandl.sk/api/",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_PLATFORM?`/mock/${{VUE_APP_WAXIOS_URL:"https://tm.jandl.sk/api/",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_PLATFORM}/${s.url}.${e.method.toUpperCase()}.json`:`/mock/${s.url}.${e.method.toUpperCase()}.json`),wn.log(s.fname=`/mock/${s.url}.${e.method.toUpperCase()}.json`);const t={method:"get",url:window.location.origin+s.fname+"?___MOCK___&"+bn(e.data||{})};e={...e,...t}}return e}}var Dn={install:(e,t)=>{const s=new yn;t&&t.routes&&Object.values(t.routes).length&&!0!==t.disabled&&s.mock(t.routes)}},Mn=s(8069),Tn={install:(e,t)=>{if(t&&!0===t.disabled)return;const s=(0,Mn.Z)();e.config.globalProperties.$events=s}},$n=s(44870),Cn=s(5658),jn=s(31310),En=s(15941);class xn{constructor(e){(0,gn.Z)(this,"currentLanguage",(0,$n.iH)()),(0,gn.Z)(this,"availableLanguages",void 0),(0,gn.Z)(this,"vendorI18n",void 0),(0,gn.Z)(this,"defaultLanguage",void 0),(0,gn.Z)(this,"languageKey",void 0),(0,gn.Z)(this,"_missingTranslation",((e,t,s,a)=>t)),(0,gn.Z)(this,"_postTranslation",(e=>e)),this.availableLanguages=e.languages||[],this.defaultLanguage=e.languages.find((t=>t.value==e.defaultLanguage)),this.languageKey=e.languageKey||{VUE_APP_WAXIOS_URL:"https://tm.jandl.sk/api/",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_PLATFORM+"_language"||0,this.vendorI18n=(0,Cn.o)({legacy:!0,fallbackLocale:this.defaultLanguage.value,messages:this._loadLocaleMessages(),missing:this._missingTranslation,postTranslation:this._postTranslation}),this.changeLanguage({title:"Slovenský",flag:"sk",value:"sk"}),this.initCurrentLanguage()}async initCurrentLanguage(){const{value:e}=await jn.u.get({key:this.languageKey});if(e)this.currentLanguage.value=JSON.parse(e);else if(this.defaultLanguage)this.currentLanguage.value=this.defaultLanguage;else{if(!this.availableLanguages[0])return En.error("[w18n] Could not init current language");this.currentLanguage.value=this.availableLanguages[0]}const t={};this.availableLanguages.forEach((e=>{t[e.value]=e.title})),this.changeLanguage(this.currentLanguage.value),this._addAxiosHeaders()}changeLanguage(e){this.currentLanguage.value=e,this._addAxiosHeaders(),jn.u.set({key:this.languageKey,value:JSON.stringify(e)}),this.vendorI18n.global.locale=e.value}_addAxiosHeaders(){pn.Z.interceptors.request.use((e=>(this.currentLanguage.value&&this.currentLanguage.value.value&&(e.headers["Accept-Language"]=this.currentLanguage.value.value),e))),pn.Z.interceptors.response.use((e=>e),(e=>Promise.reject(e?.response||e)))}_loadLocaleMessages(e="@/locales"){let t;try{t=s(8973)}catch(i){return En.warn("[@wezeo/i18n] Could not initialize i18n. Missing folder /src/locales."),{}}const a={};return t.keys().forEach((e=>{const s=e.match(/([A-Za-z0-9-_]+)\./i);if(s&&s.length>1){const i=s[1];a[i]=t(e)}})),a}}var Wn=s(15941),Sn={install:(e,t)=>{if(t&&!0===t.disabled)return;if(!t||!t.languages||!t.defaultLanguage)return Wn.warn("[@wezeo/i18n] Could not initialize i18n. Missing configuration options.");e.config.globalProperties.$events||e.use(Tn);const s=new xn(t);e.use(s.vendorI18n),e.config.globalProperties.$w18n=s}},On={install:(e,t)=>{t&&!0===t.disabled||(e.component("ion-content",i.W2),e.component("ion-page",i._i),e.component("ion-label",i.Q$),e.component("ion-back-button",i.oU),e.component("ion-checkbox",i.nz),e.component("ion-text",i.yW),e.component("ion-button",i.YG),e.component("ion-item",i.Ie),e.component("ion-item-group",i.Ub),e.component("ion-item-sliding",i.td),e.component("ion-item-option",i.u8),e.component("ion-item-options",i.IK),e.component("ion-toolbar",i.sr),e.component("ion-header",i.Gu),e.component("ion-footer",i.fr),e.component("ion-slides",i.Hr),e.component("ion-slide",i.A$),e.component("ion-spinner",i.PQ),e.component("ion-row",i.Nd),e.component("ion-col",i.wI),e.component("ion-grid",i.jY),e.component("ion-input",i.pK),e.component("ion-buttons",i.Sm),e.component("ion-icon",i.gu),e.component("ion-img",i.Xz),e.component("ion-list",i.q_),e.component("ion-skeleton-text",i.CK),e.component("ion-title",i.wd),e.component("ion-menu",i.z0),e.component("ion-split-pane",i.jI),e.component("ion-menu-button",i.fG),e.component("ion-router-outlet",i.jP),e.component("ion-segment",i.cJ),e.component("ion-segment-button",i.GO),e.component("ion-virtual-scroll",i.aJ),e.component("ion-textarea",i.g2),e.component("ion-searchbar",i.VI),e.component("ion-refresher-content",i.Wo),e.component("ion-refresher",i.nJ),e.component("ion-infinite-scroll-content",i.MB),e.component("ion-infinite-scroll",i.ju),e.component("ion-avatar",i.BJ),e.component("ion-thumbnail",i.Bs),e.component("ion-modal",i.ki),e.component("ion-radio-group",i.se),e.component("ion-radio",i.B7),e.component("ion-note",i.uN),e.component("ion-card",i.PM),e.component("ion-card-content",i.FN),e.component("ion-tab-bar",i.yq),e.component("ion-tab-button",i.ZU),e.component("ion-menu-toggle",i.zc),e.component("ion-fab",i.IJ),e.component("ion-fab-button",i.W4),e.component("ion-fab-list",i.zq),e.component("ion-reorder-group",i.oz),e.component("ion-reorder",i.Nh),e.component("ion-select",i.t9),e.component("ion-select-option",i.n0),e.component("ion-toggle",i.ho),e.component("ion-badge",i.yp),e.component("ion-chip",i.hM),e.component("ion-tabs",i.UN))}};async function Vn(e){return"Unauthenticated."==e?.response?.data?.message?un.dispatch("auth/logout"):Promise.reject(e)}pn.Z.interceptors.response.use((e=>e),(e=>Vn(e)));var zn=s(15941),An={namespaced:!0,state:{token:localStorage.getItem("wzo_vue_user_token")||"",user:JSON.parse(localStorage.getItem("wzo_vue_user_user")||"{}")},mutations:{auth_success(e,t){t.token&&(e.token=t.token,localStorage.setItem("wzo_vue_user_token",t.token)),t.user&&(e.user=t.user,localStorage.setItem("wzo_vue_user_user",JSON.stringify(t.user)))},auth_error(e){e.token="",localStorage.removeItem("wzo_vue_user_token"),localStorage.removeItem("wzo_vue_user_user")},logout(e){e.token="",e.user=null,localStorage.removeItem("wzo_vue_user_token"),localStorage.removeItem("wzo_vue_user_user"),window.open(location.origin,"_self")}},actions:{login({commit:e},t){return new Promise(((s,a)=>{kn.post("v1/tokens/create",{data:t}).then((t=>{const a=t.token,i=t.user;e("auth_success",{token:a,user:i}),s(t)})).catch((t=>{e("auth_error"),a(t)}))}))},signup({commit:e},t){return new Promise(((s,a)=>{e("auth_request"),kn.post_data("v1/auth/signup",t).then((t=>{const a=t.token,i=t.user;e("auth_success",{token:a,user:i}),s(t)})).catch((t=>{e("auth_error"),a(t)}))}))},logout({commit:e}){return new Promise((t=>{kn.post_auth_data("v1/auth/invalidate").finally((()=>{e("logout"),t(null)}))}))},forgotPassword({commit:e},t){return new Promise(((e,s)=>{kn.post("v1/users/forgot",{data:t}).then((t=>e(t))).catch((e=>s(e)))}))},resetPassword({commit:e},t){return e("auth_success",{token:t.token}),new Promise(((s,a)=>{kn.post_auth_data("v1/users/reset",{data:t}).then((t=>{e("logout"),s(t)})).catch((e=>a(e)))}))},async refreshToken({commit:e}){try{const t=await kn.post_auth_data("v1/auth/refresh"),s=t.token,a=t.user;return e("auth_success",{token:s,user:a}),s}catch(t){e("auth_error"),zn.error(t)}},async userInfo({commit:e}){return new Promise(((t,s)=>{kn.get_auth_data("v1/auth/info").then((s=>{const a=s.user;e("auth_success",{user:a}),t(a)})).catch((e=>{s(e)}))}))},updateUserInfo({commit:e},t){return new Promise(((s,a)=>{kn.put_auth(`v1/users/${t.id}`,{data:t}).then((t=>{const a=t.user;e("auth_success",{user:a}),s(a)})).catch((e=>{a(e)}))}))}},getters:{isLoggedIn:e=>!!e.token,user:e=>e.user,token:e=>e.token&&void 0!=e.token?e.token:null}},Un=s(15941),Zn={install:(e,t)=>{if(!t||1!=t.disabled)return e.config.globalProperties.$store?void e.config.globalProperties.$store.registerModule("auth",An):Un.warn("[w/auth] Could not initialize. App does not have vuex store added.")}},In={install:(e,t)=>{t&&!0===t.disabled||(e.use(ws()),e.config.globalProperties.$parseError=e=>e?.data?.message||e?.response?.data?.message||e?.message||e)}};const Fn={ref:"loadingContainer"},Hn={key:0},Pn={key:1},Ln={key:2};function Nn(e,t,s,a,i,l){return(0,m.wg)(),(0,m.iD)("div",Fn,[s.content?s.content.error?((0,m.wg)(),(0,m.iD)("div",Pn,(0,k.zw)(s.content.error),1)):"array"==typeof s.content&&!e.array.length||"object"==typeof s.content&&!Object.values(s.content).length?((0,m.wg)(),(0,m.iD)("div",Ln,(0,k.zw)(s.emptyMessage),1)):(0,m.WI)(e.$slots,"default",{key:3},void 0,!0):((0,m.wg)(),(0,m.iD)("div",Hn))],512)}var Yn={props:{content:{type:[Object,Array,Boolean],default:()=>null},emptyMessage:{type:String,default:"No items"}},data(){return{loader:null}},async mounted(){this.content||await this._startLoading()},methods:{async _startLoading(){},_stopLoading(){}},watch:{}};const qn=(0,$.Z)(Yn,[["render",Nn],["__scopeId","data-v-a2444234"]]);var Bn=qn,Rn={install:(e,t)=>{t&&!0===t.disabled||e.component("W-loadable",Bn)}},Kn={install:(e,t={})=>{Tn.install(e,t.events),fn.install(e,t.axios),Sn.install(e,t.i18n),Dn.install(e,t.moxios),On.install(e,t.ionic),Zn.install(e,t.auth),In.install(e,t.toast),Rn.install(e,t.loadable)}},Jn={parseAndTranslate(e){const t=this._parseToArrayOfStrings(e);return t.join(", ")},_parseToArrayOfStrings(e){return e?.data?.message?[Br(e.data.message)]:"string"==typeof e?[Br(e)]:e?.response?.data?Object.values(e?.response?.data):e&&e.error&&"string"==typeof e.error?[Br(e.error)]:e&&e.error&&"object"==typeof e.error?Object.values(Br(e.error)):e.data&&e.data.error&&"string"==typeof e.data.error?[Br(e.data.error)]:e&&e.data&&e.data.error&&"object"==typeof e.data.error?Object.values(e.data.error).map((e=>Br(e[0])+" ")):e.statusText?[Br(e.statusText)]:[e]}},Gn=s(15941);pn.Z.defaults.baseURL="https://tm.jandl.sk/api/";var Xn={async get(e,t){return pn.Z.get(e,t).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async get_auth(e,t){return t=this._config(t),pn.Z.get(e,t).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async get_data(e,t){return pn.Z.get(e,t).then((e=>e.data.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},async get_auth_data(e,t){return t=this._config(t),pn.Z.get(e,t).then((e=>Promise.resolve(e.data.data))).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},async post(e,t=null,s){return pn.Z.post(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async post_auth(e,t=null,s){return s=this._config(s),pn.Z.post(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async post_data(e,t=null,s){return pn.Z.post(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},async post_auth_data(e,t=null,s){return s=this._config(s),pn.Z.post(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},async delete(e,t){return pn.Z["delete"](e,t).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async delete_auth(e,t){return t=this._config(t),pn.Z["delete"](e,t).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async delete_data(e,t){return pn.Z["delete"](e,t).then((e=>e.data.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},async delete_auth_data(e,t){return t=this._config(t),pn.Z["delete"](e,t).then((e=>e.data.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},async patch(e,t=null,s){return pn.Z.patch(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async patch_auth(e,t=null,s){return s=this._config(s),pn.Z.patch(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async patch_auth_form(e,t=null,s){s=this._config(s),s.headers["Content-Type"]="multipart/form-data";const a=this._objectToFormData(t);return a.append("_method","put"),s.transformRequest=e=>e,pn.Z.post(e,a,s).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async patch_data(e,t=null,s){return pn.Z.patch(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},async patch_auth_data(e,t=null,s){return s=this._config(s),pn.Z.patch(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},async put(e,t=null,s){return pn.Z.put(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async put_auth(e,t=null,s){return s=this._config(s),pn.Z.put(e,{data:t},s).then((e=>e.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e))))},async put_data(e,t=null,s){return pn.Z.put(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},async put_auth_data(e,t=null,s){return s=this._config(s),pn.Z.put(e,{data:t},s).then((e=>e.data.data)).catch((e=>Promise.reject(Jn.parseAndTranslate(e.response||e))))},_config(e){return e&&Gn.error("NOT IMPLEMENTED"),un.getters["auth/token"]?{headers:{Authorization:`Bearer ${un.getters["auth/token"]}`}}:{headers:{}}},_buildFormData(e,t,s){!t||"object"!==typeof t||t instanceof Date||t instanceof File?e.append(s,null==t?"":t):Object.keys(t).forEach((a=>this._buildFormData(e,t[a],s?`${s}[${a}]`:a)))},_objectToFormData(e){const t=new FormData;return this._buildFormData(t,{data:e}),t}},Qn={install:(e,t)=>{t&&!0===t.disabled||(e.config.globalProperties.$axios=Xn)}},eo={namespaced:!0,state:{mastertasks:null,employees:null,teams:null,projects:null,unscheduledSubtasks:null,ongoingSubtasks:null,initialized:!1,ongoingSubtasksEmployeeId:null,unscheduledSubtasksEmployeeId:null},mutations:{set_mastertasks(e,t){e.mastertasks=t},set_employees(e,t){e.employees=t},set_teams(e,t){e.teams=t},set_projects(e,t){e.projects=t},set_unscheduled_subtasks(e,t){e.unscheduledSubtasks=t},set_ongoing_subtasks(e,t){e.ongoingSubtasks=t},remove_ongoing_subtask(e,t){e.ongoingSubtasks=e.ongoingSubtasks.filter((e=>e.id!=t))},update_team(e,t){e.teams=e.teams.map((e=>e.id==t.id?t:e))},save_team(e,t){e.teams.push(t)},delete_team(e,t){e.teams=e.teams.filter((e=>e.id!=t.id))},update_subtask(e,t){e.unscheduledSubtasks=e.unscheduledSubtasks.map((e=>e.id==t.id?t:e)),e.ongoingSubtasks=e.ongoingSubtasks.map((e=>e.id==t.id?t:e))},delete_subtask(e,t){e.unscheduledSubtasks=e.unscheduledSubtasks.filter((e=>e.id!=t.id)),e.ongoingSubtasks=e.ongoingSubtasks.filter((e=>e.id!=t.id))},set_ongoing_subtasks_employee_id(e,t){e.ongoingSubtasksEmployeeId=t},set_unscheduled_subtasks_employee_id(e,t){e.unscheduledSubtasksEmployeeId=t},initialized(e){e.initialized=!0}},actions:{initialize({dispatch:e,commit:t}){return Promise.all([e("loadMastertasks"),e("loadEmployees"),e("loadTeams"),e("loadProjects"),e("loadUnscheduledSubtasks"),e("loadOngoingSubtasks")]).then((()=>t("initialized")))},reloadSubtasks({dispatch:e}){return Promise.all([e("loadMastertasks"),e("loadProjects"),e("loadUnscheduledSubtasks"),e("loadOngoingSubtasks")])},reloadMastertasks({dispatch:e}){return Promise.all([e("loadMastertasks")])},loadMastertasks({commit:e}){return new Promise(((t,s)=>{Xn.get_auth("v1/mastertasks/?simple=true").then((({mastertasks:s})=>{e("set_mastertasks",s),t(s)})).catch((t=>{e("set_mastertasks",{error:t}),s(t)}))}))},loadEmployees({commit:e}){return new Promise(((t,s)=>{Xn.get_auth_data("v1/employees").then((s=>{e("set_employees",s),t(s)})).catch((t=>{e("set_employees",{error:t}),s(t)}))}))},loadTeams({commit:e}){return new Promise(((t,s)=>{Xn.get_auth_data("v1/teams").then((s=>{e("set_teams",s),t(s)})).catch((t=>{e("set_teams",{error:t}),s(t)}))}))},loadProjects({commit:e}){return new Promise(((t,s)=>{Xn.get_auth_data("v1/projects").then((s=>{e("set_projects",s),t(s)})).catch((t=>{e("set_projects",{error:t}),s(t)}))}))},loadUnscheduledSubtasks({commit:e,state:t},s){let a;return s?(a=s,e("set_unscheduled_subtasks_employee_id",s)):a=t.unscheduledSubtasksEmployeeId?t.unscheduledSubtasksEmployeeId:un.getters["auth/user"]?.id,new Promise(((t,s)=>{Xn.get_auth(`v1/subtasks?type=unscheduled&employee_id=${a}`).then((({subtasks:s})=>{e("set_unscheduled_subtasks",s),t(s)})).catch((t=>{e("set_unscheduled_subtasks",{error:t}),s(t)}))}))},loadOngoingSubtasks({commit:e,state:t},s){let a;return s?(a=s,e("set_ongoing_subtasks_employee_id",s)):t.ongoingSubtasksEmployeeId?a=t.ongoingSubtasksEmployeeId:(a=un.getters["auth/user"]?.id,e("set_ongoing_subtasks_employee_id",a)),new Promise(((t,s)=>{Xn.get_auth(`v1/subtasks?type=ongoing&employee_id=${a}`).then((({subtasks:s})=>{e("set_ongoing_subtasks",s),t(s)})).catch((t=>{e("set_ongoing_subtasks",{error:t}),s(t)}))}))},removeOngoingSubtask({commit:e},t){e("remove_ongoing_subtask",t)}},getters:{mastertasks:e=>e.mastertasks,employees:e=>e.employees,enrichedEmployees:e=>e.employees?e.employees.map((e=>({...e,_fullName:`${e.name} ${e.surname}`,_initials:e.name.charAt(0)+e.surname.charAt(0)}))).sort(((e,t)=>e.name<t.name?-1:1)):[],teams:e=>e.teams,projects:e=>e.projects,unscheduledSubtasks:e=>e.unscheduledSubtasks,ongoingSubtasks:e=>e.ongoingSubtasks,isInitialized:e=>e.initialized}},to={install:e=>{e.config.globalProperties.$store.registerModule("tm",eo)}};const so=["lang"],ao={key:0,class:"vuecal__flex vuecal__body",grow:"grow"},io=["onBlur","innerHTML"],lo=["innerHTML"],no=["innerHTML"],oo={class:"vuecal__flex",row:"row",grow:"grow"},ro={key:0,class:"vuecal__time-column"},uo=(0,m._)("span",{class:"vuecal__time-cell-line"},null,-1),co={class:"vuecal__time-cell-label"},mo={key:1,class:"vuecal__flex vuecal__week-numbers",column:"column"},ho=["wrap","column"],po=["onBlur","innerHTML"],vo=["innerHTML"],ko=["innerHTML"],fo=["wrap"],go=["innerHTML"],bo=["innerHTML"],_o={key:2,class:"vuecal__cell-events-count"},wo={key:3,class:"vuecal__no-event"},yo=["onBlur","innerHTML"],Do=["innerHTML"],Mo={key:2,class:"vuecal__event-time"},To={key:0},$o={key:1,class:"days-to-end"},Co=["innerHTML"],jo={key:0,class:"vuecal__scrollbar-check"},Eo=(0,m._)("div",null,null,-1),xo=[Eo];function Wo(e,t,s,i,l,n){const o=(0,m.up)("vuecal-header"),r=(0,m.up)("all-day-bar"),d=(0,m.up)("weekdays-headings"),u=(0,m.up)("vuecal-cell");return(0,m.wg)(),(0,m.iD)("div",{class:(0,k.C_)(["vuecal__flex vuecal",n.cssClasses]),column:"column",ref:"vuecal",lang:s.locale},[(0,m.Wm)(o,{options:e.$props,"edit-events":n.editEvents,"view-props":{views:n.views,weekDaysInHeader:n.weekDaysInHeader},"week-days":n.weekDays,"has-splits":n.hasSplits,"day-splits":n.daySplits,"switch-to-narrower-view":n.switchToNarrowerView},(0,m.Nv)({_:2},[e.$slots["weekday-heading"]?{name:"weekday-heading",fn:(0,m.w5)((({heading:t,view:s})=>[(0,m.WI)(e.$slots,"weekday-heading",{heading:t,view:s})])),key:"0"}:void 0,e.$slots["split-label"]?{name:"split-label",fn:(0,m.w5)((({split:t,view:s})=>[(0,m.WI)(e.$slots,"split-label",{split:t,view:s.id})])),key:"1"}:void 0]),1032,["options","edit-events","view-props","week-days","has-splits","day-splits","switch-to-narrower-view"]),s.hideBody?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",ao,[(0,m.Wm)(a.uT,{name:`slide-fade--${l.transitionDirection}`,appear:s.transitions},{default:(0,m.w5)((()=>[((0,m.wg)(),(0,m.iD)("div",{class:"vuecal__flex",style:{"min-width":"100%"},key:!!s.transitions&&l.view.id,column:"column"},[s.showAllDayEvents&&n.hasTimeColumn&&(!n.cellOrSplitMinWidth||n.isDayView&&!s.minSplitWidth)?((0,m.wg)(),(0,m.j4)(r,(0,k.vs)((0,m.dG)({key:0},n.allDayBar)),{event:(0,m.w5)((({event:t,view:s})=>[(0,m.WI)(e.$slots,"event",{view:s,event:t},(()=>[n.editEvents.title&&t.titleEditable?((0,m.wg)(),(0,m.iD)("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"contenteditable",onBlur:e=>n.onEventTitleBlur(e,t),innerHTML:t.title},null,40,io)):t.title?((0,m.wg)(),(0,m.iD)("div",{key:1,class:"vuecal__event-title",innerHTML:t.title},null,8,lo)):(0,m.kq)("",!0),!t.content||n.hasShortEvents||n.isShortMonthView?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",{key:2,class:"vuecal__event-content",innerHTML:t.content},null,8,no))]))])),_:3},16)):(0,m.kq)("",!0),(0,m._)("div",{class:(0,k.C_)(["vuecal__bg",{vuecal__flex:!n.hasTimeColumn}]),column:"column",ref:"vuecal_scroll"},[(0,m._)("div",oo,[n.hasTimeColumn?((0,m.wg)(),(0,m.iD)("div",ro,[s.showAllDayEvents&&n.cellOrSplitMinWidth&&(!n.isDayView||s.minSplitWidth)?((0,m.wg)(),(0,m.iD)("div",{key:0,class:"vuecal__all-day-text",style:(0,k.j5)({height:n.allDayBar.height})},[(0,m._)("span",null,(0,k.zw)(l.texts.allDay),1)],4)):(0,m.kq)("",!0),((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.timeCells,((t,a)=>((0,m.wg)(),(0,m.iD)("div",{class:"vuecal__time-cell",key:a,style:(0,k.j5)(`height: ${s.timeCellHeight}px`)},[(0,m.WI)(e.$slots,"time-cell",{hours:t.hours,minutes:t.minutes},(()=>[uo,(0,m._)("span",co,(0,k.zw)(t.label),1)]))],4)))),128))])):(0,m.kq)("",!0),s.showWeekNumbers&&n.isMonthView?((0,m.wg)(),(0,m.iD)("div",mo,[((0,m.wg)(),(0,m.iD)(m.HY,null,(0,m.Ko)(6,(t=>(0,m._)("div",{class:"vuecal__flex vuecal__week-number-cell",key:t,grow:"grow"},[(0,m.WI)(e.$slots,"week-number-cell",{week:n.getWeekNumber(t-1)},(()=>[(0,m.Uk)((0,k.zw)(n.getWeekNumber(t-1)),1)]))]))),64))])):(0,m.kq)("",!0),(0,m._)("div",{class:(0,k.C_)(["vuecal__flex vuecal__cells vuecal__scrollable-body",`${l.view.id}-view`]),grow:"grow",wrap:!n.cellOrSplitMinWidth||!n.isWeekView,column:!!n.cellOrSplitMinWidth},[n.cellOrSplitMinWidth&&n.isWeekView?((0,m.wg)(),(0,m.j4)(d,{key:0,"transition-direction":l.transitionDirection,"week-days":n.weekDays,"switch-to-narrower-view":n.switchToNarrowerView,style:(0,k.j5)(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:""),unscheduledTime:s.unscheduledTime,ref:"vuecal_weekday_heading"},(0,m.Nv)({_:2},[e.$slots["weekday-heading"]?{name:"weekday-heading",fn:(0,m.w5)((({heading:t,view:s})=>[(0,m.WI)(e.$slots,"weekday-heading",{heading:t,view:s})])),key:"0"}:void 0,e.$slots["split-label"]?{name:"split-label",fn:(0,m.w5)((({split:t})=>[(0,m.WI)(e.$slots,"split-label",{split:t,view:l.view.id})])),key:"1"}:void 0]),1032,["transition-direction","week-days","switch-to-narrower-view","style","unscheduledTime"])):n.hasSplits&&s.stickySplitLabels&&s.minSplitWidth?((0,m.wg)(),(0,m.iD)("div",{key:1,class:"vuecal__flex vuecal__split-days-headers",ref:"vuecal_splits_heading",style:(0,k.j5)(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.daySplits,((t,s)=>((0,m.wg)(),(0,m.iD)("div",{class:(0,k.C_)(["day-split-header",t.class||!1]),key:s},[(0,m.WI)(e.$slots,"split-label",{split:t,view:l.view.id},(()=>[(0,m.Uk)((0,k.zw)(t.label),1)]))],2)))),128))],4)):(0,m.kq)("",!0),s.showAllDayEvents&&n.hasTimeColumn&&(n.isWeekView&&n.cellOrSplitMinWidth||n.isDayView&&n.hasSplits&&s.minSplitWidth)?((0,m.wg)(),(0,m.j4)(r,(0,k.vs)((0,m.dG)({key:2},n.allDayBar)),{event:(0,m.w5)((({event:t,view:s})=>[(0,m.WI)(e.$slots,"event",{view:s,event:t},(()=>[n.editEvents.title&&t.titleEditable?((0,m.wg)(),(0,m.iD)("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"contenteditable",onBlur:e=>n.onEventTitleBlur(e,t),innerHTML:t.title},null,40,po)):t.title?((0,m.wg)(),(0,m.iD)("div",{key:1,class:"vuecal__event-title",innerHTML:t.title},null,8,vo)):(0,m.kq)("",!0),!t.content||n.hasShortEvents||n.isShortMonthView?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",{key:2,class:"vuecal__event-content",innerHTML:t.content},null,8,ko))]))])),_:3},16)):(0,m.kq)("",!0),(0,m._)("div",{class:"vuecal__flex vuecal__cells-body",ref:e=>l.cellsEl=e,grow:"grow",wrap:!n.cellOrSplitMinWidth||!n.isWeekView,style:(0,k.j5)(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.viewCells,((t,a)=>((0,m.wg)(),(0,m.j4)(u,{key:a,options:e.$props,"edit-events":n.editEvents,data:t,"cell-width":s.hideWeekdays.length&&(n.isWeekView||n.isMonthView)&&n.cellWidth,"min-timestamp":n.minTimestamp,"max-timestamp":n.maxTimestamp,"cell-splits":n.hasSplits&&n.daySplits||[]},{"cell-content":(0,m.w5)((({events:a,split:i,selectCell:o})=>[(0,m.WI)(e.$slots,"cell-content",{cell:t,view:l.view,goNarrower:o,events:a},(()=>[i&&!s.stickySplitLabels?((0,m.wg)(),(0,m.iD)("div",{key:0,class:"split-label",innerHTML:i.label},null,8,go)):(0,m.kq)("",!0),t.content?((0,m.wg)(),(0,m.iD)("div",{key:1,class:"vuecal__cell-date",innerHTML:t.content},null,8,bo)):(0,m.kq)("",!0),(n.isMonthView&&!s.eventsOnMonthView||n.isYearsOrYearView&&s.eventsCountOnYearView)&&a.length?((0,m.wg)(),(0,m.iD)("div",_o,[(0,m.WI)(e.$slots,"events-count",{view:l.view,events:a},(()=>[(0,m.Uk)((0,k.zw)(a.length),1)]))])):(0,m.kq)("",!0),!n.cellOrSplitHasEvents(a,i)&&n.isWeekOrDayView?((0,m.wg)(),(0,m.iD)("div",wo,[(0,m.WI)(e.$slots,"no-event",{},(()=>[(0,m.Uk)((0,k.zw)(l.texts.noEvent),1)]))])):(0,m.kq)("",!0)]))])),event:(0,m.w5)((({event:a,view:i})=>[(0,m.WI)(e.$slots,"event",{view:i,event:a},(()=>[n.editEvents.title&&a.titleEditable?((0,m.wg)(),(0,m.iD)("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"contenteditable",onBlur:e=>n.onEventTitleBlur(e,a),innerHTML:a.title},null,40,yo)):a.title?((0,m.wg)(),(0,m.iD)("div",{key:1,class:"vuecal__event-title",innerHTML:a.title},null,8,Do)):(0,m.kq)("",!0),!s.time||a.allDay||n.isMonthView&&(a.allDay||"short"===s.showAllDayEvents)||n.isShortMonthView?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",Mo,[(0,m.Uk)((0,k.zw)(l.utils.date.formatTime(a.start,n.TimeFormat)),1),a.endTimeMinutes?((0,m.wg)(),(0,m.iD)("span",To," - "+(0,k.zw)(l.utils.date.formatTime(a.end,n.TimeFormat,null,!0)),1)):(0,m.kq)("",!0),a.daysCount>1&&(a.segments[t.formattedDate]||{}).isFirstDay?((0,m.wg)(),(0,m.iD)("small",$o," +"+(0,k.zw)(a.daysCount-1)+(0,k.zw)((l.texts.day[0]||"").toLowerCase()),1)):(0,m.kq)("",!0)])),!a.content||n.isMonthView&&a.allDay&&"short"===s.showAllDayEvents||n.isShortMonthView?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",{key:3,class:"vuecal__event-content",innerHTML:a.content},null,8,Co))]))])),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"])))),128))],12,fo)],10,ho)])],2)]))])),_:3},8,["name","appear"]),l.ready?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",jo,xo))]))],10,so)}s(30541);let So,Oo,Vo,zo,Ao={},Uo={};class Zo{constructor(e,t=!1){(0,gn.Z)(this,"texts",{}),(0,gn.Z)(this,"dateToMinutes",(e=>60*e.getHours()+e.getMinutes())),zo=this,this._texts=e,t||!Date||Date.prototype.addDays||this._initDatePrototypes()}_initDatePrototypes(){Date.prototype.addDays=function(e){return zo.addDays(this,e)},Date.prototype.subtractDays=function(e){return zo.subtractDays(this,e)},Date.prototype.addHours=function(e){return zo.addHours(this,e)},Date.prototype.subtractHours=function(e){return zo.subtractHours(this,e)},Date.prototype.addMinutes=function(e){return zo.addMinutes(this,e)},Date.prototype.subtractMinutes=function(e){return zo.subtractMinutes(this,e)},Date.prototype.getWeek=function(){return zo.getWeek(this)},Date.prototype.isToday=function(){return zo.isToday(this)},Date.prototype.isLeapYear=function(){return zo.isLeapYear(this)},Date.prototype.format=function(e="YYYY-MM-DD"){return zo.formatDate(this,e)},Date.prototype.formatTime=function(e="HH:mm"){return zo.formatTime(this,e)}}removePrototypes(){delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime}updateTexts(e){this._texts=e}_todayFormatted(){return Oo!==(new Date).getDate()&&(So=new Date,Oo=So.getDate(),Vo=`${So.getFullYear()}-${So.getMonth()}-${So.getDate()}`),Vo}addDays(e,t){const s=new Date(e.valueOf());return s.setDate(s.getDate()+t),s}subtractDays(e,t){const s=new Date(e.valueOf());return s.setDate(s.getDate()-t),s}addHours(e,t){const s=new Date(e.valueOf());return s.setHours(s.getHours()+t),s}subtractHours(e,t){const s=new Date(e.valueOf());return s.setHours(s.getHours()-t),s}addMinutes(e,t){const s=new Date(e.valueOf());return s.setMinutes(s.getMinutes()+t),s}subtractMinutes(e,t){const s=new Date(e.valueOf());return s.setMinutes(s.getMinutes()-t),s}getWeek(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),s=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-s);const a=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t-a)/864e5+1)/7)}isToday(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`===this._todayFormatted()}isLeapYear(e){const t=e.getFullYear();return!(t%400)||t%100&&!(t%4)}getPreviousFirstDayOfWeek(e=null,t){const s=e&&new Date(e.valueOf())||new Date,a=t?7:6;return s.setDate(s.getDate()-(s.getDay()+a)%7),s}stringToDate(e){return e instanceof Date?e:(10===e.length&&(e+=" 00:00"),new Date(e.replace(/-/g,"/")))}countDays(e,t){"string"===typeof e&&(e=e.replace(/-/g,"/")),"string"===typeof t&&(t=t.replace(/-/g,"/")),e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,1,0);const s=60*(new Date(t).getTimezoneOffset()-new Date(e).getTimezoneOffset())*1e3;return Math.ceil((t-e-s)/864e5)}datesInSameTimeStep(e,t,s){return Math.abs(e.getTime()-t.getTime())<=60*s*1e3}formatDate(e,t="YYYY-MM-DD",s=null){if(s||(s=this._texts),t||(t="YYYY-MM-DD"),"YYYY-MM-DD"===t)return this.formatDateLite(e);Ao={},Uo={};const a={YYYY:()=>this._hydrateDateObject(e,s).YYYY,YY:()=>this._hydrateDateObject(e,s).YY(),M:()=>this._hydrateDateObject(e,s).M,MM:()=>this._hydrateDateObject(e,s).MM(),MMM:()=>this._hydrateDateObject(e,s).MMM(),MMMM:()=>this._hydrateDateObject(e,s).MMMM(),MMMMG:()=>this._hydrateDateObject(e,s).MMMMG(),D:()=>this._hydrateDateObject(e,s).D,DD:()=>this._hydrateDateObject(e,s).DD(),S:()=>this._hydrateDateObject(e,s).S(),d:()=>this._hydrateDateObject(e,s).d,dd:()=>this._hydrateDateObject(e,s).dd(),ddd:()=>this._hydrateDateObject(e,s).ddd(),dddd:()=>this._hydrateDateObject(e,s).dddd(),HH:()=>this._hydrateTimeObject(e,s).HH,H:()=>this._hydrateTimeObject(e,s).H,hh:()=>this._hydrateTimeObject(e,s).hh,h:()=>this._hydrateTimeObject(e,s).h,am:()=>this._hydrateTimeObject(e,s).am,AM:()=>this._hydrateTimeObject(e,s).AM,mm:()=>this._hydrateTimeObject(e,s).mm,m:()=>this._hydrateTimeObject(e,s).m};return t.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,((e,t)=>{const s=a[t.replace(/\{|\}/g,"")];return void 0!==s?s():t}))}formatDateLite(e){const t=e.getMonth()+1,s=e.getDate();return`${e.getFullYear()}-${t<10?"0":""}${t}-${s<10?"0":""}${s}`}formatTime(e,t="HH:mm",s=null,a=!1){let i=!1;if(a){const[t,s,a]=[e.getHours(),e.getMinutes(),e.getSeconds()];t+s+a===141&&(i=!0)}if(e instanceof Date&&"HH:mm"===t)return i?"24:00":this.formatTimeLite(e);Uo={},s||(s=this._texts);const l=this._hydrateTimeObject(e,s),n=t.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,((e,t)=>{const s=l[t.replace(/\{|\}/g,"")];return void 0!==s?s:t}));return i?n.replace("23:59","24:00"):n}formatTimeLite(e){const t=e.getHours(),s=e.getMinutes();return`${(t<10?"0":"")+t}:${(s<10?"0":"")+s}`}_nth(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}_hydrateDateObject(e,t){if(Ao.D)return Ao;const s=e.getFullYear(),a=e.getMonth()+1,i=e.getDate(),l=e.getDay(),n=(l-1+7)%7;return Ao={YYYY:s,YY:()=>s.toString().substring(2),M:a,MM:()=>(a<10?"0":"")+a,MMM:()=>t.months[a-1].substring(0,3),MMMM:()=>t.months[a-1],MMMMG:()=>(t.monthsGenitive||t.months)[a-1],D:i,DD:()=>(i<10?"0":"")+i,S:()=>this._nth(i),d:n+1,dd:()=>t.weekDays[n][0],ddd:()=>t.weekDays[n].substr(0,3),dddd:()=>t.weekDays[n]},Ao}_hydrateTimeObject(e,t){if(Uo.am)return Uo;let s,a;e instanceof Date?(s=e.getHours(),a=e.getMinutes()):(s=Math.floor(e/60),a=Math.floor(e%60));const i=s%12?s%12:12,l=(t||{am:"am",pm:"pm"})[24===s||s<12?"am":"pm"];return Uo={H:s,h:i,HH:(s<10?"0":"")+s,hh:(i<10?"0":"")+i,am:l,AM:l.toUpperCase(),m:a,mm:(a<10?"0":"")+a},Uo}}const Io=1440;class Fo{constructor(e){(0,gn.Z)(this,"_vuecal",null),(0,gn.Z)(this,"selectCell",((e=!1,t,s)=>{this._vuecal.$emit("cell-click",s?{date:t,split:s}:t),this._vuecal.clickToNavigate||e?this._vuecal.switchToNarrowerView():this._vuecal.dblclickToNavigate&&"ontouchstart"in window&&(this._vuecal.domEvents.dblTapACell.taps++,setTimeout((()=>this._vuecal.domEvents.dblTapACell.taps=0),this._vuecal.domEvents.dblTapACell.timeout),this._vuecal.domEvents.dblTapACell.taps>=2&&(this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.switchToNarrowerView(),this._vuecal.$emit("cell-dblclick",s?{date:t,split:s}:t)))})),(0,gn.Z)(this,"keyPressEnterCell",((e,t)=>{this._vuecal.$emit("cell-keypress-enter",t?{date:e,split:t}:e),this._vuecal.switchToNarrowerView()})),(0,gn.Z)(this,"getPosition",(e=>{const{left:t,top:s}=this._vuecal.cellsEl.getBoundingClientRect(),{clientX:a,clientY:i}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:a-t,y:i-s}})),(0,gn.Z)(this,"minutesAtCursor",(e=>{let t=0,s={x:0,y:0};const{timeStep:a,timeCellHeight:i,timeFrom:l}=this._vuecal.$props;return"number"===typeof e?t=e:"object"===typeof e&&(s=this.getPosition(e),t=Math.round(s.y*a/parseInt(i)+l)),{minutes:Math.max(Math.min(t,Io),0),cursorCoords:s}})),this._vuecal=e}}const Ho=2,Po=1440;let Lo,No,Yo;class qo{constructor(e,t){(0,gn.Z)(this,"_vuecal",null),(0,gn.Z)(this,"eventDefaults",{_eid:null,start:"",startTimeMinutes:0,end:"",endTimeMinutes:0,title:"",content:"",background:!1,allDay:!1,segments:null,repeat:null,daysCount:1,deletable:!0,deleting:!1,titleEditable:!0,resizable:!0,resizing:!1,draggable:!0,dragging:!1,draggingStatic:!1,focused:!1,class:""}),this._vuecal=e,Lo=t}createAnEvent(e,t,s){if("string"===typeof e&&(e=Lo.stringToDate(e)),!(e instanceof Date))return!1;const a=Lo.dateToMinutes(e);t=1*t||60*Ho;const i=a+t,l=Lo.addMinutes(new Date(e),t);s.end&&("string"===typeof s.end&&(s.end=Lo.stringToDate(s.end)),s.endTimeMinutes=Lo.dateToMinutes(s.end));const n={...this.eventDefaults,_eid:`${this._vuecal._.uid}_${this._vuecal.eventIdIncrement++}`,start:e,startTimeMinutes:a,end:l,endTimeMinutes:i,segments:null,...s};return"function"!==typeof this._vuecal.onEventCreate||this._vuecal.onEventCreate(n,(()=>this.deleteAnEvent(n)))?(n.startDateF!==n.endDateF&&(n.daysCount=Lo.countDays(n.start,n.end)),this._vuecal.mutableEvents.push(n),this._vuecal.addEventsToView([n]),this._vuecal.emitWithEvent("event-create",n),this._vuecal.$emit("event-change",{event:this._vuecal.cleanupEvent(n),originalEvent:null}),n):void 0}addEventSegment(e){e.segments||(e.segments={},e.segments[Lo.formatDateLite(e.start)]={start:e.start,startTimeMinutes:e.startTimeMinutes,endTimeMinutes:Po,isFirstDay:!0,isLastDay:!1});const t=e.segments[Lo.formatDateLite(e.end)];t&&(t.isLastDay=!1,t.endTimeMinutes=Po);const s=Lo.addDays(e.end,1),a=Lo.formatDateLite(s);return s.setHours(0,0,0,0),e.segments[a]={start:s,startTimeMinutes:0,endTimeMinutes:e.endTimeMinutes,isFirstDay:!1,isLastDay:!0},e.end=Lo.addMinutes(s,e.endTimeMinutes),e.daysCount=Object.keys(e.segments).length,a}removeEventSegment(e){let t=Object.keys(e.segments).length;if(t<=1)return Lo.formatDateLite(e.end);delete e.segments[Lo.formatDateLite(e.end)],t--;const s=Lo.subtractDays(e.end,1),a=Lo.formatDateLite(s),i=e.segments[a];return t?i&&(i.isLastDay=!0,i.endTimeMinutes=e.endTimeMinutes):e.segments=null,e.daysCount=t||1,e.end=s,a}createEventSegments(e,t,s){const a=t.getTime(),i=s.getTime();let l,n,o,r=e.start.getTime(),d=e.end.getTime(),u=!1;e.end.getHours()||e.end.getMinutes()||(d-=1e3),e.segments={},e.repeat?(l=a,n=Math.min(i,e.repeat.until?Lo.stringToDate(e.repeat.until).getTime():i)):(l=Math.max(a,r),n=Math.min(i,d));while(l<=n){let t=!1;const s=Lo.addDays(new Date(l),1).setHours(0,0,0,0);let a,i,c,m;if(e.repeat){const s=new Date(l),n=Lo.formatDateLite(s);(u||e.occurrences&&e.occurrences[n])&&(u||(r=e.occurrences[n].start,o=new Date(r).setHours(0,0,0,0),d=e.occurrences[n].end),u=!0,t=!0),a=l===o,i=n===Lo.formatDateLite(new Date(d)),c=new Date(a?r:l),m=Lo.formatDateLite(c),i&&(u=!1)}else t=!0,a=l===r,i=n===d&&s>n,c=a?e.start:new Date(l),m=Lo.formatDateLite(a?e.start:c);t&&(e.segments[m]={start:c,startTimeMinutes:a?e.startTimeMinutes:0,endTimeMinutes:i?e.endTimeMinutes:Po,isFirstDay:a,isLastDay:i}),l=s}return e}deleteAnEvent(e){this._vuecal.emitWithEvent("event-delete",e),this._vuecal.mutableEvents=this._vuecal.mutableEvents.filter((t=>t._eid!==e._eid)),this._vuecal.view.events=this._vuecal.view.events.filter((t=>t._eid!==e._eid))}checkCellOverlappingEvents(e,t){Yo=e.slice(0),No={},e.forEach((e=>{Yo.shift(),No[e._eid]||(No[e._eid]={overlaps:[],start:e.start,position:0,sameOverlaps:[]}),No[e._eid].position=0,Yo.forEach((s=>{No[s._eid]||(No[s._eid]={overlaps:[],start:s.start,position:0,sameOverlaps:[]});const a=this.eventInRange(s,e.start,e.end),i=this.eventSameRange(s,e),l=t.overlapsPerTimeStep?Lo.datesInSameTimeStep(e.start,s.start,t.timeStep):1;if(e.background||e.allDay||s.background||s.allDay||!a||!l){let t,a;(t=(No[e._eid]||{overlaps:[]}).overlaps.indexOf(s._eid))>-1&&No[e._eid].overlaps.splice(t,1),(a=(No[s._eid]||{overlaps:[]}).overlaps.indexOf(e._eid))>-1&&No[s._eid].overlaps.splice(a,1),No[s._eid].position--}else No[e._eid].overlaps.push(s._eid),No[e._eid].overlaps=[...new Set(No[e._eid].overlaps)],No[s._eid].overlaps.push(e._eid),No[s._eid].overlaps=[...new Set(No[s._eid].overlaps)],No[s._eid].position++,i&&(No[e._eid].sameOverlaps.push(s._eid),No[e._eid].sameOverlaps=[...new Set(No[e._eid].sameOverlaps)],No[s._eid].sameOverlaps.push(e._eid),No[s._eid].sameOverlaps=[...new Set(No[s._eid].sameOverlaps)])}))}));let s=0;for(const a in No){const e=No[a],t=e.overlaps.map((e=>({id:e,start:No[e].start})));t.push({id:a,start:e.start}),t.sort(((e,t)=>e.start<t.start?-1:e.start>t.start?1:e.id>t.id?-1:1)),e.position=t.findIndex((e=>e.id===a)),s=Math.max(this.getOverlapsStreak(e,No),s)}return[No,s]}getOverlapsStreak(e,t={}){let s=e.overlaps.length+1,a=[];return e.overlaps.forEach((s=>{if(!a.includes(s)){const i=e.overlaps.filter((e=>e!==s));i.forEach((e=>{t[e].overlaps.includes(s)||a.push(e)}))}})),a=[...new Set(a)],s-=a.length,s}eventInRange(e,t,s){if(e.allDay||!this._vuecal.time){const a=new Date(e.start).setHours(0,0,0,0),i=new Date(e.end).setHours(23,59,0,0);return i>=new Date(t).setHours(0,0,0,0)&&a<=new Date(s).setHours(0,0,0,0)}const a=e.start.getTime(),i=e.end.getTime();return a<s.getTime()&&i>t.getTime()}eventSameRange(e,t){const s=e.start.getTime()==t.start.getTime(),a=e.end.getTime()==t.end.getTime();return s&&a}}const Bo={class:"vuecal__header"},Ro={key:0,class:"vuecal__flex vuecal__menu",role:"tablist","aria-label":"Calendar views navigation"},Ko=["onDragenter","onDragleave","onClick","aria-label"],Jo={key:1,class:"vuecal__title-bar"},Go=["aria-label"],Xo={class:"vuecal__flex vuecal__title",grow:""},Qo=["aria-label"],er={key:0,class:"vuecal__flex vuecal__split-days-headers"};function tr(e,t,s,i,l,n){const o=(0,m.up)("weekdays-headings");return(0,m.wg)(),(0,m.iD)("div",Bo,[s.options.hideViewSelector?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",Ro,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(s.viewProps.views,((t,a)=>((0,m.wg)(),(0,m.iD)(m.HY,{key:a},[t.enabled?((0,m.wg)(),(0,m.iD)("button",{key:0,class:(0,k.C_)(["vuecal__view-btn",{"vuecal__view-btn--active":n.view.id===a,"vuecal__view-btn--highlighted":e.highlightedControl===a}]),type:"button",onDragenter:t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(t,a,e.$data),onDragleave:t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(t,a,e.$data),onClick:e=>n.switchView(a,null,!0),"aria-label":`${t.label} view`},(0,k.zw)(t.label),43,Ko)):(0,m.kq)("",!0)],64)))),128))])),s.options.hideTitleBar?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",Jo,[(0,m._)("button",{class:(0,k.C_)(["vuecal__arrow vuecal__arrow--prev",{"vuecal__arrow--highlighted":"previous"===e.highlightedControl}]),type:"button",onClick:t[0]||(t[0]=(...e)=>n.previous&&n.previous(...e)),onDragenter:t[1]||(t[1]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(t,"previous",e.$data)),onDragleave:t[2]||(t[2]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(t,"previous",e.$data)),"aria-label":`Previous ${n.view.id}`},[(0,m.WI)(e.$slots,"arrow-prev")],42,Go),(0,m._)("div",Xo,[(0,m.Wm)(a.uT,{name:s.options.transitions?`slide-fade--${n.transitionDirection}`:""},{default:(0,m.w5)((()=>[((0,m.wg)(),(0,m.j4)((0,m.LL)(n.broaderView?"button":"span"),{type:!!n.broaderView&&"button",key:`${n.view.id}${n.view.startDate.toString()}`,onClick:t[3]||(t[3]=e=>!!n.broaderView&&n.switchToBroaderView()),"aria-label":!!n.broaderView&&`Go to ${n.broaderView} view`},{default:(0,m.w5)((()=>[(0,m.WI)(e.$slots,"title")])),_:3},8,["type","aria-label"]))])),_:3},8,["name"])]),s.options.todayButton?((0,m.wg)(),(0,m.iD)("button",{key:0,class:(0,k.C_)(["vuecal__today-btn",{"vuecal__today-btn--highlighted":"today"===e.highlightedControl}]),type:"button",onClick:t[4]||(t[4]=(...e)=>n.goToToday&&n.goToToday(...e)),onDragenter:t[5]||(t[5]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(t,"today",e.$data)),onDragleave:t[6]||(t[6]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(t,"today",e.$data)),"aria-label":"Today"},[(0,m.WI)(e.$slots,"today-button")],34)):(0,m.kq)("",!0),(0,m._)("button",{class:(0,k.C_)(["vuecal__arrow vuecal__arrow--next",{"vuecal__arrow--highlighted":"next"===e.highlightedControl}]),type:"button",onClick:t[7]||(t[7]=(...e)=>n.next&&n.next(...e)),onDragenter:t[8]||(t[8]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(t,"next",e.$data)),onDragleave:t[9]||(t[9]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(t,"next",e.$data)),"aria-label":`Next ${n.view.id}`},[(0,m.WI)(e.$slots,"arrow-next")],42,Qo)])),s.viewProps.weekDaysInHeader?((0,m.wg)(),(0,m.j4)(o,{key:2,"week-days":s.weekDays,"transition-direction":n.transitionDirection,"switch-to-narrower-view":s.switchToNarrowerView},(0,m.Nv)({_:2},[e.$slots["weekday-heading"]?{name:"weekday-heading",fn:(0,m.w5)((({heading:t,view:s})=>[(0,m.WI)(e.$slots,"weekday-heading",{heading:t,view:s})])),key:"0"}:void 0,e.$slots["split-label"]?{name:"split-label",fn:(0,m.w5)((({split:t})=>[(0,m.WI)(e.$slots,"split-label",{split:t,view:n.view})])),key:"1"}:void 0]),1032,["week-days","transition-direction","switch-to-narrower-view"])):(0,m.kq)("",!0),(0,m.Wm)(a.uT,{name:`slide-fade--${n.transitionDirection}`},{default:(0,m.w5)((()=>[n.showDaySplits?((0,m.wg)(),(0,m.iD)("div",er,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(s.daySplits,((t,s)=>((0,m.wg)(),(0,m.iD)("div",{class:(0,k.C_)(["day-split-header",t.class||!1]),key:s},[(0,m.WI)(e.$slots,"split-label",{split:t,view:n.view.id},(()=>[(0,m.Uk)((0,k.zw)(t.label),1)]))],2)))),128))])):(0,m.kq)("",!0)])),_:3},8,["name"])])}const sr={class:"vuecal__flex vuecal__weekdays-headings",ref:"vuecal_weekday_heading"},ar=["onClick"],ir={class:"vuecal__flex weekday-label",grow:""},lr={class:"full"},nr={class:"small"},or={class:"xsmall"},rr={key:0},dr={key:0,class:"vuecal__flex vuecal__split-days-headers",grow:""};function ur(e,t,s,i,l,n){return(0,m.wg)(),(0,m.iD)("div",sr,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.headings,((i,l)=>((0,m.wg)(),(0,m.iD)(m.HY,{key:l},[i.hide?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",{key:0,class:(0,k.C_)(["vuecal__flex vuecal__heading",{today:i.today,"today-cell":i.today,clickable:n.cellHeadingsClickable,"yesterday-cell":new Date(i.date).toLocaleDateString("sk-SK")==new Date((new Date).setDate((new Date).getDate()-1)).toLocaleDateString("sk-SK")}]),style:(0,k.j5)(n.weekdayCellStyles),onClick:e=>"week"===n.view.id&&n.selectCell(i.date,e),onDblclick:t[0]||(t[0]=e=>"week"===n.view.id&&n.vuecal.dblclickToNavigate&&s.switchToNarrowerView())},[(0,m.Wm)(a.uT,{name:`slide-fade--${s.transitionDirection}`,appear:n.vuecal.transitions},{default:(0,m.w5)((()=>[((0,m.wg)(),(0,m.iD)("div",{class:"vuecal__flex",column:"",key:!!n.vuecal.transitions&&`${l}-${i.dayOfMonth}`},[(0,m._)("div",ir,[(0,m.WI)(e.$slots,"weekday-heading",{heading:n.cleanupHeading(i),view:n.view},(()=>[(0,m._)("span",lr,(0,k.zw)(i.full),1),(0,m._)("span",nr,(0,k.zw)(i.small),1),(0,m._)("span",or,(0,k.zw)(i.xsmall),1),i.dayOfMonth?((0,m.wg)(),(0,m.iD)("span",rr," "+(0,k.zw)(i.dayOfMonth),1)):(0,m.kq)("",!0)]))]),n.vuecal.hasSplits&&n.vuecal.stickySplitLabels?((0,m.wg)(),(0,m.iD)("div",dr,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.vuecal.daySplits,((t,s)=>((0,m.wg)(),(0,m.iD)("div",{class:(0,k.C_)(["day-split-header",t.class||!1]),key:s},[(0,m.WI)(e.$slots,"split-label",{split:t,view:n.view},(()=>[(0,m.Uk)((0,k.zw)(t.label),1)]))],2)))),128))])):(0,m.kq)("",!0)]))])),_:2},1032,["name","appear"])],46,ar))],64)))),128))],512)}var cr={inject:["vuecal","utils","view"],props:{transitionDirection:{type:String,default:"right"},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}},unscheduledTime:{type:Array,default:[]}},methods:{selectCell(e,t){e.getTime()!==this.view.selectedDate.getTime()&&(this.view.selectedDate=e),this.utils.cell.selectCell(!1,e,t)},cleanupHeading:e=>({label:e.full,date:e.date,unscheduledTime:e.unscheduledTime,name:e.name,initials:e.initials,...e.today?{today:e.today}:{}}),onTimelineScroll(e){this.$refs["vuecal_weekday_heading"].style.top=`${e}px`}},computed:{headings(){if(!["month","week"].includes(this.view.id))return[];let e=!1;const t=this.weekDays.map(((t,s)=>{const a=this.utils.date.addDays(this.view.startDate,this.vuecal.startWeekOnSunday?s-1:s);let i=null,l=null,n=null;return this.unscheduledTime[s]?.time&&(i=Math.floor(this.unscheduledTime[s].time/60)+","+String(this.unscheduledTime[s].time%60)[0]),this.unscheduledTime[s]?.name&&this.unscheduledTime[s]?.name&&(l=this.unscheduledTime[s].name+" "+this.unscheduledTime[s].surname,n=this.unscheduledTime[s].name.charAt(0).toUpperCase()+this.unscheduledTime[s].surname.charAt(0).toUpperCase()),{hide:t.hide,full:t.label,small:t.short||t.label.substr(0,3),xsmall:t.short||t.label.substr(0,1),unscheduledTime:i,name:l,initials:n,..."week"===this.view.id?{dayOfMonth:a.getDate(),date:a,today:!e&&this.utils.date.isToday(a)&&!e++}:{}}}));return t},cellWidth(){return 100/(7-this.weekDays.reduce(((e,t)=>e+t.hide),0))},weekdayCellStyles(){return{...this.vuecal.hideWeekdays.length?{width:`${this.cellWidth}%`}:{}}},cellHeadingsClickable(){return"week"===this.view.id&&(this.vuecal.clickToNavigate||this.vuecal.dblclickToNavigate)}}};const mr=(0,$.Z)(cr,[["render",ur]]);var hr=mr,pr={inject:["vuecal","previous","next","switchView","updateSelectedDate","modules","view"],components:{WeekdaysHeadings:hr},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},hasSplits:{type:[Boolean,Number],default:!1},daySplits:{type:Array,default:()=>[]},viewProps:{type:Object,default:()=>({})},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},data:()=>({highlightedControl:null}),methods:{goToToday(){this.updateSelectedDate(new Date((new Date).setHours(0,0,0,0)))},switchToBroaderView(){this.transitionDirection="left",this.broaderView&&this.switchView(this.broaderView)}},computed:{transitionDirection:{get(){return this.vuecal.transitionDirection},set(e){this.vuecal.transitionDirection=e}},broaderView(){const{enabledViews:e}=this.vuecal;return e[e.indexOf(this.view.id)-1]},showDaySplits(){return"day"===this.view.id&&this.hasSplits&&this.options.stickySplitLabels&&!this.options.minSplitWidth},dnd(){return this.modules.dnd}}};const vr=(0,$.Z)(pr,[["render",tr]]);var kr=vr;const fr={key:0,class:"vuecal__all-day-text",style:{width:"3em"}};function gr(e,t,s,a,i,l){const n=(0,m.up)("vuecal-cell");return(0,m.wg)(),(0,m.iD)("div",{class:"vuecal__flex vuecal__all-day",style:(0,k.j5)(s.cellOrSplitMinWidth&&{height:s.height})},[s.cellOrSplitMinWidth?(0,m.kq)("",!0):((0,m.wg)(),(0,m.iD)("div",fr,[(0,m._)("span",null,(0,k.zw)(s.label),1)])),(0,m._)("div",{class:(0,k.C_)(["vuecal__flex vuecal__cells",`${l.view.id}-view`]),grow:"",style:(0,k.j5)(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(s.cells,((t,a)=>((0,m.wg)(),(0,m.j4)(n,{key:a,options:s.options,"edit-events":l.editEvents,data:t,"all-day":!0,"cell-width":s.options.hideWeekdays.length&&(l.vuecal.isWeekView||l.vuecal.isMonthView)&&l.vuecal.cellWidth,"min-timestamp":s.options.minTimestamp,"max-timestamp":s.options.maxTimestamp,"cell-splits":s.daySplits},{event:(0,m.w5)((({event:t,view:s})=>[(0,m.WI)(e.$slots,"event",{view:s,event:t})])),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"])))),128))],6)],4)}const br=["data-split","aria-label","onTouchstart","onMousedown","onClick","onDragover","onDrop"],_r={key:0,class:"cell-time-labels"},wr=["innerHTML"],yr={key:2,class:"vuecal__cell-events"},Dr=["title"];function Mr(e,t,s,i,l,n){const o=(0,m.up)("event");return(0,m.wg)(),(0,m.j4)(a.W3,{class:(0,k.C_)(["vuecal__cell",n.cellClasses]),name:`slide-fade--${n.transitionDirection}`,tag:"div",appear:s.options.transitions,style:(0,k.j5)(n.cellStyles)},{default:(0,m.w5)((()=>[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.splitsCount?n.splits:1,((i,l)=>((0,m.wg)(),(0,m.iD)("div",{class:(0,k.C_)(["vuecal__flex vuecal__cell-content",n.splitsCount&&n.splitClasses(i)]),key:s.options.transitions?`${n.view.id}-${s.data.content}-${l}`:l,"data-split":!!n.splitsCount&&i.id,column:"",tabindex:"0","aria-label":s.data.content,onFocus:t[0]||(t[0]=e=>n.onCellFocus(e)),onKeypress:t[1]||(t[1]=(0,a.D2)((e=>n.onCellkeyPressEnter(e)),["enter"])),onTouchstart:e=>!n.isDisabled&&n.onCellTouchStart(e,n.splitsCount?i.id:null),onMousedown:e=>!n.isDisabled&&n.onCellMouseDown(e,n.splitsCount?i.id:null),onClick:e=>!n.isDisabled&&n.onCellClick(e,i),onDblclick:t[2]||(t[2]=e=>!n.isDisabled&&n.onCellDblClick(e)),onContextmenu:t[3]||(t[3]=e=>!n.isDisabled&&s.options.cellContextmenu&&n.onCellContextMenu(e)),onDragenter:t[4]||(t[4]=t=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragEnter(t,e.$data,s.data.startDate)),onDragover:t=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragOver(t,e.$data,s.data.startDate,n.splitsCount?i.id:null),onDragleave:t[5]||(t[5]=t=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragLeave(t,e.$data,s.data.startDate)),onDrop:t=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragDrop(t,e.$data,s.data.startDate,n.splitsCount?i.id:null)},[s.options.showTimeInCells&&s.options.time&&n.isWeekOrDayView&&!s.allDay?((0,m.wg)(),(0,m.iD)("div",_r,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.vuecal.timeCells,((e,t)=>((0,m.wg)(),(0,m.iD)("span",{class:"cell-time-label",key:t},(0,k.zw)(e.label),1)))),128))])):(0,m.kq)("",!0),n.isWeekOrDayView&&!s.allDay&&n.specialHours.length?((0,m.wg)(!0),(0,m.iD)(m.HY,{key:1},(0,m.Ko)(n.specialHours,((e,t)=>((0,m.wg)(),(0,m.iD)("div",{class:(0,k.C_)(["vuecal__special-hours",`vuecal__special-hours--day${e.day} ${e.class}`]),style:(0,k.j5)(`height: ${e.height}px;top: ${e.top}px`)},[e.label?((0,m.wg)(),(0,m.iD)("div",{key:0,class:"special-hours-label",innerHTML:e.label},null,8,wr)):(0,m.kq)("",!0)],6)))),256)):(0,m.kq)("",!0),(0,m.WI)(e.$slots,"cell-content",{events:n.events,selectCell:e=>n.selectCell(e,!0),split:!!n.splitsCount&&i}),n.eventsCount&&(n.isWeekOrDayView||"month"===n.view.id&&s.options.eventsOnMonthView)?((0,m.wg)(),(0,m.iD)("div",yr,[((0,m.wg)(!0),(0,m.iD)(m.HY,null,(0,m.Ko)(n.splitsCount?i.events:n.events,((t,a)=>((0,m.wg)(),(0,m.j4)(o,{key:a,"cell-formatted-date":s.data.formattedDate,event:t,"all-day":s.allDay,"cell-events":n.splitsCount?i.events:n.events,cellOverlaps:(n.splitsCount?i.overlaps[t._eid]:e.cellOverlaps[t._eid])||[],allOverlaps:(n.splitsCount?i.overlaps:e.cellOverlaps)||[],"event-position":((n.splitsCount?i.overlaps[t._eid]:e.cellOverlaps[t._eid])||[]).position,"overlaps-streak":n.splitsCount?i.overlapsStreak:e.cellOverlapsStreak},{event:(0,m.w5)((({event:t,view:s})=>[(0,m.WI)(e.$slots,"event",{view:s,event:t})])),_:2},1032,["cell-formatted-date","event","all-day","cell-events","cellOverlaps","allOverlaps","event-position","overlaps-streak"])))),128))])):(0,m.kq)("",!0)],42,br)))),128)),n.timelineVisible?((0,m.wg)(),(0,m.iD)("div",{class:"vuecal__now-line",style:(0,k.j5)(`top: ${n.todaysTimePosition}px`),key:s.options.transitions?`${n.view.id}-now-line`:"now-line",title:n.utils.date.formatTime(n.vuecal.now)},null,12,Dr)):(0,m.kq)("",!0)])),_:3},8,["class","name","appear","style"])}const Tr=["eventId","draggable"];function $r(e,t,s,i,l,n){return(0,m.wg)(),(0,m.iD)("div",{class:(0,k.C_)(["vuecal__event",n.eventClasses]),style:(0,k.j5)(n.eventStyles),eventId:`event-id-${s.event.id}`,tabindex:"0",onFocus:t[4]||(t[4]=(...e)=>n.focusEvent&&n.focusEvent(...e)),onKeypress:t[5]||(t[5]=(0,a.D2)((0,a.iM)(((...e)=>n.onEnterKeypress&&n.onEnterKeypress(...e)),["stop"]),["enter"])),onMouseenter:t[6]||(t[6]=(...e)=>n.onMouseEnter&&n.onMouseEnter(...e)),onMouseleave:t[7]||(t[7]=(...e)=>n.onMouseLeave&&n.onMouseLeave(...e)),onTouchstart:t[8]||(t[8]=(0,a.iM)(((...e)=>n.onTouchStart&&n.onTouchStart(...e)),["stop"])),onMousedown:t[9]||(t[9]=e=>n.onMouseDown(e)),onMouseup:t[10]||(t[10]=(...e)=>n.onMouseUp&&n.onMouseUp(...e)),onTouchend:t[11]||(t[11]=(...e)=>n.onMouseUp&&n.onMouseUp(...e)),onTouchmove:t[12]||(t[12]=(...e)=>n.onTouchMove&&n.onTouchMove(...e)),onDblclick:t[13]||(t[13]=(...e)=>n.onDblClick&&n.onDblClick(...e)),draggable:n.draggable,onDragstart:t[14]||(t[14]=e=>n.draggable&&n.onDragStart(e)),onDragend:t[15]||(t[15]=e=>n.draggable&&n.onDragEnd())},[n.vuecal.editEvents.delete&&s.event.deletable?((0,m.wg)(),(0,m.iD)("div",{key:0,class:"vuecal__event-delete",onClick:t[0]||(t[0]=(0,a.iM)(((...e)=>n.deleteEvent&&n.deleteEvent(...e)),["stop"])),onTouchstart:t[1]||(t[1]=(0,a.iM)(((...e)=>n.touchDeleteEvent&&n.touchDeleteEvent(...e)),["stop"]))},(0,k.zw)(n.vuecal.texts.deleteEvent),33)):(0,m.kq)("",!0),(0,m.WI)(e.$slots,"event",{event:s.event,view:n.view.id}),n.resizable?((0,m.wg)(),(0,m.iD)("div",{key:1,class:"vuecal__event-resize-handle",contenteditable:"false",onMousedown:t[2]||(t[2]=(0,a.iM)(((...e)=>n.onResizeHandleMouseDown&&n.onResizeHandleMouseDown(...e)),["stop","prevent"])),onTouchstart:t[3]||(t[3]=(0,a.iM)(((...e)=>n.onResizeHandleMouseDown&&n.onResizeHandleMouseDown(...e)),["stop","prevent"]))},null,32)):(0,m.kq)("",!0)],46,Tr)}var Cr={inject:["vuecal","utils","modules","view","domEvents","editEvents"],props:{cellFormattedDate:{type:String,default:""},event:{type:Object,default:()=>({})},cellEvents:{type:Array,default:()=>[]},cellOverlaps:{type:Object,default:()=>({})},allOverlaps:{type:Object,default:()=>({})},eventPosition:{type:Number,default:0},overlapsStreak:{type:Number,default:0},allDay:{type:Boolean,default:!1}},data:()=>({touch:{dragThreshold:30,startX:0,startY:0,dragged:!1}}),methods:{onMouseDown(e,t=!1){let s;if("BUTTON"==e.target.nodeName?s=e.target:"IMG"==e.srcElement.nodeName&&(s=e.target.parentElement),s?.classList?.contains("v-btn__content")||"BUTTON"==e?.target?.nodeName)return void e.preventDefault();if("ontouchstart"in window&&!t)return!1;const{clickHoldAnEvent:a,focusAnEvent:i,resizeAnEvent:l,dragAnEvent:n}=this.domEvents;if(i._eid===this.event._eid&&a._eid===this.event._eid)return!0;this.focusEvent(),a._eid=null,this.vuecal.editEvents.delete&&this.event.deletable&&(a.timeoutId=setTimeout((()=>{l._eid||n._eid||(a._eid=this.event._eid,this.event.deleting=!0)}),a.timeout))},onMouseUp(e){this.domEvents.focusAnEvent._eid!==this.event._eid||this.touch.dragged||(this.domEvents.focusAnEvent.mousedUp=!0),this.touch.dragged=!1},onMouseEnter(e){e.preventDefault(),this.vuecal.emitWithEvent("event-mouse-enter",this.event)},onMouseLeave(e){e.preventDefault(),this.vuecal.emitWithEvent("event-mouse-leave",this.event)},onTouchMove(e){if("function"!==typeof this.vuecal.onEventClick)return;const{clientX:t,clientY:s}=e.touches[0],{startX:a,startY:i,dragThreshold:l}=this.touch;(Math.abs(t-a)>l||Math.abs(s-i)>l)&&(this.touch.dragged=!0)},onTouchStart(e){this.touch.startX=e.touches[0].clientX,this.touch.startY=e.touches[0].clientY,this.onMouseDown(e,!0)},onEnterKeypress(e){if("function"===typeof this.vuecal.onEventClick)return this.vuecal.onEventClick(this.event,e)},onDblClick(e){if("function"===typeof this.vuecal.onEventDblclick)return this.vuecal.onEventDblclick(this.event,e)},onDragStart(e){"blocker"!=this.event.type&&"non-working-hours"!=this.event.type&&"office365_blocker"!=this.event.type&&(this.event.draggingStatic=!1,this.dnd&&this.dnd.eventDragStart(e,this.event))},onDragEnd(){this.dnd&&this.dnd.eventDragEnd(this.event)},onResizeHandleMouseDown(){this.focusEvent(),this.domEvents.dragAnEvent._eid=null,this.domEvents.resizeAnEvent=Object.assign(this.domEvents.resizeAnEvent,{_eid:this.event._eid,start:(this.segment||this.event).start,split:this.event.split||null,segment:!!this.segment&&this.utils.date.formatDateLite(this.segment.start),originalEnd:new Date((this.segment||this.event).end),originalEndTimeMinutes:this.event.endTimeMinutes}),this.event.resizing=!0},deleteEvent(e=!1){if("ontouchstart"in window&&!e)return!1;this.utils.event.deleteAnEvent(this.event)},touchDeleteEvent(e){this.deleteEvent(!0)},cancelDeleteEvent(){this.event.deleting=!1},focusEvent(){const{focusAnEvent:e}=this.domEvents,t=e._eid;if(t!==this.event._eid){if(t){const e=this.view.events.find((e=>e._eid===t));e&&(e.focused=!1)}this.vuecal.cancelDelete(),this.vuecal.emitWithEvent("event-focus",this.event),e._eid=this.event._eid,this.event.focused=!0}}},computed:{eventDimensions(){const{startTimeMinutes:e,endTimeMinutes:t}=this.segment||this.event;let s=e-this.vuecal.timeFrom;const a=Math.max(Math.round(s*this.vuecal.timeCellHeight/this.vuecal.timeStep),0);s=Math.min(t,this.vuecal.timeTo)-this.vuecal.timeFrom;const i=Math.round(s*this.vuecal.timeCellHeight/this.vuecal.timeStep),l=Math.max(i-a,5);return{top:a,height:l}},eventStyles(){if(this.event.allDay||!this.vuecal.time||!this.event.endTimeMinutes||"month"===this.view.id||this.allDay)return{};let e=100-10*this.eventPosition,t=5*this.eventPosition,s=10*(this.eventPosition+1),a=this.event.master_task_color;if(Array.isArray(this.cellOverlaps.sameOverlaps)&&this.cellOverlaps.sameOverlaps.length){const s=this.cellOverlaps.sameOverlaps.length+1,a=this.cellOverlaps.overlaps.filter((e=>{if(!this.cellOverlaps.sameOverlaps.includes(e)&&this.allOverlaps[this.event._eid].position>this.allOverlaps[e].position)return e}));e=100/s-5,t=100/s*(this.eventPosition-a.length)+5*(this.eventPosition-a.length)/s,a.length&&(e-=a.length*(10/s),t+=5*a.length-10*a.length/s*(this.eventPosition-a.length))}this.vuecal.minEventWidth&&e<this.vuecal.minEventWidth&&(e=this.vuecal.minEventWidth,t=(100-this.vuecal.minEventWidth)/this.cellOverlaps.overlaps.length*this.eventPosition);const{top:i,height:l}=this.eventDimensions;return{background:a,"z-index":`${s}`,top:`${i}px`,height:`${l}px`,width:`${e}%`,left:this.event.left&&`${this.event.left}px`||`${t}%`}},eventClasses(){const{isFirstDay:e,isLastDay:t}=this.segment||{};return{[this.event.class]:!!this.event.class,"event-blocker":this.event.is_blocker,"vuecal__event--focus":this.event.focused,"vuecal__event--resizing":this.event.resizing,"vuecal__event--background":this.event.background,"vuecal__event--deletable":this.event.deleting,"vuecal__event--all-day":this.event.allDay,"vuecal__event--dragging":!this.event.draggingStatic&&this.event.dragging,"vuecal__event--static":this.event.dragging&&this.event.draggingStatic,"vuecal__event--multiple-days":!!this.segment,"event-start":this.segment&&e&&!t,"event-middle":this.segment&&!e&&!t,"event-end":this.segment&&t&&!e}},segment(){return this.event.segments&&this.event.segments[this.cellFormattedDate]||null},draggable(){const{draggable:e,background:t,daysCount:s}=this.event;return this.vuecal.editEvents.drag&&e&&!t&&1===s},resizable(){const{editEvents:e,time:t}=this.vuecal;return e.resize&&this.event.resizable&&t&&!this.allDay&&(!this.segment||this.segment&&this.segment.isLastDay)&&"month"!==this.view.id},dnd(){return this.modules.dnd}}};const jr=(0,$.Z)(Cr,[["render",$r]]);var Er=jr,xr={inject:["vuecal","utils","modules","view","domEvents"],components:{Event:Er},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},data:{type:Object,required:!0},cellSplits:{type:Array,default:()=>[]},minTimestamp:{type:[Number,null],default:null},maxTimestamp:{type:[Number,null],default:null},cellWidth:{type:[Number,Boolean],default:!1},allDay:{type:Boolean,default:!1}},data:()=>({tmUtils:A.Z,cellOverlaps:{},cellOverlapsStreak:1,timeAtCursor:null,highlighted:!1,highlightedSplit:null}),methods:{getSplitAtCursor({target:e}){const t=e.classList.contains("vuecal__cell-split");let s=t?e:this.vuecal.findAncestor(e,"vuecal__cell-split");return s&&(s=s.attributes["data-split"].value,parseInt(s).toString()===s.toString()&&(s=parseInt(s))),s||null},splitClasses(e){return{"vuecal__cell-split":!0,"vuecal__cell-split--highlighted":this.highlightedSplit===e.id,"vuecal__cell-split--weekend":e.isWeekend,[e.class]:!!e.class}},checkCellOverlappingEvents(){this.options.time&&this.eventsCount&&!this.splitsCount&&(1===this.eventsCount?(this.cellOverlaps=[],this.cellOverlapsStreak=1):[this.cellOverlaps,this.cellOverlapsStreak]=this.utils.event.checkCellOverlappingEvents(this.events,this.options))},isDOMElementAnEvent(e){return this.vuecal.isDOMElementAnEvent(e)},selectCell(e,t=!1){const s=this.splitsCount?this.getSplitAtCursor(e):null;this.utils.cell.selectCell(t,this.timeAtCursor,s),this.timeAtCursor=null},onCellkeyPressEnter(e){this.isSelected||this.onCellFocus(e);const t=this.splitsCount?this.getSplitAtCursor(e):null;this.utils.cell.keyPressEnterCell(this.timeAtCursor,t),this.timeAtCursor=null},onCellFocus(e){if(!this.isSelected&&!this.isDisabled){this.isSelected=this.data.startDate;const t=this.splitsCount?this.getSplitAtCursor(e):null,s=this.timeAtCursor||this.data.startDate;this.vuecal.$emit("cell-focus",t?{date:s,split:t}:s)}},onCellMouseDown(e,t=null,s=!1){if("ontouchstart"in window&&!s)return!1;this.isSelected||this.onCellFocus(e);const{clickHoldACell:a,focusAnEvent:i}=this.domEvents;this.domEvents.cancelClickEventCreation=!1,a.eventCreated=!1,this.timeAtCursor=new Date(this.data.startDate);const{minutes:l,cursorCoords:{y:n}}=this.vuecal.minutesAtCursor(e);this.timeAtCursor.setMinutes(l);const o=this.isDOMElementAnEvent(e.target);!o&&i._eid&&((this.view.events.find((e=>e._eid===i._eid))||{}).focused=!1),this.editEvents.create&&!o&&this.setUpEventCreation(e,n)},setUpEventCreation(e,t){if(this.options.dragToCreateEvent&&["week","day"].includes(this.view.id)){const{dragCreateAnEvent:s}=this.domEvents;if(s.startCursorY=t,s.split=this.splitsCount?this.getSplitAtCursor(e):null,s.start=this.timeAtCursor,this.options.snapToTime){let e=60*this.timeAtCursor.getHours()+this.timeAtCursor.getMinutes();const t=e+this.options.snapToTime/2;e=t-t%this.options.snapToTime,s.start.setHours(0,e,0,0)}}else this.options.cellClickHold&&["month","week","day"].includes(this.view.id)&&this.setUpCellHoldTimer(e)},setUpCellHoldTimer(e){const{clickHoldACell:t}=this.domEvents;t.cellId=`${this.vuecal._.uid}_${this.data.formattedDate}`,t.split=this.splitsCount?this.getSplitAtCursor(e):null,t.timeoutId=setTimeout((()=>{if(t.cellId&&!this.domEvents.cancelClickEventCreation){const{_eid:e}=this.utils.event.createAnEvent(this.timeAtCursor,null,t.split?{split:t.split}:{});t.eventCreated=e}}),t.timeout)},onCellTouchStart(e,t=null){this.onCellMouseDown(e,t,!0)},onCellClick(e,t){if(e.offsetY>950&&e.offsetY<1700){const s=t.date;s.setHours(Math.floor(e.offsetY/100),0,0,0);const a=new Date(s);a.setHours(s.getHours()+1);const i=Re()(s).format("HH:mm"),l="Dashboard - Teams"===this.$route.name,n=l?t.employee_id:Number(localStorage.getItem("selectedEmployee")||this.user.id);this.$events.emit("show-menu-modal",{time:i,date:A.Z.formatDateTimeForBackend(s),employee:n}),setTimeout((()=>{this.$events.emit("add-timeblock",{id:null,start:A.Z.formatDateTimeForBackend(s),end:A.Z.formatDateTimeForBackend(a)})}),150)}this.isDOMElementAnEvent(e.target)||this.selectCell(e)},onCellDblClick(e){const t=new Date(this.data.startDate);t.setMinutes(this.vuecal.minutesAtCursor(e).minutes);const s=this.splitsCount?this.getSplitAtCursor(e):null;this.vuecal.$emit("cell-dblclick",s?{date:t,split:s}:t),this.options.dblclickToNavigate&&this.vuecal.switchToNarrowerView()},onCellContextMenu(e){e.stopPropagation(),e.preventDefault();const t=new Date(this.data.startDate),{cursorCoords:s,minutes:a}=this.vuecal.minutesAtCursor(e);t.setMinutes(a);const i=this.splitsCount?this.getSplitAtCursor(e):null;this.vuecal.$emit("cell-contextmenu",{date:t,...s,...i||{},e:e})}},computed:{...(0,U.Se)("auth",["user"]),dnd(){return this.modules.dnd},nowInMinutes(){return this.utils.date.dateToMinutes(this.vuecal.now)},isBeforeMinDate(){return null!==this.minTimestamp&&this.minTimestamp>this.data.endDate.getTime()},isAfterMaxDate(){return this.maxTimestamp&&this.maxTimestamp<this.data.startDate.getTime()},isDisabled(){const{disableDays:e}=this.options,{isYearsOrYearView:t}=this.vuecal;return!(!e.length||!e.includes(this.data.formattedDate)||t)||(this.isBeforeMinDate||this.isAfterMaxDate)},isSelected:{get(){let e=!1;const{selectedDate:t}=this.view;return e="years"===this.view.id?t.getFullYear()===this.data.startDate.getFullYear():"year"===this.view.id?t.getFullYear()===this.data.startDate.getFullYear()&&t.getMonth()===this.data.startDate.getMonth():t.getTime()===this.data.startDate.getTime(),e},set(e){this.view.selectedDate=e,this.vuecal.$emit("update:selected-date",this.view.selectedDate)}},isWeekOrDayView(){return["week","day"].includes(this.view.id)},transitionDirection(){return this.vuecal.transitionDirection},specialHours(){return this.data.specialHours.map((e=>{let{from:t,to:s}=e;return t=Math.max(t,this.options.timeFrom),s=Math.min(s,this.options.timeTo),{...e,height:(s-t)*this.timeScale,top:(t-this.options.timeFrom)*this.timeScale}}))},events(){const{startDate:e,endDate:t}=this.data;let s=[];if(!["years","year"].includes(this.view.id)||this.options.eventsCountOnYearView){if(s=this.view.events.slice(0),"month"===this.view.id&&s.push(...this.view.outOfScopeEvents),s=s.filter((s=>this.utils.event.eventInRange(s,e,t))),this.options.showAllDayEvents&&"month"!==this.view.id&&(s=s.filter((e=>!!e.allDay===this.allDay))),this.options.time&&this.isWeekOrDayView&&!this.allDay){const{timeFrom:e,timeTo:t}=this.options;s=s.filter((s=>{const a=s.daysCount>1&&s.segments[this.data.formattedDate]||{},i=1===s.daysCount&&s.startTimeMinutes<t&&s.endTimeMinutes>e,l=s.daysCount>1&&a.startTimeMinutes<t&&a.endTimeMinutes>e,n=!1;return s.allDay||i||l||n}))}!this.options.time||!this.isWeekOrDayView||this.options.showAllDayEvents&&this.allDay||s.sort(((e,t)=>e.start<t.start?-1:1)),this.cellSplits.length||this.$nextTick(this.checkCellOverlappingEvents)}return s},eventsCount(){return this.events.length},splits(){return this.cellSplits.map(((e,t)=>{const s=this.events.filter((t=>t.split===e.id)),[a,i]=this.utils.event.checkCellOverlappingEvents(s.filter((e=>!e.background&&!e.allDay)),this.options);return{...e,overlaps:a,overlapsStreak:i,events:s}}))},splitsCount(){return this.splits.length},cellClasses(){return{[this.data.class]:!!this.data.class,"vuecal__cell--current":this.data.current,"vuecal__cell--today":this.data.today,"vuecal__cell--out-of-scope":this.data.outOfScope,"vuecal__cell--before-min":this.isDisabled&&this.isBeforeMinDate,"vuecal__cell--after-max":this.isDisabled&&this.isAfterMaxDate,"vuecal__cell--disabled":this.isDisabled,"vuecal__cell--selected":this.isSelected,"vuecal__cell--highlighted":this.highlighted,"vuecal__cell--has-splits":this.splitsCount,"vuecal__cell--has-events":this.eventsCount}},cellStyles(){return{...this.cellWidth?{width:`${this.cellWidth}%`}:{}}},timelineVisible(){const{time:e,timeTo:t}=this.options;return this.data.today&&this.isWeekOrDayView&&e&&!this.allDay&&this.nowInMinutes<=t},todaysTimePosition(){if(!this.data.today||!this.options.time)return;const e=this.nowInMinutes-this.options.timeFrom;return Math.round(e*this.timeScale)},timeScale(){return this.options.timeCellHeight/this.options.timeStep}}};const Wr=(0,$.Z)(xr,[["render",Mr]]);var Sr=Wr,Or={inject:["vuecal","view","editEvents"],components:{"vuecal-cell":Sr},props:{options:{type:Object,required:!0},cells:{type:Array,required:!0},label:{type:String,required:!0},daySplits:{type:Array,default:()=>[]},shortEvents:{type:Boolean,default:!0},height:{type:String,default:""},cellOrSplitMinWidth:{type:Number,default:null}},computed:{hasCellOrSplitWidth(){return!!(this.options.minCellWidth||this.daySplits.length&&this.options.minSplitWidth)}}};const Vr=(0,$.Z)(Or,[["render",gr]]);var zr=Vr,Ar=s(15941);const Ur=1440,Zr={weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm"},Ir=["years","year","month","week","day"],Fr=new Zo(Zr);var Hr={name:"vue-cal",components:{"vuecal-cell":Sr,"vuecal-header":kr,WeekdaysHeadings:hr,AllDayBar:zr},provide(){return{vuecal:this,utils:this.utils,modules:this.modules,previous:this.previous,next:this.next,switchView:this.switchView,updateSelectedDate:this.updateSelectedDate,editEvents:this.editEvents,view:this.view,domEvents:this.domEvents}},props:{activeView:{type:String,default:"week"},scrollToHour:{type:Number,default:0},allDayBarHeight:{type:[String,Number],default:"25px"},cellClickHold:{type:Boolean,default:!0},cellContextmenu:{type:Boolean,default:!1},clickToNavigate:{type:Boolean,default:!1},dblclickToNavigate:{type:Boolean,default:!0},disableDatePrototypes:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},disableViews:{type:Array,default:()=>[]},dragToCreateEvent:{type:Boolean,default:!0},dragToCreateThreshold:{type:Number,default:15},editableEvents:{type:[Boolean,Object],default:!1},unscheduledTime:{type:Array,default:[]},events:{type:Array,default:()=>[]},eventsCountOnYearView:{type:Boolean,default:!1},eventsOnMonthView:{type:[Boolean,String],default:!1},hideBody:{type:Boolean,default:!1},hideTitleBar:{type:Boolean,default:!1},hideViewSelector:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:[String,Object],default:"en"},maxDate:{type:[String,Date],default:""},minCellWidth:{type:Number,default:0},minDate:{type:[String,Date],default:""},minEventWidth:{type:Number,default:0},minSplitWidth:{type:Number,default:0},onEventClick:{type:[Function,null],default:null},onEventCreate:{type:[Function,null],default:null},onEventDblclick:{type:[Function,null],default:null},overlapsPerTimeStep:{type:Boolean,default:!1},resizeX:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:""},showAllDayEvents:{type:[Boolean,String],default:!1},showTimeInCells:{type:Boolean,default:!1},showWeekNumbers:{type:[Boolean,String],default:!1},snapToTime:{type:Number,default:0},small:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},splitDays:{type:Array,default:()=>[]},startWeekOnSunday:{type:Boolean,default:!1},stickySplitLabels:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:Ur},todayButton:{type:Boolean,default:!1},transitions:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},watchRealTime:{type:Boolean,default:!1},xsmall:{type:Boolean,default:!1}},data(){return{ready:!1,texts:{...Zr},utils:{date:!!this.disableDatePrototypes&&Fr.removePrototypes()||Fr,cell:null,event:null},modules:{dnd:null},cellsEl:null,view:{id:"",title:"",startDate:null,endDate:null,firstCellDate:null,lastCellDate:null,selectedDate:null,events:[]},eventIdIncrement:1,now:new Date,timeTickerIds:[null,null],domEvents:{resizeAnEvent:{_eid:null,start:null,split:null,segment:null,originalEndTimeMinutes:0,originalEnd:null,end:null,startCell:null,endCell:null},dragAnEvent:{_eid:null},dragCreateAnEvent:{startCursorY:null,start:null,split:null,event:null},focusAnEvent:{_eid:null,mousedUp:!1},clickHoldAnEvent:{_eid:null,timeout:1200,timeoutId:null},dblTapACell:{taps:0,timeout:500},clickHoldACell:{cellId:null,split:null,timeout:1200,timeoutId:null,eventCreated:!1},cancelClickEventCreation:!1},mutableEvents:[],transitionDirection:"right"}},methods:{async loadLocale(e){if("object"===typeof this.locale)return this.texts=Object.assign({},Zr,e),void this.utils.date.updateTexts(this.texts);if("en"===this.locale){const e=await s.e(3320).then(s.t.bind(s,3320,19));this.texts=Object.assign({},Zr,e)}else s(66667)(`./${e}.json`).then((e=>{this.texts=Object.assign({},Zr,e.default),this.utils.date.updateTexts(this.texts)}))},loadDragAndDrop(){s.e(1466).then(s.bind(s,91466)).then((e=>{const{DragAndDrop:t}=e;this.modules.dnd=new t(this)})).catch((()=>Ar.warn("Vue Cal: Missing drag & drop module.")))},validateView(e){return Ir.includes(e)||(Ar.error(`Vue Cal: invalid active-view parameter provided: "${e}".\nA valid view must be one of: ${Ir.join(", ")}.`),e="week"),this.enabledViews.includes(e)||(Ar.warn(`Vue Cal: the provided active-view "${e}" is disabled. Using the "${this.enabledViews[0]}" view instead.`),e=this.enabledViews[0]),e},switchToNarrowerView(e=null){this.transitionDirection="right";const t=this.enabledViews[this.enabledViews.indexOf(this.view.id)+1];t&&this.switchView(t,e)},switchView(e,t=null,s=!1){e=this.validateView(e);const a=this.utils.date,i=this.view.startDate&&this.view.startDate.getTime();if(this.transitions&&s){if(this.view.id===e)return;const t=this.enabledViews;this.transitionDirection=t.indexOf(this.view.id)>t.indexOf(e)?"left":"right"}const l=this.view.id;switch(this.view.events=[],this.view.id=e,this.view.firstCellDate=null,this.view.lastCellDate=null,t||(t=this.view.selectedDate||this.view.startDate),e){case"years":this.view.startDate=new Date(25*Math.floor(t.getFullYear()/25)||2e3,0,1),this.view.endDate=new Date(this.view.startDate.getFullYear()+25,0,1),this.view.endDate.setSeconds(-1);break;case"year":this.view.startDate=new Date(t.getFullYear(),0,1),this.view.endDate=new Date(t.getFullYear()+1,0,1),this.view.endDate.setSeconds(-1);break;case"month":{this.view.startDate=new Date(t.getFullYear(),t.getMonth(),1),this.view.endDate=new Date(t.getFullYear(),t.getMonth()+1,1),this.view.endDate.setSeconds(-1);let e=new Date(this.view.startDate);if(e.getDay()!==(this.startWeekOnSunday?0:1)&&(e=a.getPreviousFirstDayOfWeek(e,this.startWeekOnSunday)),this.view.firstCellDate=e,this.view.lastCellDate=a.addDays(e,41),this.view.lastCellDate.setHours(23,59,59,0),this.hideWeekends){if([0,6].includes(this.view.firstCellDate.getDay())){const e=6!==this.view.firstCellDate.getDay()||this.startWeekOnSunday?1:2;this.view.firstCellDate=a.addDays(this.view.firstCellDate,e)}if([0,6].includes(this.view.startDate.getDay())){const e=6===this.view.startDate.getDay()?2:1;this.view.startDate=a.addDays(this.view.startDate,e)}if([0,6].includes(this.view.lastCellDate.getDay())){const e=0!==this.view.lastCellDate.getDay()||this.startWeekOnSunday?1:2;this.view.lastCellDate=a.subtractDays(this.view.lastCellDate,e)}if([0,6].includes(this.view.endDate.getDay())){const e=0===this.view.endDate.getDay()?2:1;this.view.endDate=a.subtractDays(this.view.endDate,e)}}break}case"week":{t=a.getPreviousFirstDayOfWeek(t,this.startWeekOnSunday);const e=this.hideWeekends?5:7;this.view.startDate=this.hideWeekends&&this.startWeekOnSunday?a.addDays(t,1):t,this.view.startDate.setHours(0,0,0,0),this.view.endDate=a.addDays(t,e),this.view.endDate.setSeconds(-1);break}case"day":this.view.startDate=t,this.view.startDate.setHours(0,0,0,0),this.view.endDate=new Date(t),this.view.endDate.setHours(23,59,59,0);break}this.addEventsToView();const n=this.view.startDate&&this.view.startDate.getTime();if((l!==e||n!==i)&&(this.$emit("update:activeView",e),this.ready)){const t=this.view.startDate,s={view:e,startDate:t,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate,outOfScopeEvents:this.view.outOfScopeEvents.map(this.cleanupEvent)}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:a.getWeek(this.startWeekOnSunday?a.addDays(t,1):t)}:{}};this.$refs["vuecal_scroll"].scrollTop=this.scrollToHour*this.timeCellHeight,this.$emit("view-change",s)}},previous(){this.previousNext(!1)},next(){this.previousNext()},previousNext(e=!0){const t=this.utils.date;this.transitionDirection=e?"right":"left";const s=e?1:-1;let a=null;const{startDate:i,id:l}=this.view;switch(l){case"years":a=new Date(i.getFullYear()+25*s,0,1);break;case"year":a=new Date(i.getFullYear()+1*s,1,1);break;case"month":a=new Date(i.getFullYear(),i.getMonth()+1*s,1);break;case"week":a=t[e?"addDays":"subtractDays"](t.getPreviousFirstDayOfWeek(i,this.startWeekOnSunday),7);break;case"day":a=t[e?"addDays":"subtractDays"](i,1);const l=a.getDay(),n=this.startWeekOnSunday?l:(l||7)-1,o=this.weekDays[n].hide;if(o){const s=this.weekDays.map(((e,t)=>({...e,i:t})));let i=null,l=0;e?(i=[...s.slice(n),...s].find((e=>(l++,!e.hide))).i,l--):i=[...s,...s.slice(0,n)].reverse().find((e=>(l++,!e.hide))).i,a=t[e?"addDays":"subtractDays"](a,l)}break}a&&this.switchView(l,a)},addEventsToView(e=[]){const t=this.utils.event,{startDate:s,endDate:a,firstCellDate:i,lastCellDate:l}=this.view;if(e.length||(this.view.events=[]),e=e.length?e:[...this.mutableEvents],!e||this.isYearsOrYearView&&!this.eventsCountOnYearView)return;let n=e.filter((e=>t.eventInRange(e,s,a)));this.isYearsOrYearView||this.isMonthView&&!this.eventsOnMonthView||(n=n.map((e=>e.daysCount>1?t.createEventSegments(e,i||s,l||a):e))),this.view.events.push(...n),this.isMonthView&&(this.view.outOfScopeEvents=[],e.forEach((e=>{(t.eventInRange(e,i,s)||t.eventInRange(e,a,l))&&(this.view.events.some((t=>t._eid===e._eid))||this.view.outOfScopeEvents.push(e))})))},findAncestor(e,t){while((e=e.parentElement)&&!e.classList.contains(t));return e},isDOMElementAnEvent(e){return e.classList.contains("vuecal__event")||this.findAncestor(e,"vuecal__event")},onMouseMove(e){const{resizeAnEvent:t,dragAnEvent:s,dragCreateAnEvent:a}=this.domEvents;(null!==t._eid||null!==s._eid||a.start)&&(e.preventDefault(),t._eid?this.eventResizing(e):this.dragToCreateEvent&&a.start&&this.eventDragCreation(e))},onMouseUp(e){const{focusAnEvent:t,resizeAnEvent:s,clickHoldAnEvent:a,clickHoldACell:i,dragCreateAnEvent:l}=this.domEvents,{_eid:n}=a,{_eid:o}=s;let r=!1;const{event:d,start:u}=l,c=this.isDOMElementAnEvent(e.target),m=t.mousedUp;if(t.mousedUp=!1,c&&(this.domEvents.cancelClickEventCreation=!0),i.eventCreated)return;if(o){const{originalEnd:e,originalEndTimeMinutes:t,endTimeMinutes:a}=s,i=this.view.events.find((e=>e._eid===s._eid));if(r=a&&a!==t,i&&i.end.getTime()!==e.getTime()){const t=this.mutableEvents.find((e=>e._eid===s._eid));t.endTimeMinutes=i.endTimeMinutes,t.end=i.end;const a=this.cleanupEvent(i),l={...this.cleanupEvent(i),end:e,endTimeMinutes:i.originalEndTimeMinutes};this.$emit("event-duration-change",{event:a,oldDate:s.originalEnd,originalEvent:l}),this.$emit("event-change",{event:a,originalEvent:l})}i&&(i.resizing=!1),s._eid=null,s.start=null,s.split=null,s.segment=null,s.originalEndTimeMinutes=null,s.originalEnd=null,s.endTimeMinutes=null,s.startCell=null,s.endCell=null}else u&&(d&&(this.emitWithEvent("event-drag-create",d),l.event.resizing=!1),l.start=null,l.split=null,l.event=null);c||o||this.unfocusEvent(),a.timeoutId&&!n&&(clearTimeout(a.timeoutId),a.timeoutId=null),i.timeoutId&&(clearTimeout(i.timeoutId),i.timeoutId=null);const h="function"===typeof this.onEventClick;if(m&&!r&&!n&&!d&&h){let s=this.view.events.find((e=>e._eid===t._eid));return!s&&this.isMonthView&&(s=this.view.outOfScopeEvents.find((e=>e._eid===t._eid))),s&&this.onEventClick(s,e)}},onKeyUp(e){27===e.keyCode&&this.cancelDelete()},eventResizing(e){const{resizeAnEvent:t}=this.domEvents,s=this.view.events.find((e=>e._eid===t._eid))||{segments:{}},{minutes:a,cursorCoords:i}=this.minutesAtCursor(e),l=s.segments&&s.segments[t.segment],{date:n,event:o}=this.utils,r=Math.max(a,this.timeFrom+1,(l||s).startTimeMinutes+1);if(s.endTimeMinutes=t.endTimeMinutes=r,this.snapToTime){const e=s.endTimeMinutes+this.snapToTime/2;s.endTimeMinutes=e-e%this.snapToTime}if(l&&(l.endTimeMinutes=s.endTimeMinutes),s.end.setHours(0,s.endTimeMinutes,s.endTimeMinutes===Ur?-1:0,0),this.resizeX&&this.isWeekView){s.daysCount=n.countDays(s.start,s.end);const e=this.cellsEl,a=e.offsetWidth/e.childElementCount,l=Math.floor(i.x/a);if(null===t.startCell&&(t.startCell=l-(s.daysCount-1)),t.endCell!==l){t.endCell=l;const e=n.addDays(s.start,l-t.startCell),a=Math.max(n.countDays(s.start,e),1);if(a!==s.daysCount){let e=null;e=a>s.daysCount?o.addEventSegment(s):o.removeEventSegment(s),t.segment=e,s.endTimeMinutes+=.001}}}this.$emit("event-resizing",{_eid:s._eid,end:s.end,endTimeMinutes:s.endTimeMinutes})},eventDragCreation(e){const{dragCreateAnEvent:t}=this.domEvents,{start:s,startCursorY:a,split:i}=t,l=new Date(s),{minutes:n,cursorCoords:{y:o}}=this.minutesAtCursor(e);if(t.event||!(Math.abs(a-o)<this.dragToCreateThreshold))if(t.event){if(l.setHours(0,n,n===Ur?-1:0,0),this.snapToTime){let e=60*l.getHours()+l.getMinutes();const t=e+this.snapToTime/2;e=t-t%this.snapToTime,l.setHours(0,e,0,0)}const e=s<l,{event:a}=t;a.start=e?s:l,a.end=e?l:s,a.startTimeMinutes=60*a.start.getHours()+a.start.getMinutes(),a.endTimeMinutes=60*a.end.getHours()+a.end.getMinutes()}else{if(t.event=this.utils.event.createAnEvent(s,1,{split:i}),!t.event)return t.start=null,t.split=null,void(t.event=null);t.event.resizing=!0}},unfocusEvent(){const{focusAnEvent:e,clickHoldAnEvent:t}=this.domEvents,s=this.view.events.find((s=>s._eid===(e._eid||t._eid)));e._eid=null,t._eid=null,s&&(s.focused=!1,s.deleting=!1)},cancelDelete(){const{clickHoldAnEvent:e}=this.domEvents;if(e._eid){const t=this.view.events.find((t=>t._eid===e._eid));t&&(t.deleting=!1),e._eid=null,e.timeoutId=null}},onEventTitleBlur(e,t){if(t.title===e.target.innerHTML)return;const s=t.title;t.title=e.target.innerHTML;const a=this.cleanupEvent(t);this.$emit("event-title-change",{event:a,oldTitle:s}),this.$emit("event-change",{event:a,originalEvent:{...a,title:s}})},updateMutableEvents(){const e=this.utils.date;this.mutableEvents=[],this.events.forEach((t=>{const s="string"===typeof t.start?e.stringToDate(t.start):t.start,a=e.formatDateLite(s),i=e.dateToMinutes(s);let l=null;"string"===typeof t.end&&t.end.includes("24:00")?(l=new Date(t.end.replace(" 24:00","")),l.setHours(23,59,59,0)):l="string"===typeof t.end?e.stringToDate(t.end):t.end;let n=e.formatDateLite(l),o=e.dateToMinutes(l);o&&o!==Ur||(!this.time||"string"===typeof t.end&&10===t.end.length?l.setHours(23,59,59,0):l.setSeconds(l.getSeconds()-1),n=e.formatDateLite(l),o=Ur);const r=a!==n;t=Object.assign({...this.utils.event.eventDefaults},t,{_eid:`${this._.uid}_${this.eventIdIncrement++}`,segments:r?{}:null,start:s,startTimeMinutes:i,end:l,endTimeMinutes:o,daysCount:r?e.countDays(s,l):1,class:t.class}),this.mutableEvents.push(t)}))},minutesAtCursor(e){return this.utils.cell.minutesAtCursor(e)},createEvent(e,t,s={}){return this.utils.event.createAnEvent(e,t,s)},cleanupEvent(e){e={...e};const t=["segments","deletable","deleting","titleEditable","resizable","resizing","draggable","dragging","draggingStatic","focused"];return t.forEach((t=>{t in e&&delete e[t]})),e.repeat||delete e.repeat,e},emitWithEvent(e,t){this.$emit(e,this.cleanupEvent(t))},updateSelectedDate(e){if(e=e&&"string"===typeof e?this.utils.date.stringToDate(e):new Date(e),e&&e instanceof Date){const{selectedDate:t}=this.view;t&&(this.transitionDirection=t.getTime()>e.getTime()?"left":"right"),e.setHours(0,0,0,0),t&&t.getTime()===e.getTime()||(this.view.selectedDate=e),this.switchView(this.view.id)}this.$emit("update:selected-date",this.view.selectedDate)},getWeekNumber(e){const t=this.utils.date,s=this.firstCellDateWeekNumber,a=s+e,i=this.startWeekOnSunday?1:0;return a>52?t.getWeek(t.addDays(this.view.firstCellDate,7*e+i)):a},timeTick(){this.now=new Date,this.timeTickerIds[1]=setTimeout(this.timeTick,6e4)},updateDateTexts(){this.utils.date.updateTexts(this.texts)},alignWithScrollbar(){},cellOrSplitHasEvents(e,t=null){return e.length&&(!t&&e.length||t&&e.some((e=>e.split===t.id)))}},created(){this.utils.cell=new Fo(this),this.utils.event=new qo(this,this.utils.date),this.loadLocale(this.locale),this.editEvents.drag&&this.loadDragAndDrop(),this.updateMutableEvents(this.events),this.view.id=this.currentView,this.selectedDate?this.updateSelectedDate(this.selectedDate):(this.view.selectedDate=new Date,this.switchView(this.currentView)),this.time&&this.watchRealTime&&(this.timeTickerIds[0]=setTimeout(this.timeTick,1e3*(60-this.now.getSeconds())))},mounted(){const e=this.utils.date,t="ontouchstart"in window,{resize:s,drag:a,create:i,delete:l,title:n}=this.editEvents,o=this.onEventClick&&"function"===typeof this.onEventClick;(s||a||i||l||n||o)&&window.addEventListener(t?"touchend":"mouseup",this.onMouseUp),(s||a||i&&this.dragToCreateEvent)&&window.addEventListener(t?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),n&&window.addEventListener("keyup",this.onKeyUp),t&&(this.$refs.vuecal.oncontextmenu=function(e){e.preventDefault(),e.stopPropagation()});const r=this.view.startDate,d={view:this.view.id,startDate:r,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:e.getWeek(this.startWeekOnSunday?e.addDays(r,1):r)}:{}};this.$refs["vuecal_scroll"].addEventListener("scroll",(()=>{this.$refs["vuecal_splits_heading"].style.top=`${this.$refs["vuecal_scroll"].scrollTop}px`})),this.viewportTimelineOffset=this.$refs["vuecal_scroll"].getBoundingClientRect().top,this.$refs["vuecal_scroll"].scrollTop=this.scrollToHour*this.timeCellHeight,this.$emit("ready",d),this.ready=!0},beforeUnmount(){const e="ontouchstart"in window;window.removeEventListener(e?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),window.removeEventListener(e?"touchend":"mouseup",this.onMouseUp),window.removeEventListener("keyup",this.onKeyUp),this.timeTickerIds[0]&&clearTimeout(this.timeTickerIds[0]),this.timeTickerIds[1]&&clearTimeout(this.timeTickerIds[1]),this.timeTickerIds=[null,null]},computed:{editEvents(){return this.editableEvents&&"object"===typeof this.editableEvents?{title:!!this.editableEvents.title,drag:!!this.editableEvents.drag,resize:!!this.editableEvents.resize,create:!!this.editableEvents.create,delete:!!this.editableEvents.delete}:{title:!!this.editableEvents,drag:!!this.editableEvents,resize:!!this.editableEvents,create:!!this.editableEvents,delete:!!this.editableEvents}},views(){return{years:{label:this.texts.years,enabled:!this.disableViews.includes("years")},year:{label:this.texts.year,enabled:!this.disableViews.includes("year")},month:{label:this.texts.month,enabled:!this.disableViews.includes("month")},week:{label:this.texts.week,enabled:!this.disableViews.includes("week")},day:{label:this.texts.day,enabled:!this.disableViews.includes("day")}}},currentView(){return this.validateView(this.activeView)},enabledViews(){return Object.keys(this.views).filter((e=>this.views[e].enabled))},hasTimeColumn(){return this.time&&this.isWeekOrDayView},isShortMonthView(){return this.isMonthView&&"short"===this.eventsOnMonthView},firstCellDateWeekNumber(){const e=this.utils.date,t=this.view.firstCellDate;return e.getWeek(this.startWeekOnSunday?e.addDays(t,1):t)},timeCells(){const e=[];for(let t=this.timeFrom,s=this.timeTo;t<s;t+=this.timeStep)e.push({hours:Math.floor(t/60),minutes:t%60,label:this.utils.date.formatTime(t,this.TimeFormat),value:t});return e},TimeFormat(){return this.timeFormat||(this.twelveHour?"h:mm{am}":"HH:mm")},daySplits(){return(this.splitDays.filter((e=>!e.hide))||[]).map(((e,t)=>({...e,id:e.id||t+1})))},hasSplits(){return this.daySplits.length&&this.isWeekOrDayView},hasShortEvents(){return"short"===this.showAllDayEvents},cellOrSplitMinWidth(){let e=null;return this.hasSplits&&this.minSplitWidth?e=this.visibleDaysCount*this.minSplitWidth*this.daySplits.length:this.minCellWidth&&this.isWeekView&&(e=this.visibleDaysCount*this.minCellWidth),e},allDayBar(){let e=this.allDayBarHeight||null;return e&&!isNaN(e)&&(e+="px"),{cells:this.viewCells,options:this.$props,label:this.texts.allDay,shortEvents:this.hasShortEvents,daySplits:this.hasSplits&&this.daySplits||[],cellOrSplitMinWidth:this.cellOrSplitMinWidth,height:e}},minTimestamp(){let e=null;return this.minDate&&"string"===typeof this.minDate?e=this.utils.date.stringToDate(this.minDate):this.minDate&&this.minDate instanceof Date&&(e=this.minDate),e?e.getTime():null},maxTimestamp(){let e=null;return this.maxDate&&"string"===typeof this.maxDate?e=this.utils.date.stringToDate(this.maxDate):this.maxDate&&this.minDate instanceof Date&&(e=this.maxDate),e?e.getTime():null},weekDays(){let{weekDays:e,weekDaysShort:t=[]}=this.texts;return e=e.slice(0).map(((e,s)=>({label:e,...t.length?{short:t[s]}:{},hide:this.hideWeekends&&s>=5||this.hideWeekdays.length&&this.hideWeekdays.includes(s+1)}))),this.startWeekOnSunday&&e.unshift(e.pop()),e},weekDaysInHeader(){return this.isMonthView||this.isWeekView&&!this.minCellWidth&&!(this.hasSplits&&this.minSplitWidth)},months(){return this.texts.months.map((e=>({label:e})))},specialDayHours(){return this.specialHours&&Object.keys(this.specialHours).length?Array(7).fill("").map(((e,t)=>{let s=this.specialHours[t+1]||[];return Array.isArray(s)||(s=[s]),e=[],s.forEach((({from:s,to:a,class:i,label:l},n)=>{e[n]={day:t+1,from:[null,void 0].includes(s)?null:1*s,to:[null,void 0].includes(a)?null:1*a,class:i||"",label:l||""}})),e})):{}},viewTitle(){const e=this.utils.date;let t="";const s=this.view.startDate,a=s.getFullYear(),i=s.getMonth();switch(this.view.id){case"years":t=this.texts.years;break;case"year":t=a;break;case"month":t=`${this.months[i].label} ${a}`;break;case"week":{const a=this.view.endDate,i=s.getFullYear();let l=this.texts.months[s.getMonth()];this.xsmall&&(l=l.substring(0,3));let n=`${l} ${i}`;if(a.getMonth()!==s.getMonth()){const e=a.getFullYear();let t=this.texts.months[a.getMonth()];this.xsmall&&(t=t.substring(0,3)),n=i===e?`${l} - ${t} ${i}`:this.small?`${l.substring(0,3)} ${i} - ${t.substring(0,3)} ${e}`:`${l} ${i} - ${t} ${e}`}t=`${this.texts.week} ${e.getWeek(this.startWeekOnSunday?e.addDays(s,1):s)} (${n})`;break}case"day":t=this.utils.date.formatDate(s,this.texts.dateFormat,this.texts);break}return t},viewCells(){const e=this.utils.date;let t=[],s=null,a=!1;this.watchRealTime||(this.now=new Date);const i=this.now;switch(this.view.id){case"years":s=this.view.startDate.getFullYear(),t=Array.apply(null,Array(25)).map(((t,a)=>{const l=new Date(s+a,0,1),n=new Date(s+a+1,0,1);return n.setSeconds(-1),{startDate:l,formattedDate:e.formatDateLite(l),endDate:n,content:s+a,current:s+a===i.getFullYear()}}));break;case"year":s=this.view.startDate.getFullYear(),t=Array.apply(null,Array(12)).map(((t,a)=>{const l=new Date(s,a,1),n=new Date(s,a+1,1);return n.setSeconds(-1),{startDate:l,formattedDate:e.formatDateLite(l),endDate:n,content:this.xsmall?this.months[a].label.substr(0,3):this.months[a].label,current:a===i.getMonth()&&s===i.getFullYear()}}));break;case"month":{const s=this.view.startDate.getMonth(),i=new Date(this.view.firstCellDate);a=!1,t=Array.apply(null,Array(42)).map(((t,l)=>{const n=e.addDays(i,l),o=new Date(n);o.setHours(23,59,59,0);const r=!a&&e.isToday(n)&&!a++;return{startDate:n,formattedDate:e.formatDateLite(n),endDate:o,content:n.getDate(),today:r,outOfScope:n.getMonth()!==s,class:`vuecal__cell--day${n.getDay()||7}`}})),(this.hideWeekends||this.hideWeekdays.length)&&(t=t.filter((e=>{const t=e.startDate.getDay()||7;return!(this.hideWeekends&&t>=6||this.hideWeekdays.length&&this.hideWeekdays.includes(t))})));break}case"week":{a=!1;let s=this.view.startDate;const i=this.weekDays;t=i.map(((t,i)=>{const l=e.addDays(s,this.startWeekOnSunday?i-1:i),n=new Date(l);n.setHours(23,59,59,0);const o=(l.getDay()||7)-1;return{startDate:l,formattedDate:e.formatDateLite(l),endDate:n,today:!a&&e.isToday(l)&&!a++,specialHours:this.specialDayHours[o]||[]}})).filter(((e,t)=>!i[t].hide));break}case"day":{const s=this.view.startDate,a=new Date(this.view.startDate);a.setHours(23,59,59,0);const i=(s.getDay()||7)-1;t=[{startDate:s,formattedDate:e.formatDateLite(s),endDate:a,today:e.isToday(s),specialHours:this.specialDayHours[i]||[]}];break}}return t},visibleDaysCount(){return this.isDayView?1:7-this.weekDays.reduce(((e,t)=>e+t.hide),0)},cellWidth(){return 100/this.visibleDaysCount},cssClasses(){const{resizeAnEvent:e,dragAnEvent:t,dragCreateAnEvent:s}=this.domEvents;return{[`vuecal--${this.view.id}-view`]:!0,[`vuecal--${this.locale}`]:this.locale,"vuecal--no-time":!this.time,"vuecal--view-with-time":this.hasTimeColumn,"vuecal--week-numbers":this.showWeekNumbers&&this.isMonthView,"vuecal--twelve-hour":this.twelveHour,"vuecal--click-to-navigate":this.clickToNavigate,"vuecal--hide-weekends":this.hideWeekends,"vuecal--split-days":this.hasSplits,"vuecal--sticky-split-labels":this.hasSplits&&this.stickySplitLabels,"vuecal--overflow-x":this.minCellWidth&&this.isWeekView||this.hasSplits&&this.minSplitWidth,"vuecal--small":this.small,"vuecal--xsmall":this.xsmall,"vuecal--resizing-event":e._eid,"vuecal--drag-creating-event":s.event,"vuecal--dragging-event":t._eid,"vuecal--events-on-month-view":this.eventsOnMonthView,"vuecal--short-events":this.isMonthView&&"short"===this.eventsOnMonthView,"vuecal--has-touch":"undefined"!==typeof window&&"ontouchstart"in window}},isYearsOrYearView(){return["years","year"].includes(this.view.id)},isYearsView(){return"years"===this.view.id},isYearView(){return"year"===this.view.id},isMonthView(){return"month"===this.view.id},isWeekOrDayView(){return["week","day"].includes(this.view.id)},isWeekView(){return"week"===this.view.id},isDayView(){return"day"===this.view.id}},watch:{events:{handler(e,t){this.updateMutableEvents(e),this.addEventsToView()},deep:!0},locale(e){this.loadLocale(e)},selectedDate(e){this.updateSelectedDate(e)},activeView(e){this.switchView(e)}}};const Pr=(0,$.Z)(Hr,[["render",Wo]]);var Lr=Pr,Nr={install:e=>{e.component("Vue-cal",Lr)}};s(48851),s(1292),s(81633),s(51045),s(46187),s(22299),s(93423),s(54687),s(49147),s(6250);l(),d();const Yr={axios:{disabled:!0},i18n:{languages:[{title:"Slovenský",flag:"sk",value:"sk"}],defaultLanguage:"sk"},moxios:{routes:{"GET v1/overview/teams":!0,"GET v1/overview/tasks":!0}}},qr=(0,a.ri)(rn).use(hn).use(un).use(Qn).use(Kn,Yr).use(i.oX).use(o).use(Nr).use(to).use(c(),{color:"#6200EE"}).mount("#app"),Br=qr.$i18n.t},65687:function(e,t,s){"use strict";s.d(t,{Ly:function(){return a},d2:function(){return i},Jc:function(){return l},iy:function(){return n},QS:function(){return r},rI:function(){return o}});var a=s(27484),i=s(53830),l=s.p+"img/checkmark-double.8bc9494b.svg",n=s(34413),o=(s(87500),s(60666)),r=(s(38351),s(35902),s(52906),s.p+"img/office-365.84b4e31a.svg")},7648:function(e,t,s){"use strict";var a=s(66246);t["Z"]={parseErrors(e){return Object.values(e).map((e=>(0,a.$t)(e?.$message))).join(". ")}}},83299:function(e,t){"use strict";t["Z"]={methods:{customFilter(e,t){const s=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),a=t.normalize("NFD").replace(/[\u0300-\u036f]/g,""),i=/[^a-zA-Z0-9 ]/g,l=s.replace(i,""),n=a.replace(i,"");return l.toLowerCase().includes(n.toLowerCase())||""===e}}}},34407:function(e,t,s){"use strict";var a=s(36797),i=s.n(a);t["Z"]={enrichEmployees(e){return e.map((e=>({...e,_fullName:`${e.name} ${e.surname}`,_initials:e.name.charAt(0)+e.surname.charAt(0)})))},formatDateTime(e){return i()(e),i()(e).format("DD.MM.yyyy, HH:mm")},formatDateTimeForBackend(e){return i()(e).format("YYYY-MM-DD HH:mm:ss")},formatDate(e){return i()(e).format("DD.MM.yyyy")},isBefore(e,t=null){return i()(e).isBefore(i()(t))},isAfter(e,t=i()()){return i()(e).isAfter(i()(t))}}},8973:function(e,t,s){var a={"./en.json":20790,"./sk.json":71941};function i(e){var t=l(e);return s(t)}function l(e){if(!s.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=l,e.exports=i,i.id=8973},66667:function(e,t,s){var a={"./ar.json":[68568,8568],"./bg.json":[20684,684],"./bn.json":[61170,1170],"./bs.json":[41161,1161],"./ca.json":[40612,612],"./cs.json":[50213,213],"./da.json":[98542,8542],"./de.json":[4701,4701],"./el.json":[20453,453],"./en.json":[3320,3320],"./es.json":[60076,76],"./et.json":[44075,4075],"./fa.json":[69004,9004],"./fr.json":[60007,7],"./he.json":[23746,3746],"./hr.json":[92921,2921],"./hu.json":[75723,5723],"./id.json":[12502,2502],"./is.json":[13214,3214],"./it.json":[51380,1380],"./ja.json":[72484,2484],"./ka.json":[60285,285],"./ko.json":[79249,9249],"./lt.json":[42838,2838],"./mn.json":[6177,6177],"./nl.json":[99729,9729],"./no.json":[49409,9409],"./pl.json":[25409,5409],"./pt-br.json":[74529,4529],"./ro.json":[29715,9715],"./ru.json":[32113,2113],"./sk.json":[30229,229],"./sl.json":[28636,8636],"./sq.json":[204,204],"./sr.json":[55553,5553],"./sv.json":[75979,5979],"./tr.json":[5268,5268],"./uk.json":[14057,4057],"./vi.json":[88929,8929],"./zh-cn.json":[56730,6730],"./zh-hk.json":[30841,841]};function i(e){if(!s.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],i=t[0];return s.e(t[1]).then((function(){return s.t(i,19)}))}i.keys=function(){return Object.keys(a)},i.id=66667,e.exports=i},27484:function(e,t,s){"use strict";e.exports=s.p+"img/bin.8778f5be.svg"},53830:function(e,t,s){"use strict";e.exports=s.p+"img/checkmark.76754510.svg"},34413:function(e,t,s){"use strict";e.exports=s.p+"img/eye.6d5fa7d3.svg"},87500:function(e,t,s){"use strict";e.exports=s.p+"img/home.a9495a95.svg"},35902:function(e,t,s){"use strict";e.exports=s.p+"img/icon-next.25e7a4f4.svg"},38351:function(e,t,s){"use strict";e.exports=s.p+"img/icon-prev.22ba0fa6.svg"},60666:function(e,t,s){"use strict";e.exports=s.p+"img/pencil.b9009162.svg"},52906:function(e,t,s){"use strict";e.exports=s.p+"img/search.bd80c5fb.svg"},14214:function(e,t,s){"use strict";e.exports=s.p+"img/spinner.34fd3cb2.gif"},20790:function(e){"use strict";e.exports=JSON.parse('{"Value is not a valid email address":"Value is not a valid email address","error":"chyba","Value is required":"Pole je povinné","This field should be at least 8 characters long":"Pole musí obsahovať aspoň 8 znakov","This field should be at least 6 characters long":"Pole musí obsahovať aspoň 6 znakov","This maximum length allowed is 6":"Pole musí obsahovať 6 znakov","The value must be equal to the other value":"Heslá sa nezhodujú"}')},71941:function(e){"use strict";e.exports=JSON.parse('{"Value is not a valid email address":"Zadali ste neplatný email","error":"chyba","Value is required":"Pole je povinné","This field should be at least 8 characters long":"Pole musí obsahovať aspoň 8 znakov","This field should be at least 6 characters long":"Pole musí obsahovať aspoň 6 znakov","This maximum length allowed is 6":"Pole musí obsahovať 6 znakov","The value must be equal to the other value":"Heslá sa nezhodujú"}')}},t={};function s(a){var i=t[a];if(void 0!==i)return i.exports;var l=t[a]={id:a,loaded:!1,exports:{}};return e[a].call(l.exports,l,l.exports,s),l.loaded=!0,l.exports}s.m=e,function(){var e=[];s.O=function(t,a,i,l){if(!a){var n=1/0;for(u=0;u<e.length;u++){a=e[u][0],i=e[u][1],l=e[u][2];for(var o=!0,r=0;r<a.length;r++)(!1&l||n>=l)&&Object.keys(s.O).every((function(e){return s.O[e](a[r])}))?a.splice(r--,1):(o=!1,l<n&&(n=l));if(o){e.splice(u--,1);var d=i();void 0!==d&&(t=d)}}return t}l=l||0;for(var u=e.length;u>0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[a,i,l]}}(),function(){s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,{a:t}),t}}(),function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};s.t=function(a,i){if(1&i&&(a=this(a)),8&i)return a;if("object"===typeof a&&a){if(4&i&&a.__esModule)return a;if(16&i&&"function"===typeof a.then)return a}var l=Object.create(null);s.r(l);var n={};e=e||[null,t({}),t([]),t(t)];for(var o=2&i&&a;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((function(e){n[e]=function(){return a[e]}}));return n["default"]=function(){return a},s.d(l,n),l}}(),function(){s.d=function(e,t){for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}}(),function(){s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce((function(t,a){return s.f[a](e,t),t}),[]))}}(),function(){s.u=function(e){return"js/"+e+"."+{7:"7cef58a7",76:"9977e9df",188:"d74ce2b2",204:"4dd3d03d",213:"c9ed5252",229:"b09f2145",285:"6a0985b5",453:"04d72c77",612:"4ea201aa",684:"017ebeb8",841:"65cae984",907:"bfa01f81",924:"ddc3fd73",1097:"88cdd882",1161:"59a7c68b",1170:"16217940",1380:"fc40de11",1466:"c5d34b19",2113:"2a1bcdfa",2484:"6def3002",2502:"66addef9",2612:"ea780a2e",2838:"aa69ee5c",2885:"d75b7a04",2921:"b5aad8e9",3214:"72d306e7",3311:"bcab8a66",3320:"fe7033d0",3657:"e558064c",3728:"3e558208",3746:"09ee0424",3862:"b079a5bd",4057:"4b3b38fd",4075:"2d83f71e",4392:"02bf9f00",4518:"8e2c3fa8",4529:"6ff3334b",4578:"5a7acff1",4701:"e34c277a",5268:"5d463fbd",5409:"4ce439c3",5456:"e8c8face",5553:"032fcbe7",5723:"09853a5d",5979:"385e1b41",6177:"12db94aa",6730:"61289e01",7073:"57c96578",7343:"1e290ed5",8024:"bb377405",8059:"91d676ea",8520:"cb7009ea",8542:"09badcc3",8568:"7f0dfd32",8636:"2a90cf11",8731:"a28fea96",8929:"ea6da50f",8990:"6dd37151",9004:"ffe04245",9033:"727fb9e6",9249:"d2b0f88c",9407:"ed2e3833",9409:"339f5afb",9715:"21ca1afa",9729:"812aea5b"}[e]+".js"}}(),function(){s.miniCssF=function(e){return"css/"+e+"."+{188:"37c2c58b",907:"fa9ddfdd",2612:"f67d9d9c",2885:"10c05ec3",3862:"f5c9dd84",4392:"01299cfb",5456:"2cf84289",7073:"3978ef96",8059:"2ab138a8",9033:"ace2e544",9407:"f4af91bc"}[e]+".css"}}(),function(){s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="jandl:";s.l=function(a,i,l,n){if(e[a])e[a].push(i);else{var o,r;if(void 0!==l)for(var d=document.getElementsByTagName("script"),u=0;u<d.length;u++){var c=d[u];if(c.getAttribute("src")==a||c.getAttribute("data-webpack")==t+l){o=c;break}}o||(r=!0,o=document.createElement("script"),o.charset="utf-8",o.timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-webpack",t+l),o.src=a),e[a]=[i];var m=function(t,s){o.onerror=o.onload=null,clearTimeout(h);var i=e[a];if(delete e[a],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach((function(e){return e(s)})),t)return t(s)},h=setTimeout(m.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=m.bind(null,o.onerror),o.onload=m.bind(null,o.onload),r&&document.head.appendChild(o)}}}(),function(){s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){s.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){s.p="/"}(),function(){var e=function(e,t,s,a){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css";var l=function(l){if(i.onerror=i.onload=null,"load"===l.type)s();else{var n=l&&("load"===l.type?"missing":l.type),o=l&&l.target&&l.target.href||t,r=new Error("Loading CSS chunk "+e+" failed.\n("+o+")");r.code="CSS_CHUNK_LOAD_FAILED",r.type=n,r.request=o,i.parentNode.removeChild(i),a(r)}};return i.onerror=i.onload=l,i.href=t,document.head.appendChild(i),i},t=function(e,t){for(var s=document.getElementsByTagName("link"),a=0;a<s.length;a++){var i=s[a],l=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(l===e||l===t))return i}var n=document.getElementsByTagName("style");for(a=0;a<n.length;a++){i=n[a],l=i.getAttribute("data-href");if(l===e||l===t)return i}},a=function(a){return new Promise((function(i,l){var n=s.miniCssF(a),o=s.p+n;if(t(n,o))return i();e(a,o,i,l)}))},i={4826:0};s.f.miniCss=function(e,t){var s={188:1,907:1,2612:1,2885:1,3862:1,4392:1,5456:1,7073:1,8059:1,9033:1,9407:1};i[e]?t.push(i[e]):0!==i[e]&&s[e]&&t.push(i[e]=a(e).then((function(){i[e]=0}),(function(t){throw delete i[e],t})))}}(),function(){var e={4826:0};s.f.j=function(t,a){var i=s.o(e,t)?e[t]:void 0;if(0!==i)if(i)a.push(i[2]);else{var l=new Promise((function(s,a){i=e[t]=[s,a]}));a.push(i[2]=l);var n=s.p+s.u(t),o=new Error,r=function(a){if(s.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){var l=a&&("load"===a.type?"missing":a.type),n=a&&a.target&&a.target.src;o.message="Loading chunk "+t+" failed.\n("+l+": "+n+")",o.name="ChunkLoadError",o.type=l,o.request=n,i[1](o)}};s.l(n,r,"chunk-"+t,t)}},s.O.j=function(t){return 0===e[t]};var t=function(t,a){var i,l,n=a[0],o=a[1],r=a[2],d=0;if(n.some((function(t){return 0!==e[t]}))){for(i in o)s.o(o,i)&&(s.m[i]=o[i]);if(r)var u=r(s)}for(t&&t(a);d<n.length;d++)l=n[d],s.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return s.O(u)},a=self["webpackChunkjandl"]=self["webpackChunkjandl"]||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))}();var a=s.O(void 0,[4998],(function(){return s(66246)}));a=s.O(a)})();
|
||
//# sourceMappingURL=index.e583b35f.js.map
|