1"use strict";(globalThis["webpackChunk"]=globalThis["webpackChunk"]||[]).push([[164],{52164:(e,s,t)=>{t.r(s),t.d(s,{default:()=>R});var a=t(61758);const l={class:"p-3"};function r(e,s,t,r,i,u){const o=(0,a.g2)("course-list");return(0,a.uX)(),(0,a.CE)("div",l,[(0,a.bF)(o,{dusk:"course_list"})])}t(10239);var i=t(58790),u=t(29104);const o={class:"row flex justify-end mb-2"},n={key:0},c={class:"col text-small"},d={key:1,class:"row"},g={class:"col d-flex flex-wrap justify-content-end align-items-center"},f={key:2,class:"flex"},h={class:"mr-2"},k=["disabled"],C=["disabled"],v={key:0,class:"fa-solid fa-spinner"},y={class:"row flex justify-end"},m={class:"input-group w-1/2"},p={class:"input-group-append"},b={key:0,class:"row"},L={class:"col d-flex flex-wrap pointer m-3 justify-content-center",style:{}},x=["dusk","onClick"],w={key:1,class:"course-price m-2 green font-weight-bolder float-right p-1 rounded"},E={key:2,class:"course-price m-2 green font-weight-bolder float-right p-1 rounded"},X={key:3,class:"course-price m-2 green font-weight-bolder float-right p-1 rounded"},_={class:"course-bottom p-2 h-50"},Q={class:"course-title d-flex align-items-center justify-content-center mx-auto"},F={class:"font-weight-bold m-2 overflow-hidden"},U=["innerHTML"],$={class:"course-details"},T={class:"text-xs mx-auto text-align-center"},S={key:0},j={class:"mx-auto"},A={key:0,class:"text-danger text-small w-100 text-align-center"},H=["innerHTML"],D={key:1};function I(e,s,t,l,r,I){const M=(0,a.g2)("c-dropdown-item"),N=(0,a.g2)("c-dropdown"),P=(0,a.g2)("loader");return(0,a.uX)(),(0,a.CE)("div",null,[(0,a.Lk)("div",o,[!e.dashboardLoading&&I.courses&&0===I.courses.length?((0,a.uX)(),(0,a.CE)("div",n,[(0,a.Lk)("div",c,(0,i.v_)(e.$t("course.noCoursesSharedWithYou")),1)])):(0,a.Q3)("",!0),null!==I.courses&&e.authUser.isAdmin?((0,a.uX)(),(0,a.CE)("div",d,[(0,a.Lk)("div",g,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(r.filters,((s,t)=>((0,a.uX)(),(0,a.Wv)(N,{key:"filter_"+s.key,"title-custom":e.getLabelCourse(s.key,s.value),class:"ml-2"},{default:(0,a.k6)((()=>[(0,a.bF)(M,{onParentClick:e=>{s.value=null},label:e.getLabelCourse(s.key,null)},null,8,["onParentClick","label"]),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(I.filterChoices[s.key],((l,r)=>((0,a.uX)(),(0,a.Wv)(M,{key:"dropdown-item-group"+t+r,onParentClick:t=>["status"===s.key?s.value=e.getCourseStatusFromName(l):s.value=l],label:e.getLabelCourse(s.key,l)},null,8,["onParentClick","label"])))),128))])),_:2},1032,["title-custom"])))),128))])])):(0,a.Q3)("",!0),null!==I.courses&&(e.authUser.isAdmin||e.authUser.isTeacher)?((0,a.uX)(),(0,a.CE)("div",f,[(0,a.Lk)("div",h,[(0,a.Lk)("button",{disabled:e.browserCoursesLoading,onClick:s[0]||(s[0]=(...e)=>I.searchCourses&&I.searchCourses(...e)),class:"btn btn-primary"},(0,i.v_)(e.$t("common.search")),9,k)]),(0,a.Lk)("div",null,[(0,a.Lk)("button",{disabled:r.loadingCourseCreation,onClick:s[1]||(s[1]=(...e)=>I.addCourse&&I.addCourse(...e)),class:"btn btn-secondary"},[(0,a.eW)((0,i.v_)(e.$t("common.create"))+" ",1),r.loadingCourseCreation?((0,a.uX)(),(0,a.CE)("span",v)):(0,a.Q3)("",!0)],8,C)])])):(0,a.Q3)("",!0)]),(0,a.Lk)("div",y,[(0,a.Lk)("div",m,[(0,a.bo)((0,a.Lk)("input",{"onUpdate:modelValue":s[2]||(s[2]=e=>r.searchQuery=e),type:"text",class:"form-control"},null,512),[[u.Jo,r.searchQuery]]),(0,a.Lk)("div",p,[(0,a.Lk)("span",{onClick:s[3]||(s[3]=e=>r.searchQuery=""),class:"input-group-text pointer"},s[4]||(s[4]=[(0,a.Lk)("span",{class:"fa-solid fa-xmark"},null,-1)]))])])]),e.browserCoursesLoading?((0,a.uX)(),(0,a.CE)("div",D,[(0,a.bF)(P,{condition:e.browserCoursesLoading,marginy:"200"},null,8,["condition"])])):((0,a.uX)(),(0,a.CE)("div",b,[(0,a.Lk)("div",L,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(I.displayedCourses,(t=>((0,a.uX)(),(0,a.CE)("div",{dusk:t.name[e.authUser.locale],onClick:s=>{I.resetCourseSelection(),e.$router.push("/studio/courses/"+t.id)},class:"course-container white-background shadow-sm m-3 pointer rounded",style:{"align-self":"flex-start"}},[(0,a.Lk)("div",{class:"course-top h-50 p-2",style:(0,i.Tr)("height:5rem;background-size: cover;background-position: center center;background-image:url("+e.getAvatarFromStorage(t.thumbnail)+");")},[t.difficulty?((0,a.uX)(),(0,a.CE)("div",{key:0,class:"course-difficulty text-xs white px-3 pull-left",style:(0,i.Tr)("background-color:"+e.getDifficultyColor(t.difficulty,"en")+";")},(0,i.v_)(I.getDifficulty(t.difficulty,t.target_language.prefix)),5)):(0,a.Q3)("",!0),e.hasEditionRights(t)?((0,a.uX)(),(0,a.CE)("div",w,s[5]||(s[5]=[(0,a.Lk)("span",{class:"fa-solid fa-pencil"},null,-1)]))):(0,a.Q3)("",!0),e.authUser.isAdmin&&t.status===e.getCourseStatusFromName("classroom")?((0,a.uX)(),(0,a.CE)("div",E,s[6]||(s[6]=[(0,a.Lk)("span",{class:"fa-solid fa-user"},null,-1)]))):(0,a.Q3)("",!0),e.authUser.isAdmin&&t.status===e.getCourseStatusFromName("anybody")?((0,a.uX)(),(0,a.CE)("div",X,s[7]||(s[7]=[(0,a.Lk)("span",{class:"fa-solid fa-users"},null,-1)]))):(0,a.Q3)("",!0)],4),(0,a.Lk)("div",_,[(0,a.Lk)("div",Q,[(0,a.Lk)("div",F,(0,i.v_)(t.name[e.authUser.locale]),1),t.target_language?((0,a.uX)(),(0,a.CE)("div",{key:0,class:"d-inline-block",innerHTML:e.getFlags([t.target_language_id])},null,8,U)):(0,a.Q3)("",!0)]),(0,a.Lk)("div",$,[(0,a.Lk)("div",T,[0!==t.cards_count?((0,a.uX)(),(0,a.CE)("span",S,(0,i.v_)(t.cards_count)+" "+(0,i.v_)(e.$t("course.cards")),1)):(0,a.Q3)("",!0)]),(0,a.Lk)("div",j,[null==t.id?((0,a.uX)(),(0,a.CE)("div",A,"Not saved")):(0,a.Q3)("",!0)])]),(0,a.Lk)("div",{class:"course-lang flex items-center justify-center",innerHTML:e.getFlags(t.display_languages.map((e=>e.prefix)))},null,8,H)])],8,x)))),256))])]))])}var M=t(36980);const N={data(){return{loadingCourseCreation:!1,filters:[{key:"targetLang",label:this.$tc("course.language"),value:null},{key:"difficulty",label:this.$tc("course.level"),value:null},{key:"status",label:this.$tc("course.status2"),value:null}],searchQuery:""}},computed:{...(0,M.aH)(["dashboardLoading","browserCoursesLoading"]),courses(){return this.$store.state.courses},filterChoices(){return{targetLang:this.langs,difficulty:this.availableDifficulties,status:this.availableCourseStatus}},displayedCourses(){return this.courses&&this.courses.length>0?this.courses.filter((e=>!(!e?.name?.[this.authUser.locale]||!e.name[this.authUser.locale].includes(this.searchQuery)))):[]}},methods:{...(0,M.i0)(["fetchCourses"]),addCourse(){this.loadingCourseCreation=!0,this.$store.dispatch("addCourse")},resetCourseSelection(){this.$store.commit("clearCourse")},getDifficulty(e,s){return"ja"===s?this.beautifulEnToJa(e):e},searchCourses(){this.fetchCourses({targetLang:this.filters.find((e=>"targetLang"===e.key)).value??null,difficulty:this.filters.find((e=>"difficulty"===e.key)).value??null,status:this.filters.find((e=>"status"===e.key)).value??null})}},mixins:[mixin_common],mounted(){this.filters.find((e=>"targetLang"===e.key)).value=this.authUser.targetLang,this.searchCourses(),this.loadingCourseCreation=!1}};var P=t(12807);const W=(0,P.A)(N,[["render",I],["__scopeId","data-v-4537d51a"]]),K=W,J={components:{CourseList:K}},z=(0,P.A)(J,[["render",r]]),R=z}}]);
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.