1import{z as w,dl as _,d9 as b,ep as I,ex as x,ec as L,dc as R,ey as P,aq as y,dn as U,d as z,j as A,dC as B,a as N,c as O,f as v,v as m,ez as j}from"./index-DcSVvNrM.js";import{S}from"./school.injections-D9uAkOkG.js";import{u as E}from"./useCoursesSeo-CaVSpD9A.js";import{u as C}from"./useLocale-BECgx5XS.js";import{R as F}from"./Reviews-DxdWBK-p.js";import"./useLeaveReviewForm-B43VXZof.js";function V(t,s){if(!w(t))return[];const i=t.avatarLeonardoUuid,r=w(i)?_({uuid:i,width:128}):void 0,u=(s??[]).slice(0,30).map(a=>({"@type":"Review",datePublished:b(a.dateCreated*1e3).toISOString(),reviewBody:a.text,author:{"@type":"Person",name:a.user.name},reviewRating:{"@type":"Rating",ratingValue:a.rating,bestRating:5,worstRating:1},itemReviewed:{"@type":"Organization",name:t.title}}));return[I({name:t.title,url:t.url,logo:r!==void 0?x({url:r}):void 0,aggregateRating:{"@type":"AggregateRating",ratingValue:t.rating,ratingCount:t.reviewCount,bestRating:5,worstRating:1},review:u})]}async function k(t,s){const i=L(),{setCoursesPageProperties:r}=E(),{t:u,p:l}=C(),a=30,e=R(S),c="vc.ru",d=P(async({isFromStart:n})=>{const{reviews:g}=await i.getSchoolReviews({slug:t.value,limit:a,sorting:s.value,isFromStart:n});return g});function p(){var n,g,f,h;w(e==null?void 0:e.value)&&r({title:u("courses.school.seo.reviews.title",{school:(n=e.value)==null?void 0:n.title,count:l("courses.reviewCounter",((g=e.value)==null?void 0:g.reviewCount)??0)}),meta:{description:u("courses.school.seo.reviews.description",{school:(f=e.value)==null?void 0:f.title,count:l("courses.scoreCounter",((h=e.value)==null?void 0:h.reviewCount)??0),site:c,year:new Date().getFullYear()})},schema:V(e.value,d.items)})}async function o(){await d.loadInitial(),p()}return y(t,async()=>{await o()}),y(s,async()=>{await o()},{deep:!0}),await U({onServer:o,onHydration:o,onAfterClientRender:async()=>{d.items.length===0&&await o()}}),d}const W=z({__name:"SchoolReviews",props:{slug:{},sorting:{}},async setup(t){let s,i;const r=t,u=A(),l=m(()=>r.slug),a=m(()=>r.sorting),{t:e}=C(),c=([s,i]=B(()=>k(l,a)),s=await s,i(),s),d=R(S),p=m(()=>[{label:e("courses.school.sorting.popular"),value:"popular",url:o("popular")},{label:e("courses.school.sorting.date"),value:"date",url:o("date")},{label:e("courses.school.sorting.date_asc"),value:"date_asc",url:o("date_asc")},{label:e("courses.school.sorting.positive"),value:"positive",url:o("positive")},{label:e("courses.school.sorting.negative"),value:"negative",url:o("negative")}]);function o(n){return u.resolve(j(l.value,n)).href}return(n,g)=>(N(),O(F,{items:v(c).items,school:v(d),"sorting-options":p.value,"active-sorting":a.value,"is-ended":v(c).isEnded,"is-loading":v(c).isLoading,"load-more":v(c).loadMore},null,8,["items","school","sorting-options","active-sorting","is-ended","is-loading","load-more"]))}});export{W 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.