(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["main"],{"0395":function(e,t,r){"use strict";r("caad");var a=r("7a23"),o=Object(a["withScopeId"])("data-v-7717f19a");Object(a["pushScopeId"])("data-v-7717f19a");var c={id:"user-auth-form"},n={id:"user-form"},s={class:"form-items"},u={key:1};Object(a["popScopeId"])();var i=o((function(e,t,r,i,d,l){var b=Object(a["resolveComponent"])("AlertMessage"),p=Object(a["resolveComponent"])("router-link"),O=Object(a["resolveComponent"])("ErrorMessage");return Object(a["openBlock"])(),Object(a["createBlock"])("div",c,[Object(a["createVNode"])("div",n,[Object(a["createVNode"])("div",{class:["form-box",{disabled:e.registration_disabled}]},[e.registration_disabled?(Object(a["openBlock"])(),Object(a["createBlock"])(b,{key:0,message:"user.REGISTER_DISABLED"})):Object(a["createCommentVNode"])("",!0),Object(a["createVNode"])("form",{onSubmit:t[5]||(t[5]=Object(a["withModifiers"])((function(t){return e.onSubmit(e.action)}),["prevent"]))},[Object(a["createVNode"])("div",s,["register"===e.action?Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createBlock"])("input",{key:0,id:"username",disabled:e.registration_disabled,required:"","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.formData.username=t}),placeholder:e.$t("user.USERNAME")},null,8,["disabled","placeholder"])),[[a["vModelText"],e.formData.username]]):Object(a["createCommentVNode"])("",!0),"reset"!==e.action?Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createBlock"])("input",{key:1,id:"email",disabled:e.registration_disabled,required:"",type:"email","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.formData.email=t}),placeholder:"reset-request"===e.action?e.$t("user.ENTER_EMAIL"):e.$t("user.EMAIL")},null,8,["disabled","placeholder"])),[[a["vModelText"],e.formData.email]]):Object(a["createCommentVNode"])("",!0),"reset-request"!==e.action?Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createBlock"])("input",{key:2,id:"password",disabled:e.registration_disabled,required:"",type:"password","onUpdate:modelValue":t[3]||(t[3]=function(t){return e.formData.password=t}),placeholder:"reset"===e.action?e.$t("user.ENTER_PASSWORD"):e.$t("user.PASSWORD")},null,8,["disabled","placeholder"])),[[a["vModelText"],e.formData.password]]):Object(a["createCommentVNode"])("",!0),["register","reset"].includes(e.action)?Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createBlock"])("input",{key:3,id:"confirm-password",disabled:e.registration_disabled,type:"password",required:"","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.formData.password_conf=t}),placeholder:"reset"===e.action?e.$t("user.ENTER_PASSWORD_CONFIRMATION"):e.$t("user.PASSWORD_CONFIRM")},null,8,["disabled","placeholder"])),[[a["vModelText"],e.formData.password_conf]]):Object(a["createCommentVNode"])("",!0)]),Object(a["createVNode"])("button",{type:"submit",disabled:e.registration_disabled},Object(a["toDisplayString"])(e.$t(e.buttonText)),9,["disabled"])],32),"login"===e.action?(Object(a["openBlock"])(),Object(a["createBlock"])("div",u,[Object(a["createVNode"])(p,{class:"password-forgotten",to:"/password-reset/request"},{default:o((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.$t("user.PASSWORD_FORGOTTEN")),1)]})),_:1})])):Object(a["createCommentVNode"])("",!0),e.errorMessages?(Object(a["openBlock"])(),Object(a["createBlock"])(O,{key:2,message:e.errorMessages},null,8,["message"])):Object(a["createCommentVNode"])("",!0)],2)])])})),d=r("1da1"),l=(r("96cf"),r("6c02")),b=r("dad5"),p=r("2906"),O=Object(a["defineComponent"])({name:"UserAuthForm",props:{action:{type:String,required:!0},token:{type:String,default:""}},setup:function(e){var t=Object(a["reactive"])({username:"",email:"",password:"",password_conf:""}),r=Object(l["c"])(),o=Object(p["a"])(),c=Object(a["computed"])((function(){return i(e.action)})),n=Object(a["computed"])((function(){return o.getters[b["a"].GETTERS.ERROR_MESSAGES]})),s=Object(a["computed"])((function(){return o.getters[b["a"].GETTERS.APP_CONFIG]})),u=Object(a["computed"])((function(){return"register"===e.action&&!s.value.is_registration_enabled}));function i(t){switch(t){case"reset-request":case"reset":return"buttons.SUBMIT";default:return"buttons.".concat(e.action.toUpperCase())}}function O(r){switch(r){case"reset":return e.token?o.dispatch(b["e"].ACTIONS.RESET_USER_PASSWORD,{password:t.password,password_conf:t.password_conf,token:e.token}):o.commit(b["a"].MUTATIONS.SET_ERROR_MESSAGES,"user.INVALID_TOKEN");case"reset-request":return o.dispatch(b["e"].ACTIONS.SEND_PASSWORD_RESET_REQUEST,{email:t.email});default:o.dispatch(b["e"].ACTIONS.LOGIN_OR_REGISTER,{actionType:r,formData:t})}}function j(){t.username="",t.email="",t.password="",t.password_conf=""}return Object(a["watch"])((function(){return r.path}),Object(d["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:o.commit(b["a"].MUTATIONS.EMPTY_ERROR_MESSAGES),j();case 2:case"end":return e.stop()}}),e)})))),{appConfig:s,buttonText:c,errorMessages:n,formData:t,registration_disabled:u,onSubmit:O}}});r("c3f6");O.render=i,O.__scopeId="data-v-7717f19a";t["a"]=O},"0ccb":function(e,t,r){var a=r("50c4"),o=r("1148"),c=r("1d80"),n=Math.ceil,s=function(e){return function(t,r,s){var u,i,d=String(c(t)),l=d.length,b=void 0===s?" ":String(s),p=a(r);return p<=l||""==b?d:(u=p-l,i=o.call(b,n(u/b.length)),i.length>u&&(i=i.slice(0,u)),e?d+i:i+d)}};e.exports={start:s(!1),end:s(!0)}},"0fe0":function(e,t,r){"use strict";r("8338")},"121b":function(e,t,r){},"21d8":function(e,t,r){"use strict";r("647c")},"224d":function(e,t,r){"use strict";r("8d2d")},"288e":function(e,t,r){"use strict";r("bbd4")},"2b62":function(e,t,r){"use strict";r("fd0a")},"38f1":function(e,t,r){"use strict";r("92c3")},"3dde":function(e,t,r){},4572:function(e,t,r){"use strict";r("6458")},"4d90":function(e,t,r){"use strict";var a=r("23e7"),o=r("0ccb").start,c=r("9a0c");a({target:"String",proto:!0,forced:c},{padStart:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},"4fad":function(e,t,r){var a=r("23e7"),o=r("6f53").entries;a({target:"Object",stat:!0},{entries:function(e){return o(e)}})},"51ce":function(e,t,r){"use strict";r("6553")},5782:function(e,t,r){},"5e10":function(e,t,r){},"5fcb":function(e,t,r){"use strict";r("f153")},6458:function(e,t,r){},"647c":function(e,t,r){},6553:function(e,t,r){},"6ca7":function(e,t,r){"use strict";r("3dde")},"6f53":function(e,t,r){var a=r("83ab"),o=r("df75"),c=r("fc6a"),n=r("d1e7").f,s=function(e){return function(t){var r,s=c(t),u=o(s),i=u.length,d=0,l=[];while(i>d)r=u[d++],a&&!n.call(s,r)||l.push(e?[r,s[r]]:s[r]);return l}};e.exports={entries:s(!0),values:s(!1)}},7277:function(e,t,r){"use strict";r.r(t);var a=r("7a23"),o=Object(a["withScopeId"])("data-v-79cde82c");Object(a["pushScopeId"])("data-v-79cde82c");var c={key:0,id:"dashboard",class:"view"},n={class:"container mobile-menu"},s={class:"box"},u=Object(a["createVNode"])("i",{class:"fa fa-bar-chart","aria-hidden":"true"},null,-1),i=Object(a["createVNode"])("i",{class:"fa fa-calendar","aria-hidden":"true"},null,-1),d=Object(a["createVNode"])("i",{class:"fa fa-map-o","aria-hidden":"true"},null,-1),l=Object(a["createVNode"])("i",{class:"fa fa-trophy","aria-hidden":"true"},null,-1),b={class:"container"},p={class:"container dashboard-container"},O={class:"left-container dashboard-sub-container"},j={class:"right-container dashboard-sub-container"},f=Object(a["createVNode"])("div",{id:"bottom"},null,-1),m={key:1,class:"app-loading"};Object(a["popScopeId"])();var v=o((function(e,t,r,o,v,k){var y=Object(a["resolveComponent"])("UserStatsCards"),h=Object(a["resolveComponent"])("UserMonthStats"),S=Object(a["resolveComponent"])("UserRecords"),w=Object(a["resolveComponent"])("UserCalendar"),g=Object(a["resolveComponent"])("Timeline"),C=Object(a["resolveComponent"])("Loader");return e.authUser.username&&e.sports.length>0?(Object(a["openBlock"])(),Object(a["createBlock"])("div",c,[Object(a["createVNode"])("div",n,[Object(a["createVNode"])("div",s,[Object(a["createVNode"])("div",{class:["mobile-menu-item",{"is-selected":"chart"===e.isSelected}],onClick:t[1]||(t[1]=function(t){return e.updateDisplayColumn("chart")})},[u],2),Object(a["createVNode"])("div",{class:["mobile-menu-item",{"is-selected":"calendar"===e.isSelected}],onClick:t[2]||(t[2]=function(t){return e.updateDisplayColumn("calendar")})},[i],2),Object(a["createVNode"])("div",{class:["mobile-menu-item",{"is-selected":"timeline"===e.isSelected}],onClick:t[3]||(t[3]=function(t){return e.updateDisplayColumn("timeline")})},[d],2),Object(a["createVNode"])("div",{class:["mobile-menu-item",{"is-selected":"records"===e.isSelected}],onClick:t[4]||(t[4]=function(t){return e.updateDisplayColumn("records")})},[l],2)])]),Object(a["createVNode"])("div",b,[Object(a["createVNode"])(y,{user:e.authUser},null,8,["user"])]),Object(a["createVNode"])("div",p,[Object(a["createVNode"])("div",O,[Object(a["createVNode"])(h,{sports:e.sports,user:e.authUser,class:{"is-hidden":!("chart"===e.isSelected)}},null,8,["sports","user","class"]),Object(a["createVNode"])(S,{sports:e.sports,user:e.authUser,class:{"is-hidden":!("records"===e.isSelected)}},null,8,["sports","user","class"])]),Object(a["createVNode"])("div",j,[Object(a["createVNode"])(w,{sports:e.sports,user:e.authUser,class:{"is-hidden":!("calendar"===e.isSelected)}},null,8,["sports","user","class"]),Object(a["createVNode"])(g,{sports:e.sports,user:e.authUser,class:{"is-hidden":!("timeline"===e.isSelected)}},null,8,["sports","user","class"])])]),f])):(Object(a["openBlock"])(),Object(a["createBlock"])("div",m,[Object(a["createVNode"])(C)]))}));function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r0&&0===e.workouts.length?(Object(a["openBlock"])(),Object(a["createBlock"])("div",D,[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(g(Array(e.initWorkoutsCount).keys()),(function(t){return Object(a["openBlock"])(),Object(a["createBlock"])(s,{user:e.user,key:t},null,8,["user"])})),128))])):(Object(a["openBlock"])(),Object(a["createBlock"])("div",V,[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(e.workouts,(function(t){return Object(a["openBlock"])(),Object(a["createBlock"])(s,{workout:t,sport:e.workouts.length>0?e.sports.filter((function(e){return e.id===t.sport_id}))[0]:null,user:e.user,key:t.id},null,8,["workout","sport","user"])})),128)),0===e.workouts.length?(Object(a["openBlock"])(),Object(a["createBlock"])(u,{key:0})):Object(a["createCommentVNode"])("",!0),e.moreWorkoutsExist?(Object(a["openBlock"])(),Object(a["createBlock"])("div",_,[Object(a["createVNode"])("button",{onClick:t[1]||(t[1]=function(){return e.loadMoreWorkouts&&e.loadMoreWorkouts.apply(e,arguments)})},Object(a["toDisplayString"])(e.$t("workouts.LOAD_MORE_WORKOUT")),1)])):Object(a["createCommentVNode"])("",!0)]))])})),I=r("5530"),M=Object(a["withScopeId"])("data-v-3d1a0054");Object(a["pushScopeId"])("data-v-3d1a0054");var E={class:"timeline-workout"},R={class:"box"},A={class:"workout-user-date"},x={class:"workout-user"},U={key:0},q={key:1,class:"no-map"},W=Object(a["createVNode"])("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1),L={key:0},F=Object(a["createVNode"])("i",{class:"fa fa-road","aria-hidden":"true"},null,-1),P={key:0};Object(a["popScopeId"])();var $=M((function(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("UserPicture"),u=Object(a["resolveComponent"])("router-link"),i=Object(a["resolveComponent"])("StaticMap"),d=Object(a["resolveComponent"])("SportImage");return Object(a["openBlock"])(),Object(a["createBlock"])("div",E,[Object(a["createVNode"])("div",R,[Object(a["createVNode"])("div",A,[Object(a["createVNode"])("div",x,[Object(a["createVNode"])(s,{user:e.user},null,8,["user"]),e.user.username?(Object(a["openBlock"])(),Object(a["createBlock"])(u,{key:0,class:"workout-user-name",to:{name:"User",params:{username:e.user.username}}},{default:M((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.user.username),1)]})),_:1},8,["to"])):Object(a["createCommentVNode"])("",!0)]),e.workout?(Object(a["openBlock"])(),Object(a["createBlock"])(u,{key:0,class:"workout-title",to:{name:"Workout",params:{workoutId:e.workout.id}}},{default:M((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.workout.title),1)]})),_:1},8,["to"])):Object(a["createCommentVNode"])("",!0),e.workout&&e.user?(Object(a["openBlock"])(),Object(a["createBlock"])("div",{key:1,class:"workout-date",title:e.format(e.getDateWithTZ(e.workout.workout_date,e.user.timezone),"dd/MM/yyyy HH:mm")},Object(a["toDisplayString"])(e.formatDistance(new Date(e.workout.workout_date),new Date,{addSuffix:!0,locale:e.locale})),9,["title"])):Object(a["createCommentVNode"])("",!0)]),Object(a["createVNode"])("div",{class:["workout-map",{"no-cursor":!e.workout}],onClick:t[1]||(t[1]=function(t){return e.workout?e.$router.push({name:"Workout",params:{workoutId:e.workout.id}}):null})},[e.workout?(Object(a["openBlock"])(),Object(a["createBlock"])("div",U,[e.workout.with_gpx?(Object(a["openBlock"])(),Object(a["createBlock"])(i,{key:0,workout:e.workout},null,8,["workout"])):(Object(a["openBlock"])(),Object(a["createBlock"])("div",q,Object(a["toDisplayString"])(e.$t("workouts.NO_MAP")),1))])):Object(a["createCommentVNode"])("",!0)],2),Object(a["createVNode"])("div",{class:"workout-data",onClick:t[2]||(t[2]=function(t){return e.$router.push({name:"Workout",params:{workoutId:e.workout.id}})})},[Object(a["createVNode"])("div",null,[e.sport?(Object(a["openBlock"])(),Object(a["createBlock"])(d,{key:0,"sport-label":e.sport.label},null,8,["sport-label"])):Object(a["createCommentVNode"])("",!0)]),Object(a["createVNode"])("div",null,[W,e.workout?(Object(a["openBlock"])(),Object(a["createBlock"])("span",L,Object(a["toDisplayString"])(e.workout.moving),1)):Object(a["createCommentVNode"])("",!0)]),Object(a["createVNode"])("div",null,[F,e.workout?(Object(a["openBlock"])(),Object(a["createBlock"])("span",P,Object(a["toDisplayString"])(e.workout.distance)+" km",1)):Object(a["createCommentVNode"])("",!0)])])])])})),G=r("b166"),H=r("fd3a"),Y=r("8c86");function K(e,t){Object(Y["a"])(2,arguments);var r=Object(H["a"])(e),a=Object(H["a"])(t),o=r.getTime()-a.getTime();return o<0?-1:o>0?1:o}function X(e,t){Object(Y["a"])(2,arguments);var r=Object(H["a"])(e),a=Object(H["a"])(t),o=r.getFullYear()-a.getFullYear(),c=r.getMonth()-a.getMonth();return 12*o+c}function z(e){Object(Y["a"])(1,arguments);var t=Object(H["a"])(e);return t.setHours(23,59,59,999),t}var J=r("8cac");function Z(e){Object(Y["a"])(1,arguments);var t=Object(H["a"])(e);return z(t).getTime()===Object(J["a"])(t).getTime()}function Q(e,t){Object(Y["a"])(2,arguments);var r,a=Object(H["a"])(e),o=Object(H["a"])(t),c=K(a,o),n=Math.abs(X(a,o));if(n<1)r=0;else{1===a.getMonth()&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-c*n);var s=K(a,o)===-c;Z(Object(H["a"])(e))&&1===n&&1===K(e,o)&&(s=!1),r=c*(n-Number(s))}return 0===r?0:r}function ee(e,t){Object(Y["a"])(2,arguments);var r=Object(H["a"])(e),a=Object(H["a"])(t);return r.getTime()-a.getTime()}function te(e,t){Object(Y["a"])(2,arguments);var r=ee(e,t)/1e3;return r>0?Math.floor(r):Math.ceil(r)}var re=r("8923");function ae(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var r in t=t||{},t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}function oe(e){return ae({},e)}var ce=r("2420"),ne=1440,se=2520,ue=43200,ie=86400;function de(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(Y["a"])(2,arguments);var a=r.locale||re["a"];if(!a.formatDistance)throw new RangeError("locale must contain formatDistance property");var o=K(e,t);if(isNaN(o))throw new RangeError("Invalid time value");var c,n,s=oe(r);s.addSuffix=Boolean(r.addSuffix),s.comparison=o,o>0?(c=Object(H["a"])(t),n=Object(H["a"])(e)):(c=Object(H["a"])(e),n=Object(H["a"])(t));var u,i=te(n,c),d=(Object(ce["a"])(n)-Object(ce["a"])(c))/1e3,l=Math.round((i-d)/60);if(l<2)return r.includeSeconds?i<5?a.formatDistance("lessThanXSeconds",5,s):i<10?a.formatDistance("lessThanXSeconds",10,s):i<20?a.formatDistance("lessThanXSeconds",20,s):i<40?a.formatDistance("halfAMinute",null,s):i<60?a.formatDistance("lessThanXMinutes",1,s):a.formatDistance("xMinutes",1,s):0===l?a.formatDistance("lessThanXMinutes",1,s):a.formatDistance("xMinutes",l,s);if(l<45)return a.formatDistance("xMinutes",l,s);if(l<90)return a.formatDistance("aboutXHours",1,s);if(l=o?o:e.user.nb_workouts;Object(a["onBeforeMount"])((function(){return u()}));var n=Object(a["computed"])((function(){return t.getters[pe["f"].GETTERS.TIMELINE_WORKOUTS]})),s=Object(a["computed"])((function(){return n.value.length>0&&null!==n.value[n.value.length-1].previous_workout}));function u(){t.dispatch(pe["f"].ACTIONS.GET_TIMELINE_WORKOUTS,Object(I["a"])({page:r.value,per_page:o},ke["a"]))}function i(){r.value+=1,t.dispatch(pe["f"].ACTIONS.GET_MORE_TIMELINE_WORKOUTS,Object(I["a"])({page:r.value,per_page:o},ke["a"]))}return{initWorkoutsCount:c,moreWorkoutsExist:s,per_page:o,workouts:n,loadMoreWorkouts:i}}});r("e0ff");ye.render=T,ye.__scopeId="data-v-e324c07c";var he=ye,Se={id:"user-calendar"},we={class:"calendar-card box"};function ge(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("CalendarHeader"),u=Object(a["resolveComponent"])("CalendarDays"),i=Object(a["resolveComponent"])("CalendarCells");return Object(a["openBlock"])(),Object(a["createBlock"])("div",Se,[Object(a["createVNode"])("div",we,[Object(a["createVNode"])(s,{day:e.day,"locale-options":"enGB",onDisplayNextMonth:e.displayNextMonth,onDisplayPreviousMonth:e.displayPreviousMonth},null,8,["day","onDisplayNextMonth","onDisplayPreviousMonth"]),Object(a["createVNode"])(u,{"start-date":e.calendarDates.start,"locale-options":"enGB"},null,8,["start-date"]),Object(a["createVNode"])(i,{currentDay:e.day,"end-date":e.calendarDates.end,sports:e.sports,"start-date":e.calendarDates.start,timezone:e.user.timezone,workouts:e.calendarWorkouts,weekStartingMonday:e.user.weekm},null,8,["currentDay","end-date","sports","start-date","timezone","workouts","weekStartingMonday"])])])}var Ce=r("74b5"),Ne=r("a618"),Be={class:"calendar-cells"},De={class:"calendar-cell-day"};function Ve(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("CalendarWorkouts");return Object(a["openBlock"])(),Object(a["createBlock"])("div",Be,[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(e.rows,(function(t,r){return Object(a["openBlock"])(),Object(a["createBlock"])("div",{class:"calendar-row",key:r},[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(t,(function(t,r){return Object(a["openBlock"])(),Object(a["createBlock"])("div",{class:["calendar-cell",{"disabled-cell":!e.isSameMonth(t,e.currentDay),"week-end":e.isWeekEnd(r),today:e.isToday(t)}],key:r},[Object(a["createVNode"])(s,{workouts:e.filterWorkouts(t,e.workouts),sports:e.sports},null,8,["workouts","sports"]),Object(a["createVNode"])("div",De,Object(a["toDisplayString"])(e.format(t,"d")),1)],2)})),128))])})),128))])}r("caad");var _e=r("f7f1");function Te(e){Object(Y["a"])(1,arguments);var t=Object(H["a"])(e);return t.setHours(0,0,0,0),t}function Ie(e,t){Object(Y["a"])(2,arguments);var r=Te(e),a=Te(t);return r.getTime()===a.getTime()}function Me(e,t){Object(Y["a"])(2,arguments);var r=Object(H["a"])(e),a=Object(H["a"])(t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function Ee(e){return Object(Y["a"])(1,arguments),Ie(e,Date.now())}var Re={class:"calendar-workouts"},Ae={class:"desktop-display"},xe={key:0,class:"workouts-display"},Ue={key:1,class:"donut-display"},qe={class:"mobile-display"},We={key:0,class:"donut-display"};function Le(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("CalendarWorkout"),u=Object(a["resolveComponent"])("CalendarWorkoutsChart");return Object(a["openBlock"])(),Object(a["createBlock"])("div",Re,[Object(a["createVNode"])("div",Ae,[e.workouts.length<=e.displayedWorkoutCount?(Object(a["openBlock"])(),Object(a["createBlock"])("div",xe,[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(e.workouts.slice(0,e.displayedWorkoutCount),(function(t,r){return Object(a["openBlock"])(),Object(a["createBlock"])(s,{key:r,workout:t,sportLabel:e.getSportLabel(t,e.sports)},null,8,["workout","sportLabel"])})),128))])):(Object(a["openBlock"])(),Object(a["createBlock"])("div",Ue,[Object(a["createVNode"])(u,{workouts:e.workouts,sports:e.sports,datasets:e.chartDatasets,colors:e.colors},null,8,["workouts","sports","datasets","colors"])]))]),Object(a["createVNode"])("div",qe,[e.workouts.length>0?(Object(a["openBlock"])(),Object(a["createBlock"])("div",We,[Object(a["createVNode"])(u,{workouts:e.workouts,sports:e.sports,datasets:e.chartDatasets,colors:e.colors},null,8,["workouts","sports","datasets","colors"])])):Object(a["createCommentVNode"])("",!0)])])}r("d81d");function Fe(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("SportImage");return Object(a["openBlock"])(),Object(a["createBlock"])("div",{class:"calendar-workout",onClick:t[1]||(t[1]=function(t){return e.$router.push({name:"Workout",params:{workoutId:e.workout.id}})})},[Object(a["createVNode"])(s,{"sport-label":e.sportLabel,title:e.workout.title},null,8,["sport-label","title"]),Object(a["createVNode"])("sup",null,[e.workout.records.length>0?(Object(a["openBlock"])(),Object(a["createBlock"])("i",{key:0,class:"fa fa-trophy custom-fa-small","aria-hidden":"true",title:e.workout.records.map((function(t){return" ".concat(e.t("workouts.RECORD_".concat(t.record_type)))}))},null,8,["title"])):Object(a["createCommentVNode"])("",!0)])])}var Pe=r("47e2"),$e=Object(a["defineComponent"])({name:"CalendarWorkout",props:{workout:{type:Object,required:!0},sportLabel:{type:String,required:!0}},setup:function(){var e=Object(Pe["b"])(),t=e.t;return{t:t}}});r("38f1");$e.render=Fe;var Ge=$e,He=Object(a["withScopeId"])("data-v-b30dea28");Object(a["pushScopeId"])("data-v-b30dea28");var Ye={class:"calendar-workouts-chart"},Ke={class:"workouts-count"},Xe={key:0,class:"workouts-pane"},ze={class:"more-workouts"};Object(a["popScopeId"])();var Je=He((function(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("DonutChart"),u=Object(a["resolveComponent"])("CalendarWorkout"),i=Object(a["resolveDirective"])("click-outside");return Object(a["openBlock"])(),Object(a["createBlock"])("div",Ye,[Object(a["createVNode"])("div",{class:"workouts-chart",onClick:t[1]||(t[1]=function(){return e.togglePane&&e.togglePane.apply(e,arguments)})},[Object(a["createVNode"])("div",Ke,Object(a["toDisplayString"])(e.workouts.length),1),Object(a["createVNode"])(s,{datasets:e.datasets,colors:e.colors},null,8,["datasets","colors"])]),e.isHidden?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createBlock"])("div",Xe,[Object(a["withDirectives"])(Object(a["createVNode"])("div",ze,[Object(a["createVNode"])("i",{class:"fa fa-times calendar-more","aria-hidden":"true",onClick:t[2]||(t[2]=function(){return e.togglePane&&e.togglePane.apply(e,arguments)})}),(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(e.workouts,(function(t,r){return Object(a["openBlock"])(),Object(a["createBlock"])(u,{key:r,workout:t,sportLabel:e.getSportLabel(t,e.sports)},null,8,["workout","sportLabel"])})),128))],512),[[i,e.togglePane]])]))])})),Ze=(r("4fad"),{class:"donut-chart"}),Qe={height:"34",width:"34",viewBox:"0 0 34 34"};function et(e,t,r,o,c,n){return Object(a["openBlock"])(),Object(a["createBlock"])("div",Ze,[(Object(a["openBlock"])(),Object(a["createBlock"])("svg",Qe,[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(Object.entries(e.datasets),(function(t,r){return Object(a["openBlock"])(),Object(a["createBlock"])("g",{key:r},[Object(a["createVNode"])("circle",{cx:e.cx,cy:e.cy,r:e.radius,fill:"transparent",stroke:e.colors[+t[0]],"stroke-dashoffset":e.calculateStrokeDashOffset(t[1].percentage,e.circumference),"stroke-dasharray":e.circumference,"stroke-width":"3","stroke-opacity":"0.8",transform:e.returnCircleTransformValue(r,t[1].percentage)},null,8,["cx","cy","r","stroke","stroke-dashoffset","stroke-dasharray","transform"])])})),128))]))])}r("99af");var tt=Object(a["defineComponent"])({name:"DonutChart",props:{colors:{type:Object,required:!0},datasets:{type:Object,required:!0}},setup:function(){var e=-90,t=16,r=16,a=14,o=2*Math.PI*a;function c(e,t){return t-e*t}function n(a,o){var c="rotate(".concat(e,", ").concat(t,", ").concat(r,")");return e=360*o+e,c}return{angleOffset:e,circumference:o,cx:t,cy:r,radius:a,calculateStrokeDashOffset:c,returnCircleTransformValue:n}}});tt.render=et;var rt=tt,at=r("1119"),ot=Object(a["defineComponent"])({name:"CalendarWorkoutsChart",components:{CalendarWorkout:Ge,DonutChart:rt},props:{colors:{type:Object,required:!0},datasets:{type:Object,required:!0},sports:{type:Object,required:!0},workouts:{type:Object,required:!0}},setup:function(){var e=Object(a["ref"])(!0);function t(t){t.stopPropagation(),e.value=!e.value}return{isHidden:e,getSportLabel:at["a"],togglePane:t}}});r("0fe0");ot.render=Je,ot.__scopeId="data-v-b30dea28";var ct=ot,nt=Object(a["defineComponent"])({name:"CalendarWorkouts",components:{CalendarWorkout:Ge,CalendarWorkoutsChart:ct},props:{workouts:{type:Object,required:!0},sports:{type:Object,required:!0}},setup:function(e){return{chartDatasets:Object(a["computed"])((function(){return Object(ke["c"])(e.workouts)})),colors:Object(a["computed"])((function(){return Object(at["c"])(e.sports)})),displayedWorkoutCount:6,getSportLabel:at["a"]}}});r("21d8");nt.render=Le;var st=nt,ut=Object(a["defineComponent"])({name:"CalendarCells",components:{CalendarWorkouts:st},props:{currentDay:{type:Date,required:!0},endDate:{type:Date,required:!0},sports:{type:Object,required:!0},startDate:{type:Date,required:!0},timezone:{type:String,required:!0},weekStartingMonday:{type:Boolean,required:!0},workouts:{type:Object,required:!0}},setup:function(e){var t=Object(a["ref"])([]),r=Object(a["toRefs"])(e),o=r.startDate,c=r.endDate,n=r.weekStartingMonday;function s(){t.value=[];var e=o.value;while(e<=c.value){for(var r=[],a=0;a<7;a++)r.push(e),e=Object(_e["a"])(e,1);t.value.push(r)}}function u(e){return n.value?[5,6].includes(e):[0,6].includes(e)}function i(t,r){return r?r.filter((function(r){return Ie(Object(je["c"])(r.workout_date,e.timezone),t)})).reverse():[]}return Object(a["onMounted"])((function(){return s()})),Object(a["watch"])((function(){return e.currentDay}),(function(){return s()})),{rows:t,format:G["a"],isSameMonth:Me,isToday:Ee,isWeekEnd:u,filterWorkouts:i}}});r("288e");ut.render=Ve;var it=ut,dt={class:"calendar-days"};function lt(e,t,r,o,c,n){return Object(a["openBlock"])(),Object(a["createBlock"])("div",dt,[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(e.days,(function(t,r){return Object(a["openBlock"])(),Object(a["createBlock"])("div",{class:"calendar-day",key:r},Object(a["toDisplayString"])(e.format(t,"EEE",e.localeOptions)),1)})),128))])}var bt=Object(a["defineComponent"])({name:"CalendarDays",props:{startDate:{type:Date,required:!0},localeOptions:{type:String,required:!0}},setup:function(e){for(var t=[],r=0;r<7;r++)t.push(Object(_e["a"])(e.startDate,r));return{days:t,addDays:_e["a"],format:G["a"]}}});r("5fcb");bt.render=lt;var pt=bt,Ot={class:"calendar-header"},jt=Object(a["createVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1),ft={class:"calendar-month"},mt=Object(a["createVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1);function vt(e,t,r,o,c,n){return Object(a["openBlock"])(),Object(a["createBlock"])("div",Ot,[Object(a["createVNode"])("div",{class:"calendar-arrow calendar-arrow-left",onClick:t[1]||(t[1]=function(t){return e.emit("displayPreviousMonth")})},[jt]),Object(a["createVNode"])("div",ft,[Object(a["createVNode"])("span",null,Object(a["toDisplayString"])(e.format(e.day,"MMM yyyy",e.localeOptions)),1)]),Object(a["createVNode"])("div",{class:"calendar-arrow calendar-arrow-right",onClick:t[2]||(t[2]=function(t){return e.emit("displayNextMonth")})},[mt])])}var kt=Object(a["defineComponent"])({name:"CalendarHeader",props:{day:{type:Date,required:!0},localeOptions:{type:String,required:!0}},emits:["displayNextMonth","displayPreviousMonth"],setup:function(e,t){var r=t.emit;return{emit:r,format:G["a"]}}});r("e4ea");kt.render=vt;var yt=kt,ht=Object(a["defineComponent"])({name:"UserCalendar",components:{CalendarCells:it,CalendarDays:pt,CalendarHeader:yt},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0}},setup:function(e){var t=Object(Oe["a"])();Object(a["onBeforeMount"])((function(){return s()}));var r="yyyy-MM-dd",o=Object(a["ref"])(new Date),c=Object(a["ref"])(Object(je["b"])(o.value,e.user.weekm)),n=Object(a["computed"])((function(){return t.getters[pe["f"].GETTERS.CALENDAR_WORKOUTS]}));function s(){c.value=Object(je["b"])(o.value,e.user.weekm);var a=Object(I["a"])({from:Object(G["a"])(c.value.start,r),to:Object(G["a"])(c.value.end,r),page:1,per_page:100},ke["a"]);t.dispatch(pe["f"].ACTIONS.GET_CALENDAR_WORKOUTS,a)}function u(){o.value=Object(Ce["a"])(o.value,1),s()}function i(){o.value=Object(Ne["a"])(o.value,1),s()}return{day:o,calendarDates:c,calendarWorkouts:n,displayNextMonth:u,displayPreviousMonth:i}}});r("51ce");ht.render=ge;var St=ht,wt=Object(a["withScopeId"])("data-v-7958b39f");Object(a["pushScopeId"])("data-v-7958b39f");var gt={class:"user-month-stats"};Object(a["popScopeId"])();var Ct=wt((function(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("StatChart"),u=Object(a["resolveComponent"])("Card");return Object(a["openBlock"])(),Object(a["createBlock"])("div",gt,[Object(a["createVNode"])(u,null,{title:wt((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.$t("dashboard.THIS_MONTH")),1)]})),content:wt((function(){return[Object(a["createVNode"])(s,{sports:e.sports,user:e.user,"chart-params":e.chartParams,"displayed-sport-ids":e.selectedSportIds,"hide-chart-if-no-data":!0},null,8,["sports","user","chart-params","displayed-sport-ids"])]})),_:1})])})),Nt=r("f628"),Bt=r("ec59"),Dt=Object(a["defineComponent"])({name:"UserMonthStats",components:{StatChart:Bt["a"]},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0}},setup:function(e){var t=new Date;return{chartParams:{duration:"week",start:Object(Nt["a"])(t),end:Object(J["a"])(t)},selectedSportIds:e.sports.map((function(e){return e.id}))}}});r("224d");Dt.render=Ct,Dt.__scopeId="data-v-7958b39f";var Vt=Dt,_t=(r("b64b"),r("4e82"),Object(a["withScopeId"])("data-v-080b37ac"));Object(a["pushScopeId"])("data-v-080b37ac");var Tt={class:"user-records-section"},It={class:"section-title"},Mt=Object(a["createVNode"])("i",{class:"fa fa-trophy custom-fa-small","aria-hidden":"true"},null,-1),Et={class:"user-records"},Rt={key:0,class:"no-records"};Object(a["popScopeId"])();var At=_t((function(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("RecordsCard");return Object(a["openBlock"])(),Object(a["createBlock"])("div",Tt,[Object(a["createVNode"])("div",It,[Mt,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.$t("workouts.RECORD",2)),1)]),Object(a["createVNode"])("div",Et,[0===Object.keys(e.recordsBySport).length?(Object(a["openBlock"])(),Object(a["createBlock"])("div",Rt,Object(a["toDisplayString"])(e.$t("workouts.NO_RECORDS")),1)):Object(a["createCommentVNode"])("",!0),(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(Object.keys(e.recordsBySport).sort(),(function(t){return Object(a["openBlock"])(),Object(a["createBlock"])(s,{sportTranslatedLabel:t,records:e.recordsBySport[t],key:t},null,8,["sportTranslatedLabel","records"])})),128))])])})),xt=Object(a["withScopeId"])("data-v-db29ce96");Object(a["pushScopeId"])("data-v-db29ce96");var Ut={class:"records-card"},qt={class:"record-type"},Wt={class:"record-value"},Lt={class:"record-date"};Object(a["popScopeId"])();var Ft=xt((function(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("SportImage"),u=Object(a["resolveComponent"])("router-link"),i=Object(a["resolveComponent"])("Card");return Object(a["openBlock"])(),Object(a["createBlock"])("div",Ut,[Object(a["createVNode"])(i,null,{title:xt((function(){return[Object(a["createVNode"])(s,{"sport-label":e.records.label},null,8,["sport-label"]),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.sportTranslatedLabel),1)]})),content:xt((function(){return[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(e.records.records,(function(t){return Object(a["openBlock"])(),Object(a["createBlock"])("div",{class:"record",key:t.id},[Object(a["createVNode"])("span",qt,Object(a["toDisplayString"])(e.t("workouts.RECORD_".concat(t.record_type))),1),Object(a["createVNode"])("span",Wt,Object(a["toDisplayString"])(t.value),1),Object(a["createVNode"])("span",Lt,[Object(a["createVNode"])(u,{to:{name:"Workout",params:{workoutId:t.workout_id}}},{default:xt((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(t.workout_date),1)]})),_:2},1032,["to"])])])})),128))]})),_:1})])})),Pt=Object(a["defineComponent"])({name:"RecordsCard",props:{records:{type:Object,required:!0},sportTranslatedLabel:{type:String,required:!0}},setup:function(){var e=Object(Pe["b"])(),t=e.t;return{t:t}}});r("2b62");Pt.render=Ft,Pt.__scopeId="data-v-db29ce96";var $t=Pt,Gt=(r("7db0"),function(e,t){var r;switch(e.record_type){case"AS":case"MS":r="".concat(e.value," km/h");break;case"FD":r="".concat(e.value," km");break;case"LD":r=e.value;break;default:throw new Error('Invalid record type, expected: "AS", "FD", "LD", "MD", got: "'.concat(e.record_type,'"'))}return{workout_date:Object(je["a"])(Object(je["c"])(e.workout_date,t)).workout_date,workout_id:e.workout_id,id:e.id,record_type:e.record_type,value:r}}),Ht=function(e,t,r){return e.reduce((function(e,a){var o=t.find((function(e){return e.id===a.sport_id}));return o&&o.label&&(void 0===e[o.translatedLabel]&&(e[o.translatedLabel]={label:o.label,records:[]}),e[o.translatedLabel].records.push(Gt(a,r))),e}),{})},Yt=Object(a["defineComponent"])({name:"UserRecords",components:{RecordsCard:$t},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0}},setup:function(e){var t=Object(Pe["b"])(),r=t.t,o=Object(a["computed"])((function(){return Ht(e.user.records,Object(at["d"])(e.sports,r),e.user.timezone)}));return{recordsBySport:o}}});r("c11a");Yt.render=At,Yt.__scopeId="data-v-080b37ac";var Kt=Yt,Xt=(r("b680"),r("a9e3"),{id:"user-stats"});function zt(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("StatCard");return Object(a["openBlock"])(),Object(a["createBlock"])("div",Xt,[Object(a["createVNode"])(s,{icon:"calendar",value:e.user.nb_workouts,text:e.$t("workouts.WORKOUT",e.user.nb_workouts)},null,8,["value","text"]),Object(a["createVNode"])(s,{icon:"road",value:Number(e.user.total_distance).toFixed(2),text:e.$t("workouts.KM")},null,8,["value","text"]),Object(a["createVNode"])(s,{icon:"clock-o",value:e.total_duration.days,text:e.total_duration.duration},null,8,["value","text"]),Object(a["createVNode"])(s,{icon:"tags",value:e.user.nb_sports,text:e.$t("workouts.SPORT",e.user.nb_sports)},null,8,["value","text"])])}r("ac1f"),r("466d"),r("1276");var Jt=r("05d9"),Zt=Object(a["defineComponent"])({name:"UserStatsCards",components:{StatCard:Jt["a"]},props:{user:{type:Object,required:!0}},setup:function(e){var t=Object(Pe["b"])(),r=t.t,o=Object(a["computed"])((function(){return e.user.total_duration}));function c(e){var t=e.value.match(/day/g)?e.value.split(", ")[1]:e.value;return{days:e.value.match(/day/g)?"".concat(e.value.split(" ")[0]," ").concat(e.value.match(/days/g)?r("common.DAY",2):r("common.DAY",1)):"0 ".concat(r("common.DAY",2),","),duration:"".concat(t.split(":")[0],"h ").concat(t.split(":")[1],"min")}}return{total_duration:Object(a["computed"])((function(){return c(o)}))}}});r("d224");Zt.render=zt;var Qt=Zt,er=Object(a["defineComponent"])({name:"Dashboard",components:{Timeline:he,UserCalendar:St,UserMonthStats:Vt,UserRecords:Kt,UserStatsCards:Qt},setup:function(){var e=Object(Oe["a"])(),t=Object(a["computed"])((function(){return e.getters[pe["e"].GETTERS.AUTH_USER_PROFILE]})),r=Object(a["computed"])((function(){return e.getters[pe["b"].GETTERS.SPORTS]})),o=Object(a["ref"])("chart");function c(e){o.value=e}return{authUser:t,sports:r,isSelected:o,updateDisplayColumn:c}}});r("4572");er.render=v,er.__scopeId="data-v-79cde82c";t["default"]=er},7416:function(e,t,r){"use strict";r.d(t,"a",(function(){return B})),r.d(t,"b",(function(){return D})),r.d(t,"c",(function(){return V}));r("d81d"),r("4de4"),r("caad"),r("2532");var a=r("b166"),o=r("d6e9"),c=r("fe1f"),n=r("cdb6"),s=r("8c86");function u(e,t){Object(s["a"])(2,arguments);var r=Object(c["a"])(t);return Object(n["a"])(e,-r)}var i=r("69eb"),d=r("a618"),l=r("f628"),b=r("fd3a");function p(e){Object(s["a"])(1,arguments);var t=Object(b["a"])(e),r=t.getFullYear();return t.setFullYear(r+1,0,0),t.setHours(23,59,59,999),t}var O=r("2fc8"),j=r("8cac"),f=r("f7f1");function m(e,t){Object(s["a"])(2,arguments);var r=Object(c["a"])(t),a=7*r;return Object(f["a"])(e,a)}function v(e,t){Object(s["a"])(2,arguments);var r=Object(c["a"])(t);return m(e,-r)}var k=r("74b5"),y=r("5e65"),h=r("1119"),S={week:{api:"yyyy-MM-dd",chart:"dd/MM/yyyy"},month:{api:"yyyy-MM",chart:"MM/yyyy"},year:{api:"yyyy",chart:"yyyy"}},w=["nb_workouts","total_duration","total_distance"],g=function(e,t){for(var r=[],a=Object(y["d"])(e.duration,e.start,t);a<=e.end;a=Object(y["e"])(e.duration,a))r.push(a);return r},C=function(e,t){return{label:e,backgroundColor:[t],data:[]}},N=function(e){var t={nb_workouts:[],total_distance:[],total_duration:[]};return e.map((function(e){var r=h["b"][e.label];t.nb_workouts.push(C(e.label,r)),t.total_distance.push(C(e.label,r)),t.total_duration.push(C(e.label,r))})),t},B=function(e,t,r,o,c){var n=g(e,t),s=S[e.duration],u=r.filter((function(e){return o.includes(e.id)})),i=[],d=N(u),l={};return u.map((function(e){return l[e.label]=e.id})),n.map((function(e){var t=Object(a["a"])(e,s.api),r=Object(a["a"])(e,s.chart);i.push(r),w.map((function(e){d[e].map((function(r){r.data.push(c!=={}&&t in c&&l[r.label]in c[t]?c[t][l[r.label]][e]:0)}))}))})),{labels:i,datasets:d}},D=function(e,t,r){var a=r?1:0,c="year"===t?Object(o["a"])(u(e,9)):"week"===t?Object(i["a"])(Object(d["a"])(e,2),{weekStartsOn:a}):Object(l["a"])(Object(d["a"])(e,11)),n="year"===t?p(e):"week"===t?Object(O["a"])(e,{weekStartsOn:a}):Object(j["a"])(e);return{duration:t,end:n,start:c}},V=function(e,t,r){var a=e.duration,c=e.start,s=e.end,b=r?1:0;return{duration:a,end:"year"===a?p(t?u(s,1):Object(n["a"])(s,1)):"week"===a?Object(O["a"])(t?v(s,1):m(s,1),{weekStartsOn:b}):Object(j["a"])(t?Object(d["a"])(s,1):Object(k["a"])(s,1)),start:"year"===a?Object(o["a"])(t?u(c,1):Object(n["a"])(c,1)):"week"===a?Object(i["a"])(t?v(c,1):m(c,1),{weekStartsOn:b}):Object(l["a"])(t?Object(d["a"])(c,1):Object(k["a"])(c,1))}}},"778a":function(e,t,r){"use strict";r("c1a9")},"80e9":function(e,t,r){},8338:function(e,t,r){},"887b":function(e,t,r){"use strict";r("121b")},"8d2d":function(e,t,r){},9080:function(e,t,r){},"90d2":function(e,t,r){"use strict";r("f2a6")},"92c3":function(e,t,r){},9433:function(e,t,r){"use strict";r("80e9")},"9a0c":function(e,t,r){var a=r("342f");e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(a)},a0b1:function(e,t,r){},a618:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var a=r("fe1f"),o=r("74b5"),c=r("8c86");function n(e,t){Object(c["a"])(2,arguments);var r=Object(a["a"])(t);return Object(o["a"])(e,-r)}},a881:function(e,t,r){},b3b8:function(e,t,r){},b499:function(e,t,r){"use strict";r("a881")},b85a:function(e,t,r){"use strict";r("5e10")},bbd4:function(e,t,r){},c11a:function(e,t,r){"use strict";r("b3b8")},c1a9:function(e,t,r){},c3f6:function(e,t,r){"use strict";r("df24")},ccb2:function(e,t,r){"use strict";r.r(t);var a=r("7a23"),o=Object(a["withScopeId"])("data-v-01dc8b36");Object(a["pushScopeId"])("data-v-01dc8b36");var c={id:"statistics",class:"view"},n={key:0,class:"container"};Object(a["popScopeId"])();var s=o((function(e,t,r,s,u,i){var d=Object(a["resolveComponent"])("Statistics"),l=Object(a["resolveComponent"])("Card"),b=Object(a["resolveComponent"])("NoWorkouts");return Object(a["openBlock"])(),Object(a["createBlock"])("div",c,[e.authUser.username?(Object(a["openBlock"])(),Object(a["createBlock"])("div",n,[Object(a["createVNode"])(l,null,{title:o((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.$t("statistics.STATISTICS")),1)]})),content:o((function(){return[Object(a["createVNode"])(d,{class:{"stats-disabled":0===e.authUser.nb_workouts},user:e.authUser,sports:e.sports},null,8,["class","user","sports"])]})),_:1}),0===e.authUser.nb_workouts?(Object(a["openBlock"])(),Object(a["createBlock"])(b,{key:0})):Object(a["createCommentVNode"])("",!0)])):Object(a["createCommentVNode"])("",!0)])})),u=(r("4de4"),r("caad"),r("2532"),Object(a["withScopeId"])("data-v-dad311d4"));Object(a["pushScopeId"])("data-v-dad311d4");var i={key:0,id:"user-statistics"};Object(a["popScopeId"])();var d=u((function(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("StatsMenu"),u=Object(a["resolveComponent"])("StatChart"),d=Object(a["resolveComponent"])("SportsMenu");return e.translatedSports?(Object(a["openBlock"])(),Object(a["createBlock"])("div",i,[Object(a["createVNode"])(s,{onTimeFrameUpdate:e.updateTimeFrame,onArrowClick:e.handleOnClickArrows},null,8,["onTimeFrameUpdate","onArrowClick"]),Object(a["createVNode"])(u,{sports:e.sports,user:e.user,chartParams:e.chartParams,"displayed-sport-ids":e.selectedSportIds,fullStats:!0},null,8,["sports","user","chartParams","displayed-sport-ids"]),Object(a["createVNode"])(d,{"selected-sport-ids":e.selectedSportIds,"user-sports":e.sports,onSelectedSportIdsUpdate:e.updateSelectedSportIds},null,8,["selected-sport-ids","user-sports","onSelectedSportIdsUpdate"])])):Object(a["createCommentVNode"])("",!0)})),l=(r("d81d"),r("47e2")),b=r("ec59"),p=Object(a["withScopeId"])("data-v-56f0f302");Object(a["pushScopeId"])("data-v-56f0f302");var O={class:"chart-menu"},j={class:"chart-arrow"},f={class:"time-frames custom-checkboxes-group"},m={class:"time-frames-checkboxes custom-checkboxes"},v={class:"chart-arrow"};Object(a["popScopeId"])();var k=p((function(e,t,r,o,c,n){return Object(a["openBlock"])(),Object(a["createBlock"])("div",O,[Object(a["createVNode"])("div",j,[Object(a["createVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true",onClick:t[1]||(t[1]=function(t){return e.emit("arrowClick",!0)})})]),Object(a["createVNode"])("div",f,[Object(a["createVNode"])("div",m,[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(e.timeFrames,(function(t){return Object(a["openBlock"])(),Object(a["createBlock"])("div",{class:"time-frame custom-checkbox",key:t},[Object(a["createVNode"])("label",null,[Object(a["createVNode"])("input",{type:"radio",id:t,name:t,checked:e.selectedTimeFrame===t,onInput:function(r){return e.onUpdateTimeFrame(t)}},null,40,["id","name","checked","onInput"]),Object(a["createVNode"])("span",null,Object(a["toDisplayString"])(e.$t("statistics.TIME_FRAMES.".concat(t))),1)])])})),128))])]),Object(a["createVNode"])("div",v,[Object(a["createVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true",onClick:t[2]||(t[2]=function(t){return e.emit("arrowClick",!1)})})])])})),y=Object(a["defineComponent"])({name:"StatsMenu",emits:["arrowClick","timeFrameUpdate"],setup:function(e,t){var r=t.emit,o=Object(a["ref"])("month"),c=["week","month","year"];function n(e){o.value=e,r("timeFrameUpdate",e)}return{selectedTimeFrame:o,timeFrames:c,onUpdateTimeFrame:n,emit:r}}});r("b499");y.render=k,y.__scopeId="data-v-56f0f302";var h=y,S={class:"sports-menu"},w={class:"sport-label"};function g(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("SportImage");return Object(a["openBlock"])(),Object(a["createBlock"])("div",S,[(Object(a["openBlock"])(!0),Object(a["createBlock"])(a["Fragment"],null,Object(a["renderList"])(e.translatedSports,(function(t){return Object(a["openBlock"])(),Object(a["createBlock"])("label",{type:"checkbox",key:t.id,style:{color:e.sportColors[t.label]}},[Object(a["createVNode"])("input",{type:"checkbox",id:t.id,name:t.label,checked:e.selectedSportIds.includes(t.id),onInput:function(r){return e.updateSelectedSportIds(t.id)}},null,40,["id","name","checked","onInput"]),Object(a["createVNode"])(s,{"sport-label":t.label},null,8,["sport-label"]),Object(a["createVNode"])("span",w,Object(a["toDisplayString"])(t.translatedLabel),1)],4)})),128))])}var C=r("1119"),N=Object(a["defineComponent"])({name:"SportsMenu",props:{selectedSportIds:{type:Array,default:function(){return[]}},userSports:{type:Object,required:!0}},emits:["selectedSportIdsUpdate"],setup:function(e,t){var r=t.emit,o=Object(l["b"])(),c=o.t,n=Object(a["computed"])((function(){return Object(C["d"])(e.userSports,c)}));function s(e){r("selectedSportIdsUpdate",e)}return{sportColors:Object(a["inject"])("sportColors"),translatedSports:n,updateSelectedSportIds:s}}});r("9433");N.render=g;var B=N,D=r("7416"),V=Object(a["defineComponent"])({name:"Statistics",components:{SportsMenu:B,StatChart:b["a"],StatsMenu:h},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0}},setup:function(e){var t=Object(l["b"])(),r=t.t,o=Object(a["ref"])("month"),c=["week","month","year"],n=Object(a["ref"])(d(o.value)),s=Object(a["computed"])((function(){return Object(C["d"])(e.sports,r)})),u=Object(a["ref"])(p(e.sports));function i(e){o.value=e,n.value=d(o.value)}function d(t){return Object(D["b"])(new Date,t,e.user.weekm)}function b(t){n.value=Object(D["c"])(n.value,t,e.user.weekm)}function p(e){return e.map((function(e){return e.id}))}function O(e){u.value.includes(e)?u.value=u.value.filter((function(t){return t!==e})):u.value.push(e)}return Object(a["watch"])((function(){return e.sports}),(function(e){u.value=p(e)})),{chartParams:n,selectedTimeFrame:o,timeFrames:c,translatedSports:s,selectedSportIds:u,handleOnClickArrows:b,updateSelectedSportIds:O,updateTimeFrame:i}}});r("778a");V.render=d,V.__scopeId="data-v-dad311d4";var _=V,T=r("1724"),I=r("dad5"),M=r("2906"),E=Object(a["defineComponent"])({name:"StatisticsView",components:{NoWorkouts:T["a"],Statistics:_},setup:function(){var e=Object(M["a"])(),t=Object(a["computed"])((function(){return e.getters[I["e"].GETTERS.AUTH_USER_PROFILE]})),r=Object(a["computed"])((function(){return e.getters[I["b"].GETTERS.SPORTS].filter((function(e){return t.value.sports_list.includes(e.id)}))}));return{authUser:t,sports:r}}});r("b85a");E.render=s,E.__scopeId="data-v-01dc8b36";t["default"]=E},d224:function(e,t,r){"use strict";r("a0b1")},d277:function(e,t,r){"use strict";r.r(t);var a=r("7a23"),o={id:"loginOrRegister",class:"view"},c={class:"container"},n={class:"container-sub"},s={class:"container-sub"};function u(e,t,r,u,i,d){var l=Object(a["resolveComponent"])("BikePic"),b=Object(a["resolveComponent"])("LoginOrRegisterForm");return Object(a["openBlock"])(),Object(a["createBlock"])("div",o,[Object(a["createVNode"])("div",c,[Object(a["createVNode"])("div",n,[Object(a["createVNode"])(l)]),Object(a["createVNode"])("div",s,[Object(a["createVNode"])(b,{action:e.action},null,8,["action"])])])])}var i=Object(a["withScopeId"])("data-v-645e8c6f");Object(a["pushScopeId"])("data-v-645e8c6f");var d={id:"about"};Object(a["popScopeId"])();var l=i((function(e,t,r,o,c,n){return Object(a["openBlock"])(),Object(a["createBlock"])("div",d,[Object(a["createVNode"])("img",{class:"bike-img",src:"/img/bike.svg",alt:"mountain bike"},null,8,["src"])])})),b={name:"About"};r("6ca7");b.render=l,b.__scopeId="data-v-645e8c6f";var p=b,O=r("0395"),j=Object(a["defineComponent"])({name:"NavBar",components:{BikePic:p,LoginOrRegisterForm:O["a"]},props:{action:{type:String,required:!0}}});r("887b");j.render=u;t["default"]=j},d28b:function(e,t,r){var a=r("746f");a("iterator")},df24:function(e,t,r){},e01a:function(e,t,r){"use strict";var a=r("23e7"),o=r("83ab"),c=r("da84"),n=r("5135"),s=r("861d"),u=r("9bf2").f,i=r("e893"),d=c.Symbol;if(o&&"function"==typeof d&&(!("description"in d.prototype)||void 0!==d().description)){var l={},b=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof b?new d(e):void 0===e?d():d(e);return""===e&&(l[t]=!0),t};i(b,d);var p=b.prototype=d.prototype;p.constructor=b;var O=p.toString,j="Symbol(test)"==String(d("test")),f=/^Symbol\((.*)\)[^)]+$/;u(p,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=O.call(e);if(n(l,e))return"";var r=j?t.slice(7,-1):t.replace(f,"$1");return""===r?void 0:r}}),a({global:!0,forced:!0},{Symbol:b})}},e0ff:function(e,t,r){"use strict";r("9080")},e19f:function(e,t,r){"use strict";r.r(t);var a=r("7a23"),o={class:"not-found view"};function c(e,t,r,c,n,s){var u=Object(a["resolveComponent"])("NotFound");return Object(a["openBlock"])(),Object(a["createBlock"])("div",o,[Object(a["createVNode"])(u)])}var n=r("f7f9"),s=Object(a["defineComponent"])({name:"NotFoundView",components:{NotFound:n["a"]}});s.render=c;t["default"]=s},e4ea:function(e,t,r){"use strict";r("5782")},ea96:function(e,t,r){"use strict";r("ffcc")},ec59:function(e,t,r){"use strict";var a=r("7a23"),o=Object(a["withScopeId"])("data-v-6eb9bb83");Object(a["pushScopeId"])("data-v-6eb9bb83");var c={class:"start-chart"},n={key:0},s={key:1},u={class:"chart-radio"};Object(a["popScopeId"])();var i=o((function(e,t,r,o,i,d){var l=Object(a["resolveComponent"])("Chart");return Object(a["openBlock"])(),Object(a["createBlock"])("div",c,[e.hideChartIfNoData&&e.emptyStats?(Object(a["openBlock"])(),Object(a["createBlock"])("div",n,Object(a["toDisplayString"])(e.$t("workouts.NO_WORKOUTS")),1)):(Object(a["openBlock"])(),Object(a["createBlock"])("div",s,[Object(a["createVNode"])("div",u,[Object(a["createVNode"])("label",null,[Object(a["createVNode"])("input",{type:"radio",name:"total_distance",checked:"total_distance"===e.displayedData,onClick:t[1]||(t[1]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,["checked"]),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.$t("workouts.DISTANCE")),1)]),Object(a["createVNode"])("label",null,[Object(a["createVNode"])("input",{type:"radio",name:"total_duration",checked:"total_duration"===e.displayedData,onClick:t[2]||(t[2]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,["checked"]),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.$t("workouts.DURATION")),1)]),Object(a["createVNode"])("label",null,[Object(a["createVNode"])("input",{type:"radio",name:"nb_workouts",checked:"nb_workouts"===e.displayedData,onClick:t[3]||(t[3]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,["checked"]),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.$t("workouts.WORKOUT",2)),1)])]),e.labels.length>0?(Object(a["openBlock"])(),Object(a["createBlock"])(l,{key:0,datasets:e.datasets,labels:e.labels,displayedData:e.displayedData,displayedSportIds:e.displayedSportIds,fullStats:e.fullStats},null,8,["datasets","labels","displayedData","displayedSportIds","fullStats"])):Object(a["createCommentVNode"])("",!0)]))])})),d=r("1da1"),l=(r("96cf"),r("b0c0"),r("b64b"),r("b166")),b={class:"chart"};function p(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("BarChart");return Object(a["openBlock"])(),Object(a["createBlock"])("div",b,[Object(a["createVNode"])(s,Object(a["mergeProps"])(e.barChartProps,{class:"bar-chart"}),null,16)])}r("d81d");var O=r("b48c"),j=r("47e2"),f=(r("b680"),r("d3b7"),r("25f0"),r("4d90"),r("99af"),function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="0";t&&(r=String(Math.floor(e/86400)),e%=86400);var a=String(Math.floor(e/3600)).padStart(2,"0");e%=3600;var o=String(Math.floor(e/60)).padStart(2,"0"),c=String(e%60).padStart(2,"0");return t?"".concat("0"===r?"":"".concat(r,"d ")).concat("00"===a?"":"".concat(a,"h ")).concat(o,"m ").concat(c,"s"):"".concat("00"===a?"":"".concat(a,":")).concat(o,":").concat(c)}),m=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return"total_duration"===e?f(t,r):"total_distance"===e?t.toFixed(2)+" km":t.toString()},v=Object(a["defineComponent"])({name:"Chart",components:{BarChart:O["BarChart"]},props:{datasets:{type:Object,required:!0},labels:{type:Object,required:!0},displayedData:{type:String,required:!0},displayedSportIds:{type:Array,required:!0},fullStats:{type:Boolean,required:!0}},setup:function(e){var t=Object(j["b"])(),r=t.t;function o(e){return isNaN(e)?0:+e}function c(e,t){return o(e)+o(t)}var n=Object(a["computed"])((function(){return{labels:e.labels,datasets:JSON.parse(JSON.stringify(e.datasets))}})),s=Object(a["computed"])((function(){return{responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:e.fullStats?40:22}},scales:{x:{stacked:!0,grid:{drawOnChartArea:!1}},y:{stacked:!0,grid:{drawOnChartArea:!1},ticks:{maxTicksLimit:6,callback:function(t){return m(e.displayedData,+t,!1)}},afterFit:function(t){t.width=e.fullStats?75:60}}},plugins:{datalabels:{anchor:"end",align:"end",rotation:function(t){return e.fullStats&&t.chart.chartArea.width<580?310:0},display:function(t){return!(e.fullStats&&t.chart.chartArea.width<300)},formatter:function(t,r){var a=r.chart.data.datasets.map((function(e){return e.data[r.dataIndex]})).reduce((function(e,t){return c(e,t)}),0);return r.datasetIndex===e.displayedSportIds.length-1&&a>0?m(e.displayedData,a,!1):null}},legend:{display:!1},tooltip:{interaction:{intersect:!0,mode:"index"},filter:function(e){return"0"!==e.formattedValue},callbacks:{label:function(t){var a=r("sports.".concat(t.dataset.label,".LABEL"))||"";return a&&(a+=": "),null!==t.parsed.y&&(a+=m(e.displayedData,t.parsed.y)),a},footer:function(t){var a=0;return t.map((function(e){a+=e.parsed.y})),"".concat(r("common.TOTAL"),": ")+m(e.displayedData,a)}}}}}})),u=Object(O["useBarChart"])({chartData:n,options:s}),i=u.barChartProps;return{barChartProps:i}}});v.render=p;var k=v,y=r("dad5"),h=r("2906"),S=r("7416"),w=Object(a["defineComponent"])({name:"UserMonthStats",components:{Chart:k},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0},chartParams:{type:Object,required:!0},displayedSportIds:{type:Array,default:function(){return[]}},fullStats:{type:Boolean,default:!1},hideChartIfNoData:{type:Boolean,default:!1}},setup:function(e){var t=Object(h["a"])(),r=Object(a["ref"])("total_distance"),o=Object(a["computed"])((function(){return t.getters[y["c"].GETTERS.USER_STATS]})),c=Object(a["computed"])((function(){return Object(S["a"])(e.chartParams,e.user.weekm,e.sports,e.displayedSportIds,o.value)}));function n(r){t.dispatch(y["c"].ACTIONS.GET_USER_STATS,{username:e.user.username,filterType:"by_time",params:r})}function s(e){r.value=e.target.name}function u(e,t){return{from:Object(l["a"])(e.start,"yyyy-MM-dd"),to:Object(l["a"])(e.end,"yyyy-MM-dd"),time:"week"===e.duration?"week".concat(t.weekm?"m":""):e.duration}}return Object(a["onBeforeMount"])((function(){return n(u(e.chartParams,e.user))})),Object(a["watch"])((function(){return e.chartParams}),function(){var t=Object(d["a"])(regeneratorRuntime.mark((function t(r){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:n(u(r,e.user));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),{datasets:Object(a["computed"])((function(){return c.value.datasets[r.value]})),labels:Object(a["computed"])((function(){return c.value.labels})),emptyStats:Object(a["computed"])((function(){return 0===Object.keys(o.value).length})),displayedData:r,updateDisplayData:s}}});r("90d2");w.render=i,w.__scopeId="data-v-6eb9bb83";t["a"]=w},f153:function(e,t,r){},f2a6:function(e,t,r){},fb6a:function(e,t,r){"use strict";var a=r("23e7"),o=r("861d"),c=r("e8b5"),n=r("23cb"),s=r("50c4"),u=r("fc6a"),i=r("8418"),d=r("b622"),l=r("1dde"),b=l("slice"),p=d("species"),O=[].slice,j=Math.max;a({target:"Array",proto:!0,forced:!b},{slice:function(e,t){var r,a,d,l=u(this),b=s(l.length),f=n(e,b),m=n(void 0===t?b:t,b);if(c(l)&&(r=l.constructor,"function"!=typeof r||r!==Array&&!c(r.prototype)?o(r)&&(r=r[p],null===r&&(r=void 0)):r=void 0,r===Array||void 0===r))return O.call(l,f,m);for(a=new(void 0===r?Array:r)(j(m-f,0)),d=0;f