2 lines
60 KiB
JavaScript
2 lines
60 KiB
JavaScript
(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-36baa80f");Object(a["pushScopeId"])("data-v-36baa80f");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["b"].GETTERS.ERROR_MESSAGES]})),s=Object(a["computed"])((function(){return o.getters[b["b"].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(a){switch(a){case"reset":return e.token?o.dispatch(b["a"].ACTIONS.RESET_USER_PASSWORD,{password:t.password,password_conf:t.password_conf,token:e.token}):o.commit(b["b"].MUTATIONS.SET_ERROR_MESSAGES,"user.INVALID_TOKEN");case"reset-request":return o.dispatch(b["a"].ACTIONS.SEND_PASSWORD_RESET_REQUEST,{email:t.email});default:o.dispatch(b["a"].ACTIONS.LOGIN_OR_REGISTER,{actionType:a,formData:t,redirectUrl:r.query.from})}}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["b"].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("7eb4");O.render=i,O.__scopeId="data-v-36baa80f";t["a"]=O},"0774":function(e,t,r){"use strict";r("283c")},"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")},"24cc":function(e,t,r){},"283c":function(e,t,r){},"288e":function(e,t,r){"use strict";r("bbd4")},"2b62":function(e,t,r){"use strict";r("fd0a")},"2c2e":function(e,t,r){},"38f1":function(e,t,r){"use strict";r("92c3")},"3dde":function(e,t,r){},"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){},"57a9":function(e,t,r){"use strict";r("24cc")},"5fcb":function(e,t,r){"use strict";r("f153")},"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)}},"702c":function(e,t,r){"use strict";r("83b5")},7277:function(e,t,r){"use strict";r.r(t);var a=r("7a23"),o=Object(a["withScopeId"])("data-v-ad6483fc");Object(a["pushScopeId"])("data-v-ad6483fc");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 k=o((function(e,t,r,o,k,v){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 v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function y(e){if(Array.isArray(e))return v(e)}r("a4d3"),r("e01a"),r("d3b7"),r("d28b"),r("3ca3"),r("ddb0"),r("a630");function h(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}r("fb6a"),r("b0c0");function S(e,t){if(e){if("string"===typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,t):void 0}}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e){return y(e)||h(e)||S(e)||w()}r("4de4");var C=Object(a["withScopeId"])("data-v-e324c07c");Object(a["pushScopeId"])("data-v-e324c07c");var N={id:"timeline"},B={class:"section-title"},D={key:0},V={key:1},_={key:1,class:"more-workouts"};Object(a["popScopeId"])();var T=C((function(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("WorkoutCard"),u=Object(a["resolveComponent"])("NoWorkouts");return Object(a["openBlock"])(),Object(a["createBlock"])("div",N,[Object(a["createVNode"])("div",B,Object(a["toDisplayString"])(e.$t("workouts.LATEST_WORKOUTS")),1),e.user.nb_workouts>0&&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-99d3cd20");Object(a["pushScopeId"])("data-v-99d3cd20");var E={class:"timeline-workout"},R={class:"box"},x={class:"workout-user-date"},A={class:"workout-user"},U={key:0},q={key:1,class:"no-map"},W={class:"img"},L={class:"data"},F=Object(a["createVNode"])("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1),P={key:0},$={class:"data"},G=Object(a["createVNode"])("i",{class:"fa fa-road","aria-hidden":"true"},null,-1),H={key:0},Y={key:0,class:"data elevation"},K={class:"data-values"},X={key:1,class:"data altitude"},z=Object(a["createVNode"])("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1),J={class:"data-values"};Object(a["popScopeId"])();var Z=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",x,[Object(a["createVNode"])("div",A,[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",{"without-gpx":e.workout&&!e.workout.with_gpx}],onClick:t[2]||(t[2]=function(t){return e.$router.push({name:"Workout",params:{workoutId:e.workout.id}})})},[Object(a["createVNode"])("div",W,[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",L,[F,e.workout?(Object(a["openBlock"])(),Object(a["createBlock"])("span",P,Object(a["toDisplayString"])(e.workout.moving),1)):Object(a["createCommentVNode"])("",!0)]),Object(a["createVNode"])("div",$,[G,e.workout?(Object(a["openBlock"])(),Object(a["createBlock"])("span",H,Object(a["toDisplayString"])(e.workout.distance)+" km",1)):Object(a["createCommentVNode"])("",!0)]),e.workout&&e.workout.with_gpx?(Object(a["openBlock"])(),Object(a["createBlock"])("div",Y,[Object(a["createVNode"])("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:e.$t("workouts.ELEVATION")},null,8,["alt"]),Object(a["createVNode"])("div",K,[Object(a["createVNode"])("span",null,Object(a["toDisplayString"])(e.workout.min_alt)+"/",1),Object(a["createVNode"])("span",null,Object(a["toDisplayString"])(e.workout.max_alt)+" m ",1)])])):Object(a["createCommentVNode"])("",!0),e.workout&&e.workout.with_gpx?(Object(a["openBlock"])(),Object(a["createBlock"])("div",X,[z,Object(a["createVNode"])("div",J,[Object(a["createVNode"])("span",null,"+ "+Object(a["toDisplayString"])(e.workout.ascent)+"/",1),Object(a["createVNode"])("span",null,"- "+Object(a["toDisplayString"])(e.workout.descent)+" m ",1)])])):Object(a["createCommentVNode"])("",!0)],2)])])})),Q=r("b166"),ee=r("fd3a"),te=r("8c86");function re(e,t){Object(te["a"])(2,arguments);var r=Object(ee["a"])(e),a=Object(ee["a"])(t),o=r.getTime()-a.getTime();return o<0?-1:o>0?1:o}function ae(e,t){Object(te["a"])(2,arguments);var r=Object(ee["a"])(e),a=Object(ee["a"])(t),o=r.getFullYear()-a.getFullYear(),c=r.getMonth()-a.getMonth();return 12*o+c}function oe(e){Object(te["a"])(1,arguments);var t=Object(ee["a"])(e);return t.setHours(23,59,59,999),t}var ce=r("8cac");function ne(e){Object(te["a"])(1,arguments);var t=Object(ee["a"])(e);return oe(t).getTime()===Object(ce["a"])(t).getTime()}function se(e,t){Object(te["a"])(2,arguments);var r,a=Object(ee["a"])(e),o=Object(ee["a"])(t),c=re(a,o),n=Math.abs(ae(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=re(a,o)===-c;ne(Object(ee["a"])(e))&&1===n&&1===re(e,o)&&(s=!1),r=c*(n-Number(s))}return 0===r?0:r}function ue(e,t){Object(te["a"])(2,arguments);var r=Object(ee["a"])(e),a=Object(ee["a"])(t);return r.getTime()-a.getTime()}function ie(e,t){Object(te["a"])(2,arguments);var r=ue(e,t)/1e3;return r>0?Math.floor(r):Math.ceil(r)}var de=r("8923");function le(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 be(e){return le({},e)}var pe=r("2420"),Oe=1440,je=2520,fe=43200,me=86400;function ke(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(te["a"])(2,arguments);var a=r.locale||de["a"];if(!a.formatDistance)throw new RangeError("locale must contain formatDistance property");var o=re(e,t);if(isNaN(o))throw new RangeError("Invalid time value");var c,n,s=be(r);s.addSuffix=Boolean(r.addSuffix),s.comparison=o,o>0?(c=Object(ee["a"])(t),n=Object(ee["a"])(e)):(c=Object(ee["a"])(e),n=Object(ee["a"])(t));var u,i=ie(n,c),d=(Object(pe["a"])(n)-Object(pe["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<Oe){var b=Math.round(l/60);return a.formatDistance("aboutXHours",b,s)}if(l<je)return a.formatDistance("xDays",1,s);if(l<fe){var p=Math.round(l/Oe);return a.formatDistance("xDays",p,s)}if(l<me)return u=Math.round(l/fe),a.formatDistance("aboutXMonths",u,s);if(u=se(n,c),u<12){var O=Math.round(l/fe);return a.formatDistance("xMonths",O,s)}var j=u%12,f=Math.floor(u/12);return j<3?a.formatDistance("aboutXYears",f,s):j<9?a.formatDistance("overXYears",f,s):a.formatDistance("almostXYears",f+1,s)}var ve=r("68c6"),ye=r("c46a"),he=r("dad5"),Se=r("2906"),we=r("5e65"),ge=Object(a["defineComponent"])({name:"WorkoutCard",components:{StaticMap:ve["a"],UserPicture:ye["a"]},props:{workout:{type:Object,required:!1},user:{type:Object,required:!0},sport:{type:Object,required:!1}},setup:function(){var e=Object(Se["a"])(),t=Object(a["computed"])((function(){return e.getters[he["b"].GETTERS.LOCALE]}));return{format:Q["a"],formatDistance:ke,getDateWithTZ:we["c"],locale:t}}});r("702c");ge.render=Z,ge.__scopeId="data-v-99d3cd20";var Ce=ge,Ne=r("1724"),Be=r("9230"),De=Object(a["defineComponent"])({name:"Timeline",components:{NoWorkouts:Ne["a"],WorkoutCard:Ce},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0}},setup:function(e){var t=Object(Se["a"])(),r=Object(a["ref"])(1),o=5,c=e.user.nb_workouts>=o?o:e.user.nb_workouts;Object(a["onBeforeMount"])((function(){return u()}));var n=Object(a["computed"])((function(){return t.getters[he["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(he["f"].ACTIONS.GET_TIMELINE_WORKOUTS,Object(I["a"])({page:r.value,per_page:o},Be["a"]))}function i(){r.value+=1,t.dispatch(he["f"].ACTIONS.GET_MORE_TIMELINE_WORKOUTS,Object(I["a"])({page:r.value,per_page:o},Be["a"]))}return{initWorkoutsCount:c,moreWorkoutsExist:s,per_page:o,workouts:n,loadMoreWorkouts:i}}});r("e0ff");De.render=T,De.__scopeId="data-v-e324c07c";var Ve=De,_e={id:"user-calendar"},Te={class:"calendar-card box"};function Ie(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",_e,[Object(a["createVNode"])("div",Te,[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 Me=r("74b5"),Ee=r("a618"),Re={class:"calendar-cells"},xe={class:"calendar-cell-day"};function Ae(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("CalendarWorkouts");return Object(a["openBlock"])(),Object(a["createBlock"])("div",Re,[(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",xe,Object(a["toDisplayString"])(e.format(t,"d")),1)],2)})),128))])})),128))])}r("caad");var Ue=r("f7f1");function qe(e){Object(te["a"])(1,arguments);var t=Object(ee["a"])(e);return t.setHours(0,0,0,0),t}function We(e,t){Object(te["a"])(2,arguments);var r=qe(e),a=qe(t);return r.getTime()===a.getTime()}function Le(e,t){Object(te["a"])(2,arguments);var r=Object(ee["a"])(e),a=Object(ee["a"])(t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function Fe(e){return Object(te["a"])(1,arguments),We(e,Date.now())}var Pe={class:"calendar-workouts"},$e={class:"desktop-display"},Ge={key:0,class:"workouts-display"},He={key:1,class:"donut-display"},Ye={class:"mobile-display"},Ke={key:0,class:"donut-display"};function Xe(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",Pe,[Object(a["createVNode"])("div",$e,[e.workouts.length<=e.displayedWorkoutCount?(Object(a["openBlock"])(),Object(a["createBlock"])("div",Ge,[(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",He,[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",Ye,[e.workouts.length>0?(Object(a["openBlock"])(),Object(a["createBlock"])("div",Ke,[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 ze(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 Je=r("47e2"),Ze=Object(a["defineComponent"])({name:"CalendarWorkout",props:{workout:{type:Object,required:!0},sportLabel:{type:String,required:!0}},setup:function(){var e=Object(Je["b"])(),t=e.t;return{t:t}}});r("38f1");Ze.render=ze;var Qe=Ze,et=Object(a["withScopeId"])("data-v-b30dea28");Object(a["pushScopeId"])("data-v-b30dea28");var tt={class:"calendar-workouts-chart"},rt={class:"workouts-count"},at={key:0,class:"workouts-pane"},ot={class:"more-workouts"};Object(a["popScopeId"])();var ct=et((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",tt,[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",rt,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",at,[Object(a["withDirectives"])(Object(a["createVNode"])("div",ot,[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]])]))])})),nt=(r("4fad"),{class:"donut-chart"}),st={height:"34",width:"34",viewBox:"0 0 34 34"};function ut(e,t,r,o,c,n){return Object(a["openBlock"])(),Object(a["createBlock"])("div",nt,[(Object(a["openBlock"])(),Object(a["createBlock"])("svg",st,[(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 it=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}}});it.render=ut;var dt=it,lt=r("1119"),bt=Object(a["defineComponent"])({name:"CalendarWorkoutsChart",components:{CalendarWorkout:Qe,DonutChart:dt},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:lt["a"],togglePane:t}}});r("0fe0");bt.render=ct,bt.__scopeId="data-v-b30dea28";var pt=bt,Ot=Object(a["defineComponent"])({name:"CalendarWorkouts",components:{CalendarWorkout:Qe,CalendarWorkoutsChart:pt},props:{workouts:{type:Object,required:!0},sports:{type:Object,required:!0}},setup:function(e){return{chartDatasets:Object(a["computed"])((function(){return Object(Be["c"])(e.workouts)})),colors:Object(a["computed"])((function(){return Object(lt["c"])(e.sports)})),displayedWorkoutCount:6,getSportLabel:lt["a"]}}});r("21d8");Ot.render=Xe;var jt=Ot,ft=Object(a["defineComponent"])({name:"CalendarCells",components:{CalendarWorkouts:jt},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(Ue["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 We(Object(we["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:Q["a"],isSameMonth:Le,isToday:Fe,isWeekEnd:u,filterWorkouts:i}}});r("288e");ft.render=Ae;var mt=ft,kt={class:"calendar-days"};function vt(e,t,r,o,c,n){return Object(a["openBlock"])(),Object(a["createBlock"])("div",kt,[(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 yt=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(Ue["a"])(e.startDate,r));return{days:t,addDays:Ue["a"],format:Q["a"]}}});r("5fcb");yt.render=vt;var ht=yt,St={class:"calendar-header"},wt=Object(a["createVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1),gt={class:"calendar-month"},Ct=Object(a["createVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1);function Nt(e,t,r,o,c,n){return Object(a["openBlock"])(),Object(a["createBlock"])("div",St,[Object(a["createVNode"])("div",{class:"calendar-arrow calendar-arrow-left",onClick:t[1]||(t[1]=function(t){return e.emit("displayPreviousMonth")})},[wt]),Object(a["createVNode"])("div",gt,[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")})},[Ct])])}var Bt=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:Q["a"]}}});r("e4ea");Bt.render=Nt;var Dt=Bt,Vt=Object(a["defineComponent"])({name:"UserCalendar",components:{CalendarCells:mt,CalendarDays:ht,CalendarHeader:Dt},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0}},setup:function(e){var t=Object(Se["a"])();Object(a["onBeforeMount"])((function(){return s()}));var r="yyyy-MM-dd",o=Object(a["ref"])(new Date),c=Object(a["ref"])(Object(we["b"])(o.value,e.user.weekm)),n=Object(a["computed"])((function(){return t.getters[he["f"].GETTERS.CALENDAR_WORKOUTS]}));function s(){c.value=Object(we["b"])(o.value,e.user.weekm);var a=Object(I["a"])({from:Object(Q["a"])(c.value.start,r),to:Object(Q["a"])(c.value.end,r),page:1,per_page:100},Be["a"]);t.dispatch(he["f"].ACTIONS.GET_CALENDAR_WORKOUTS,a)}function u(){o.value=Object(Me["a"])(o.value,1),s()}function i(){o.value=Object(Ee["a"])(o.value,1),s()}return{day:o,calendarDates:c,calendarWorkouts:n,displayNextMonth:u,displayPreviousMonth:i}}});r("51ce");Vt.render=Ie;var _t=Vt,Tt=Object(a["withScopeId"])("data-v-7958b39f");Object(a["pushScopeId"])("data-v-7958b39f");var It={class:"user-month-stats"};Object(a["popScopeId"])();var Mt=Tt((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",It,[Object(a["createVNode"])(u,null,{title:Tt((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.$t("dashboard.THIS_MONTH")),1)]})),content:Tt((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})])})),Et=r("f628"),Rt=r("ec59"),xt=Object(a["defineComponent"])({name:"UserMonthStats",components:{StatChart:Rt["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(Et["a"])(t),end:Object(ce["a"])(t)},selectedSportIds:e.sports.map((function(e){return e.id}))}}});r("224d");xt.render=Mt,xt.__scopeId="data-v-7958b39f";var At=xt,Ut=(r("b64b"),r("4e82"),Object(a["withScopeId"])("data-v-080b37ac"));Object(a["pushScopeId"])("data-v-080b37ac");var qt={class:"user-records-section"},Wt={class:"section-title"},Lt=Object(a["createVNode"])("i",{class:"fa fa-trophy custom-fa-small","aria-hidden":"true"},null,-1),Ft={class:"user-records"},Pt={key:0,class:"no-records"};Object(a["popScopeId"])();var $t=Ut((function(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("RecordsCard");return Object(a["openBlock"])(),Object(a["createBlock"])("div",qt,[Object(a["createVNode"])("div",Wt,[Lt,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.$t("workouts.RECORD",2)),1)]),Object(a["createVNode"])("div",Ft,[0===Object.keys(e.recordsBySport).length?(Object(a["openBlock"])(),Object(a["createBlock"])("div",Pt,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))])])})),Gt=Object(a["withScopeId"])("data-v-db29ce96");Object(a["pushScopeId"])("data-v-db29ce96");var Ht={class:"records-card"},Yt={class:"record-type"},Kt={class:"record-value"},Xt={class:"record-date"};Object(a["popScopeId"])();var zt=Gt((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",Ht,[Object(a["createVNode"])(i,null,{title:Gt((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:Gt((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",Yt,Object(a["toDisplayString"])(e.t("workouts.RECORD_".concat(t.record_type))),1),Object(a["createVNode"])("span",Kt,Object(a["toDisplayString"])(t.value),1),Object(a["createVNode"])("span",Xt,[Object(a["createVNode"])(u,{to:{name:"Workout",params:{workoutId:t.workout_id}}},{default:Gt((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(t.workout_date),1)]})),_:2},1032,["to"])])])})),128))]})),_:1})])})),Jt=Object(a["defineComponent"])({name:"RecordsCard",props:{records:{type:Object,required:!0},sportTranslatedLabel:{type:String,required:!0}},setup:function(){var e=Object(Je["b"])(),t=e.t;return{t:t}}});r("2b62");Jt.render=zt,Jt.__scopeId="data-v-db29ce96";var Zt=Jt,Qt=(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(we["a"])(Object(we["c"])(e.workout_date,t)).workout_date,workout_id:e.workout_id,id:e.id,record_type:e.record_type,value:r}}),er=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(Qt(a,r))),e}),{})},tr=Object(a["defineComponent"])({name:"UserRecords",components:{RecordsCard:Zt},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0}},setup:function(e){var t=Object(Je["b"])(),r=t.t,o=Object(a["computed"])((function(){return er(e.user.records,Object(lt["d"])(e.sports,r),e.user.timezone)}));return{recordsBySport:o}}});r("c11a");tr.render=$t,tr.__scopeId="data-v-080b37ac";var rr=tr,ar=(r("b680"),r("a9e3"),{id:"user-stats"});function or(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("StatCard");return Object(a["openBlock"])(),Object(a["createBlock"])("div",ar,[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 cr=r("05d9"),nr=Object(a["defineComponent"])({name:"UserStatsCards",components:{StatCard:cr["a"]},props:{user:{type:Object,required:!0}},setup:function(e){var t=Object(Je["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");nr.render=or;var sr=nr,ur=Object(a["defineComponent"])({name:"Dashboard",components:{Timeline:Ve,UserCalendar:_t,UserMonthStats:At,UserRecords:rr,UserStatsCards:sr},setup:function(){var e=Object(Se["a"])(),t=Object(a["computed"])((function(){return e.getters[he["a"].GETTERS.AUTH_USER_PROFILE]})),r=Object(a["computed"])((function(){return e.getters[he["c"].GETTERS.SPORTS]})),o=Object(a["ref"])("chart");function c(e){o.value=e}return{authUser:t,sports:r,isSelected:o,updateDisplayColumn:c}}});r("57a9");ur.render=k,ur.__scopeId="data-v-ad6483fc";t["default"]=ur},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 k(e,t){Object(s["a"])(2,arguments);var r=Object(c["a"])(t);return m(e,-r)}var v=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","total_ascent","total_descent"],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:[],total_ascent:[],total_descent:[]};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.total_ascent.push(C(e.label,r)),t.total_descent.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?k(s,1):m(s,1),{weekStartsOn:b}):Object(j["a"])(t?Object(d["a"])(s,1):Object(v["a"])(s,1)),start:"year"===a?Object(o["a"])(t?u(c,1):Object(n["a"])(c,1)):"week"===a?Object(i["a"])(t?k(c,1):m(c,1),{weekStartsOn:b}):Object(l["a"])(t?Object(d["a"])(c,1):Object(v["a"])(c,1))}}},"778a":function(e,t,r){"use strict";r("c1a9")},"7eb4":function(e,t,r){"use strict";r("2c2e")},8338:function(e,t,r){},"83b5":function(e,t,r){},"887b":function(e,t,r){"use strict";r("121b")},"8d2d":function(e,t,r){},9080:function(e,t,r){},"92c3":function(e,t,r){},"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")},bbd4:function(e,t,r){},bf1d:function(e,t,r){"use strict";r("f00c")},c11a:function(e,t,r){"use strict";r("b3b8")},c1a9:function(e,t,r){},ccb2:function(e,t,r){"use strict";r.r(t);var a=r("7a23"),o=Object(a["withScopeId"])("data-v-cdc23a7c");Object(a["pushScopeId"])("data-v-cdc23a7c");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"},k={class:"chart-arrow"};Object(a["popScopeId"])();var v=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",k,[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=v,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("bf1d");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["a"].GETTERS.AUTH_USER_PROFILE]})),r=Object(a["computed"])((function(){return e.getters[I["c"].GETTERS.SPORTS].filter((function(e){return t.value.sports_list.includes(e.id)}))}));return{authUser:t,sports:r}}});r("d3c0");E.render=s,E.__scopeId="data-v-cdc23a7c";t["default"]=E},cfa1:function(e,t,r){},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")},d3c0:function(e,t,r){"use strict";r("cfa1")},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")},ec59:function(e,t,r){"use strict";var a=r("7a23"),o=Object(a["withScopeId"])("data-v-831b4ece");Object(a["pushScopeId"])("data-v-831b4ece");var c={class:"start-chart"},n={key:0},s={key:1},u={class:"chart-radio"},i={key:0},d={key:1};Object(a["popScopeId"])();var l=o((function(e,t,r,o,l,b){var p=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.fullStats?(Object(a["openBlock"])(),Object(a["createBlock"])("label",i,[Object(a["createVNode"])("input",{type:"radio",name:"total_ascent",checked:"total_ascent"===e.displayedData,onClick:t[4]||(t[4]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,["checked"]),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.$t("workouts.ASCENT")),1)])):Object(a["createCommentVNode"])("",!0),e.fullStats?(Object(a["openBlock"])(),Object(a["createBlock"])("label",d,[Object(a["createVNode"])("input",{type:"radio",name:"total_descent",checked:"total_descent"===e.displayedData,onClick:t[5]||(t[5]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,["checked"]),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.$t("workouts.DESCENT")),1)])):Object(a["createCommentVNode"])("",!0)]),e.labels.length>0?(Object(a["openBlock"])(),Object(a["createBlock"])(p,{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)]))])})),b=r("1da1"),p=(r("96cf"),r("b0c0"),r("b64b"),r("b166")),O={class:"chart"};function j(e,t,r,o,c,n){var s=Object(a["resolveComponent"])("BarChart");return Object(a["openBlock"])(),Object(a["createBlock"])("div",O,[Object(a["createVNode"])(s,Object(a["mergeProps"])(e.barChartProps,{class:"bar-chart"}),null,16)])}r("d81d");var f=r("b48c"),m=r("47e2"),k=(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)}),v=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];switch(e){case"total_duration":return k(t,r);case"total_distance":return t.toFixed(2)+" km";case"total_ascent":case"total_descent":return(t/1e3).toFixed(2)+" km";default:return t.toString()}},y=Object(a["defineComponent"])({name:"Chart",components:{BarChart:f["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(m["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 v(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?v(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+=v(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"),": ")+v(e.displayedData,a)}}}}}})),u=Object(f["useBarChart"])({chartData:n,options:s}),i=u.barChartProps;return{barChartProps:i}}});y.render=j;var h=y,S=r("dad5"),w=r("2906"),g=r("7416"),C=Object(a["defineComponent"])({name:"UserMonthStats",components:{Chart:h},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(w["a"])(),r=Object(a["ref"])("total_distance"),o=Object(a["computed"])((function(){return t.getters[S["d"].GETTERS.USER_STATS]})),c=Object(a["computed"])((function(){return Object(g["a"])(e.chartParams,e.user.weekm,e.sports,e.displayedSportIds,o.value)}));function n(r){t.dispatch(S["d"].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(p["a"])(e.start,"yyyy-MM-dd"),to:Object(p["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(b["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("0774");C.render=l,C.__scopeId="data-v-831b4ece";t["a"]=C},f00c:function(e,t,r){},f153: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<m;f++,d++)f in l&&i(a,d,l[f]);return a.length=d,a}})},fd0a:function(e,t,r){}}]);
|
|
//# sourceMappingURL=main.a0127c7a.js.map
|