import{_ as E,u as M,j as T,c as a,o as n,a as e,C as d,l as u,t as s,D as F,b as l,B as I,f as O}from"./app-L4cdeQDO.js";const W={class:"course-card h-100"},q={class:"card border-light theme-shadow overflow-hidden h-100"},A=["src"],G={class:"category-badge"},H={class:"card-body pb-0"},J={class:"course-details-wrapper"},K={class:"d-flex align-items-center gap-2"},P={class:"d-flex align-items-center gap-2"},Q={class:"header-metadata"},R={class:"course-title fw-bold text-hover"},U={class:"card-text text-muted d-flex flex-column flex-xl-row gap-2 justify-content-between mb-3 mt-3 mt-md-0"},X={key:0,class:"d-flex align-items-center"},Y={class:"text-primary me-2"},Z={key:0,class:"fs-4"},ee={key:1,class:"fs-4"},te={key:0,class:"text-muted text-decoration-line-through"},se={key:0,style:{"font-size":"14px"}},oe={key:1,style:{"font-size":"14px"}},re={key:1,class:"d-flex w-100 align-self-center me-auto my-auto mt-1"},ce={class:"card-footer bg-white border-light py-0"},ae={class:"row"},ne={class:"col-12 text-muted course-metadata py-2"},ie=["src"],le={class:"fw-bold"},de={class:"order-md-1 order-xl-2"},ue={__name:"CourseCard",props:{course:Object},setup(t){const i=M();function V(r){const c=window.innerWidth<=576?20:60;return r.length>c?r.slice(0,c)+"...":r}const L=r=>{if(!r)return"";const o=r.split(" ");return o.length===1?o[0]:o[0]+" "+o[o.length-1]},S=r=>{if(r>=60){const o=Math.floor(r/60),c=r%60;return`${o} hour${o>1?"s":""}${c>0?` ${c} min`:""}`}return`${r} min`};return(r,o)=>{var m,h,f,g,b,y,_,x,v,w,k,p,C,D,$,j,N,z;const c=T("router-link");return n(),a("div",W,[e("div",q,[d(c,{to:"/details/"+t.course.id,class:"course-thumbnail-wrapper position-relative"},{default:u(()=>[e("img",{src:t.course.thumbnail,class:"course-thumbnail card-img-top object-fit-cover",alt:"..."},null,8,A),e("div",G,[e("strong",null,s(t.course.category),1)])]),_:1},8,["to"]),e("div",H,[e("div",J,[e("div",K,[o[0]||(o[0]=e("i",{class:"bi bi-mortarboard"},null,-1)),e("span",null,s(t.course.chapter_count)+" "+s(r.$t("Classes")),1)]),e("div",P,[o[1]||(o[1]=e("i",{class:"bi bi-clock text-warning"},null,-1)),e("span",null,s(S((m=t.course)==null?void 0:m.total_duration)),1)])]),e("div",Q,[d(c,{to:`/details/${t.course.id}`,class:"text-decoration-none d-block mb-2"},{default:u(()=>[e("p",R,s(V(t.course.title)),1)]),_:1},8,["to"])]),e("div",U,[!((h=t.course)!=null&&h.is_free)&&!((f=t.course)!=null&&f.is_enrolled)?(n(),a("div",X,[e("strong",Y,[((b=(g=l(i))==null?void 0:g.masterData)==null?void 0:b.currency_position)=="Left"?(n(),a("span",Z,s((_=(y=l(i))==null?void 0:y.masterData)==null?void 0:_.currency_symbol)+s(t.course.price??t.course.regular_price),1)):(n(),a("span",ee,s(t.course.price??t.course.regular_price)+s((v=(x=l(i))==null?void 0:x.masterData)==null?void 0:v.currency_symbol),1))]),(w=t.course)!=null&&w.price?(n(),a("span",te,[((p=(k=l(i))==null?void 0:k.masterData)==null?void 0:p.currency_position)=="Left"?(n(),a("span",se,s((D=(C=l(i))==null?void 0:C.masterData)==null?void 0:D.currency_symbol)+s(t.course.regular_price),1)):(n(),a("span",oe,s(t.course.regular_price)+s((j=($=l(i))==null?void 0:$.masterData)==null?void 0:j.currency_symbol),1))])):F("",!0)])):(n(),a("div",re,[e("span",{class:I(["badge px-3 py-2 rounded fw-semibold",(N=t.course)!=null&&N.is_enrolled?"bg-primary text-white":"bg-light text-primary border border-primary"]),style:{"font-size":"13px"}},s((z=t.course)!=null&&z.is_enrolled?r.$t("Enrolled"):r.$t("Free")),3)]))])]),e("div",ce,[e("div",ae,[e("div",ne,[d(c,{to:"/instructor/"+t.course.instructor.id,class:"d-flex align-items-center gap-2 text-decoration-none text-muted"},{default:u(()=>{var B;return[e("img",{src:t.course.instructor.profile_picture,alt:"instructor-avatar",width:"35",height:"35",class:"rounded-circle object-fit-cover"},null,8,ie),e("span",le,s(L((B=t.course.instructor)==null?void 0:B.name)),1)]}),_:1},8,["to"]),e("span",de,[o[2]||(o[2]=e("i",{class:"bi bi-star-fill me-2 text-warning"},null,-1)),e("strong",null,s(t.course.average_rating),1),O(" ("+s(t.course.review_count)+") ",1)])])])])])])}}},he=E(ue,[["__scopeId","data-v-967b2595"]]);export{he as C};
