PageSourceSearch

https://www.bergesinstitutespanish.com/build/assets/StudyGroupDiscussion-PnIk5c90.js

js bergesinstitutespanish.com collected 2026-10-02 03:02:10 UTC 4,232 bytes, 1 lines download raw bytes

1import{L as p}from"./Loader-Baqe17Om.js";import{C as b,a as _}from"./Comment-CWHoySSZ.js";import{r as u,o,c as n,a,b as l,t as m,f as d,F as f,e as y,i as C}from"./vue-router-CSEP06dd.js";import{_ as k}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Modal-TGyeVepA.js";const w={components:{Loader:p,Comment:_,CommentBox:b},data(){return{group:null,comments:[],loading:!0,loadingMore:!1,currentPage:1,lastPage:1,newCommentBody:"",posting:!1}},computed:{groupId(){return this.$route.params.group_id},hasMorePages(){return this.currentPage<this.lastPage}},mounted(){axios.get("/get-study-group/"+this.groupId).then(e=>{this.group=e.data.data,this.addTitleAndDescription(this.group.name,""),this.loadComments(),this.focusNewComment()}).catch(e=>{Snackbar.show(this.getErrorMessage(e)),this.$router.push(this.$path("study-groups"))})},methods:{loadComments(e=!1){return e&&(this.loadingMore=!0,this.currentPage++),axios.get("/study-group-comments/"+this.groupId,{params:{page:this.currentPage}}).then(s=>{this.comments=e?[...this.comments,...s.data.data]:s.data.data,this.currentPage=s.data.meta.current_page,this.lastPage=s.data.meta.last_page,this.loadingMore=!1}).finally(()=>{this.loading=!1})},submitComment(){if(!this.posting){if(!this.newCommentBody.trim()){Snackbar.show(this.$t("writeCommentFirst"));return}this.posting=!0,Snackbar.show(this.$t("posting")),axios.post("/study-group-comments/"+this.groupId,{body:this.newCommentBody}).then(()=>{this.newCommentBody="",this.currentPage=1,this.loadComments().then(()=>{this.posting=!1,Snackbar.show(this.$t("success"))})}).catch(e=>{this.posting=!1,Snackbar.show(this.getErrorMessage(e))})}},handleReply(e){this.posting||(this.posting=!0,Snackbar.show(this.$t("posting")),axios.post("/study-group-comments/"+this.groupId,{parent_comment_id:e.parent_comment_id,reply_to_user_id:e.reply_to_user_id,body:e.body}).then(()=>{this.currentPage=1,this.loadComments().then(()=>{this.posting=!1,Snackbar.show(this.$t("success"))})}).catch(s=>{this.posting=!1,Snackbar.show(this.getErrorMessage(s))}))},focusNewComment(){setTimeout(()=>{var e;return(e=this.$refs.newCommentBox)==null?void 0:e.focus()},100)},refreshComments(){this.loading||(this.loading=!0,this.currentPage=1,this.loadComments())},loadMore(){this.loadingMore||this.loadComments(!0)}}},M={key:0,class:"p-4 border-bottom d-flex justify-content-between align-items-start"},B={class:"d-flex align-items-center"},P=["src"],S={class:"h3 mb-1"},v={class:"text-muted small"},x={key:1,class:"p-4 border-bottom"},I={key:2},V={class:"p-4 mb-5"},N={key:0,class:"small"},E={key:1},R={key:0},F={key:1};function L(e,s,T,j,t,i){const h=u("comment-box"),c=u("loader"),g=u("comment");return o(),n("div",null,[t.group?(o(),n("div",M,[a("div",B,[t.group.image_url?(o(),n("img",{key:0,src:t.group.image_url,class:"rounded-circle me-3 group-image",alt:""},null,8,P)):l("",!0),a("div",null,[a("h1",S,m(e.$tc("comment",2))+": "+m(t.group.name),1),a("div",v,m(t.group.members.length)+" "+m(e.$tc("member",t.group.members.length)),1)])]),a("button",{class:"btn btn-outline-primary btn-sm",onClick:s[0]||(s[0]=(...r)=>i.refreshComments&&i.refreshComments(...r))},m(e.$t("refresh")),1)])):l("",!0),t.group?(o(),n("div",x,[d(h,{ref:"newCommentBox",modelValue:t.newCommentBody,"onUpdate:modelValue":s[1]||(s[1]=r=>t.newCommentBody=r),placeholder:e.$t("writeComment"),"submit-label":e.$t("sendComment"),"always-submittable":"",onSubmit:i.submitComment},null,8,["modelValue","placeholder","submit-label","onSubmit"])])):l("",!0),d(c,{show:t.loading},null,8,["show"]),t.loading?l("",!0):(o(),n("div",I,[a("div",V,[t.comments.length===0?(o(),n("p",N,m(e.$t("noComments")),1)):l("",!0),(o(!0),n(f,null,y(t.comments,r=>(o(),C(g,{key:r.id,comment:r,"is-reply":!1,"like-url":"/study-group-comment-like/"+i.groupId+"/"+r.id,"always-submittable":"",onReply:i.handleReply},null,8,["comment","like-url","onReply"]))),128)),i.hasMorePages?(o(),n("div",E,[a("button",{class:"btn btn-outline-primary",onClick:s[2]||(s[2]=(...r)=>i.loadMore&&i.loadMore(...r))},[t.loadingMore?(o(),n("span",R,m(e.$t("loading"))+"...",1)):(o(),n("span",F,m(e.$t("loadMore")),1))])])):l("",!0)])]))])}const z=k(w,[["render",L],["__scopeId","data-v-efe3c34a"]]);export{z 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.