text: (function(e){function t(t){for(var r,o,i=t[0],u=t[1],c=t[2],d=0,f=[];d<i.length;d++)o=i[d],Object.prototype.hasOwnProperty.call(s,o)&&s[o]&&f.push(s[o][0]),s[o]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);l&&l(t);while(f.length)f.shift()();return a.push.apply(a,c||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],r=!0,i=1;i<n.length;i++){var u=n[i];0!==s[u]&&(r=!1)}r&&(a.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},s={app:0},a=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/";var i=window["webpackJsonp"]=window["webpackJsonp"]||[],u=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var l=u;a.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"02a5":function(e,t,n){},"034f":function(e,t,n){"use strict";var r=n("85ec"),s=n.n(r);s.a},1837:function(e,t,n){},"1c4a":function(e,t,n){"use strict";var r=n("02a5"),s=n.n(r);s.a},"25d3":function(e,t,n){"use strict";var r=n("1837"),s=n.n(r);s.a},"2a65":function(e,t,n){"use strict";var r=n("3dc7"),s=n.n(r);s.a},"3dc7":function(e,t,n){},4678:function(e,t,n){var r={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function s(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}s.keys=function(){return Object.keys(r)},s.resolve=a,e.exports=s,s.id="4678"},"4eda":function(e,t,n){},5172:function(e,t,n){"use strict";var r=n("b62e"),s=n.n(r);s.a},"531c":function(e,t,n){"use strict";var r=n("4eda"),s=n.n(r);s.a},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d"),n("619b"),n("0cdd");var r=n("2b0e"),s=n("8c4f"),a=n("5f5b");n("ab8b"),n("2dd8");r["default"].use(a["a"]);var o,i,u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("b-navbar",{attrs:{id:"bar",toggleable:"lg",type:"dark",variant:"info"}},[n("b-container",{attrs:{fluid:""}},[n("b-navbar-brand",{attrs:{id:"brandtitle",href:"#"}},[e._v("House Work")]),n("b-navbar-nav",{staticClass:"ml-auto"},[e.getConnected?n("b-nav-item-dropdown",{attrs:{right:""},scopedSlots:e._u([{key:"button-content",fn:function(){return[n("LoginStatus")]},proxy:!0}],null,!1,1098105133)},[n("b-dropdown-item",{attrs:{href:"#"}},[e._v("Accueil")]),n("UserHouses"),n("b-dropdown-divider"),n("MenuEntriesHouse"),n("b-dropdown-divider"),n("b-dropdown-item",{attrs:{href:"#/userParam"}},[e._v(e._s(e.$lang.userParam.title))]),n("b-dropdown-item",{attrs:{href:"/logout#"}},[e._v(e._s(e.$lang.logout))])],1):e._e()],1)],1)],1),n("b-container",{attrs:{id:"main",fluid:""}},[n("router-view")],1)],1)},c=[],l=(n("4de4"),n("b0c0"),n("5530")),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("b-form",{on:{submit:[function(t){return e.callLogin(),!1},function(e){e.stopPropagation(),e.preventDefault()}]}},[n("b-card",{staticClass:"text-left",attrs:{id:"hw-login"}},[n("b-card-text",[n("div",{attrs:{role:"group"}},[n("label",{attrs:{for:"input-login"}},[e._v(e._s(e.lang.LoginLabel)+":")]),n("b-form-input",{attrs:{id:"input-login",trim:""},model:{value:e.login,callback:function(t){e.login=t},expression:"login"}})],1),n("div",{attrs:{role:"group"}},[n("label",{attrs:{for:"input-password"}},[e._v(e._s(e.lang.PasswordLabel)+":")]),n("b-form-input",{attrs:{type:"password",id:"input-password",trim:""},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})],1)]),n("b-row",[n("b-col",{attrs:{md:"2"}},[n("b-button",{attrs:{type:"submit"}},[e._v(e._s(e.lang.ConnectionLabel))])],1),n("b-col",{attrs:{md:"2"}},[n("b-button",{on:{click:function(t){return e.callRegister()}}},[e._v(e._s(e.lang.RegisterLabel))])],1)],1)],1)],1)},f=[],m=n("d4ec"),p=n("bee2"),b=n("1157"),g=n.n(b),v={post:function(e,t){return g.a.ajax({url:e,type:"POST",data:JSON.stringify(t),dataType:"json",contentType:"application/json; charset=utf-8"})},get:function(e){return g.a.get(e)},delete:function(e){return g.a.ajax({url:e,method:"DELETE"})}},h=function(){function e(){Object(m["a"])(this,e),this.defUser=null}return Object(p["a"])(e,[{key:"currentUser",value:function(){return null==this.defUser&&(this.defUser=g.a.get("/api/user/current")),this.defUser}},{key:"login",value:function(e,t){return this.defUser=g.a.post("/login",{login:e,password:t}),this.defUser}},{key:"register",value:function(e,t){return this.defUser=g.a.post("/register",{login:e,password:t}),this.defUser}},{key:"update",value:function(e,t){return v.post("/api/user/update/"+e.id,{name:e.name,updatePassword:null!==t,password:t})}}]),e}(),w=new h,y=w,j=(n("4160"),n("159b"),n("ade3")),k=n("2f62"),_=function(){function e(){Object(m["a"])(this,e)}return Object(p["a"])(e,[{key:"convertInputValue",value:function(e){return new Date(e+"T00:00")}},{key:"addDay",value:function(e,t){var n=new Date(e.valueOf());return n.setDate(n.getDate()+t),n}},{key:"sameDay",value:function(e,t){return null!=e&&null!=t&&(e.getDate()==t.getDate()&&e.getMonth()==t.getMonth()&&e.getYear()==t.getYear())}},{key:"removeTime",value:function(e){var t=new Date(e.valueOf());return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}},{key:"build7DayBefore",value:function(e){var t=this.removeTime(e),n=[],r=this.addDay(t,-6);r=this.removeTime(r);while(r.valueOf()<=t.valueOf())n.push(r),r=this.addDay(r,1);return n}},{key:"filterByDay",value:function(e,t,n){var r=this;return null==t?[]:t.filter((function(t){return r.sameDay(e,n(t))}))}},{key:"formatDateISO",value:function(e){var t=""+e.getDate();1==t.length&&(t="0"+t);var n=""+(e.getMonth()+1);return 1==n.length&&(n="0"+n),e.getFullYear()+"-"+n+"-"+t}}]),e}(),T=new _,$=T,O=function(){function e(){Object(m["a"])(this,e)}return Object(p["a"])(e,[{key:"create",value:function(e,t){return v.post("/api/work/create/"+e,t)}},{key:"list",value:function(e,t,n){return v.get("/api/work/list/"+e+"/"+t+"/"+n)}},{key:"remove",value:function(e,t){return v.delete("/api/work/remove/"+e+"/"+t.id)}}]),e}(),C=new O,S=C,D=function(){function e(){Object(m["a"])(this,e)}return Object(p["a"])(e,[{key:"create",value:function(e){return g.a.post("/api/house/create",e)}},{key:"retrieve",value:function(e){return g.a.get("/api/house/retrieve/"+e)}},{key:"update",value:function(e,t){return g.a.post("/api/house/update/"+e,{houseForm:t})}},{key:"remove",value:function(e){return g.a.ajax({url:"/api/house/delete/"+e,method:"DELETE"})}},{key:"listOwned",value:function(){return g.a.get("/api/house/listOwned")}},{key:"listAvailables",value:function(){return g.a.get("/api/house/listAvailables")}},{key:"invitUser",value:function(e,t){return g.a.post("/api/house/register/"+e.id,{login:t})}},{key:"getScoresByUser",value:function(e){return g.a.get("/api/work/scoresByUser/"+e)}}]),e}(),x=new D,E=x;r["default"].use(k["a"]);var H="DISCONNECTED",P="CONNECTED",A="UPDATE_HOUSES",U="REMOVE_HOUSE",L="SELECT_HOUSE",R="ADD_TASK_TYPE",N="REMOVE_TASK_TYPE",B="CHANGE_SELECTED_PERIOD",I="WORKS_UPDATE",W="ADD_WORK",z="REMOVE_WORK",M="CHANGE_SCORES_BY_USER",V="CHANGE_DATE",q="SELECT_HOUSE_ID",Y="CHECK_CONNECTED",K="LOAD_SCORES_BY_USER",F="ACTION_LOAD_HOUSES",G=0,J=1,Q=2,Z=new k["a"].Store({state:{stateConnected:G,currentUser:null,houses:[],selectedHouse:null,currentTime:new Date,works:null,scoresByUser:[]},mutations:(o={},Object(j["a"])(o,P,(function(e,t){e.stateConnected=Q,e.currentUser=Object(l["a"])({},t)})),Object(j["a"])(o,H,(function(e){e.stateConnected=J,e.currentUser=null})),Object(j["a"])(o,A,(function(e,t){t.forEach((function(t){t.owned=e.currentUser.id===t.owner.id})),e.houses=t,null!=e.selectedHouse&&0==e.houses.filter((function(t){return t.id==e.selectedHouse.id})).length&&(e.selectedHouse=null)})),Object(j["a"])(o,L,(function(e,t){console.log(L+" -> ",t),t.owned=e.currentUser.id===t.owner.id,t.types=t.types.sort((function(e,t){return e.id-t.id})),e.selectedHouse=t,e.works=null,null==e.currentTime&&(e.currentTime=$.removeTime(new Date))})),Object(j["a"])(o,U,(function(e,t){e.houses=e.houses.filter((function(e){return e.id!=t.id}))})),Object(j["a"])(o,R,(function(e,t){e.selectedHouse.types.push(t)})),Object(j["a"])(o,N,(function(e,t){e.selectedHouse.types=e.selectedHouse.types.filter((function(e){return e.id!=t.id}))})),Object(j["a"])(o,B,(function(e,t){e.currentTime=t,e.works=null})),Object(j["a"])(o,I,(function(e,t){e.works=t})),Object(j["a"])(o,W,(function(e,t){null!=e.works&&e.works.push(t)})),Object(j["a"])(o,z,(function(e,t){null!=e.works&&(e.works=e.works.filter((function(e){return e.id!=t.id})))})),Object(j["a"])(o,M,(function(e,t){e.scoresByUser=t})),o),actions:(i={},Object(j["a"])(i,V,(function(e,t){console.log("ACTION_CHANGE_DATE"),null==t&&(t=e.state.currentTime,null==t&&(t=$.removeTime(new Date)));var n=$.addDay(t,1).getTime(),r=$.addDay(t,-7).getTime();e.commit(B,t),S.list(e.state.selectedHouse.id,r,n).done((function(t){e.commit(I,t)}))})),Object(j["a"])(i,Y,(function(e){y.currentUser().done((function(t){t.login?e.commit(P,t):e.commit(H)}))})),Object(j["a"])(i,F,(function(e,t){E.listAvailables().done((function(n){console.log("Loaded",n),e.commit(A,n),t&&t()}))})),Object(j["a"])(i,q,(function(e,t){if(!e.state.selectedHouse||e.state.selectedHouse.id!=t){var n=function(){console.log("Seek in ",e.state.houses,t),e.state.houses.filter((function(n){n.id==t&&(console.log("HouseId",t),e.commit(L,n),e.dispatch(V))}))};console.log(e.state.houses),e.state.houses&&0!=e.state.houses.length?n():e.dispatch(F,n)}})),Object(j["a"])(i,K,(function(e){e.state.selectedHouse&&E.getScoresByUser(e.state.selectedHouse.id).done((function(t){e.commit(M,t)}))})),i)}),X={LoginLabel:"E-mail",PasswordLabel:"Mot de passe",ConfirmPasswordLabel:"Confirmer le mot de passe",ConnectionLabel:"Connexion",NameLabel:"Nom",RegisterLabel:"S'enregistrer",PostRegisterLabel:"Nous vous avons envoyé un e-mail avec un lien. Veuillez cliquer sur ce lien pour confirmer votre inscription",CreateHouseLabel:"Ajouter",CreateTaskType:"Ajouter",CreateWork:"Ajouter",CreateWho:"Qui",CreateTask:"Tâche",CreateWhen:"Quand",PleaseConfirmRemoveOf:"Veuillez confirmer la suppression : ",forbidden:"Interdit",logout:"Déconnexion",days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],taskType:{id:"Id",name:"Nom",value:"Valeur",reservedToAdmin:"Admin",shortName:"Alias/Sigle",colorRgb:"Couleur (Rgb)"},userParam:{title:"Paramétrage",name:"Nom",newPassword:"Nouveau mot de passe",confirmPassword:"Nouveau mot de passe(confirmation)",save:"Sauvegarde"}},ee=X,te={name:"Login",data:function(){return{lang:ee,login:"",password:""}},methods:{callLogin:function(e){var t=this;console.log(y),y.login(this.login,this.password).done((function(e){t.$store.commit(P,e),console.log(e),t.$store.dispatch(F,(function(){1==t.$store.state.houses.length&&t.$store.dispatch(F,(function(){t.$router.push("/houseBoard/"+t.$store.state.houses[0].id)}))})),0!=e?t.$router.push("/board"):alert("Error")})),e.stopPropagation(),e.preventDefault()},callRegister:function(){this.$router.push("/register")}}},ne=te,re=(n("e734"),n("2877")),se=Object(re["a"])(ne,d,f,!1,null,"158ac402",null),ae=se.exports,oe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("b-card",{staticClass:"text-left",attrs:{id:"hw-login"}},[n("b-card-text",[n("div",{attrs:{role:"group"}},[n("label",{attrs:{for:"input-login"}},[e._v(e._s(e.lang.LoginLabel)+":")]),n("b-form-input",{attrs:{id:"input-login",trim:""},model:{value:e.login,callback:function(t){e.login=t},expression:"login"}})],1),n("div",{attrs:{role:"group"}},[n("label",{attrs:{for:"input-password"}},[e._v(e._s(e.lang.PasswordLabel)+":")]),n("b-form-input",{attrs:{type:"password",id:"input-password",trim:""},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})],1),n("div",{attrs:{role:"group"}},[n("label",{attrs:{for:"input-confirm-password"}},[e._v(e._s(e.lang.ConfirmPasswordLabel)+":")]),n("b-form-input",{attrs:{type:"password",id:"input-confirm-password",trim:""},model:{value:e.confirmPassword,callback:function(t){e.confirmPassword=t},expression:"confirmPassword"}})],1)]),n("div",{attrs:{id:"hw-button",role:"group"}},[n("b-button",{on:{click:function(t){return e.callRegister()}}},[e._v(e._s(e.lang.RegisterLabel))])],1)],1)},ie=[],ue={name:"Login",data:function(){return{lang:ee,login:"",password:"",confirmPassword:""}},methods:{callRegister:function(){var e=this;this.password==this.confirmPassword&&y.register(this.login,this.password).done((function(t){0!=t?e.$router.push("/postRegister"):alert("Error")}))}}},ce=ue,le=(n("25d3"),Object(re["a"])(ce,oe,ie,!1,null,"e3d07e8a",null)),de=le.exports,fe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("b-card",{staticClass:"text-left",attrs:{id:"hw-login"}},[n("b-card-text",[n("div",[e._v(e._s(e.lang.PostRegisterLabel))])])],1)},me=[],pe={name:"PostRegister",data:function(){return{lang:ee}},methods:{}},be=pe,ge=(n("5172"),Object(re["a"])(be,fe,me,!1,null,"358a8758",null)),ve=ge.exports,he=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"board"}},[null==e.getSelected?n("div",[e._v(" Veuillez sélectionner une maison. ")]):e._e(),null!=e.getSelected?n("div",e._l(e.getHouses,(function(t){return n("b-dropdown-item",{key:t.id,on:{click:function(n){return e.select(t)}}},[n("router-link",{attrs:{to:{name:"houseBoard",params:{houseId:t.id}}}},[e._v(e._s(t.name)+" ")])],1)})),1):e._e()])},we=[],ye={name:"UserBoard",computed:{getSelected:function(){return this.$store.state.selectedHouse},getHouses:function(){return this.$store.state.houses}}},je=ye,ke=(n("bfe1"),Object(re["a"])(je,he,we,!1,null,"3b2a429b",null)),_e=ke.exports,Te=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"board"}},[null==e.getSelected?n("div",[e._v(" Veuillez sélectionner une maison. ")]):e._e(),null!=e.getSelected?n("div",{staticClass:"info"},[n("Works")],1):e._e()])},$e=[],Oe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return null!=e.getSelected?n("div",[n("b-row",[n("b-col",[n("b-input",{attrs:{type:"date",value:e.getCurrentTime},on:{change:e.changeDate}})],1),n("b-col",[n("CreateWorkButton",{ref:"createButton"})],1)],1),null==e.getWorks?n("div",{staticClass:"loading"},[e._v(" Loading... ")]):e._e(),e.days?n("b-row",e._l(e.days,(function(t){return n("b-col",{key:t.valueOf(),staticClass:"day"},[e.canAdd(t)?n("b-button",{staticClass:"dayhd",attrs:{variant:"light"},on:{click:function(n){return e.openCreate(t)}}},[e._v(e._s(e._f("weekday")(t))+" "+e._s(e._f("formatDate")(t)))]):e._e(),e.canAdd(t)?e._e():n("div",{staticClass:"dayhd",attrs:{variant:"light"}},[e._v(e._s(e._f("weekday")(t))+" "+e._s(e._f("formatDate")(t)))]),e._l(e.workByDays[t.valueOf()],(function(t){return n("div",{key:t.id,staticClass:"work",attrs:{"bg-variant":"primary","text-variant":"white"}},[n("span",{staticClass:"circle",style:{backgroundColor:t.type.colorRgb}},[e._v(e._s(t.type.shortName))]),n("p",{staticClass:"textRow"},[e._v(e._s(e._f("displayName")(t.worker)))]),n("p",{staticClass:"textRow"},[e._v(e._s(t.type.name))]),e.canRemove(t)?n("p",{staticClass:"topright",on:{click:function(n){return e.remove(t)}}},[n("span",{staticClass:"material-icons"},[e._v("clear")])]):e._e()])}))],2)})),1):e._e()],1):e._e()},Ce=[],Se=function(){var e=this,t=e.$createElement,n=e._self._c||t;return null!=e.getSelected?n("div",[n("b-button",{on:{click:function(t){return e.create()}}},[e._v(e._s(e.$lang.CreateWork))]),n("b-modal",{ref:"mdlConfirmAdd",attrs:{title:""},on:{ok:function(t){return e.add()}}},[n("div",{attrs:{role:"group"}},[n("label",{attrs:{for:"login"}},[e._v(e._s(e.$lang.CreateWho))]),n("b-form-select",{attrs:{id:"login",options:e.getSelected.users,"value-field":"id","text-field":"login"},model:{value:e.worker,callback:function(t){e.worker=t},expression:"worker"}})],1),n("div",{attrs:{role:"group"}},[n("label",{attrs:{for:"task"}},[e._v(e._s(e.$lang.CreateTask))]),n("b-form-select",{attrs:{id:"task",options:e.getAvailablesTypes,"value-field":"id","text-field":"name"},model:{value:e.taskType,callback:function(t){e.taskType=t},expression:"taskType"}})],1),n("div",{attrs:{role:"group"}},[n("label",{attrs:{for:"when"}},[e._v(e._s(e.$lang.CreateWhen))]),n("b-form-input",{attrs:{id:"when",type:"date"},model:{value:e.when,callback:function(t){e.when=t},expression:"when"}})],1)])],1):e._e()},De=[],xe={name:"Works",data:function(){var e={lang:ee,worker:this.$store.state.currentUser.id,taskType:null,when:null};return e},computed:{getSelected:function(){return Z.state.selectedHouse},getAvailablesTypes:function(){var e=Z.state.selectedHouse,t=e.owned;return e.types.filter((function(e){return t||!e.reservedToAdmin}))}},methods:{create:function(){this.$refs["mdlConfirmAdd"].show()},add:function(){var e=this;S.create(Z.state.selectedHouse.id,{workerId:this.worker,taskTypeId:this.taskType,date:$.convertInputValue(this.when).getTime()}).done((function(e){Z.commit(W,e)})).fail((function(){e.$bvToast.toast(e.$lang.forbidden,{title:e.$lang.forbidden,variant:"danger",autoHideDelay:5e3,solid:!0})}))},showDialog:function(e){this.when=$.formatDateISO(e),console.log(e,this.when),this.$refs["mdlConfirmAdd"].show()}}},Ee=xe,He=Object(re["a"])(Ee,Se,De,!1,null,"befed7d8",null),Pe=He.exports,Ae={name:"Works",data:function(){var e=new Date;e.setDate(e.getDate()-2);var t=new Date;t.setDate(t.getDate()+1);var n={lang:ee,days:null,workByDays:null,limitDate:e.getTime(),maxDate:t.getTime()};return n},components:{CreateWorkButton:Pe},computed:{getSelected:function(){return Z.state.selectedHouse},getCurrentTime:function(){var e=Z.state.currentTime;return null==e?null:$.formatDateISO(e)},getLoadingWorks:function(){return Z.state.loadingWorks},getWorks:function(){return Z.state.works}},watch:{getWorks:function(){var e=this;if(null==Z.state.currentTime)return this.$data.days=null,void(this.$data.workByDays={});this.$data.days=$.build7DayBefore(Z.state.currentTime),this.$data.workByDays={},this.$data.days.forEach((function(t){e.$data.workByDays[t.valueOf()]=$.filterByDay(t,Z.state.works,(function(e){return new Date(e.date)}))}))}},methods:{changeDate:function(e){var t=$.convertInputValue(e);this.$store.dispatch(V,t)},remove:function(e){S.remove(Z.state.selectedHouse.id,e).done((function(){Z.commit(z,e)}))},canAdd:function(e){return console.log(this.limitDate,e.getTime(),this.maxDate),this.$store.state.selectedHouse.owned||this.limitDate<=e.getTime()&&e.getTime()<=this.maxDate},canRemove:function(e){return this.$store.state.selectedHouse.owned||e.date>=this.limitDate&&e.date<=this.maxDate&&e.worker.id===this.$store.state.currentUser.id&&!e.type.reservedToAdmin},openCreate:function(e){this.$refs.createButton.showDialog(e)}}},Ue=Ae,Le=(n("531c"),Object(re["a"])(Ue,Oe,Ce,!1,null,"58160fde",null)),Re=Le.exports,Ne={name:"HouseBoard",computed:{getSelected:function(){return console.log("getSelected",this.$store.state.selectedHouse),this.$store.state.selectedHouse}},components:{Works:Re}},Be=Ne,Ie=(n("8302"),Object(re["a"])(Be,Te,$e,!1,null,"03750be0",null)),We=Ie.exports,ze=function(){var e=this,t=e.$createElement,n=e._self._c||t;return null!=e.getSelected?n("div",[n("div",[e._v("Tasks configuration")]),e._l(e.getSelected.types,(function(t){return n("b-card",{key:t.id},[n("b-row",[n("b-col",{attrs:{lg:"1",md:"12"}},[n("b-form-group",{attrs:{label:e.$lang.taskType.id}},[e._v("("+e._s(t.id)+")")])],1),n("b-col",{attrs:{lg:"2",md:"12"}},[n("b-form-group",{attrs:{label:e.$lang.taskType.name}},[n("b-form-input",{attrs:{id:"input-",readonly:!e.getSelected.owned,type:"text",required:""},on:{change:function(n){return e.update(t)}},model:{value:t.name,callback:function(n){e.$set(t,"name",n)},expression:"t.name"}})],1)],1),n("b-col",{attrs:{lg:"2",md:"12"}},[n("b-form-group",{attrs:{label:e.$lang.taskType.value}},[n("b-form-input",{attrs:{id:"input-",readonly:!e.getSelected.owned,type:"number",required:""},on:{change:function(n){return e.update(t)}},model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"t.value"}})],1)],1),n("b-col",{attrs:{lg:"1",md:"12"}},[n("b-form-group",{attrs:{label:e.$lang.taskType.reservedToAdmin}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.reservedToAdmin,expression:"t.reservedToAdmin"}],attrs:{type:"checkbox",disabled:!e.getSelected.owned},domProps:{checked:Array.isArray(t.reservedToAdmin)?e._i(t.reservedToAdmin,null)>-1:t.reservedToAdmin},on:{change:[function(n){var r=t.reservedToAdmin,s=n.target,a=!!s.checked;if(Array.isArray(r)){var o=null,i=e._i(r,o);s.checked?i<0&&e.$set(t,"reservedToAdmin",r.concat([o])):i>-1&&e.$set(t,"reservedToAdmin",r.slice(0,i).concat(r.slice(i+1)))}else e.$set(t,"reservedToAdmin",a)},function(n){return e.update(t)}]}})])],1),n("b-col",{attrs:{lg:"2",md:"12"}},[n("b-form-group",{attrs:{label:e.$lang.taskType.shortName}},[n("b-form-input",{attrs:{id:"input-",readonly:!e.getSelected.owned,type:"text",required:"",max:"3"},on:{change:function(n){return e.update(t)}},model:{value:t.shortName,callback:function(n){e.$set(t,"shortName",n)},expression:"t.shortName"}})],1)],1),n("b-col",{attrs:{lg:"2",md:"12"}},[n("b-form-group",{attrs:{label:e.$lang.taskType.colorRgb}},[n("b-form-input",{attrs:{id:"input-",readonly:!e.getSelected.owned,type:"text",required:"",max:"6"},on:{change:function(n){return e.update(t)}},model:{value:t.colorRgb,callback:function(n){e.$set(t,"colorRgb",n)},expression:"t.colorRgb"}})],1)],1),n("b-col",{attrs:{lg:"1",md:"12"}},[e.getSelected.owned?n("b-button",{on:{click:function(n){return e.remove(t)}}},[e._v("-")]):e._e()],1)],1)],1)})),e.getSelected.owned?n("b-button",{on:{click:function(t){return e.create()}}},[e._v(e._s(e.$lang.CreateTaskType))]):e._e()],2):e._e()},Me=[],Ve=function(){function e(){Object(m["a"])(this,e)}return Object(p["a"])(e,[{key:"create",value:function(e,t){return v.post("/api/taskType/create/"+e,t)}},{key:"update",value:function(e,t){return v.post("/api/taskType/update/"+e+"/"+t.id,t)}},{key:"remove",value:function(e,t){return v.delete("/api/taskType/delete/"+e+"/"+t.id)}}]),e}(),qe=new Ve,Ye=qe,Ke={name:"TaskTypes",computed:{getSelected:function(){return this.$store.state.selectedHouse}},methods:{create:function(){Ye.create(Z.state.selectedHouse.id,{name:"new",value:"0"}).done((function(e){Z.commit(R,e)}))},update:function(e){Ye.update(Z.state.selectedHouse.id,e)},remove:function(e){Ye.remove(Z.state.selectedHouse.id,e).done((function(e){Z.commit(N,e)}))}}},Fe=Ke,Ge=Object(re["a"])(Fe,ze,Me,!1,null,"05bd3d51",null),Je=Ge.exports,Qe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return null!=e.getSelected?n("div",[n("div",[e._v("Workers")]),e._l(e.getSelected.users,(function(t){return n("b-row",{key:t.id},[n("b-col",[e._v(" "+e._s(t.login)+" ")]),n("b-col",[e.getSelected.owned?n("b-button",{on:{click:function(n){return e.remove(t)}}},[e._v("-")]):e._e()],1)],1)})),e.getSelected.owned?n("b-row",[n("b-col",[n("b-form-input",{attrs:{id:"input-",type:"text",required:""},model:{value:e.newWorker,callback:function(t){e.newWorker=t},expression:"newWorker"}})],1),n("b-col",[n("b-button",{on:{click:function(t){return e.register()}}},[e._v("+")])],1)],1):e._e()],2):e._e()},Ze=[],Xe={name:"WorkersList",data:function(){var e={lang:ee,newWorker:""};return e},computed:{getSelected:function(){return Z.state.selectedHouse}},methods:{register:function(){var e=this;E.invitUser(Z.state.selectedHouse,this.newWorker).done((function(){e.$bvToast.toast("Utilisateur invité",{variant:"success",solid:!0})})).fail((function(){e.$bvToast.toast("Utilisateur non trouvé",{variant:"danger",solid:!0})}))}}},et=Xe,tt=Object(re["a"])(et,Qe,Ze,!1,null,"9598d58c",null),nt=tt.exports,rt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return null!=e.getSelected?n("div",[n("p",[e._v(" "+e._s(e.getSelected.name)+" ("+e._s(e.getSelected.id)+")")]),n("b-card",[n("b-row",e._l(e.getScoresByUser,(function(t){return n("div",{key:t.login,staticClass:"roundContainer",attrs:{col:"1"}},[n("div",{staticClass:"round"},[e._v(" "+e._s(t.value)+" ")]),n("div",[e._v(" "+e._s(e._f("displayName")(t))+" ")])])})),0)],1),n("b-card",[n("b-row",[n("b-col",{attrs:{col:"12"}},[n("b-card",[n("div",{staticClass:"summaryContainer"},[n("canvas",{ref:"weekSummary"})])])],1)],1)],1)],1):e._e()},st=[],at=n("30ef"),ot=n.n(at),it={name:"HouseInfo",computed:{getSelected:function(){return Z.state.selectedHouse},getScoresByUser:function(){return Z.state.scoresByUser}},watch:{getSelected:function(){Z.dispatch(K)},getScoresByUser:function(){this.chart&&this.chart.destroy();var e=[],t=[];Z.state.scoresByUser.forEach((function(n){e.push(n.login),t.push(n.value)}));var n=this.$refs.weekSummary.getContext("2d");this.chart=new ot.a(n,{type:"bar",data:{labels:e,datasets:[{label:"Score",data:t,backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"rgba(255, 99, 132, 1)",borderWidth:1}]},options:{scales:{yAxes:[{display:!0,ticks:{beginAtZero:!0}}]}}}),console.log(this.chart)}},mounted:function(){var e=this;this.$nextTick((function(){console.log(e.$refs.weekSummary),Z.dispatch(K)}))}},ut=it,ct=(n("2a65"),Object(re["a"])(ut,rt,st,!1,null,"6e72eb0e",null)),lt=ct.exports,dt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("em",[e._v(e._s(e.getLogin))])},ft=[],mt={name:"LoginStatus",data:function(){console.log(this.$lang),this.$store.dispatch(Y)},computed:{getLogin:function(){return this.$store.state.currentUser?this.$store.state.currentUser.login:""}}},pt=mt,bt=(n("1c4a"),Object(re["a"])(pt,dt,ft,!1,null,"3de1682e",null)),gt=bt.exports,vt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e._l(e.getHouses,(function(t){return n("b-dropdown-item",{key:t.id,on:{click:function(n){return e.select(t)}}},[n("router-link",{attrs:{to:{name:"houseBoard",params:{houseId:t.id}}}},[e._v(e._s(t.name)+" ")]),e._v(" "),t.owned?n("b-button",{on:{click:function(n){return e.remove(t)}}},[e._v("-")]):e._e()],1)})),n("b-dropdown-item",{on:{click:function(t){return e.create()}}},[e._v(e._s(e.lang.CreateHouseLabel))]),n("b-modal",{ref:"mdlConfirmRemove",attrs:{title:""},on:{ok:function(t){return e.removeConfirmed()}}},[e._v(" "+e._s(e.lang.PleaseConfirmRemoveOf)+" ")]),n("b-modal",{ref:"mdlConfirmAdd",attrs:{title:""},on:{ok:function(t){return e.createConfirmed()}}},[n("div",{attrs:{role:"group"}},[n("label",{attrs:{for:"input-password"}},[e._v(e._s(e.lang.NameLabel)+":")]),n("b-form-input",{attrs:{type:"string",trim:""},model:{value:e.newName,callback:function(t){e.newName=t},expression:"newName"}})],1)])],2)},ht=[],wt={name:"UserHouses",data:function(){var e={lang:ee,owned:[],availables:[],selectedToRemove:null,newName:""};return e},created:function(){this.$store.dispatch(F)},computed:{getHouses:function(){return Z.state.houses},getSelected:function(){return Z.state.selectedHouse}},methods:{loading:function(){},create:function(){this.$refs["mdlConfirmAdd"].show()},createConfirmed:function(){var e=this;E.create({name:this.newName}).done((function(){e.$store.dispatch(F,(function(){})),e.$bvToast.toast("Add success",{variant:"success",solid:!0})}))},remove:function(e){this.selectedToRemove=e,this.$refs["mdlConfirmRemove"].show()},removeConfirmed:function(){var e=this;E.remove(this.selectedToRemove.id).done((function(){Z.commit(U,e.selectedToRemove)}))},select:function(e){Z.commit(L,e),Z.dispatch(V,Z.state.currentTime)}}},yt=wt,jt=Object(re["a"])(yt,vt,ht,!1,null,"8c8c63cc",null),kt=jt.exports,_t=function(){var e=this,t=e.$createElement,n=e._self._c||t;return null!=e.getSelected?n("div",[n("b-dropdown-item",{attrs:{to:{name:"taskTypes",params:{houseId:e.getSelected.id}}}},[e._v(" Types ")]),n("b-dropdown-item",{attrs:{to:{name:"workers",params:{houseId:e.getSelected.id}}}},[e._v(" Travailleurs ")]),n("b-dropdown-item",{attrs:{to:{name:"houseInfo",params:{houseId:e.getSelected.id}}}},[e._v(" Infos ")])],1):e._e()},Tt=[],$t={name:"MenuEntriesHouse",data:function(){var e={lang:ee};return e},computed:{getSelected:function(){return console.log("getSelected",this.$store.state.selectedHouse),this.$store.state.selectedHouse}}},Ot=$t,Ct=Object(re["a"])(Ot,_t,Tt,!1,null,"30e00439",null),St=Ct.exports,Dt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("b-form-group",{attrs:{label:e.$lang.userParam.name}},[n("b-form-input",{attrs:{id:"input-",type:"text",required:""},model:{value:e.getCurrentUser.name,callback:function(t){e.$set(e.getCurrentUser,"name",t)},expression:"getCurrentUser.name"}})],1),n("b-form-group",{attrs:{label:e.$lang.userParam.newPassword}},[n("b-form-input",{attrs:{id:"input-",type:"text",required:""},model:{value:e.newPassword,callback:function(t){e.newPassword=t},expression:"newPassword"}})],1),n("b-form-group",{attrs:{label:e.$lang.userParam.confirmPassword}},[n("b-form-input",{attrs:{id:"input-",type:"text",required:""},model:{value:e.confirmPassword,callback:function(t){e.confirmPassword=t},expression:"confirmPassword"}})],1),n("b-button",{on:{click:function(t){return e.update()}}},[e._v(e._s(e.$lang.userParam.save))])],1)},xt=[],Et={name:"UserParam",data:function(){return{newPassword:"",confirmPassword:""}},computed:{getCurrentUser:function(){return this.$store.state.currentUser}},methods:{update:function(){y.update(this.$store.state.currentUser,this.newPassword&&this.newPassword===this.confirmPassword?this.newPassword:null),this.newPassword="",this.confirmPassword=""}}},Ht=Et,Pt=Object(re["a"])(Ht,Dt,xt,!1,null,"59a9d0f6",null),At=Pt.exports,Ut={houseBoard:!0,taskTypes:!0,workers:!0,houseInfo:!0},Lt=[{path:"/",component:ae},{path:"/board",component:_e},{path:"/houseBoard/:houseId",name:"houseBoard",component:We},{path:"/taskTypes/:houseId",name:"taskTypes",component:Je},{path:"/workers/:houseId",name:"workers",component:nt},{path:"/houseInfo/:houseId",name:"houseInfo",component:lt},{path:"/register",component:de},{path:"/postRegister",component:ve},{path:"/userParam",component:At}],Rt=new s["a"]({routes:Lt}),Nt={name:"app",created:function(){Z.dispatch(Y),console.log("Created:",this.$route.params);var e=this.$route.params.houseId;console.log(e),e&&Z.dispatch(q,e)},components:{LoginStatus:gt,UserHouses:kt,MenuEntriesHouse:St},router:Rt,store:Z,computed:Object(l["a"])(Object(l["a"])({},Object(k["b"])(["stateConnected"])),{},{getConnected:function(){return this.$store.state.stateConnected==Q}}),watch:{stateConnected:function(e){e==J&&0==this.$route.matched.filter((function(e){return!Ut[e.name]})).length&&this.$router.push("/")},$route:function(e,t){console.log(e,t);var n=this.$route.params.houseId;n&&Z.dispatch(q,n)}}},Bt=Nt,It=(n("034f"),Object(re["a"])(Bt,u,c,!1,null,null,null)),Wt=It.exports,zt=function(e){e.prototype.$lang=ee,e.prototype.$store=Z,e.filter("displayName",(function(e){return e.name?e.name:e.login})),e.filter("weekday",(function(e){if(e)return ee.days[e.getDay()]})),e.filter("formatDate",(function(e){if(e){var t=""+e.getDate();1==t.length&&(t="0"+t);var n=""+(e.getMonth()+1);return 1==n.length&&(n="0"+n),t+"/"+n+"/"+e.getFullYear()}}))},Mt=zt;r["default"].use(s["a"]),r["default"].config.productionTip=!1,window.houseWorkStore=Z,Mt(r["default"]),new r["default"]({render:function(e){return e(Wt)}}).$mount("#app")},"72e3":function(e,t,n){},"7cdc":function(e,t,n){},8302:function(e,t,n){"use strict";var r=n("72e3"),s=n.n(r);s.a},"85ec":function(e,t,n){},a4a1:function(e,t,n){},b62e:function(e,t,n){},bfe1:function(e,t,n){"use strict";var r=n("7cdc"),s=n.n(r);s.a},e734:function(e,t,n){"use strict";var r=n("a4a1"),s=n.n(r);s.a}});
  //# sourceMappingURL=app.55467571.js.map