PageSourceSearch

https://ebidyaloy.com/_next/static/chunks/pages/educonnect/groups/[groupId]-02d7bf2d07feac74.js

js ebidyaloy.com collected 2026-10-02 00:51:50 UTC 17,799 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25345],{28282:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/educonnect/groups/[groupId]",function(){return n(64679)}])},64679:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var i=n(47568),o=n(29815),r=n(97582),l=n(85893),s=n(67294),a=n(11163),d=n(41664),c=n.n(d),u=n(52980),_=n(14660),p=n(50853),f=n(44981),g=n(52638),x=n(3619),h=n(91049),E=n.n(h),b=[{id:"feed",label:E().__("IDS_ECN_FEED"),icon:"dynamic_feed"},{id:"members",label:E().__("IDS_ECN_MEMBERS"),icon:"people"},{id:"about",label:E().__("IDS_ECN_ABOUT"),icon:"info"}],S={id:"",name:E().__("IDS_ECN_LOADING"),subject:"",memberCount:0,description:"",color:"#2563EB",isPrivate:!1,createdAt:""},m={Learning:"Student",Teaching:"Teacher","Manage Institute":"Institute"},y=function(e){var t;return(null===e||void 0===e||null===(t=e.profilePicture)||void 0===t?void 0:t.path)||(null===e||void 0===e?void 0:e.profilePicture)||"/image/learning/top_icon_profile.png"},v=E().__("IDS_ECN_NOT_AVAILABLE_INSTITUTE");function I(){var e=(0,a.useRouter)().query.groupId,t=(0,s.useState)("feed"),n=t[0],d=t[1],h=(0,s.useState)(S),I=h[0],C=h[1],N=(0,s.useState)(!1),j=N[0],D=N[1],A=(0,s.useState)([]),k=A[0],B=A[1],T=(0,s.useState)([]),F=T[0],R=T[1],O=(0,s.useState)(!0),z=O[0],w=O[1],P=(0,s.useState)(1),W=P[0],U=P[1],L=(0,s.useState)(!1),G=L[0],M=L[1],H=(0,s.useState)(""),Z=H[0],J=H[1],V=(0,s.useState)(!1),X=V[0],Y=V[1],q=(0,s.useState)(!1),K=q[0],Q=q[1],$=(0,s.useState)(!1),ee=$[0],te=$[1],ne=(0,s.useState)(""),ie=ne[0],oe=ne[1],re=(0,s.useState)(!1),le=re[0],se=re[1],ae=(0,s.useState)(!1),de=ae[0],ce=ae[1],ue=(0,s.useState)(null),_e=ue[0],pe=ue[1],fe=(0,s.useState)(!1),ge=fe[0],xe=fe[1],he=(0,s.useState)(!1),Ee=he[0],be=he[1];(0,s.useEffect)((function(){Q(Boolean(window.localStorage.getItem("token")));try{var e=JSON.parse(window.localStorage.getItem("user")||"{}"),t=(null===e||void 0===e?void 0:e.currentAccountType)||(null===e||void 0===e?void 0:e.accountType)||"";te("Manage Institute"===t),oe(t)}catch(n){}}),[]),(0,s.useEffect)((function(){e&&((0,x.mI)(e).then((function(e){var t,n,i=null===(t=e.data)||void 0===t||null===(n=t.payload)||void 0===n?void 0:n.group;i&&(C({id:i._id,name:i.name||"Unknown Group",subject:i.subject||"",memberCount:i.memberCount||0,description:i.description||"",color:i.coverColor||"#2563EB",isPrivate:i.isPrivate||!1,createdAt:i.createdAt||""}),D(i.isJoined||!1))})).catch((function(){})),(0,x.S9)(e).then((function(e){var t,n,i=(null===(t=e.data)||void 0===t||null===(n=t.payload)||void 0===n?void 0:n.members)||[];B(i.map((function(e){var t,n,i,o;return{id:(null===(t=e.userId)||void 0===t?void 0:t._id)||e._id,name:(null===(n=e.userId)||void 0===n?void 0:n.name)||"Unknown",role:(o=null===(i=e.userId)||void 0===i?void 0:i.currentAccountType,m[o]||"Student"),avatar:y(e.userId),groupRole:e.role||"member"}})))})).catch((function(){})))}),[e]);var Se=(0,s.useCallback)((0,i.Z)((function(){var t,n,i,l,s,a,d,c=arguments;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:1,n=!(c.length>1&&void 0!==c[1])||c[1],!e)return[2];w(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,x.Ud)(e,t)];case 2:return s=r.sent(),a=(null===(i=s.data)||void 0===i?void 0:i.payload)||{},d=(a.posts||[]).map(g.BM).filter(Boolean),R((function(e){return n?d:(0,o.Z)(e).concat((0,o.Z)(d))})),M(t<((null===(l=a.pagination)||void 0===l?void 0:l.pages)||1)),U(t),[3,5];case 3:return r.sent(),[3,5];case 4:return w(!1),[7];case 5:return[2]}}
1))})),[e]);(0,s.useEffect)((function(){e&&Se(1,!0)}),[e,Se]);var me=function(){var t=(0,i.Z)((function(){var t;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:if(!K)return se(!0),[2];D(t=!j),n.label=1;case 1:return n.trys.push([1,6,,7]),j?[4,(0,x.vB)(e)]:[3,3];case 2:return n.sent(),[3,5];case 3:return[4,(0,x.AW)(e)];case 4:n.sent(),j||Se(1,!0),n.label=5;case 5:return[3,7];case 6:return n.sent(),D(!t),[3,7];case 7:return[2]}}))}));return function(){return t.apply(this,arguments)}}(),ye=function(){var t=(0,i.Z)((function(){var t,n,i,o,l,s,a,d,c,u;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!K)return se(!0),[2];t="Teaching"===ie||"Manage Institute"===ie,xe(!0),r.label=1;case 1:return r.trys.push([1,6,7,8]),t?[4,(0,x._3)(e,{name:I.name})]:[3,3];case 2:return o=r.sent(),l=(null===(n=o.data)||void 0===n||null===(i=n.payload)||void 0===i?void 0:i.conversationId)||null,pe(l),ce(!0),[3,5];case 3:return[4,(0,x.kt)()];case 4:d=r.sent(),c=(null===(s=d.data)||void 0===s||null===(a=s.payload)||void 0===a?void 0:a.conversations)||[],(u=c.find((function(t){return t.studyGroupId&&t.studyGroupId.toString()===(null===e||void 0===e?void 0:e.toString())})))?(pe(u._id||u.id),ce(!0)):be(!0),r.label=5;case 5:return[3,8];case 6:return r.sent(),be(!0),[3,8];case 7:return xe(!1),[7];case 8:return[2]}}
1))}));return function(){return t.apply(this,arguments)}}(),ve=function(){var t=(0,i.Z)((function(){var t,n,i,l,s;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!Z.trim()||!K)return[2];Y(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,x.mR)(e,{content:Z.trim()})];case 2:return i=r.sent(),(l=null===(t=i.data)||void 0===t||null===(n=t.payload)||void 0===n?void 0:n.post)&&(s=(0,g.BM)(l))&&R((function(e){return[s].concat((0,o.Z)(e))})),J(""),[3,5];case 3:return r.sent(),alert(E().__("IDS_ECN_FAILED_POST_RETRY")),[3,5];case 4:return Y(!1),[7];case 5:return[2]}}))}));return function(){return t.apply(this,arguments)}}();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(u.Z,{title:I.name,children:[le&&(0,l.jsx)(p.Z,{onClose:function(){return se(!1)},action:E().__("IDS_ECN_JOIN_THIS_GROUP_ACTION")}),Ee&&(0,l.jsx)("div",{style:{position:"fixed",inset:0,zIndex:300,background:"rgba(0,0,0,0.4)",display:"flex",alignItems:"center",justifyContent:"center",padding:16},onClick:function(){return be(!1)},children:(0,l.jsxs)("div",{style:{background:"#fff",borderRadius:20,maxWidth:380,width:"100%",overflow:"hidden",boxShadow:"0 24px 64px rgba(0,0,0,0.18)"},onClick:function(e){return e.stopPropagation()},children:[(0,l.jsxs)("div",{style:{background:"linear-gradient(135deg, #1E3A8A, #2563EB)",padding:"16px 20px",display:"flex",alignItems:"center",gap:10},children:[(0,l.jsx)("div",{style:{width:36,height:36,borderRadius:10,background:"rgba(255,255,255,0.15)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:20,color:"#fff"},children:"chat_bubble_outline"})}),(0,l.jsx)("p",{style:{fontSize:15,fontWeight:800,color:"#fff"},children:E().__("IDS_ECN_GROUP_CHAT")})]}),(0,l.jsxs)("div",{style:{padding:"24px 20px 20px",textAlign:"center"},children:[(0,l.jsx)("div",{style:{width:56,height:56,borderRadius:16,background:"#FEF3C7",border:"1.5px solid #FDE68A",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px"},children:(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:28,color:"#D97706"},children:"lock_clock"})}),(0,l.jsx)("p",{style:{fontSize:14,fontWeight:800,color:"#111827",marginBottom:8},children:E().__("IDS_ECN_NOT_ADDED_CHAT")}),(0,l.jsxs)("p",{style:{fontSize:13,color:"#6B7280",lineHeight:1.6},children:[E().__("IDS_ECN_NOT_ADDED_CHAT_PREFIX")," ",(0,l.jsx)("strong",{style:{color:"#1E3A8A"},children:I.name})," ",E().__("IDS_ECN_NOT_ADDED_CHAT_SUFFIX")]}),(0,l.jsx)("button",{onClick:function(){return be(!1)},style:{marginTop:20,width:"100%",height:42,borderRadius:12,background:"linear-gradient(135deg, #2563EB, #1D4ED8)",color:"#fff",fontSize:14,fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 3px 10px rgba(37,99,235,0.3)"},children:E().__("IDS_ECN_GOT_IT")})]})]})}),(0,l.jsxs)("div",{className:"rounded-2xl overflow-hidden mb-4",style:{border:"1px solid #E5E7EB",boxShadow:"0 2px 12px rgba(0,0,0,0.08)"},children:[(0,l.jsxs)("div",{style:{height:140,background:I.color,display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[(0,l.jsx)("span",{className:"material-icons-outlined text-white",style:{fontSize:64,opacity:.2},children:"group"}),(0,l.jsx)(c(),{href:"/educonnect/groups",children:(0,l.jsxs)("a",{style:{position:"absolute",top:12,left:12,display:"flex",alignItems:"center",gap:4,padding:"6px 12px",borderRadius:10,background:"rgba(0,0,0,0.3)",color:"#fff",fontSize:12,fontWeight:600,textDecoration:"none",backdropFilter:"blur(4px)"},children:[(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:16},children:"arrow_back"}),E().__("IDS_ECN_GROUPS_BACK")]})}),(0,l.jsxs)("button",{onClick:ye,disabled:ge,style:{position:"absolute",top:12,right:12,display:"flex",alignItems:"center",gap:6,padding:"6px 14px",borderRadius:10,background:"rgba(0,0,0,0.3)",color:"#fff",fontSize:12,fontWeight:600,border:"none",backdropFilter:"blur(4px)",cursor:ge?"default":"pointer",opacity:ge?.7:1},children:[(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:16},children:ge?"hourglass_empty":"chat_bubble_outline"}),ge?E().__("IDS_ECN_OPENING"):E().__("IDS_ECN_GROUP_CHAT")]})]}),(0,l.jsxs)("div",{className:"p-4 bg-white flex items-end gap-4",children:[(0,l.jsx)("div",{style:{width:64,height:64,borderRadius:16,background:I.color,border:"4px solid #fff",boxShadow:"0 2px 8px rgba(0,0,0,0.12)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:-32},children:(0,l.jsx)("span",{className:"material-icons-outlined text-white",style:{fontSize:28},children:"group"})}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("h1",{style:{fontSize:20,fontWeight:900,color:"#111827"},children:I.name}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,l.jsxs)("span",{style:{fontSize:12,color:"#6B7280"}
1,children:[I.memberCount.toLocaleString()," ",E().__("IDS_ECN_MEMBERS_LOWER")]}),I.subject&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{style:{fontSize:12,color:"#9CA3AF"},children:"\xb7"}),(0,l.jsx)("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:20,background:"#EDE9FE",color:"#7C3AED",fontWeight:700},children:I.subject})]})]})]}),(0,l.jsx)("button",{onClick:ee?void 0:me,disabled:ee,title:ee?v:void 0,style:{padding:"8px 20px",borderRadius:12,background:ee?"#F3F4F6":j?"#F9FAFB":"linear-gradient(135deg, #7C3AED, #6D28D9)",border:ee||j?"1.5px solid #E5E7EB":"none",color:ee?"#9CA3AF":j?"#374151":"#fff",fontSize:13,fontWeight:700,cursor:ee?"not-allowed":"pointer",flexShrink:0},children:j?"\u2713 ".concat(E().__("IDS_ECN_JOINED")):E().__("IDS_ECN_JOIN_GROUP")})]}),(0,l.jsx)("div",{className:"flex overflow-x-auto",style:{borderTop:"1px solid #E5E7EB",background:"#fff",scrollbarWidth:"none"},children:b.map((function(e){return(0,l.jsxs)("button",{onClick:function(){return d(e.id)},style:{flex:1,minWidth:80,display:"flex",alignItems:"center",justifyContent:"center",gap:5,padding:"11px 8px",border:"none",borderBottom:n===e.id?"2.5px solid #7C3AED":"2.5px solid transparent",background:n===e.id?"#EDE9FE":"transparent",color:n===e.id?"#7C3AED":"#6B7280",fontSize:12,fontWeight:n===e.id?700:500,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:15},children:e.icon}),e.label]},e.id)}))})]}),"feed"===n&&(0,l.jsxs)("div",{children:[K&&j&&(0,l.jsxs)("div",{style:{background:"#fff",borderRadius:16,border:"1px solid #E5E7EB",padding:14,marginBottom:14,boxShadow:"0 1px 4px rgba(0,0,0,0.04)",opacity:ee?.65:1},children:[ee&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 10px",background:"#F9FAFB",borderRadius:8,border:"1px solid #E5E7EB",marginBottom:10},children:[(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:14,color:"#9CA3AF",flexShrink:0},children:"info"}),(0,l.jsx)("span",{style:{fontSize:11,color:"#6B7280"},children:E().__("IDS_ECN_NOT_AVAILABLE_INSTITUTE")})]}),(0,l.jsx)("textarea",{value:Z,onChange:function(e){ee||J(e.target.value)},disabled:ee,title:ee?v:void 0,placeholder:ee?E().__("IDS_ECN_INSTITUTE_CANNOT_POST"):E().__("IDS_ECN_SHARE_WITH_GROUP_PH"),rows:2,style:{width:"100%",border:"1.5px solid #E5E7EB",borderRadius:10,padding:"10px 12px",fontSize:13,color:"#374151",resize:"none",outline:"none",background:"#F9FAFB",lineHeight:1.6,boxSizing:"border-box",cursor:ee?"not-allowed":void 0},onFocus:function(e){ee||(e.target.style.border="1.5px solid #7C3AED",e.target.style.background="#fff")},onBlur:function(e){e.target.style.border="1.5px solid #E5E7EB",e.target.style.background="#F9FAFB"}}),(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:8},children:(0,l.jsxs)("button",{onClick:ve,disabled:!Z.trim()||X||ee,title:ee?v:void 0,style:{display:"flex",alignItems:"center",gap:5,padding:"7px 16px",borderRadius:9,border:"none",background:Z.trim()&&!ee?"linear-gradient(135deg, #7C3AED, #6D28D9)":"#E5E7EB",color:Z.trim()&&!ee?"#fff":"#9CA3AF",fontSize:12,fontWeight:700,cursor:Z.trim()&&!ee?"pointer":"not-allowed"},children:[(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:14},children:"send"}),X?E().__("IDS_ECN_POSTING"):E().__("IDS_ECN_POST")]})})]}),z&&0===F.length?(0,l.jsxs)("div",{style:{textAlign:"center",padding:"40px 0",color:"#9CA3AF"},children:[(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:36,display:"block",marginBottom:8},children:"hourglass_empty"}),E().__("IDS_ECN_LOADING")]}):0===F.length?(0,l.jsxs)("div",{style:{textAlign:"center",padding:"40px 0",color:"#9CA3AF",background:"#fff",borderRadius:16,border:"1px solid #E5E7EB"},children:[(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:40,display:"block",marginBottom:8,color:"#D1D5DB"},children:"dynamic_feed"}),(0,l.jsx)("p",{style:{fontSize:14,fontWeight:600},children:E().__("IDS_ECN_NO_POSTS_GROUP")}),j&&(0,l.jsx)("p",{style:{fontSize:12,marginTop:4},children:E().__("IDS_ECN_BE_FIRST_SHARE")}),!j&&(0,l.jsx)("p",{style:{fontSize:12,marginTop:4},children:E().__("IDS_ECN_JOIN_TO_POST")})]}):(0,l.jsxs)(l.Fragment,{children:[F.map((function(e){return(0,l.jsx)(_.Z,{post:e,isLoggedIn:K,onDelete:function(e){return R((function(t){return t.filter((function(t){return t.id!==e}))}))}},e.id)})),G&&(0,l.jsx)("div",{style:{textAlign:"center",marginTop:12},children:(0,l.jsx)("button",{onClick:function(){return Se(W+1,!1)},disabled:z,style:{padding:"9px 24px",borderRadius:10,background:"#EDE9FE",border:"1px solid #DDD6FE",color:"#7C3AED",fontSize:13,fontWeight:700,cursor:"pointer"},children:z?E().__("IDS_ECN_LOADING"):E().__("IDS_ECN_LOAD_MORE")})})]})]}),"members"===n&&(0,l.jsxs)("div",{className:"rounded-2xl overflow-hidden",style:{background:"#fff",border:"1px solid #E5E7EB"},children:[(0,l.jsx)("div",{className:"p-4",style:{borderBottom:"1px solid #F3F4F6"},children:(0,l.jsxs)("p",{style:{fontSize:14,fontWeight:800,color:"#111827"}
1,children:[I.memberCount.toLocaleString()," ",E().__("IDS_ECN_MEMBERS")]})}),0===k.length?(0,l.jsxs)("div",{style:{padding:"32px 0",textAlign:"center",color:"#9CA3AF"},children:[(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:36,display:"block",marginBottom:8},children:"people_outline"}),E().__("IDS_ECN_NO_MEMBERS_YET")]}):k.map((function(e){return(0,l.jsxs)("div",{className:"flex items-center gap-3 p-4",style:{borderBottom:"1px solid #F9FAFB"},children:[(0,l.jsx)("img",{src:e.avatar,alt:"",style:{width:44,height:44,borderRadius:"50%",objectFit:"cover",border:"2px solid #E5E7EB"}}),(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsx)("p",{style:{fontSize:14,fontWeight:700,color:"#111827"},children:e.name}),(0,l.jsx)("p",{style:{fontSize:11,color:"#6B7280",textTransform:"capitalize"},children:e.groupRole})]}),(0,l.jsx)("span",{style:{fontSize:10,padding:"3px 8px",borderRadius:20,fontWeight:700,background:"Teacher"===e.role?"#D1FAE5":"Institute"===e.role?"#EDE9FE":"#EFF6FF",color:"Teacher"===e.role?"#065F46":"Institute"===e.role?"#7C3AED":"#1D4ED8"},children:e.role})]},e.id)}))]}),"about"===n&&(0,l.jsxs)("div",{className:"rounded-2xl p-5",style:{background:"#fff",border:"1px solid #E5E7EB"},children:[(0,l.jsx)("h2",{style:{fontSize:16,fontWeight:800,color:"#111827",marginBottom:12},children:E().__("IDS_ECN_ABOUT_THIS_GROUP")}),I.description?(0,l.jsx)("p",{style:{fontSize:14,color:"#374151",lineHeight:1.8,marginBottom:16},children:I.description}):(0,l.jsx)("p",{style:{fontSize:13,color:"#9CA3AF",marginBottom:16,fontStyle:"italic"},children:E().__("IDS_ECN_NO_DESCRIPTION")}),(0,l.jsx)("div",{className:"flex flex-col gap-3",children:[{key:"members",icon:"group",label:E().__("IDS_ECN_MEMBERS"),value:"".concat(I.memberCount.toLocaleString()," ").concat(E().__("IDS_ECN_MEMBERS_LOWER"))},{key:"subject",icon:"category",label:E().__("IDS_ECN_SUBJECT"),value:I.subject||E().__("IDS_ECN_GENERAL")},{key:"privacy",icon:I.isPrivate?"lock":"lock_open",label:E().__("IDS_ECN_PRIVACY"),value:I.isPrivate?E().__("IDS_ECN_PRIVATE_GROUP_VALUE"):E().__("IDS_ECN_PUBLIC_GROUP_VALUE")},{key:"created",icon:"calendar_today",label:E().__("IDS_ECN_CREATED"),value:I.createdAt?new Date(I.createdAt).toLocaleDateString("en-US",{month:"long",year:"numeric"}):"\u2014"}].map((function(e){return(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("span",{className:"material-icons-outlined",style:{fontSize:20,color:"#7C3AED"},children:e.icon}),(0,l.jsx)("span",{style:{fontSize:13,color:"#6B7280",minWidth:80},children:e.label}),(0,l.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#111827"},children:e.value})]},e.key)}))})]})]}),(0,l.jsx)(f.Z,{open:de,onClose:function(){ce(!1),pe(null)},theme:"blue",initialConvId:_e})]})}}},function(e){e.O(0,[41664,44981,52980,14660,49774,92888,40179],(function(){return t=28282,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

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.