FitTrackee/fittrackee/dist/static/js/workouts.3abba015.js
2023-04-08 09:25:13 +02:00

2 lines
80 KiB
JavaScript

"use strict";(self["webpackChunkfittrackee_client"]=self["webpackChunkfittrackee_client"]||[]).push([[401],{2238:function(t,e,o){o.d(e,{Z:function(){return nt}});o(7658);var a=o(6252),n=o(3577),l=o(2262),r=o(9963),s=o(9150),i=o(2201),u=o(5801),d=o(9917),c=o(6558),p=o(8966),m=o(631),w=o(3649);const v={id:"workout-form"},k=["onSubmit"],y={class:"form-items"},f={key:0,class:"form-item-radio"},_=["checked","disabled"],g={for:"withGpx"},S=["checked","disabled"],h={for:"withoutGpx"},b={class:"form-item"},U=["disabled"],T=["value"],O={key:1,class:"form-item"},E={for:"gpxFile"},D=["disabled"],I={class:"files-help info-box"},A={key:2,class:"form-item"},C={for:"title"},R=["required","disabled"],$={key:3},N={class:"workout-date-duration"},L={class:"form-item"},j={class:"workout-date-time"},x=["disabled"],z=["disabled"],W={class:"form-item"},F=["disabled"],B=["disabled"],H=["disabled"],P={class:"workout-data"},Z={class:"form-item"},M=["disabled"],q={class:"form-item"},G=["disabled"],Y={class:"form-item"},K=["disabled"],X={class:"form-item"},V={key:1},J={key:2,class:"form-buttons"},Q=["disabled"],tt=["onClick"];var et=(0,a.aZ)({__name:"WorkoutEdition",props:{authUser:null,sports:null,isCreation:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},workout:{default:()=>({})}},setup(t){const e=t,{t:o}=(0,s.QT)(),et=(0,d.o)(),ot=(0,i.tv)(),{authUser:at,workout:nt,isCreation:lt,loading:rt}=(0,l.BK)(e),st=(0,a.Fl)((()=>(0,m.xH)(e.sports,o,"is_active_for_user",nt.value.id?[nt.value.sport_id]:[]))),it=(0,a.Fl)((()=>et.getters[u.SY.GETTERS.APP_CONFIG])),ut=it.value.max_single_file_size?(0,p.Z)(it.value.max_single_file_size):"",dt=it.value.gpx_limit_import,ct=it.value.max_zip_file_size?(0,p.Z)(it.value.max_zip_file_size):"",pt=(0,a.Fl)((()=>et.getters[u.SY.GETTERS.ERROR_MESSAGES])),mt=(0,l.qj)({sport_id:"",title:"",notes:"",workoutDate:"",workoutTime:"",workoutDurationHour:"",workoutDurationMinutes:"",workoutDurationSeconds:"",workoutDistance:"",workoutAscent:"",workoutDescent:""}),wt=(0,l.iH)(e.workout.id?e.workout.with_gpx:e.isCreation);let vt=null;const kt=(0,l.iH)(!1),yt=(0,l.iH)([]);function ft(t){mt.notes=t}function _t(){wt.value=!wt.value,kt.value=!1}function gt(t){t.target.files&&(vt=t.target.files[0])}function St(t){if(mt.sport_id=`${t.sport_id}`,mt.title=t.title,mt.notes=t.notes,!t.with_gpx){const o=(0,c.Jo)((0,c.eB)(t.workout_date,e.authUser.timezone),"yyyy-MM-dd"),a=t.duration.split(":");mt.workoutDistance=`${at.value.imperial_units?(0,w.sC)(t.distance,"km","mi",3):parseFloat(t.distance.toFixed(3))}`,mt.workoutDate=o.workout_date,mt.workoutTime=o.workout_time,mt.workoutDurationHour=a[0],mt.workoutDurationMinutes=a[1],mt.workoutDurationSeconds=a[2],mt.workoutAscent=null===t.ascent?"":`${at.value.imperial_units?(0,w.sC)(t.ascent,"m","ft",2):parseFloat(t.ascent.toFixed(2))}`,mt.workoutDescent=null===t.descent?"":`${at.value.imperial_units?(0,w.sC)(t.descent,"m","ft",2):parseFloat(t.descent.toFixed(2))}`}}function ht(){return yt.value.includes("workouts.INVALID_DISTANCE")}function bt(){return yt.value.includes("workouts.INVALID_DURATION")}function Ut(){return yt.value.includes("workouts.INVALID_ASCENT_OR_DESCENT")}function Tt(t){yt.value=[],t.title=mt.title,t.duration=3600*+mt.workoutDurationHour+60*+mt.workoutDurationMinutes+ +mt.workoutDurationSeconds,t.duration<=0&&yt.value.push("workouts.INVALID_DURATION"),t.distance=at.value.imperial_units?(0,w.sC)(+mt.workoutDistance,"mi","km",3):+mt.workoutDistance,t.distance<=0&&yt.value.push("workouts.INVALID_DISTANCE"),t.workout_date=`${mt.workoutDate} ${mt.workoutTime}`,t.ascent=""===mt.workoutAscent?null:at.value.imperial_units?(0,w.sC)(+mt.workoutAscent,"ft","m",3):+mt.workoutAscent,t.descent=""===mt.workoutDescent?null:at.value.imperial_units?(0,w.sC)(+mt.workoutDescent,"ft","m",3):+mt.workoutDescent,(null!==t.ascent&&null===t.descent||null===t.ascent&&null!==t.descent)&&yt.value.push("workouts.INVALID_ASCENT_OR_DESCENT")}function Ot(){const t={sport_id:+mt.sport_id,notes:mt.notes};if(e.workout.id)e.workout.with_gpx?t.title=mt.title:Tt(t),yt.value.length>0?et.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,yt.value):et.dispatch(u.aX.ACTIONS.EDIT_WORKOUT,{workoutId:e.workout.id,data:t});else if(wt.value){if(!vt){const t="workouts.NO_FILE_PROVIDED";return void et.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,t)}t.file=vt,et.dispatch(u.aX.ACTIONS.ADD_WORKOUT,t)}else Tt(t),yt.value.length>0?et.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,yt.value):et.dispatch(u.aX.ACTIONS.ADD_WORKOUT_WITHOUT_GPX,t)}function Et(){e.workout.id?ot.push({name:"Workout",params:{workoutId:e.workout.id}}):ot.go(-1)}function Dt(){kt.value=!0}return(0,a.bv)((()=>{e.workout.id&&St(e.workout)})),(0,a.Ah)((()=>et.commit(u.SY.MUTATIONS.EMPTY_ERROR_MESSAGES))),(0,a.YP)((()=>e.workout),(async(t,e)=>{t!==e&&t&&t.id&&St(t)})),(t,e)=>{const o=(0,a.up)("CustomTextArea"),s=(0,a.up)("ErrorMessage"),i=(0,a.up)("Loader"),u=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",{id:"workout-edition",class:(0,n.C_)(["center-card with-margin",{"center-form":(0,l.SU)(nt)&&(0,l.SU)(nt).with_gpx}])},[(0,a.Wm)(u,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,n.zw)(t.$t(`workouts.${(0,l.SU)(lt)?"ADD":"EDIT"}_WORKOUT`)),1)])),content:(0,a.w5)((()=>[(0,a._)("div",v,[(0,a._)("form",{class:(0,n.C_)({errors:kt.value}),onSubmit:(0,r.iM)(Ot,["prevent"])},[(0,a._)("div",y,[(0,l.SU)(lt)?((0,a.wg)(),(0,a.iD)("div",f,[(0,a._)("div",null,[(0,a._)("input",{id:"withGpx",type:"radio",checked:wt.value,disabled:(0,l.SU)(rt),onClick:_t},null,8,_),(0,a._)("label",g,(0,n.zw)(t.$t("workouts.WITH_GPX")),1)]),(0,a._)("div",null,[(0,a._)("input",{id:"withoutGpx",type:"radio",checked:!wt.value,disabled:(0,l.SU)(rt),onClick:_t},null,8,S),(0,a._)("label",h,(0,n.zw)(t.$t("workouts.WITHOUT_GPX")),1)])])):(0,a.kq)("",!0),(0,a._)("div",b,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.SPORT",1))+"*: ",1),(0,a.wy)((0,a._)("select",{id:"sport",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[0]||(e[0]=t=>mt.sport_id=t)},[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,l.SU)(st),(t=>((0,a.wg)(),(0,a.iD)("option",{value:t.id,key:t.id},(0,n.zw)(t.translatedLabel),9,T)))),128))],40,U),[[r.bM,mt.sport_id]])]),(0,l.SU)(lt)&&wt.value?((0,a.wg)(),(0,a.iD)("div",O,[(0,a._)("label",E,(0,n.zw)(t.$t("workouts.GPX_FILE"))+" "+(0,n.zw)(t.$t("workouts.ZIP_ARCHIVE_DESCRIPTION"))+"*: ",1),(0,a._)("input",{id:"gpxFile",name:"gpxFile",type:"file",accept:".gpx, .zip",disabled:(0,l.SU)(rt),required:"",onInvalid:Dt,onInput:gt},null,40,D),(0,a._)("div",I,[(0,a._)("div",null,[(0,a._)("strong",null,(0,n.zw)(t.$t("workouts.GPX_FILE"))+":",1),(0,a._)("ul",null,[(0,a._)("li",null,(0,n.zw)(t.$t("workouts.MAX_SIZE"))+": "+(0,n.zw)((0,l.SU)(ut)),1)])]),(0,a._)("div",null,[(0,a._)("strong",null,(0,n.zw)(t.$t("workouts.ZIP_ARCHIVE"))+":",1),(0,a._)("ul",null,[(0,a._)("li",null,(0,n.zw)(t.$t("workouts.NO_FOLDER")),1),(0,a._)("li",null,(0,n.zw)(t.$t("workouts.MAX_FILES"))+": "+(0,n.zw)((0,l.SU)(dt)),1),(0,a._)("li",null,(0,n.zw)(t.$t("workouts.MAX_SIZE"))+": "+(0,n.zw)((0,l.SU)(ct)),1)])])])])):((0,a.wg)(),(0,a.iD)("div",A,[(0,a._)("label",C,(0,n.zw)(t.$t("workouts.TITLE"))+": ",1),(0,a.wy)((0,a._)("input",{id:"title",name:"title",type:"text",required:!(0,l.SU)(lt),onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[1]||(e[1]=t=>mt.title=t)},null,40,R),[[r.nr,mt.title]])])),wt.value?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)("div",$,[(0,a._)("div",N,[(0,a._)("div",L,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.WORKOUT_DATE"))+"*:",1),(0,a._)("div",j,[(0,a.wy)((0,a._)("input",{id:"workout-date",name:"workout-date",type:"date",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[2]||(e[2]=t=>mt.workoutDate=t)},null,40,x),[[r.nr,mt.workoutDate]]),(0,a.wy)((0,a._)("input",{id:"workout-time",name:"workout-time",class:"workout-time",type:"time",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[3]||(e[3]=t=>mt.workoutTime=t)},null,40,z),[[r.nr,mt.workoutTime]])])]),(0,a._)("div",W,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.DURATION"))+"*:",1),(0,a._)("div",null,[(0,a.wy)((0,a._)("input",{id:"workout-duration-hour",name:"workout-duration-hour",class:(0,n.C_)(["workout-duration",{errored:bt()}]),type:"text",placeholder:"HH",minlength:"1",maxlength:"2",pattern:"^([0-1]?[0-9]|2[0-3])$",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[4]||(e[4]=t=>mt.workoutDurationHour=t)},null,42,F),[[r.nr,mt.workoutDurationHour]]),(0,a.Uk)(" : "),(0,a.wy)((0,a._)("input",{id:"workout-duration-minutes",name:"workout-duration-minutes",class:(0,n.C_)(["workout-duration",{errored:bt()}]),type:"text",pattern:"^([0-5][0-9])$",minlength:"2",maxlength:"2",placeholder:"MM",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[5]||(e[5]=t=>mt.workoutDurationMinutes=t)},null,42,B),[[r.nr,mt.workoutDurationMinutes]]),(0,a.Uk)(" : "),(0,a.wy)((0,a._)("input",{id:"workout-duration-seconds",name:"workout-duration-seconds",class:(0,n.C_)(["workout-duration",{errored:bt()}]),type:"text",pattern:"^([0-5][0-9])$",minlength:"2",maxlength:"2",placeholder:"SS",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[6]||(e[6]=t=>mt.workoutDurationSeconds=t)},null,42,H),[[r.nr,mt.workoutDurationSeconds]])])])]),(0,a._)("div",P,[(0,a._)("div",Z,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.DISTANCE"))+" ("+(0,n.zw)((0,l.SU)(at).imperial_units?"mi":"km")+")*: ",1),(0,a.wy)((0,a._)("input",{class:(0,n.C_)({errored:ht()}),name:"workout-distance",type:"number",min:"0",step:"0.001",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[7]||(e[7]=t=>mt.workoutDistance=t)},null,42,M),[[r.nr,mt.workoutDistance]])]),(0,a._)("div",q,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.ASCENT"))+" ("+(0,n.zw)((0,l.SU)(at).imperial_units?"ft":"m")+"): ",1),(0,a.wy)((0,a._)("input",{class:(0,n.C_)({errored:Ut()}),name:"workout-ascent",type:"number",min:"0",step:"0.01",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[8]||(e[8]=t=>mt.workoutAscent=t)},null,42,G),[[r.nr,mt.workoutAscent]])]),(0,a._)("div",Y,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.DESCENT"))+" ("+(0,n.zw)((0,l.SU)(at).imperial_units?"ft":"m")+"): ",1),(0,a.wy)((0,a._)("input",{class:(0,n.C_)({errored:Ut()}),name:"workout-descent",type:"number",min:"0",step:"0.01",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[9]||(e[9]=t=>mt.workoutDescent=t)},null,42,K),[[r.nr,mt.workoutDescent]])])])])),(0,a._)("div",X,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.NOTES"))+": ",1),(0,a.Wm)(o,{name:"notes",input:mt.notes,disabled:(0,l.SU)(rt),onUpdateValue:ft},null,8,["input","disabled"])])]),(0,l.SU)(pt)?((0,a.wg)(),(0,a.j4)(s,{key:0,message:(0,l.SU)(pt)},null,8,["message"])):(0,a.kq)("",!0),(0,l.SU)(rt)?((0,a.wg)(),(0,a.iD)("div",V,[(0,a.Wm)(i)])):((0,a.wg)(),(0,a.iD)("div",J,[(0,a._)("button",{class:"confirm",type:"submit",disabled:(0,l.SU)(rt)},(0,n.zw)(t.$t("buttons.SUBMIT")),9,Q),(0,a._)("button",{class:"cancel",onClick:(0,r.iM)(Et,["prevent"])},(0,n.zw)(t.$t("buttons.CANCEL")),9,tt)]))],42,k)])])),_:1})],2)}}}),ot=o(3744);const at=(0,ot.Z)(et,[["__scopeId","data-v-45d3bf87"]]);var nt=at},4189:function(t,e,o){o.r(e),o.d(e,{default:function(){return p}});var a=o(6252),n=o(2262),l=o(2238),r=o(5801),s=o(9917);const i={id:"add-workout",class:"view"},u={class:"container"};var d=(0,a.aZ)({__name:"AddWorkout",setup(t){const e=(0,s.o)(),o=(0,a.Fl)((()=>e.getters[r.O8.GETTERS.SPORTS])),d=(0,a.Fl)((()=>e.getters[r.YN.GETTERS.AUTH_USER_PROFILE])),c=(0,a.Fl)((()=>e.getters[r.aX.GETTERS.WORKOUT_DATA]));return(t,e)=>((0,a.wg)(),(0,a.iD)("div",i,[(0,a._)("div",u,[(0,a.Wm)(l.Z,{authUser:(0,n.SU)(d),sports:(0,n.SU)(o),isCreation:!0,loading:(0,n.SU)(c).loading},null,8,["authUser","sports","loading"])])]))}});const c=d;var p=c},8237:function(t,e,o){o.r(e),o.d(e,{default:function(){return m}});var a=o(6252),n=o(2262),l=o(2201),r=o(2238),s=o(5801),i=o(9917);const u={id:"edit-workout",class:"view"},d={class:"container"};var c=(0,a.aZ)({__name:"EditWorkout",setup(t){const e=(0,l.yj)(),o=(0,i.o)(),c=(0,a.Fl)((()=>o.getters[s.YN.GETTERS.AUTH_USER_PROFILE])),p=(0,a.Fl)((()=>o.getters[s.O8.GETTERS.SPORTS])),m=(0,a.Fl)((()=>o.getters[s.aX.GETTERS.WORKOUT_DATA]));return(0,a.wF)((()=>{o.dispatch(s.aX.ACTIONS.GET_WORKOUT_DATA,{workoutId:e.params.workoutId})})),(0,a.YP)((()=>e.params.workoutId),(async t=>{t||o.commit(s.aX.MUTATIONS.EMPTY_WORKOUT)})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",u,[(0,a._)("div",d,[(0,n.SU)(m).workout.id?((0,a.wg)(),(0,a.j4)(r.Z,{key:0,authUser:(0,n.SU)(c),sports:(0,n.SU)(p),workout:(0,n.SU)(m).workout,loading:(0,n.SU)(m).loading},null,8,["authUser","sports","workout","loading"])):(0,a.kq)("",!0)])]))}});const p=c;var m=p},5018:function(t,e,o){o.r(e),o.d(e,{default:function(){return qa}});var a=o(6252),n=o(2262),l=o(2201),r=o(8273),s=(o(7658),o(3577)),i=o(9963),u=o(5167);const d=t=>((0,a.dD)("data-v-4d9f9a8a"),t=t(),(0,a.Cn)(),t),c={id:"workout-card-title"},p=["title"],m=d((()=>(0,a._)("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1))),w=[m],v={class:"workout-card-title"},k={class:"workout-title-date"},y={key:0,class:"workout-title"},f={key:1,class:"workout-title"},_={class:"workout-segment"},g=d((()=>(0,a._)("i",{class:"fa fa-map-marker","aria-hidden":"true"},null,-1))),S={class:"workout-date"},h={class:"workout-link"},b=["title"],U=d((()=>(0,a._)("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1))),T=[U];var O=(0,a.aZ)({__name:"WorkoutCardTitle",props:{sport:null,workoutObject:null},emits:["displayModal"],setup(t,{emit:e}){const o=t,{sport:l,workoutObject:r}=(0,n.BK)(o);async function d(t){await u.Z.get(`workouts/${t}/gpx/download`,{responseType:"blob"}).then((e=>{const o=window.URL.createObjectURL(new Blob([e.data],{type:"application/gpx+xml"})),a=document.createElement("a");a.href=o,a.setAttribute("download",`${t}.gpx`),document.body.appendChild(a),a.click()}))}return(t,o)=>{const u=(0,a.up)("SportImage"),m=(0,a.up)("router-link");return(0,a.wg)(),(0,a.iD)("div",c,[(0,a._)("div",{class:(0,s.C_)(["workout-previous workout-arrow",{inactive:!(0,n.SU)(r).previousUrl}]),title:(0,n.SU)(r).previousUrl?t.$t(`workouts.PREVIOUS_${(0,n.SU)(r).type}`):t.$t(`workouts.NO_PREVIOUS_${(0,n.SU)(r).type}`),onClick:o[0]||(o[0]=e=>(0,n.SU)(r).previousUrl?t.$router.push((0,n.SU)(r).previousUrl):null)},w,10,p),(0,a._)("div",v,[(0,a.Wm)(u,{"sport-label":(0,n.SU)(l).label,color:(0,n.SU)(l).color},null,8,["sport-label","color"]),(0,a._)("div",k,["WORKOUT"===(0,n.SU)(r).type?((0,a.wg)(),(0,a.iD)("div",y,[(0,a._)("span",null,(0,s.zw)((0,n.SU)(r).title),1),(0,a._)("i",{class:"fa fa-edit","aria-hidden":"true",onClick:o[1]||(o[1]=e=>t.$router.push({name:"EditWorkout",params:{workoutId:(0,n.SU)(r).workoutId}}))}),(0,n.SU)(r).with_gpx?((0,a.wg)(),(0,a.iD)("i",{key:0,class:"fa fa-download","aria-hidden":"true",onClick:o[2]||(o[2]=(0,i.iM)((t=>d((0,n.SU)(r).workoutId)),["prevent"]))})):(0,a.kq)("",!0),(0,a._)("i",{class:"fa fa-trash","aria-hidden":"true",onClick:o[3]||(o[3]=t=>e("displayModal",!0))})])):((0,a.wg)(),(0,a.iD)("div",f,[(0,a.Uk)((0,s.zw)((0,n.SU)(r).title)+" ",1),(0,a._)("span",_,[(0,a.Uk)(" — "),g,(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.SEGMENT"))+" "+(0,s.zw)((0,n.SU)(r).segmentId+1),1)])])),(0,a._)("div",S,[(0,a.Uk)((0,s.zw)((0,n.SU)(r).workoutDate)+" - "+(0,s.zw)((0,n.SU)(r).workoutTime)+" ",1),(0,a._)("span",h,["SEGMENT"===(0,n.SU)(r).type?((0,a.wg)(),(0,a.j4)(m,{key:0,to:{name:"Workout",params:{workoutId:(0,n.SU)(r).workoutId}}},{default:(0,a.w5)((()=>[(0,a.Uk)(" > "+(0,s.zw)(t.$t("workouts.BACK_TO_WORKOUT")),1)])),_:1},8,["to"])):(0,a.kq)("",!0)])])])]),(0,a._)("div",{class:(0,s.C_)(["workout-next workout-arrow",{inactive:!(0,n.SU)(r).nextUrl}]),title:(0,n.SU)(r).nextUrl?t.$t(`workouts.NEXT_${(0,n.SU)(r).type}`):t.$t(`workouts.NO_NEXT_${(0,n.SU)(r).type}`),onClick:o[4]||(o[4]=e=>(0,n.SU)(r).nextUrl?t.$router.push((0,n.SU)(r).nextUrl):null)},T,10,b)])}}}),E=o(3744);const D=(0,E.Z)(O,[["__scopeId","data-v-4d9f9a8a"]]);var I=D;const A=t=>((0,a.dD)("data-v-1a5282f6"),t=t(),(0,a.Cn)(),t),C={key:0,class:"workout-record"},R=A((()=>(0,a._)("sup",null,[(0,a._)("i",{class:"fa fa-trophy","aria-hidden":"true"})],-1))),$=[R];var N=(0,a.aZ)({__name:"WorkoutRecord",props:{recordType:null,workoutObject:null},setup(t){const e=t,{recordType:o,workoutObject:l}=(0,n.BK)(e);return(t,e)=>(0,n.SU)(l).records&&(0,n.SU)(l).records.find((t=>t.record_type===(0,n.SU)(o)))?((0,a.wg)(),(0,a.iD)("span",C,$)):(0,a.kq)("",!0)}});const L=(0,E.Z)(N,[["__scopeId","data-v-1a5282f6"]]);var j=L,x=o(9150),z=o(3649);const W=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"],F=t=>{const e=Math.floor(t/22.5+.5);return W[e%16]},B={class:"wind"},H={class:"wind-bearing"},P=["title"];var Z=(0,a.aZ)({__name:"WeatherWind",props:{weather:null,useImperialUnits:{type:Boolean}},setup(t){const e=t,{useImperialUnits:o,weather:l}=(0,n.BK)(e),{t:r}=(0,x.QT)();function i(t){return r(`workouts.WEATHER.WIND_DIRECTIONS.${F(t)}`)}return(t,e)=>((0,a.wg)(),(0,a.iD)("div",B,[(0,a.Uk)((0,s.zw)((0,n.SU)(z.Y2)((0,n.SU)(l).wind,(0,n.SU)(o)))+" ",1),(0,a._)("div",H,[(0,n.SU)(l).windBearing?((0,a.wg)(),(0,a.iD)("i",{key:0,class:"fa fa-long-arrow-down",style:(0,s.j5)({transform:`rotate(${(0,n.SU)(l).windBearing}deg)`}),"aria-hidden":"true",title:i((0,n.SU)(l).windBearing)},null,12,P)):(0,a.kq)("",!0)])]))}});const M=(0,E.Z)(Z,[["__scopeId","data-v-40697ed1"]]);var q=M;const G=t=>((0,a.dD)("data-v-807b431a"),t=t(),(0,a.Cn)(),t),Y={key:0,id:"workout-weather"},K={class:"weather-table"},X=G((()=>(0,a._)("th",null,null,-1))),V={class:"weather-th"},J=["src","alt","title"],Q={class:"weather-th"},tt=["src","alt","title"],et=["alt","title"],ot=["alt","title"],at=["alt","title"];var nt=(0,a.aZ)({__name:"WorkoutWeather",props:{workoutObject:null,useImperialUnits:{type:Boolean}},setup(t){const e=t,{useImperialUnits:o,workoutObject:l}=(0,n.BK)(e);return(t,e)=>(0,n.SU)(l).weatherStart&&(0,n.SU)(l).weatherEnd?((0,a.wg)(),(0,a.iD)("div",Y,[(0,a._)("table",K,[(0,a._)("thead",null,[(0,a._)("tr",null,[X,(0,a._)("th",null,[(0,a._)("div",V,[(0,a.Uk)((0,s.zw)(t.$t("workouts.START"))+" ",1),(0,a._)("img",{class:"weather-img",src:`/img/weather/${(0,n.SU)(l).weatherStart.icon}.svg`,alt:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherStart.icon}`),title:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherStart.icon}`)},null,8,J)])]),(0,a._)("th",null,[(0,a._)("div",Q,[(0,a.Uk)((0,s.zw)(t.$t("workouts.END"))+" ",1),(0,a._)("img",{class:"weather-img",src:`/img/weather/${(0,n.SU)(l).weatherEnd.icon}.svg`,alt:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherEnd.icon}`),title:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherEnd.icon}`)},null,8,tt)])])])]),(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("img",{class:"weather-img weather-img-small",src:"/img/weather/temperature.svg",alt:t.$t("workouts.WEATHER.TEMPERATURE"),title:t.$t("workouts.WEATHER.TEMPERATURE")},null,8,et)]),(0,a._)("td",null,(0,s.zw)((0,n.SU)(z.x$)((0,n.SU)(l).weatherStart.temperature,(0,n.SU)(o))),1),(0,a._)("td",null,(0,s.zw)((0,n.SU)(z.x$)((0,n.SU)(l).weatherEnd.temperature,(0,n.SU)(o))),1)]),(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("img",{class:"weather-img weather-img-small",src:"/img/weather/pour-rain.svg",alt:t.$t("workouts.WEATHER.HUMIDITY"),title:t.$t("workouts.WEATHER.HUMIDITY")},null,8,ot)]),(0,a._)("td",null,(0,s.zw)(Number(100*(0,n.SU)(l).weatherStart.humidity).toFixed(1))+"% ",1),(0,a._)("td",null,(0,s.zw)(Number(100*(0,n.SU)(l).weatherEnd.humidity).toFixed(1))+"% ",1)]),(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("img",{class:"weather-img weather-img-small",src:"/img/weather/breeze.svg",alt:t.$t("workouts.WEATHER.WIND"),title:t.$t("workouts.WEATHER.WIND")},null,8,at)]),(0,a._)("td",null,[(0,a.Wm)(q,{weather:(0,n.SU)(l).weatherStart,useImperialUnits:(0,n.SU)(o)},null,8,["weather","useImperialUnits"])]),(0,a._)("td",null,[(0,a.Wm)(q,{weather:(0,n.SU)(l).weatherEnd,useImperialUnits:(0,n.SU)(o)},null,8,["weather","useImperialUnits"])])])])])])):(0,a.kq)("",!0)}});const lt=(0,E.Z)(nt,[["__scopeId","data-v-807b431a"]]);var rt=lt;const st=t=>((0,a.dD)("data-v-74c5993b"),t=t(),(0,a.Cn)(),t),it={id:"workout-info"},ut={class:"workout-data"},dt=st((()=>(0,a._)("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1))),ct={class:"label"},pt={class:"value"},mt={key:0},wt={class:"value"},vt={class:"value"},kt={class:"workout-data"},yt=st((()=>(0,a._)("i",{class:"fa fa-road","aria-hidden":"true"},null,-1))),ft={class:"label"},_t={class:"workout-data"},gt=st((()=>(0,a._)("i",{class:"fa fa-tachometer","aria-hidden":"true"},null,-1))),St={class:"label"},ht=st((()=>(0,a._)("br",null,null,-1))),bt={class:"label"},Ut={key:0,class:"workout-data"},Tt=["alt"],Ot={class:"label"},Et=st((()=>(0,a._)("br",null,null,-1))),Dt={class:"label"},It={key:1,class:"workout-data"},At=st((()=>(0,a._)("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1))),Ct={class:"label"},Rt=st((()=>(0,a._)("br",null,null,-1))),$t={class:"label"};var Nt=(0,a.aZ)({__name:"WorkoutData",props:{workoutObject:null,useImperialUnits:{type:Boolean},displayHARecord:{type:Boolean}},setup(t){const e=t,{displayHARecord:o,workoutObject:l,useImperialUnits:r}=(0,n.BK)(e),i=(0,a.Fl)((()=>"0:00:00"!==e.workoutObject.pauses&&null!==e.workoutObject.pauses));return(t,e)=>{const u=(0,a.up)("Distance");return(0,a.wg)(),(0,a.iD)("div",it,[(0,a._)("div",ut,[dt,(0,a._)("span",ct,(0,s.zw)(t.$t("workouts.DURATION")),1),(0,a.Uk)(": "),(0,a._)("span",pt,(0,s.zw)((0,n.SU)(l).moving),1),(0,a.Wm)(j,{workoutObject:(0,n.SU)(l),recordType:"LD"},null,8,["workoutObject"]),(0,n.SU)(i)?((0,a.wg)(),(0,a.iD)("div",mt,[(0,a.Uk)(" ("+(0,s.zw)(t.$t("workouts.PAUSES"))+": ",1),(0,a._)("span",wt,(0,s.zw)((0,n.SU)(l).pauses),1),(0,a.Uk)(" - "+(0,s.zw)(t.$t("workouts.TOTAL_DURATION"))+": ",1),(0,a._)("span",vt,(0,s.zw)((0,n.SU)(l).duration)+")",1)])):(0,a.kq)("",!0)]),(0,a._)("div",kt,[yt,(0,a._)("span",ft,(0,s.zw)(t.$t("workouts.DISTANCE")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).distance,digits:3,unitFrom:"km",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,a.Wm)(j,{workoutObject:(0,n.SU)(l),recordType:"FD"},null,8,["workoutObject"])]),(0,a._)("div",_t,[gt,(0,a._)("span",St,(0,s.zw)(t.$t("workouts.AVERAGE_SPEED")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).aveSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,a.Wm)(j,{workoutObject:(0,n.SU)(l),recordType:"AS"},null,8,["workoutObject"]),ht,(0,a._)("span",bt,(0,s.zw)(t.$t("workouts.MAX_SPEED")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).maxSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,a.Wm)(j,{workoutObject:(0,n.SU)(l),recordType:"MS"},null,8,["workoutObject"])]),null!==(0,n.SU)(l).maxAlt&&null!==(0,n.SU)(l).minAlt?((0,a.wg)(),(0,a.iD)("div",Ut,[(0,a._)("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:t.$t("workouts.ELEVATION")},null,8,Tt),(0,a._)("span",Ot,(0,s.zw)(t.$t("workouts.MIN_ALTITUDE")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).minAlt,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),Et,(0,a._)("span",Dt,(0,s.zw)(t.$t("workouts.MAX_ALTITUDE")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).maxAlt,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"])])):(0,a.kq)("",!0),null!==(0,n.SU)(l).ascent&&null!==(0,n.SU)(l).descent?((0,a.wg)(),(0,a.iD)("div",It,[At,(0,a._)("span",Ct,(0,s.zw)(t.$t("workouts.ASCENT")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).ascent,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,n.SU)(o)?((0,a.wg)(),(0,a.j4)(j,{key:0,workoutObject:(0,n.SU)(l),recordType:"HA"},null,8,["workoutObject"])):(0,a.kq)("",!0),Rt,(0,a._)("span",$t,(0,s.zw)(t.$t("workouts.DESCENT")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).descent,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"])])):(0,a.kq)("",!0),(0,a.Wm)(rt,{workoutObject:(0,n.SU)(l),useImperialUnits:(0,n.SU)(r)},null,8,["workoutObject","useImperialUnits"])])}}});const Lt=(0,E.Z)(Nt,[["__scopeId","data-v-74c5993b"]]);var jt=Lt;function xt(t,e){return Array.from(t.getElementsByTagName(e))}function zt(t){return t?.normalize(),t&&t.textContent||""}function Wt(t,e,o){const a=t.getElementsByTagName(e),n=a.length?a[0]:null;return n&&o&&o(n),n}function Ft(t,e,o){const a={};if(!t)return a;const n=t.getElementsByTagName(e),l=n.length?n[0]:null;return l&&o?o(l,a):a}function Bt(t,e,o){const a=zt(Wt(t,e));return a&&o&&o(a)||{}}function Ht(t,e,o){const a=parseFloat(zt(Wt(t,e)));if(!isNaN(a))return a&&o&&o(a)||{}}function Pt(t,e,o){const a=parseFloat(zt(Wt(t,e)));if(!isNaN(a))return a&&o&&o(a),a}function Zt(t,e){const o={};for(const a of e)Bt(t,a,(t=>{o[a]=t}));return o}function Mt(t){return 1===t?.nodeType}function qt(t){return Ft(t,"line",(t=>{const e=Object.assign({},Bt(t,"color",(t=>({stroke:`#${t}`}))),Ht(t,"opacity",(t=>({"stroke-opacity":t}))),Ht(t,"width",(t=>({"stroke-width":96*t/25.4}))));return e}))}function Gt(t){let e=[];if(null===t)return e;for(const o of Array.from(t.childNodes)){if(!Mt(o))continue;const t=Yt(o.nodeName);if("gpxtpx:TrackPointExtension"===t)e=e.concat(Gt(o));else{const a=zt(o);e.push([t,Kt(a)])}}return e}function Yt(t){return["heart","gpxtpx:hr","hr"].includes(t)?"heart":t}function Kt(t){const e=parseFloat(t);return isNaN(e)?t:e}function Xt(t){const e=[parseFloat(t.getAttribute("lon")||""),parseFloat(t.getAttribute("lat")||"")];if(isNaN(e[0])||isNaN(e[1]))return null;Pt(t,"ele",(t=>{e.push(t)}));const o=Wt(t,"time");return{coordinates:e,time:o?zt(o):null,extendedValues:Gt(Wt(t,"extensions"))}}function Vt(t){const e=Zt(t,["name","cmt","desc","type","time","keywords"]),o=Array.from(t.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const n of o)n.parentNode?.parentNode===t&&(e[n.tagName.replace(":","_")]=zt(n));const a=xt(t,"link");return a.length&&(e.links=a.map((t=>Object.assign({href:t.getAttribute("href")},Zt(t,["text","type"]))))),e}function Jt(t,e){const o=xt(t,e),a=[],n=[],l={};for(let r=0;r<o.length;r++){const t=Xt(o[r]);if(t){a.push(t.coordinates),t.time&&n.push(t.time);for(const[e,a]of t.extendedValues){const t="heart"===e?e:e.replace("gpxtpx:","")+"s";l[t]||(l[t]=Array(o.length).fill(null)),l[t][r]=a}}}if(!(a.length<2))return{line:a,times:n,extendedValues:l}}function Qt(t){const e=Jt(t,"rtept");if(e)return{type:"Feature",properties:Object.assign({_gpxType:"rte"},Vt(t),qt(Wt(t,"extensions"))),geometry:{type:"LineString",coordinates:e.line}}}function te(t){const e=xt(t,"trkseg"),o=[],a=[],n=[];for(const s of e){const t=Jt(s,"trkpt");t&&(n.push(t),t.times&&t.times.length&&a.push(t.times))}if(0===n.length)return null;const l=n.length>1,r=Object.assign({_gpxType:"trk"},Vt(t),qt(Wt(t,"extensions")),a.length?{coordinateProperties:{times:l?a:a[0]}}:{});for(const s of n){o.push(s.line),r.coordinateProperties||(r.coordinateProperties={});const t=r.coordinateProperties,e=Object.entries(s.extendedValues);for(let o=0;o<e.length;o++){const[a,r]=e[o];l?(t[a]||(t[a]=n.map((t=>new Array(t.line.length).fill(null)))),t[a][o]=r):t[a]=r}}return{type:"Feature",properties:r,geometry:l?{type:"MultiLineString",coordinates:o}:{type:"LineString",coordinates:o[0]}}}function ee(t){const e=Object.assign(Vt(t),Zt(t,["sym"])),o=Xt(t);return o?{type:"Feature",properties:e,geometry:{type:"Point",coordinates:o.coordinates}}:null}function*oe(t){for(const e of xt(t,"trk")){const t=te(e);t&&(yield t)}for(const e of xt(t,"rte")){const t=Qt(e);t&&(yield t)}for(const e of xt(t,"wpt")){const t=ee(e);t&&(yield t)}}function ae(t){return{type:"FeatureCollection",features:Array.from(oe(t))}}Math.PI;const ne=(t,e)=>{for(const o of Object.keys(e))t.on(o,e[o])},le=t=>{for(const e of Object.keys(t)){const o=t[e];o&&se(o.cancel)&&o.cancel()}},re=t=>t&&"function"==typeof t.charAt?t.charAt(0).toUpperCase()+t.slice(1):t,se=t=>"function"==typeof t,ie=(t,e,o)=>{for(const n in o){const l="set"+re(n);t[l]?(0,a.YP)((()=>o[n]),((e,o)=>{t[l](e,o)})):e[l]&&(0,a.YP)((()=>o[n]),(t=>{e[l](t)}))}},ue=(t,e,o={})=>{const a={...o};for(const n in t){const o=e[n],l=t[n];o&&(o&&!0===o.custom||void 0!==l&&(a[n]=l))}return a},de=t=>{const e={};for(const o in t)if(o.startsWith("on")&&!o.startsWith("onUpdate")&&"onReady"!==o){const a=o.slice(2).toLocaleLowerCase();e[a]=t[o]}return e},ce=async t=>{const e=await Promise.all([o.e(431).then(o.t.bind(o,6431,17)),o.e(93).then(o.t.bind(o,7093,17)),o.e(858).then(o.t.bind(o,8858,17))]);delete t.Default.prototype._getIconUrl,t.Default.mergeOptions({iconRetinaUrl:e[0].default,iconUrl:e[1].default,shadowUrl:e[2].default})},pe=t=>{const e=(0,n.iH)(((...e)=>console.warn(`Method ${t} has been invoked without being replaced`))),o=(...t)=>e.value(...t);return o.wrapped=e,(0,a.JJ)(t,o),o},me=(t,e)=>t.wrapped.value=e,we="object"==typeof self&&self.self===self&&self||"object"==typeof o.g&&o.g.global===o.g&&o.g||globalThis,ve=t=>{const e=(0,a.f3)(t);if(!e)throw new Error(`Attempt to inject ${t} before it was provided.`);return e},ke=Symbol(),ye=Symbol(),fe=Symbol(),_e=Symbol(),ge=Symbol(),Se=Symbol(),he=Symbol(),be=Symbol(),Ue=Symbol(),Te=Symbol(),Oe=Symbol(),Ee=Symbol(),De={options:{type:Object,default:()=>({}),custom:!0}},Ie=t=>({options:t.options,methods:{}}),Ae={...De,pane:{type:String},attribution:{type:String},name:{type:String,custom:!0},layerType:{type:String,custom:!0},visible:{type:Boolean,custom:!0,default:!0}},Ce=(t,e,o)=>{const n=ve(ye),l=ve(fe),{options:r,methods:s}=Ie(t),i=ue(t,Ae,r),u=()=>n({leafletObject:e.value}),d=()=>l({leafletObject:e.value}),c={...s,setAttribution(o){d(),e.value.options.attribution=o,t.visible&&u()},setName(){d(),t.visible&&u()},setLayerType(){d(),t.visible&&u()},setVisible(t){e.value&&(t?u():d())},bindPopup(t){e.value&&se(e.value.bindPopup)?e.value.bindPopup(t):console.warn("Attempt to bind popup before bindPopup method available on layer.")},bindTooltip(t){e.value&&se(e.value.bindTooltip)?e.value.bindTooltip(t):console.warn("Attempt to bind tooltip before bindTooltip method available on layer.")},unbindTooltip(){e.value&&(se(e.value.closeTooltip)&&e.value.closeTooltip(),se(e.value.unbindTooltip)&&e.value.unbindTooltip())},unbindPopup(){e.value&&(se(e.value.closePopup)&&e.value.closePopup(),se(e.value.unbindPopup)&&e.value.unbindPopup())},updateVisibleProp(t){o.emit("update:visible",t)}};return(0,a.JJ)(Ue,c.bindPopup),(0,a.JJ)(Te,c.bindTooltip),(0,a.JJ)(Oe,c.unbindPopup),(0,a.JJ)(Ee,c.unbindTooltip),(0,a.Ah)((()=>{c.unbindPopup(),c.unbindTooltip(),d()})),{options:i,methods:c}},Re=(t,e)=>{if(t&&e.default)return(0,a.h)("div",{style:{display:"none"}},e.default())},$e={...Ae,interactive:{type:Boolean,default:void 0},bubblingMouseEvents:{type:Boolean,default:void 0}},Ne=(t,e,o)=>{const{options:a,methods:n}=Ce(t,e,o);return{options:ue(t,$e,a),methods:n}},Le={...$e,stroke:{type:Boolean,default:void 0},color:{type:String},weight:{type:Number},opacity:{type:Number},lineCap:{type:String},lineJoin:{type:String},dashArray:{type:String},dashOffset:{type:String},fill:{type:Boolean,default:void 0},fillColor:{type:String},fillOpacity:{type:Number},fillRule:{type:String},className:{type:String}},je=(t,e,o)=>{const{options:n,methods:l}=Ne(t,e,o),r=ue(t,Le,n),s=ve(fe),i={...l,setStroke(t){e.value.setStyle({stroke:t})},setColor(t){e.value.setStyle({color:t})},setWeight(t){e.value.setStyle({weight:t})},setOpacity(t){e.value.setStyle({opacity:t})},setLineCap(t){e.value.setStyle({lineCap:t})},setLineJoin(t){e.value.setStyle({lineJoin:t})},setDashArray(t){e.value.setStyle({dashArray:t})},setDashOffset(t){e.value.setStyle({dashOffset:t})},setFill(t){e.value.setStyle({fill:t})},setFillColor(t){e.value.setStyle({fillColor:t})},setFillOpacity(t){e.value.setStyle({fillOpacity:t})},setFillRule(t){e.value.setStyle({fillRule:t})},setClassName(t){e.value.setStyle({className:t})}};return(0,a.Jd)((()=>{s({leafletObject:e.value})})),{options:r,methods:i}},xe={...Le,radius:{type:Number},latLng:{type:[Object,Array],required:!0,custom:!0}},ze=(t,e,o)=>{const{options:a,methods:n}=je(t,e,o),l=ue(t,xe,a),r={...n,setRadius(t){e.value.setRadius(t)},setLatLng(t){e.value.setLatLng(t)}};return{options:l,methods:r}},We={...xe,radius:{type:Number}},Fe=(t,e,o)=>{const{options:a,methods:n}=ze(t,e,o),l=ue(t,We,a),r={...n};return{options:l,methods:r}},Be=((0,a.aZ)({name:"LCircle",props:We,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye),{options:u,methods:d}=Fe(t,l,e);return(0,a.bv)((async()=>{const{circle:c}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.latLng,u));const p=de(e.attrs);l.value.on(p),ie(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}),(0,a.aZ)({name:"LCircleMarker",props:xe,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye),{options:u,methods:d}=ze(t,l,e);return(0,a.bv)((async()=>{const{circleMarker:c}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.latLng,u));const p=de(e.attrs);l.value.on(p),ie(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}),{...De,position:{type:String}}),He=(t,e)=>{const{options:o,methods:n}=Ie(t),l=ue(t,Be,o),r={...n,setPosition(t){e.value&&e.value.setPosition(t)}};return(0,a.Ah)((()=>{e.value&&e.value.remove()})),{options:l,methods:r}},Pe=t=>t.default?(0,a.h)("div",{ref:"root"},t.default()):null,Ze=(0,a.aZ)({name:"LControl",props:{...Be,disableClickPropagation:{type:Boolean,custom:!0,default:!0},disableScrollPropagation:{type:Boolean,custom:!0,default:!1}},setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(),s=(0,a.f3)(ke),i=ve(_e),{options:u,methods:d}=He(t,l);return(0,a.bv)((async()=>{const{Control:c,DomEvent:p}=s?we.L:await o.e(633).then(o.bind(o,6633)),m=c.extend({onAdd(){return r.value}});l.value=(0,n.Xl)(new m(u)),ie(d,l.value,t),i({leafletObject:l.value}),t.disableClickPropagation&&r.value&&p.disableClickPropagation(r.value),t.disableScrollPropagation&&r.value&&p.disableScrollPropagation(r.value),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{root:r,leafletObject:l}},render(){return Pe(this.$slots)}}),Me={...Be,prefix:{type:String}},qe=(t,e)=>{const{options:o,methods:a}=He(t,e),n=ue(t,Me,o),l={...a,setPrefix(t){e.value.setPrefix(t)}};return{options:n,methods:l}},Ge=((0,a.aZ)({name:"LControlAttribution",props:Me,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(ke),s=ve(_e),{options:i,methods:u}=qe(t,l);return(0,a.bv)((async()=>{const{control:d}=r?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.attribution(i)),ie(u,l.value,t),s({leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),{...Be,collapsed:{type:Boolean,default:void 0},autoZIndex:{type:Boolean,default:void 0},hideSingleBase:{type:Boolean,default:void 0},sortLayers:{type:Boolean,default:void 0},sortFunction:{type:Function}}),Ye=(t,e)=>{const{options:o}=He(t,e);return{options:ue(t,Ge,o),methods:{addLayer(t){"base"===t.layerType?e.value.addBaseLayer(t.leafletObject,t.name):"overlay"===t.layerType&&e.value.addOverlay(t.leafletObject,t.name)},removeLayer(t){e.value.removeLayer(t.leafletObject)}}}},Ke=(0,a.aZ)({name:"LControlLayers",props:Ge,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(ke),s=ve(ge),{options:i,methods:u}=Ye(t,l);return(0,a.bv)((async()=>{const{control:d}=r?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.layers(void 0,void 0,i)),ie(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),Xe={...Be,maxWidth:{type:Number},metric:{type:Boolean,default:void 0},imperial:{type:Boolean,default:void 0},updateWhenIdle:{type:Boolean,default:void 0}},Ve=(t,e)=>{const{options:o,methods:a}=He(t,e);return{options:ue(t,Xe,o),methods:a}},Je=((0,a.aZ)({name:"LControlScale",props:Xe,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(ke),s=ve(_e),{options:i,methods:u}=Ve(t,l);return(0,a.bv)((async()=>{const{control:d}=r?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.scale(i)),ie(u,l.value,t),s({leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),{...Be,zoomInText:{type:String},zoomInTitle:{type:String},zoomOutText:{type:String},zoomOutTitle:{type:String}}),Qe=(t,e)=>{const{options:o,methods:a}=He(t,e);return{options:ue(t,Je,o),methods:a}},to=((0,a.aZ)({name:"LControlZoom",props:Je,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(ke),s=ve(_e),{options:i,methods:u}=Qe(t,l);return(0,a.bv)((async()=>{const{control:d}=r?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.zoom(i)),ie(u,l.value,t),s({leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),{...Ae}),eo=(t,e,o)=>{const{options:n,methods:l}=Ce(t,e,o),r=ue(t,to,n),s={...l,addLayer(t){e.value.addLayer(t.leafletObject)},removeLayer(t){e.value.removeLayer(t.leafletObject)}};return(0,a.JJ)(ye,s.addLayer),(0,a.JJ)(fe,s.removeLayer),{options:r,methods:s}},oo={...to},ao=(t,e,o)=>{const{options:a,methods:n}=eo(t,e,o),l=ue(t,oo,a),r={...n};return{options:l,methods:r}},no=((0,a.aZ)({props:oo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye),{methods:u,options:d}=ao(t,l,e);return(0,a.bv)((async()=>{const{featureGroup:c}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(void 0,d));const p=de(e.attrs);l.value.on(p),ie(u,l.value,t),i({...t,...u,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}),{...to,geojson:{type:[Object,Array],custom:!0},optionsStyle:{type:Function,custom:!0}}),lo=(t,e,o)=>{const{options:a,methods:n}=eo(t,e,o),l=ue(t,no,a);Object.prototype.hasOwnProperty.call(t,"optionsStyle")&&(l.style=t.optionsStyle);const r={...n,setGeojson(t){e.value.clearLayers(),e.value.addData(t)},setOptionsStyle(t){e.value.setStyle(t)},getGeoJSONData(){return e.value.toGeoJSON()},getBounds(){return e.value.getBounds()}};return{options:l,methods:r}},ro=(0,a.aZ)({props:no,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye),{methods:u,options:d}=lo(t,l,e);return(0,a.bv)((async()=>{const{geoJSON:c}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.geojson,d));const p=de(e.attrs);l.value.on(p),ie(u,l.value,t),i({...t,...u,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}),so={...Ae,opacity:{type:Number},zIndex:{type:Number},tileSize:{type:[Number,Array,Object]},noWrap:{type:Boolean,default:void 0},minZoom:{type:Number},maxZoom:{type:Number}},io=(t,e,o)=>{const{options:n,methods:l}=Ce(t,e,o),r=ue(t,so,n),s={...l,setTileComponent(){var t;null==(t=e.value)||t.redraw()}};return(0,a.Ah)((()=>{e.value.off()})),{options:r,methods:s}},uo=(t,e,o,n)=>t.extend({initialize(t){this.tileComponents={},this.on("tileunload",this._unloadTile),o.setOptions(this,t)},createTile(t){const o=this._tileCoordsToKey(t);this.tileComponents[o]=e.create("div");const l=(0,a.h)({setup:n,props:["coords"]},{coords:t});return(0,i.sY)(l,this.tileComponents[o]),this.tileComponents[o]},_unloadTile(t){const e=this._tileCoordsToKey(t.coords);this.tileComponents[e]&&(this.tileComponents[e].innerHTML="",this.tileComponents[e]=void 0)}}),co=((0,a.aZ)({props:{...so,childRender:{type:Function,required:!0}},setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(null),s=(0,n.iH)(!1),i=(0,a.f3)(ke),u=ve(ye),{options:d,methods:c}=io(t,l,e);return(0,a.bv)((async()=>{const{GridLayer:r,DomUtil:p,Util:m}=i?we.L:await o.e(633).then(o.bind(o,6633)),w=uo(r,p,m,t.childRender);l.value=(0,n.Xl)(new w(d));const v=de(e.attrs);l.value.on(v),ie(c,l.value,t),u({...t,...c,leafletObject:l.value}),s.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{root:r,ready:s,leafletObject:l}},render(){return this.ready?(0,a.h)("div",{style:{display:"none"},ref:"root"}):null}}),{iconUrl:{type:String},iconRetinaUrl:{type:String},iconSize:{type:[Object,Array]},iconAnchor:{type:[Object,Array]},popupAnchor:{type:[Object,Array]},tooltipAnchor:{type:[Object,Array]},shadowUrl:{type:String},shadowRetinaUrl:{type:String},shadowSize:{type:[Object,Array]},shadowAnchor:{type:[Object,Array]},bgPos:{type:[Object,Array]},className:{type:String}}),po=(0,a.aZ)({name:"LIcon",props:{...co,...De},setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(ke),s=ve(Se),i=ve(he),u=ve(be);let d,c,p,m,w;const v=(o,a,n)=>{const l=o&&o.innerHTML;if(!a)return void(n&&w&&s()&&i(l));const r=de(e.attrs);w&&c(w,r);const{options:v}=Ie(t),k=ue(t,co,v);l&&(k.html=l),w=k.html?p(k):m(k),d(w,r),u(w)},k=()=>{(0,a.Y3)((()=>v(l.value,!0,!1)))},y=()=>{(0,a.Y3)((()=>v(l.value,!1,!0)))},f={setIconUrl:k,setIconRetinaUrl:k,setIconSize:k,setIconAnchor:k,setPopupAnchor:k,setTooltipAnchor:k,setShadowUrl:k,setShadowRetinaUrl:k,setShadowAnchor:k,setBgPos:k,setClassName:k,setHtml:k};return(0,a.bv)((async()=>{const{DomEvent:e,divIcon:a,icon:n}=r?we.L:await o.e(633).then(o.bind(o,6633));d=e.on,c=e.off,p=a,m=n,ie(f,{},t),new MutationObserver(y).observe(l.value,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),k()})),{root:l}},render(){const t=this.$slots.default?this.$slots.default():void 0;return(0,a.h)("div",{ref:"root"},t)}}),mo={...Ae,opacity:{type:Number},alt:{type:String},interactive:{type:Boolean,default:void 0},crossOrigin:{type:Boolean,default:void 0},errorOverlayUrl:{type:String},zIndex:{type:Number},className:{type:String},url:{type:String,required:!0,custom:!0},bounds:{type:[Array,Object],required:!0,custom:!0}},wo=(t,e,o)=>{const{options:a,methods:n}=Ce(t,e,o),l=ue(t,mo,a),r={...n,setOpacity(t){return e.value.setOpacity(t)},setUrl(t){return e.value.setUrl(t)},setBounds(t){return e.value.setBounds(t)},getBounds(){return e.value.getBounds()},getElement(){return e.value.getElement()},bringToFront(){return e.value.bringToFront()},bringToBack(){return e.value.bringToBack()},setZIndex(t){return e.value.setZIndex(t)}};return{options:l,methods:r}},vo=((0,a.aZ)({name:"LImageOverlay",props:mo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye),{options:u,methods:d}=wo(t,l,e);return(0,a.bv)((async()=>{const{imageOverlay:c}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.url,t.bounds,u));const p=de(e.attrs);l.value.on(p),ie(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}),(0,a.aZ)({props:to,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye),{methods:u}=eo(t,l,e);return(0,a.bv)((async()=>{const{layerGroup:d}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d(void 0,t.options));const c=de(e.attrs);l.value.on(c),ie(u,l.value,t),i({...t,...u,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}));function ko(t,e,o){var a,n,l;void 0===e&&(e=50),void 0===o&&(o={});var r=null!=(a=o.isImmediate)&&a,s=null!=(n=o.callback)&&n,i=o.maxWait,u=Date.now(),d=[];function c(){if(void 0!==i){var t=Date.now()-u;if(t+e>=i)return i-t}return e}var p=function(){var e=[].slice.call(arguments),o=this;return new Promise((function(a,n){var i=r&&void 0===l;if(void 0!==l&&clearTimeout(l),l=setTimeout((function(){if(l=void 0,u=Date.now(),!r){var a=t.apply(o,e);s&&s(a),d.forEach((function(t){return(0,t.resolve)(a)})),d=[]}}),c()),i){var p=t.apply(o,e);return s&&s(p),a(p)}d.push({resolve:a,reject:n})}))};return p.cancel=function(t){void 0!==l&&clearTimeout(l),d.forEach((function(e){return(0,e.reject)(t)})),d=[]},p}const yo={...De,center:{type:[Object,Array]},bounds:{type:[Array,Object]},maxBounds:{type:[Array,Object]},zoom:{type:Number},minZoom:{type:Number},maxZoom:{type:Number},paddingBottomRight:{type:[Object,Array]},paddingTopLeft:{type:Object},padding:{type:Object},worldCopyJump:{type:Boolean,default:void 0},crs:{type:[String,Object]},maxBoundsViscosity:{type:Number},inertia:{type:Boolean,default:void 0},inertiaDeceleration:{type:Number},inertiaMaxSpeed:{type:Number},easeLinearity:{type:Number},zoomAnimation:{type:Boolean,default:void 0},zoomAnimationThreshold:{type:Number},fadeAnimation:{type:Boolean,default:void 0},markerZoomAnimation:{type:Boolean,default:void 0},noBlockingAnimations:{type:Boolean,default:void 0},useGlobalLeaflet:{type:Boolean,default:!0,custom:!0}},fo=(0,a.aZ)({emits:["ready","update:zoom","update:center","update:bounds"],props:yo,setup(t,e){const l=(0,n.iH)(),r=(0,n.qj)({ready:!1,layersToAdd:[],layersInControl:[]}),{options:s}=Ie(t),i=ue(t,yo,s),u=pe(ye),d=pe(fe),c=pe(_e),p=pe(ge);(0,a.JJ)(ke,t.useGlobalLeaflet);const m=(0,a.Fl)((()=>{const e={};return t.noBlockingAnimations&&(e.animate=!1),e})),w=(0,a.Fl)((()=>{const e=m.value;return t.padding&&(e.padding=t.padding),t.paddingTopLeft&&(e.paddingTopLeft=t.paddingTopLeft),t.paddingBottomRight&&(e.paddingBottomRight=t.paddingBottomRight),e})),v={moveend:ko((t=>{r.leafletRef&&(e.emit("update:zoom",r.leafletRef.getZoom()),e.emit("update:center",r.leafletRef.getCenter()),e.emit("update:bounds",r.leafletRef.getBounds()))})),overlayadd(t){const e=r.layersInControl.find((e=>e.name===t.name));e&&e.updateVisibleProp(!0)},overlayremove(t){const e=r.layersInControl.find((e=>e.name===t.name));e&&e.updateVisibleProp(!1)}};(0,a.bv)((async()=>{t.useGlobalLeaflet&&(we.L=we.L||await o.e(243).then(o.t.bind(o,5243,23)));const{map:s,CRS:k,Icon:y,latLngBounds:f,latLng:_,DomEvent:g,stamp:S}=t.useGlobalLeaflet?we.L:await o.e(633).then(o.bind(o,6633));try{i.beforeMapMount&&await i.beforeMapMount()}catch(T){console.error(`The following error occurred running the provided beforeMapMount hook ${T.message}`)}await ce(y);const h="string"==typeof i.crs?k[i.crs]:i.crs;i.crs=h||k.EPSG3857;const b={addLayer(t){void 0!==t.layerType&&(void 0===r.layerControl?r.layersToAdd.push(t):r.layersInControl.find((e=>S(e.leafletObject)===S(t.leafletObject)))||(r.layerControl.addLayer(t),r.layersInControl.push(t))),!1!==t.visible&&r.leafletRef.addLayer(t.leafletObject)},removeLayer(t){void 0!==t.layerType&&(void 0===r.layerControl?r.layersToAdd=r.layersToAdd.filter((e=>e.name!==t.name)):(r.layerControl.removeLayer(t.leafletObject),r.layersInControl=r.layersInControl.filter((e=>S(e.leafletObject)!==S(t.leafletObject))))),r.leafletRef.removeLayer(t.leafletObject)},registerLayerControl(t){r.layerControl=t,r.layersToAdd.forEach((t=>{r.layerControl.addLayer(t)})),r.layersToAdd=[],c(t)},registerControl(t){r.leafletRef.addControl(t.leafletObject)},setZoom(t){const e=r.leafletRef.getZoom();t!==e&&r.leafletRef.setZoom(t,m.value)},setCrs(t){const e=r.leafletRef.getBounds();r.leafletRef.options.crs=t,r.leafletRef.fitBounds(e,{animate:!1,padding:[0,0]})},fitBounds(t){r.leafletRef.fitBounds(t,w.value)},setBounds(t){if(!t)return;const e=f(t);e.isValid()&&!(r.lastSetBounds||r.leafletRef.getBounds()).equals(e,0)&&(r.lastSetBounds=e,r.leafletRef.fitBounds(e))},setCenter(t){if(null==t)return;const e=_(t),o=r.lastSetCenter||r.leafletRef.getCenter();(o.lat!==e.lat||o.lng!==e.lng)&&(r.lastSetCenter=e,r.leafletRef.panTo(e,m.value))}};me(u,b.addLayer),me(d,b.removeLayer),me(c,b.registerControl),me(p,b.registerLayerControl),r.leafletRef=(0,n.Xl)(s(l.value,i)),ie(b,r.leafletRef,t);const U=de(e.attrs);ne(r.leafletRef,v),g.on(r.leafletRef.getContainer(),U),r.ready=!0,(0,a.Y3)((()=>e.emit("ready",r.leafletRef)))})),(0,a.Jd)((()=>{le(v),r.leafletRef&&(r.leafletRef.off(),r.leafletRef.remove())}));const k=(0,a.Fl)((()=>r.leafletRef)),y=(0,a.Fl)((()=>r.ready));return{root:l,ready:y,leafletObject:k}},render(){return(0,a.h)("div",{style:{width:"100%",height:"100%"},ref:"root"},this.ready&&this.$slots.default?this.$slots.default():{})}}),_o=["Symbol(Comment)","Symbol(Text)"],go=["LTooltip","LPopup"],So={...Ae,draggable:{type:Boolean,default:void 0},icon:{type:[Object]},zIndexOffset:{type:Number},latLng:{type:[Object,Array],custom:!0,required:!0}},ho=(t,e,o)=>{const{options:a,methods:n}=Ce(t,e,o),l=ue(t,So,a),r={...n,setDraggable(t){e.value.dragging&&(t?e.value.dragging.enable():e.value.dragging.disable())},latLngSync(t){o.emit("update:latLng",t.latlng),o.emit("update:lat-lng",t.latlng)},setLatLng(t){if(null!=t&&e.value){const o=e.value.getLatLng();(!o||!o.equals(t))&&e.value.setLatLng(t)}}};return{options:l,methods:r}},bo=(t,e)=>{const o=e.slots.default&&e.slots.default();return o&&o.length&&o.some(Uo)};function Uo(t){return!(_o.includes(t.type.toString())||go.includes(t.type.name))}const To=(0,a.aZ)({name:"LMarker",props:So,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye);(0,a.JJ)(Se,(()=>{var t;return!(null==(t=l.value)||!t.getElement())})),(0,a.JJ)(he,(t=>{var e,o;const a=se(null==(e=l.value)?void 0:e.getElement)&&(null==(o=l.value)?void 0:o.getElement());a&&(a.innerHTML=t)})),(0,a.JJ)(be,(t=>{var e;return(null==(e=l.value)?void 0:e.setIcon)&&l.value.setIcon(t)}));const{options:u,methods:d}=ho(t,l,e),c={moveHandler:ko(d.latLngSync)};return(0,a.bv)((async()=>{const{marker:p,divIcon:m}=s?we.L:await o.e(633).then(o.bind(o,6633));bo(u,e)&&(u.icon=m({className:""})),l.value=(0,n.Xl)(p(t.latLng,u));const w=de(e.attrs);l.value.on(w),l.value.on("move",c.moveHandler),ie(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),(0,a.Jd)((()=>le(c))),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}),Oo={...Le,smoothFactor:{type:Number},noClip:{type:Boolean,default:void 0},latLngs:{type:Array,required:!0,custom:!0}},Eo=(t,e,o)=>{const{options:a,methods:n}=je(t,e,o),l=ue(t,Oo,a),r={...n,setSmoothFactor(t){e.value.setStyle({smoothFactor:t})},setNoClip(t){e.value.setStyle({noClip:t})},addLatLng(t){e.value.addLatLng(t)}};return{options:l,methods:r}},Do={...Oo},Io=(t,e,o)=>{const{options:a,methods:n}=Eo(t,e,o),l=ue(t,Do,a),r={...n,toGeoJSON(t){return e.value.toGeoJSON(t)}};return{options:l,methods:r}},Ao=((0,a.aZ)({name:"LPolygon",props:Do,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye),{options:u,methods:d}=Io(t,l,e);return(0,a.bv)((async()=>{const{polygon:c}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.latLngs,u));const p=de(e.attrs);l.value.on(p),ie(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}),(0,a.aZ)({name:"LPolyline",props:Oo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye),{options:u,methods:d}=Eo(t,l,e);return(0,a.bv)((async()=>{const{polyline:c}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.latLngs,u));const p=de(e.attrs);l.value.on(p),ie(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}),{...De,content:{type:String,default:null}}),Co=(t,e)=>{const{options:o,methods:a}=Ie(t),n={...a,setContent(t){e.value&&null!==t&&void 0!==t&&e.value.setContent(t)}};return{options:o,methods:n}},Ro=t=>t.default?(0,a.h)("div",{ref:"root"},t.default()):null,$o={...Ao,latLng:{type:[Object,Array],default:()=>[]}},No=(t,e)=>{const{options:o,methods:a}=Co(t,e);return{options:o,methods:a}},Lo=((0,a.aZ)({name:"LPopup",props:$o,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(null),s=(0,a.f3)(ke),i=ve(Ue),u=ve(Oe),{options:d,methods:c}=No(t,l);return(0,a.bv)((async()=>{const{popup:u}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(u(d)),void 0!==t.latLng&&l.value.setLatLng(t.latLng),ie(c,l.value,t);const p=de(e.attrs);l.value.on(p),l.value.setContent(t.content||r.value||""),i(l.value),(0,a.Y3)((()=>e.emit("ready",l.value)))})),(0,a.Jd)((()=>{u()})),{root:r,leafletObject:l}},render(){return Ro(this.$slots)}}),{...Do,latLngs:{...Do.latLngs,required:!1},bounds:{type:Object,custom:!0}}),jo=(t,e,o)=>{const{options:a,methods:n}=Io(t,e,o),l=ue(t,Lo,a),r={...n,setBounds(t){e.value.setBounds(t)},setLatLngs(t){e.value.setBounds(t)}};return{options:l,methods:r}},xo=((0,a.aZ)({name:"LRectangle",props:Lo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=ve(ye),{options:u,methods:d}=jo(t,l,e);return(0,a.bv)((async()=>{const{rectangle:c,latLngBounds:p}=s?we.L:await o.e(633).then(o.bind(o,6633)),m=t.bounds?p(t.bounds):p(t.latLngs||[]);l.value=(0,n.Xl)(c(m,u));const w=de(e.attrs);l.value.on(w),ie(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Re(this.ready,this.$slots)}}),{...so,tms:{type:Boolean,default:void 0},subdomains:{type:[String,Array],validator:t=>"string"==typeof t||!!Array.isArray(t)&&t.every((t=>"string"==typeof t))},detectRetina:{type:Boolean,default:void 0},url:{type:String,required:!0,custom:!0}}),zo=(t,e,o)=>{const{options:a,methods:n}=io(t,e,o),l=ue(t,xo,a),r={...n};return{options:l,methods:r}},Wo=(0,a.aZ)({props:xo,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(ke),s=ve(ye),{options:i,methods:u}=zo(t,l,e);return(0,a.bv)((async()=>{const{tileLayer:d}=r?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d(t.url,i));const c=de(e.attrs);l.value.on(c),ie(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),Fo={...Ao},Bo=(t,e)=>{const{options:o,methods:n}=Co(t,e),l=ve(Ee);return(0,a.Jd)((()=>{l()})),{options:o,methods:n}},Ho=((0,a.aZ)({name:"LTooltip",props:Fo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(null),s=(0,a.f3)(ke),i=ve(Te),{options:u,methods:d}=Bo(t,l);return(0,a.bv)((async()=>{const{tooltip:c}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(u)),ie(d,l.value,t);const p=de(e.attrs);l.value.on(p),l.value.setContent(t.content||r.value||""),i(l.value),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{root:r,leafletObject:l}},render(){return Ro(this.$slots)}}),{...xo,layers:{type:String,required:!0},styles:{type:String},format:{type:String},transparent:{type:Boolean,default:void 0},version:{type:String},crs:{type:Object},uppercase:{type:Boolean,default:void 0}}),Po=(t,e,o)=>{const{options:a,methods:n}=zo(t,e,o);return{options:ue(t,Ho,a),methods:{...n}}};(0,a.aZ)({props:Ho,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(ke),s=ve(ye),{options:i,methods:u}=Po(t,l,e);return(0,a.bv)((async()=>{const{tileLayer:d}=r?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.wms(t.url,i));const c=de(e.attrs);l.value.on(c),ie(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}});var Zo=(0,a.aZ)({__name:"CustomMarker",props:{markerCoordinates:null,isStart:{type:Boolean}},setup(t){const e=t,{isStart:o,markerCoordinates:l}=(0,n.BK)(e);return(t,e)=>(0,n.SU)(l).latitude?((0,a.wg)(),(0,a.j4)((0,n.SU)(To),{key:0,"lat-lng":[(0,n.SU)(l).latitude,(0,n.SU)(l).longitude]},{default:(0,a.w5)((()=>[(0,a.Wm)((0,n.SU)(po),{"icon-url":`/img/workouts/${(0,n.SU)(o)?"start":"finish"}.svg`,iconSize:[15,15]},null,8,["icon-url"])])),_:1},8,["lat-lng"])):(0,a.kq)("",!0)}});const Mo=Zo;var qo=Mo,Go=o(5801),Yo=o(9917),Ko=o(2024);const Xo=t=>((0,a.dD)("data-v-2aec89b0"),t=t(),(0,a.Cn)(),t),Vo={id:"workout-map"},Jo={key:0,class:"leaflet-container"},Qo={key:1},ta=Xo((()=>(0,a._)("i",{class:"fa fa-refresh","aria-hidden":"true"},null,-1))),ea={key:1,class:"no-map"};var oa=(0,a.aZ)({__name:"index",props:{workoutData:null,markerCoordinates:{default:()=>({})}},setup(t){const e=t,o=(0,Yo.o)(),{workoutData:l,markerCoordinates:r}=(0,n.BK)(e),i=(0,n.iH)(null),u=(0,a.Fl)((()=>_())),d=(0,a.Fl)((()=>o.getters[Go.SY.GETTERS.APP_CONFIG])),c=(0,a.Fl)((()=>y(u))),p=(0,a.Fl)((()=>e.workoutData&&e.workoutData.gpx?k(e.workoutData.gpx):{})),m=(0,a.Fl)((()=>e.workoutData&&e.workoutData.chartData.length>0?{latitude:e.workoutData.chartData[0].latitude,longitude:e.workoutData.chartData[0].longitude}:{})),w=(0,a.Fl)((()=>e.workoutData&&e.workoutData.chartData.length>0?{latitude:e.workoutData.chartData[e.workoutData.chartData.length-1].latitude,longitude:e.workoutData.chartData[e.workoutData.chartData.length-1].longitude}:{})),v=(0,n.iH)(!1);function k(t){if(!t||""!==t)try{const e=ae((new DOMParser).parseFromString(t,"text/xml"));return{jsonData:e}}catch(e){return console.error("Invalid gpx content"),{}}return{}}function y(t){return[(t.value[0][0]+t.value[1][0])/2,(t.value[0][1]+t.value[1][1])/2]}function f(t){i.value?.leafletObject&&i.value?.leafletObject.fitBounds(t)}function _(){return e.workoutData?[[e.workoutData.workout.bounds[0],e.workoutData.workout.bounds[1]],[e.workoutData.workout.bounds[2],e.workoutData.workout.bounds[3]]]:[]}function g(){i.value?.leafletObject.fitBounds(_())}function S(){v.value=!v.value,v.value||setTimeout((()=>{g()}),100)}return(t,e)=>{const o=(0,a.up)("VFullscreen");return(0,a.wg)(),(0,a.iD)("div",Vo,[(0,n.SU)(l).loading?((0,a.wg)(),(0,a.iD)("div",Jo)):((0,a.wg)(),(0,a.iD)("div",Qo,[(0,n.SU)(l).workout.with_gpx?((0,a.wg)(),(0,a.j4)(o,{key:0,modelValue:v.value,"onUpdate:modelValue":e[1]||(e[1]=t=>v.value=t)},{default:(0,a.w5)((()=>[(0,a._)("div",{class:(0,s.C_)(["leaflet-container",{"fullscreen-map":v.value}])},[(0,n.SU)(p).jsonData&&(0,n.SU)(c)&&2===(0,n.SU)(u).length?((0,a.wg)(),(0,a.j4)((0,n.SU)(fo),{key:0,zoom:13,maxZoom:19,center:(0,n.SU)(c),bounds:(0,n.SU)(u),zoomAnimation:!1,ref_key:"workoutMap",ref:i,onReady:e[0]||(e[0]=t=>f((0,n.SU)(u)))},{default:(0,a.w5)((()=>[(0,a.Wm)((0,n.SU)(Ke)),(0,a.Wm)((0,n.SU)(Ze),{position:"topleft",class:"map-control",onClick:g},{default:(0,a.w5)((()=>[ta])),_:1}),(0,a.Wm)((0,n.SU)(Ze),{position:"topleft",class:"map-control",onClick:S},{default:(0,a.w5)((()=>[(0,a._)("i",{class:(0,s.C_)("fa fa-"+(v.value?"compress":"arrows-alt")),"aria-hidden":"true"},null,2)])),_:1}),(0,a.Wm)((0,n.SU)(Wo),{url:`${(0,n.SU)(Ko.k)()}workouts/map_tile/{s}/{z}/{x}/{y}.png`,attribution:(0,n.SU)(d).map_attribution,bounds:(0,n.SU)(u)},null,8,["url","attribution","bounds"]),(0,a.Wm)((0,n.SU)(ro),{geojson:(0,n.SU)(p).jsonData},null,8,["geojson"]),(0,n.SU)(r).latitude?((0,a.wg)(),(0,a.j4)((0,n.SU)(To),{key:0,"lat-lng":[(0,n.SU)(r).latitude,(0,n.SU)(r).longitude]},null,8,["lat-lng"])):(0,a.kq)("",!0),(0,a.Wm)((0,n.SU)(vo),{name:t.$t("workouts.START_AND_FINISH"),"layer-type":"overlay"},{default:(0,a.w5)((()=>[(0,n.SU)(m).latitude?((0,a.wg)(),(0,a.j4)(qo,{key:0,markerCoordinates:(0,n.SU)(m),isStart:!0},null,8,["markerCoordinates"])):(0,a.kq)("",!0),(0,n.SU)(w).latitude?((0,a.wg)(),(0,a.j4)(qo,{key:1,markerCoordinates:(0,n.SU)(w),isStart:!1},null,8,["markerCoordinates"])):(0,a.kq)("",!0)])),_:1},8,["name"])])),_:1},8,["center","bounds"])):(0,a.kq)("",!0)],2)])),_:1},8,["modelValue"])):((0,a.wg)(),(0,a.iD)("div",ea,(0,s.zw)(t.$t("workouts.NO_MAP")),1))]))])}}});const aa=(0,E.Z)(oa,[["__scopeId","data-v-2aec89b0"]]);var na=aa,la=o(6558);const ra={class:"workout-detail"};var sa=(0,a.aZ)({__name:"index",props:{authUser:null,displaySegment:{type:Boolean},sports:null,workoutData:null,markerCoordinates:{default:()=>({})}},setup(t){const e=t,o=(0,l.yj)(),r=(0,Yo.o)(),{authUser:s,markerCoordinates:i,workoutData:u}=(0,n.BK)(e),d=(0,a.Fl)((()=>e.workoutData.workout)),c=(0,n.iH)(o.params.workoutId?+o.params.segmentId:null),p=(0,a.Fl)((()=>d.value.segments.length>0&&c.value?d.value.segments[+c.value-1]:null)),m=(0,n.iH)(!1),w=(0,a.Fl)((()=>e.sports?e.sports.find((t=>t.id===e.workoutData.workout.sport_id)):{})),v=(0,a.Fl)((()=>y(d.value,p.value)));function k(t,e,o){const a=e&&o&&1!==o?`/workouts/${t.id}/segment/${o-1}`:!e&&t.previous_workout?`/workouts/${t.previous_workout}`:null,n=e&&o&&o<t.segments.length?`/workouts/${t.id}/segment/${o+1}`:!e&&t.next_workout?`/workouts/${t.next_workout}`:null;return{previousUrl:a,nextUrl:n}}function y(t,o){const a=k(t,e.displaySegment,c.value?+c.value:null),n=(0,la.Jo)((0,la.eB)(e.workoutData.workout.workout_date,e.authUser.timezone),e.authUser.date_format);return{ascent:o?o.ascent:t.ascent,aveSpeed:o?o.ave_speed:t.ave_speed,distance:o?o.distance:t.distance,descent:o?o.descent:t.descent,duration:o?o.duration:t.duration,maxAlt:o?o.max_alt:t.max_alt,maxSpeed:o?o.max_speed:t.max_speed,minAlt:o?o.min_alt:t.min_alt,moving:o?o.moving:t.moving,nextUrl:a.nextUrl,pauses:o?o.pauses:t.pauses,previousUrl:a.previousUrl,records:o?[]:t.records,segmentId:o?o.segment_id:null,title:t.title,type:e.displaySegment?"SEGMENT":"WORKOUT",workoutDate:n.workout_date,weatherEnd:o?null:t.weather_end,weatherStart:o?null:t.weather_start,with_gpx:t.with_gpx,workoutId:t.id,workoutTime:n.workout_time}}function f(t){m.value=t}function _(t){r.dispatch(Go.aX.ACTIONS.DELETE_WORKOUT,{workoutId:t})}return(0,a.YP)((()=>o.params.segmentId),(async t=>{t&&(c.value=+t)})),(t,e)=>{const o=(0,a.up)("Modal"),l=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",ra,[m.value?((0,a.wg)(),(0,a.j4)(o,{key:0,title:t.$t("common.CONFIRMATION"),message:t.$t("workouts.WORKOUT_DELETION_CONFIRMATION"),onConfirmAction:e[0]||(e[0]=t=>_((0,n.SU)(v).workoutId)),onCancelAction:e[1]||(e[1]=t=>f(!1))},null,8,["title","message"])):(0,a.kq)("",!0),(0,a.Wm)(l,null,{title:(0,a.w5)((()=>[(0,a.Wm)(I,{sport:(0,n.SU)(w),workoutObject:(0,n.SU)(v),onDisplayModal:e[2]||(e[2]=t=>f(!0))},null,8,["sport","workoutObject"])])),content:(0,a.w5)((()=>[(0,a.Wm)(na,{workoutData:(0,n.SU)(u),markerCoordinates:(0,n.SU)(i)},null,8,["workoutData","markerCoordinates"]),(0,a.Wm)(jt,{workoutObject:(0,n.SU)(v),useImperialUnits:(0,n.SU)(s).imperial_units,displayHARecord:(0,n.SU)(s).display_ascent},null,8,["workoutObject","useImperialUnits","displayHARecord"])])),_:1})])}}});const ia=(0,E.Z)(sa,[["__scopeId","data-v-9fc0bab8"]]);var ua=ia,da=o(6518);const ca=t=>{const e=document.getElementById(t);if(e){let t=e.querySelector("ul");return t||(t=document.createElement("ul"),e.appendChild(t)),t}throw new Error("No legend container")},pa={id:"htmlLegend",afterUpdate(t,e,o){const a=ca(o.containerID);while(a.firstChild)a.firstChild.remove();const n=t.options.plugins?.legend?.labels?.generateLabels?t.options.plugins?.legend?.labels?.generateLabels(t):[];n.forEach((e=>{const o=document.createElement("li");o.onclick=()=>{void 0!==e.datasetIndex&&(t.setDatasetVisibility(e.datasetIndex,!t.isDatasetVisible(e.datasetIndex)),t.update())};const n=document.createElement("input");n&&(n.type="checkbox",n.id=e.text,n.checked=!e.hidden);const l=document.createTextNode(e.text),r=document.createElement("span");r&&(r.style.background=String(e.fillStyle),r.style.borderColor=String(e.strokeStyle)),o.appendChild(n),o.appendChild(l),o.appendChild(r),a.appendChild(o)}))}};var ma=o(3768);const wa=t=>((0,a.dD)("data-v-0b68c436"),t=t(),(0,a.Cn)(),t),va={id:"workout-chart"},ka={class:"chart-radio"},ya=["checked"],fa=["checked"],_a=wa((()=>(0,a._)("div",{id:"chart-legend"},null,-1))),ga={class:"chart-info"},Sa={class:"no-data-cleaning"},ha={class:"elevation-start"},ba=["checked"];var Ua=(0,a.aZ)({__name:"index",props:{authUser:null,workoutData:null},emits:["getCoordinates"],setup(t,{emit:e}){const o=t,{t:l}=(0,x.QT)(),r=(0,n.iH)(!0),i=(0,n.iH)(!0),u=(0,a.Fl)((()=>(0,ma.EX)(o.workoutData.chartData,l,o.authUser.imperial_units))),d=g("km"),c=g("m"),p=(0,a.Fl)((()=>({labels:r.value?u.value.distance_labels:u.value.duration_labels,datasets:JSON.parse(JSON.stringify([u.value.datasets.speed,u.value.datasets.elevation]))}))),m=(0,a.Fl)((()=>u.value.coordinates)),w=(0,a.Fl)((()=>({responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:22}},scales:{x:{grid:{drawOnChartArea:!1},ticks:{count:10,callback:function(t){return r.value?Number(t).toFixed(2):y(t)}},type:"linear",bounds:"data",title:{display:!0,text:r.value?l("workouts.DISTANCE")+` (${d})`:l("workouts.DURATION")}},ySpeed:{grid:{drawOnChartArea:!1},position:"left",title:{display:!0,text:l("workouts.SPEED")+` (${d}/h)`}},yElevation:{beginAtZero:i.value,grid:{drawOnChartArea:!1},position:"right",title:{display:!0,text:l("workouts.ELEVATION")+` (${c})`}}},elements:{point:{pointStyle:"circle",pointRadius:0}},plugins:{datalabels:{display:!1},tooltip:{interaction:{intersect:!1,mode:"index"},callbacks:{label:function(t){const e=` ${t.dataset.label}: ${t.formattedValue}`;return"yElevation"===t.dataset.yAxisID?e+` ${c}`:e+` ${d}/h`},title:function(t){return t.length>0&&f(m.value[t[0].dataIndex]),0===t.length?"":r.value?`${l("workouts.DISTANCE")}: ${t[0].label} ${d}`:`${l("workouts.DURATION")}: ${y(t[0].label.replace(",",""))}`}}},legend:{display:!1},htmlLegend:{containerID:"chart-legend"}}}))),{lineChartProps:v}=(0,da.tn)({chartData:p,options:w,plugins:[pa]});function k(){r.value=!r.value}function y(t){return new Date(1e3*+t).toISOString().substr(11,8)}function f(t){e("getCoordinates",t)}function _(){f({latitude:null,longitude:null})}function g(t){return o.authUser.imperial_units?z.Dl[t].defaultTarget:t}return(t,e)=>{const o=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",va,[(0,a.Wm)(o,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.ANALYSIS")),1)])),content:(0,a.w5)((()=>[(0,a._)("div",ka,[(0,a._)("label",null,[(0,a._)("input",{type:"radio",name:"distance",checked:r.value,onClick:k},null,8,ya),(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.DISTANCE")),1)]),(0,a._)("label",null,[(0,a._)("input",{type:"radio",name:"duration",checked:!r.value,onClick:k},null,8,fa),(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.DURATION")),1)])]),_a,(0,a.Wm)((0,n.SU)(da.wW),(0,a.dG)((0,n.SU)(v),{class:"line-chart",onMouseleave:_}),null,16),(0,a._)("div",ga,[(0,a._)("div",Sa,(0,s.zw)(t.$t("workouts.NO_DATA_CLEANING")),1),(0,a._)("div",ha,[(0,a._)("label",null,[(0,a._)("input",{type:"checkbox",checked:i.value,onClick:e[0]||(e[0]=t=>i.value=!i.value)},null,8,ba),(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.START_ELEVATION_AT_ZERO")),1)])])])])),_:1})])}}});const Ta=(0,E.Z)(Ua,[["__scopeId","data-v-0b68c436"]]);var Oa=Ta,Ea=o(2335);const Da={id:"workout-note"},Ia=["innerHTML"];var Aa=(0,a.aZ)({__name:"WorkoutNotes",props:{notes:{default:()=>null}},setup(t){const e=t,{notes:o}=(0,n.BK)(e);return(t,e)=>{const l=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",Da,[(0,a.Wm)(l,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.NOTES")),1)])),content:(0,a.w5)((()=>[(0,a._)("span",{innerHTML:(0,n.SU)(o)&&""!==(0,n.SU)(o)?(0,n.SU)(Ea.O)((0,n.SU)(o)):t.$t("workouts.NO_NOTES")},null,8,Ia)])),_:1})])}}});const Ca=(0,E.Z)(Aa,[["__scopeId","data-v-f6b59442"]]);var Ra=Ca;const $a={id:"workout-segments"};var Na=(0,a.aZ)({__name:"WorkoutSegments",props:{segments:null,useImperialUnits:{type:Boolean}},setup(t){const e=t,{segments:o,useImperialUnits:l}=(0,n.BK)(e);return(t,e)=>{const r=(0,a.up)("router-link"),i=(0,a.up)("Distance"),u=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",$a,[(0,a.Wm)(u,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.SEGMENT",2)),1)])),content:(0,a.w5)((()=>[(0,a._)("ul",null,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(o),((e,o)=>((0,a.wg)(),(0,a.iD)("li",{key:e.segment_id},[(0,a.Wm)(r,{to:{name:"WorkoutSegment",params:{workoutId:e.workout_id,segmentId:o+1}}},{default:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.SEGMENT",1))+" "+(0,s.zw)(o+1),1)])),_:2},1032,["to"]),(0,a.Uk)(" ("+(0,s.zw)(t.$t("workouts.DISTANCE"))+": ",1),(0,a.Wm)(i,{distance:e.distance,unitFrom:"km",useImperialUnits:(0,n.SU)(l)},null,8,["distance","useImperialUnits"]),(0,a.Uk)(", "+(0,s.zw)(t.$t("workouts.DURATION"))+": "+(0,s.zw)(e.duration)+") ",1)])))),128))])])),_:1})])}}});const La=(0,E.Z)(Na,[["__scopeId","data-v-6b8a27cd"]]);var ja=La;const xa=t=>((0,a.dD)("data-v-53c4e53a"),t=t(),(0,a.Cn)(),t),za={id:"workout",class:"view"},Wa={class:"container"},Fa={key:0,class:"workout-container"},Ba={key:0},Ha=xa((()=>(0,a._)("div",{id:"bottom"},null,-1))),Pa={key:1};var Za=(0,a.aZ)({__name:"Workout",props:{displaySegment:{type:Boolean}},setup(t){const e=t,o=(0,l.yj)(),s=(0,Yo.o)(),{displaySegment:i}=(0,n.BK)(e),u=(0,a.Fl)((()=>s.getters[Go.aX.GETTERS.WORKOUT_DATA])),d=(0,a.Fl)((()=>s.getters[Go.YN.GETTERS.AUTH_USER_PROFILE])),c=(0,a.Fl)((()=>s.getters[Go.O8.GETTERS.SPORTS])),p=(0,n.iH)({latitude:null,longitude:null});function m(t){p.value={latitude:t.latitude,longitude:t.longitude}}return(0,a.wF)((()=>{const t={workoutId:o.params.workoutId};e.displaySegment&&(t.segmentId=o.params.segmentId),s.dispatch(Go.aX.ACTIONS.GET_WORKOUT_DATA,t)})),(0,a.Ah)((()=>{s.commit(Go.aX.MUTATIONS.EMPTY_WORKOUT)})),(0,a.YP)((()=>o.params.workoutId),(async t=>{t&&s.dispatch(Go.aX.ACTIONS.GET_WORKOUT_DATA,{workoutId:t})})),(0,a.YP)((()=>o.params.segmentId),(async t=>{if(o.params.workoutId){const e={workoutId:o.params.workoutId};t&&(e.segmentId=t),s.dispatch(Go.aX.ACTIONS.GET_WORKOUT_DATA,e)}})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",za,[(0,a._)("div",Wa,[(0,n.SU)(c).length>0?((0,a.wg)(),(0,a.iD)("div",Fa,[(0,n.SU)(u).workout.id?((0,a.wg)(),(0,a.iD)("div",Ba,[(0,a.Wm)(ua,{workoutData:(0,n.SU)(u),sports:(0,n.SU)(c),authUser:(0,n.SU)(d),markerCoordinates:p.value,displaySegment:(0,n.SU)(i)},null,8,["workoutData","sports","authUser","markerCoordinates","displaySegment"]),(0,n.SU)(u).workout.with_gpx&&(0,n.SU)(u).chartData.length>0?((0,a.wg)(),(0,a.j4)(Oa,{key:0,workoutData:(0,n.SU)(u),authUser:(0,n.SU)(d),displaySegment:(0,n.SU)(i),onGetCoordinates:m},null,8,["workoutData","authUser","displaySegment"])):(0,a.kq)("",!0),!(0,n.SU)(i)&&(0,n.SU)(u).workout.segments.length>1?((0,a.wg)(),(0,a.j4)(ja,{key:1,segments:(0,n.SU)(u).workout.segments,useImperialUnits:(0,n.SU)(d).imperial_units},null,8,["segments","useImperialUnits"])):(0,a.kq)("",!0),(0,n.SU)(i)?(0,a.kq)("",!0):((0,a.wg)(),(0,a.j4)(Ra,{key:2,notes:(0,n.SU)(u).workout.notes},null,8,["notes"])),Ha])):((0,a.wg)(),(0,a.iD)("div",Pa,[(0,n.SU)(u).loading?(0,a.kq)("",!0):((0,a.wg)(),(0,a.j4)(r.Z,{key:0,target:"WORKOUT"}))]))])):(0,a.kq)("",!0)])]))}});const Ma=(0,E.Z)(Za,[["__scopeId","data-v-53c4e53a"]]);var qa=Ma},9628:function(t,e,o){o.r(e),o.d(e,{default:function(){return Bt}});var a=o(6252),n=o(2262),l=o(3577),r=o(9150),s=(o(7658),o(2201)),i=o(631),u=o(3649);const d=t=>((0,a.dD)("data-v-6c38593a"),t=t(),(0,a.Cn)(),t),c={class:"workouts-filters"},p={class:"box"},m={class:"form"},w={class:"form-items-group"},v={class:"form-item"},k=["value"],y={class:"form-item"},f=["value"],_={class:"form-items-group"},g={class:"form-item"},S=["value"],h=d((()=>(0,a._)("option",{value:""},null,-1))),b=["value"],U={class:"form-items-group"},T={class:"form-item"},O={class:"form-inputs-group"},E=["value"],D=["value"],I={class:"form-items-group"},A={class:"form-item"},C={class:"form-inputs-group"},R=["value"],$=["value"],N={class:"form-items-group"},L={class:"form-item"},j={class:"form-inputs-group"},x=["value"],z=["value"],W={class:"form-items-group"},F={class:"form-item"},B={class:"form-inputs-group"},H=["value"],P=["value"],Z={class:"form-button"};var M=(0,a.aZ)({__name:"WorkoutsFilters",props:{authUser:null,sports:null},emits:["filter"],setup(t,{emit:e}){const o=t,{t:d}=(0,r.QT)(),M=(0,s.yj)(),q=(0,s.tv)(),{authUser:G}=(0,n.BK)(o),Y=G.value.imperial_units?u.Dl.km.defaultTarget:"km",K=(0,a.Fl)((()=>(0,i.xH)(o.sports,d)));let X=Object.assign({},M.query);function V(t){""===t.target.value?delete X[t.target.name]:X[t.target.name]=t.target.value}function J(){e("filter"),"page"in X&&(X["page"]="1"),q.push({path:"/workouts",query:X})}function Q(){e("filter"),q.push({path:"/workouts",query:{}})}return(0,a.YP)((()=>M.query),(t=>{X=Object.assign({},t)})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",c,[(0,a._)("div",p,[(0,a._)("div",m,[(0,a._)("div",w,[(0,a._)("div",v,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.FROM"))+": ",1),(0,a._)("input",{name:"from",type:"date",value:t.$route.query.from,onChange:V},null,40,k)]),(0,a._)("div",y,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.TO"))+": ",1),(0,a._)("input",{name:"to",type:"date",value:t.$route.query.to,onChange:V},null,40,f)])]),(0,a._)("div",_,[(0,a._)("div",g,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.SPORT",1))+":",1),(0,a._)("select",{name:"sport_id",value:t.$route.query.sport_id,onChange:V},[h,((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(K).filter((t=>(0,n.SU)(G).sports_list.includes(t.id))),(t=>((0,a.wg)(),(0,a.iD)("option",{value:t.id,key:t.id},(0,l.zw)(t.translatedLabel),9,b)))),128))],40,S)])]),(0,a._)("div",U,[(0,a._)("div",T,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.DISTANCE"))+" ("+(0,l.zw)((0,n.SU)(Y))+"): ",1),(0,a._)("div",O,[(0,a._)("input",{name:"distance_from",type:"number",min:"0",step:"0.1",value:t.$route.query.distance_from,onChange:V},null,40,E),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{name:"distance_to",type:"number",min:"0",step:"0.1",value:t.$route.query.distance_to,onChange:V},null,40,D)])])]),(0,a._)("div",I,[(0,a._)("div",A,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.DURATION"))+": ",1),(0,a._)("div",C,[(0,a._)("input",{name:"duration_from",value:t.$route.query.duration_from,onChange:V,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,R),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{name:"duration_to",value:t.$route.query.duration_to,onChange:V,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,$)])])]),(0,a._)("div",N,[(0,a._)("div",L,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.AVE_SPEED"))+" ("+(0,l.zw)((0,n.SU)(Y))+"/h): ",1),(0,a._)("div",j,[(0,a._)("input",{min:"0",name:"ave_speed_from",value:t.$route.query.ave_speed_from,onChange:V,step:"0.1",type:"number"},null,40,x),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{min:"0",name:"ave_speed_to",value:t.$route.query.ave_speed_to,onChange:V,step:"0.1",type:"number"},null,40,z)])])]),(0,a._)("div",W,[(0,a._)("div",F,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.MAX_SPEED"))+" ("+(0,l.zw)((0,n.SU)(Y))+"/h): ",1),(0,a._)("div",B,[(0,a._)("input",{min:"0",name:"max_speed_from",value:t.$route.query.max_speed_from,onChange:V,step:"0.1",type:"number"},null,40,H),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{min:"0",name:"max_speed_to",value:t.$route.query.max_speed_to,onChange:V,step:"0.1",type:"number"},null,40,P)])])])]),(0,a._)("div",Z,[(0,a._)("button",{class:"confirm",onClick:J},(0,l.zw)(t.$t("buttons.FILTER")),1),(0,a._)("button",{class:"confirm",onClick:Q},(0,l.zw)(t.$t("buttons.CLEAR_FILTER")),1)])])]))}}),q=o(3744);const G=(0,q.Z)(M,[["__scopeId","data-v-6c38593a"]]);var Y=G,K=o(8626),X=o(5020),V=o(2056),J=o(5630),Q=o(5801),tt=o(9917),et=o(2766),ot=o(6558),at=o(3768);const nt=t=>((0,a.dD)("data-v-19504874"),t=t(),(0,a.Cn)(),t),lt={class:"workouts-list"},rt={class:"total"},st={class:"total-label"},it={key:0},ut={key:0,class:"workouts-table responsive-table"},dt=nt((()=>(0,a._)("th",{class:"sport-col"},null,-1))),ct={class:"sport-col"},pt={class:"cell-heading"},mt=["onMouseover"],wt={class:"cell-heading"},vt={key:0,class:"fa fa-map-o","aria-hidden":"true"},kt={class:"title"},yt={class:"workout-date"},ft={class:"cell-heading"},_t={class:"text-right"},gt={class:"cell-heading"},St={class:"text-right"},ht={class:"cell-heading"},bt={class:"text-right"},Ut={class:"cell-heading"},Tt={class:"text-right"},Ot={class:"cell-heading"},Et={class:"text-right"},Dt={class:"cell-heading"},It={class:"text-right"},At={class:"cell-heading"},Ct=nt((()=>(0,a._)("div",{id:"bottom"},null,-1)));var Rt=(0,a.aZ)({__name:"WorkoutsList",props:{user:null,sports:null},setup(t){const e=t,o=(0,tt.o)(),r=(0,s.yj)(),d=(0,s.tv)(),{user:c,sports:p}=(0,n.BK)(e),m=["ave_speed","distance","duration","workout_date"],w=(0,a.Fl)((()=>o.getters[Q.aX.GETTERS.USER_WORKOUTS])),v=(0,a.Fl)((()=>o.getters[Q.aX.GETTERS.WORKOUTS_PAGINATION])),k=(0,a.Fl)((()=>o.getters[Q.SY.GETTERS.LANGUAGE]));let y=S(r.query);const f=(0,n.iH)(null);function _(t){o.dispatch(Q.aX.ACTIONS.GET_USER_WORKOUTS,c.value.imperial_units?h(t):t)}function g(t,e){const o=Object.assign({},r.query);o[t]=e,"per_page"===t&&(o["page"]="1"),y=S(o),d.push({path:"/workouts",query:y})}function S(t){const e=(0,et.pm)(t,m,at.eR.order_by,{defaultSort:at.eR.order});return Object.keys(t).filter((t=>et.Ne.includes(t))).map((o=>{"string"===typeof t[o]&&(e[o]=t[o])})),e}function h(t){const e={...t};return Object.entries(e).map((t=>{t[0].match("speed|distance")&&t[1]&&(e[t[0]]=(0,u.sC)(+t[1],"mi","km"))})),e}function b(t){f.value=t}return(0,a.wF)((()=>{_(y)})),(0,a.YP)((()=>r.query),(async t=>{y=S(t),_(y)})),(t,e)=>{const o=(0,a.up)("SportImage"),r=(0,a.up)("router-link"),s=(0,a.up)("Distance");return(0,a.wg)(),(0,a.iD)("div",lt,[(0,a._)("div",{class:(0,l.C_)(["box",{"empty-table":0===(0,n.SU)(w).length}])},[(0,a._)("div",rt,[(0,a._)("span",st,(0,l.zw)(t.$t("common.TOTAL").toLowerCase())+": ",1),null!==(0,n.SU)(v).total?((0,a.wg)(),(0,a.iD)("span",it,(0,l.zw)((0,n.SU)(v).total)+" "+(0,l.zw)(t.$t("workouts.WORKOUT",(0,n.SU)(v).total)),1)):(0,a.kq)("",!0)]),(0,a.Wm)(K.Z,{sort:(0,n.SU)(et.fS),order_by:m,query:(0,n.SU)(y),message:"workouts",onUpdateSelect:g},null,8,["sort","query"]),(0,n.SU)(w).length>0?((0,a.wg)(),(0,a.iD)("div",ut,[(0,a.Wm)(X.Z,{class:"top-pagination",pagination:(0,n.SU)(v),path:"/workouts",query:(0,n.SU)(y)},null,8,["pagination","query"]),(0,a._)("table",null,[(0,a._)("thead",{class:(0,l.C_)({smaller:"de"===(0,n.SU)(k)})},[(0,a._)("tr",null,[dt,(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.WORKOUT",1))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DATE"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DISTANCE"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DURATION"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.AVE_SPEED"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.MAX_SPEED"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.ASCENT"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DESCENT"))),1)])],2),(0,a._)("tbody",null,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(w),(u=>((0,a.wg)(),(0,a.iD)("tr",{key:u.id},[(0,a._)("td",ct,[(0,a._)("span",pt,(0,l.zw)(t.$t("workouts.SPORT",1)),1),(0,n.SU)(p).length>0?((0,a.wg)(),(0,a.j4)(o,{key:0,title:(0,n.SU)(p).find((t=>t.id===u.sport_id)).translatedLabel,"sport-label":(0,n.SU)(i.PA)(u,(0,n.SU)(p)),color:(0,n.SU)(i.CM)(u,(0,n.SU)(p))},null,8,["title","sport-label","color"])):(0,a.kq)("",!0)]),(0,a._)("td",{class:"workout-title",onMouseover:t=>b(u.id),onMouseleave:e[0]||(e[0]=t=>b(null))},[(0,a._)("span",wt,(0,l.zw)((0,l.kC)(t.$t("workouts.WORKOUT",1))),1),(0,a.Wm)(r,{class:"nav-item",to:{name:"Workout",params:{workoutId:u.id}}},{default:(0,a.w5)((()=>[u.with_gpx?((0,a.wg)(),(0,a.iD)("i",vt)):(0,a.kq)("",!0),(0,a._)("span",kt,(0,l.zw)(u.title),1)])),_:2},1032,["to"]),u.with_gpx&&f.value===u.id?((0,a.wg)(),(0,a.j4)(V.Z,{key:0,workout:u,"display-hover":!0},null,8,["workout"])):(0,a.kq)("",!0)],40,mt),(0,a._)("td",yt,[(0,a._)("span",ft,(0,l.zw)(t.$t("workouts.DATE")),1),(0,a.Uk)(" "+(0,l.zw)((0,n.SU)(ot.p6)(u.workout_date,(0,n.SU)(c).timezone,(0,n.SU)(c).date_format)),1)]),(0,a._)("td",_t,[(0,a._)("span",gt,(0,l.zw)(t.$t("workouts.DISTANCE")),1),(0,a.Wm)(s,{distance:u.distance,unitFrom:"km",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",St,[(0,a._)("span",ht,(0,l.zw)(t.$t("workouts.DURATION")),1),(0,a.Uk)(" "+(0,l.zw)(u.moving),1)]),(0,a._)("td",bt,[(0,a._)("span",Ut,(0,l.zw)(t.$t("workouts.AVE_SPEED")),1),(0,a.Wm)(s,{distance:u.ave_speed,unitFrom:"km",speed:!0,useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",Tt,[(0,a._)("span",Ot,(0,l.zw)(t.$t("workouts.MAX_SPEED")),1),(0,a.Wm)(s,{distance:u.max_speed,unitFrom:"km",speed:!0,useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",Et,[(0,a._)("span",Dt,(0,l.zw)(t.$t("workouts.ASCENT")),1),null!==u.ascent?((0,a.wg)(),(0,a.j4)(s,{key:0,distance:u.ascent,unitFrom:"m",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])):(0,a.kq)("",!0)]),(0,a._)("td",It,[(0,a._)("span",At,(0,l.zw)(t.$t("workouts.DESCENT")),1),null!==u.descent?((0,a.wg)(),(0,a.j4)(s,{key:0,distance:u.descent,unitFrom:"m",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])):(0,a.kq)("",!0)])])))),128))])]),(0,a.Wm)(X.Z,{pagination:(0,n.SU)(v),path:"/workouts",query:(0,n.SU)(y)},null,8,["pagination","query"])])):(0,a.kq)("",!0)],2),0===(0,n.SU)(w).length?((0,a.wg)(),(0,a.j4)(J.Z,{key:0})):(0,a.kq)("",!0),Ct])}}});const $t=(0,q.Z)(Rt,[["__scopeId","data-v-19504874"]]);var Nt=$t;const Lt={key:0,id:"workouts",class:"view"},jt={class:"container workouts-container"},xt={class:"display-filters"},zt={class:"list-container"};var Wt=(0,a.aZ)({__name:"WorkoutsView",setup(t){const{t:e}=(0,r.QT)(),o=(0,tt.o)(),s=(0,a.Fl)((()=>o.getters[Q.YN.GETTERS.AUTH_USER_PROFILE])),u=(0,a.Fl)((()=>o.getters[Q.O8.GETTERS.SPORTS])),d=(0,a.Fl)((()=>(0,i.xH)(u.value,e))),c=(0,n.iH)(!0);function p(){c.value=!c.value}return(t,e)=>(0,n.SU)(s).username?((0,a.wg)(),(0,a.iD)("div",Lt,[(0,a._)("div",jt,[(0,a._)("div",{class:(0,l.C_)(["filters-container",{hidden:c.value}])},[(0,a.Wm)(Y,{sports:(0,n.SU)(d),authUser:(0,n.SU)(s),onFilter:p},null,8,["sports","authUser"])],2),(0,a._)("div",xt,[(0,a._)("div",{onClick:p},[(0,a._)("i",{class:(0,l.C_)("fa fa-caret-"+(c.value?"down":"up")),"aria-hidden":"true"},null,2),(0,a._)("span",null,(0,l.zw)(t.$t(`workouts.${c.value?"DISPLAY":"HIDE"}_FILTERS`)),1)])]),(0,a._)("div",zt,[(0,a.Wm)(Nt,{user:(0,n.SU)(s),sports:(0,n.SU)(d)},null,8,["user","sports"])])])])):(0,a.kq)("",!0)}});const Ft=(0,q.Z)(Wt,[["__scopeId","data-v-57ec0168"]]);var Bt=Ft}}]);
//# sourceMappingURL=workouts.3abba015.js.map