1import{L as b}from"./Loader-Baqe17Om.js";import{r as m,o as l,c as d,a as t,t as n,w as k,j as w,F as _,e as f,b as v,f as h,g,d as L}from"./vue-router-CSEP06dd.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const P={components:{Loader:b},data(){return{ready:!1,status:"",currentPage:0,totalPages:0,videos:[],selectedLevel:null}},mounted(){this.addTitleAndDescription(this.$t("videoLessons"),this.$t("descriptionVideos")),this.$root.levels?this.setUp():this.getLevels(()=>this.setUp())},methods:{setUp(){this.selectedLevel=this.grammarLevels()[0].id,this.fetchVideos()},fetchVideos(){this.status||(this.status="loading",axios.get("/video-lessons/"+this.selectedLevel+"?page="+(this.currentPage+1)).then(i=>{this.ready=!0,this.currentPage++,this.totalPages=i.data.last_page,i.data.data.forEach(e=>{e.session_number>0&&this.videos.push(e)}),this.$root.auth_user.profile&&axios.get("/video-watch-records").then(e=>{this.videos.forEach(a=>{a.watched=!1,e.data.forEach(u=>{u.video_id===a.id&&(a.watched=!0)})}),this.updateMeta()}).catch(),this.status=""}).catch())},updateLevel(){this.ready=!1,this.videos=[],this.currentPage=0,this.totalPages=0,this.fetchVideos()},updateMeta(){setTimeout(()=>{document.querySelectorAll("video").forEach((e,a)=>{let u=setInterval(()=>{if(e.readyState>0){let s=parseInt(e.duration/60,10),r=Math.round(e.duration%60).toString();r.length<2&&(r="0"+r);let c=document.createElement("div");c.innerHTML=` 2 <div class="position-absolute m-1 px-1 small text-black">${s}:${r}</div> 3 `,this.videos[a].watched&&(c.innerHTML+=` 4 <div class="position-absolute bottom-0 m-1 px-1 small fw-bold">${this.$t("watched")}</div> 5 `),e.parentElement.prepend(c),clearInterval(u)}},200)})},200)}}},E={class:"p-4 border-bottom"},M={class:"h3"},x={class:"text-muted"},C={class:"p-4 border-bottom"},S=["value"],j={class:"p-4"},A={key:0,class:"mt-4 text-center"},B={class:"mt-2"},F=["href"],T={key:1},U={key:0},D={class:"row g-3"},I={class:"session"},N={key:0,class:"position-relative content"},H=["src"],$={key:1,class:"box rounded-3 p-3 bg-light-gray d-flex justify-content-center align-items-center w-100"},q={class:"p-2 small"},z={class:"fw-bold"},W={href:""},G={key:1,class:"mt-2"};function J(i,e,a,u,s,r){const c=m("loader"),y=m("vue-feather"),p=m("router-link");return l(),d("div",null,[t("div",E,[t("h1",M,n(i.$t("videoLessons")),1),t("div",x,n(i.$t("recordedWithPermission")),1)]),t("div",C,[s.selectedLevel?k((l(),d("select",{key:0,class:"form-select","onUpdate:modelValue":e[0]||(e[0]=o=>s.selectedLevel=o),onChange:e[1]||(e[1]=(...o)=>r.updateLevel&&r.updateLevel(...o))},[(l(!0),d(_,null,f(this.grammarLevels(),o=>(l(),d("option",{value:o.id},n(o.name),9,S))),256))],544)),[[w,s.selectedLevel]]):v("",!0)]),h(c,{show:!s.ready},null,8,["show"]),t("div",j,[s.videos&&s.videos.length>1&&s.videos[0].url==="blocked"?(l(),d("div",A,[t("div",null,n(i.$t("videoAlert")),1),t("div",B,[t("a",{class:"btn btn-dark",href:i.$path("levels-and-schedule")},n(i.$t("registerForAClass")),9,F)])])):v("",!0),s.ready?(l(),d("div",T,[s.videos.length>0?(l(),d("div",U,[t("div",D,[(l(!0),d(_,null,f(s.videos,o=>(l(),d("div",{class:"col-12 col-md-6",key:o.id},[t("div",I,[h(p,{to:i.$path("video")+"/"+o.id,style:{color:"inherit"}},{default:g(()=>[o.url!=="blocked"?(l(),d("div",N,[e[3]||(e[3]=t("div",{class:"box rounded-3 border p-3 d-flex justify-content-center align-items-center w-100"},[t("img",{class:"w-100",alt:"Berges logo",src:"/img/berges_logo_large.jpg"})],-1)),t("video",{class:"visually-hidden",src:o.url},null,8,H)])):(l(),d("div",$,[h(y,{type:"lock",size:"1.5rem"})]))]),_:2},1032,["to"]),h(p,{to:i.$path("video")+"/"+o.id,class:"text-dark text-decoration-none"},{default:g(()=>[t("div",q,[t("div",z,n(i.$t("class"))+" "+n(o.session_number),1)])]),_:2},1032,["to"])])]))),128))]),!s.status&&s.videos.length>0&&s.currentPage<s.totalPages?(l(),d("div",{key:0,class:"mt-3 ms-2 small",onClick:e[2]||(e[2]=L((...o)=>r.fetchVideos&&r.fetchVideos(...o),["prevent"]))},[t("a",W,n(i.$t("loadMore")),1)])):v("",!0)])):(l(),d("div",G,n(i.$t("noVideosFound")),1))])):v("",!0)]),h(c,{show:s.ready&&s.status},null,8,["show"])])}const R=V(P,[["render",J]]);export{R as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.