1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7556],{72213:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/s/groups/[id]",function(){return n(96717)}])},29534:function(e,t,n){"use strict";var s=n(47568),o=n(20414),i=n(85893),r=n(67294),a=n(37546),l=n(41449),c=n(61646);t.Z=function(e){var t=e.group,n=void 0===t?null:t,d=e.refreshGroups,u=e.texts,p=(0,r.useState)(!1),m=p[0],f=p[1],h=function(){var e=(0,s.Z)((function(){var e;return(0,o.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),f(!0),[4,c.Z.get("/index.php?route=account/group/leaveGroup&customer_sgroup_id=".concat(n.customer_sgroup_id),{})];case 1:return t.sent().data.error?((0,a.P)(u.error_left_group+n.title+" !"),f(!1),[2]):(null===(e=null===document||void 0===document?void 0:document.getElementById("close-modal-group-leave"))||void 0===e||e.click(),d?[4,d()]:[3,3]);case 2:t.sent(),t.label=3;case 3:return(0,a.b)(u.toast_left_from+n.title+u.success_left_from),f(!1),[3,5];case 4:return t.sent(),(0,a.P)(u.error_left_group+n.title+" !"),f(!1),[3,5];case 5:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}();return(0,i.jsx)("div",{className:"modal fade",id:"modal-group-leave",tabIndex:-1,"aria-labelledby":"modal-group-leave-label","aria-hidden":"true",children:(0,i.jsx)("div",{className:"modal-dialog modal-dialog-centered",children:(0,i.jsxs)("div",{className:"modal-content",children:[(0,i.jsxs)("div",{className:"modal-header",children:[n&&(0,i.jsx)("h5",{className:"modal-title",id:"modal-group-leave-label",children:u.title_leave_from_group+n.title}),(0,i.jsx)("button",{id:"close-modal-group-leave",type:"button",className:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})]}),(0,i.jsx)("div",{className:"modal-body p-4",children:n&&(0,i.jsx)(i.Fragment,{children:m?(0,i.jsx)(l.Z,{height:300}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{children:u.text_sure_leave_group+n.title+"?"}),(0,i.jsxs)("div",{className:"d-flex mt-4 flex-row-reverse justify-content-between w-100",children:[(0,i.jsx)("button",{type:"submit",className:"btn btn-primary",onClick:h,disabled:m,children:u.button_leave}),(0,i.jsx)("button",{type:"button",className:"btn btn-secondary","data-bs-dismiss":"modal",children:u.button_cancel})]})]})})})]})})})}},31267:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var s=n(47041);function o(e){var t=e.redirect_url;(0,s.setCookie)("login_page_redirect",t,{maxAge:36e5})}},96717:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return Q},default:function(){return Y}});var s=n(47568),o=n(20414),i=n(85893),r=n(67294),a=n(9008),l=n.n(a),c=n(7917),d=n(11163),u=n(55120),p=n(37546),m=n(41449),f=n(61646),h=function(e){var t=e.profile,n=e.texts,a=(0,r.useState)(t.cover_image),l=a[0],c=a[1],h=(0,r.useState)(!1),g=h[0],_=h[1],v=(0,r.useState)(t.profile_image),x=v[0],j=v[1],b=(0,r.useState)({opacity:0}),y=b[0],N=b[1],w=(0,r.useState)({opacity:0}),P=w[0],S=w[1],k=(0,d.useRouter)(),Z=k.pathname,C=k.query,F=(0,r.useState)(!1),I=F[0],E=F[1],M=t.is_admin,O=function(){var e=(0,s.Z)((function(e){var s,i,r,a,l,d,u;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return e.target.files[0].size>2e7?((0,p.P)(n.error_file_too_big_single),[3,6]):[3,1];case 1:if(!(s=e.target.files[0]))return[2];_(!0),o.label=2;case 2:return o.trys.push([2,5,,6]),(r=new FormData).append("customer_sgroup_id",t.customer_sgroup_id),r.append("type","cover"),r.append("file",s),[4,f.Z.post("/index.php?route=account/group/addGroupImage",r,{})];case 3:return a=o.sent(),(null===(l=a.data)||void 0===l||null===(i=l.error)||void 0===i?void 0:i.file)?((0,p.P)(l.error.file),_(!1),[2]):200!==a.status?((0,p.P)(n.error_add_image_cover),_(!1),[2]):[4,f.Z.get("/index.php?route=account/group/info&slug=".concat(encodeURI(C.id)))];case 4:return d=o.sent(),u=d.data,c(u.cover_image),_(!1),(0,p.b)(n.succes_update_image_cover),[3,6];case 5:return o.sent(),(0,p.P)(n.error_add_image_cover),_(!1),[3,6];case 6:return[2]}}
1))}));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=(0,s.Z)((function(e){var s,i,r,a,l,c,d;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return e.target.files[0].size>2e7?((0,p.P)(n.error_file_too_big_single),[3,6]):[3,1];case 1:if(!(s=e.target.files[0]))return[2];E(!0),o.label=2;case 2:return o.trys.push([2,5,,6]),(r=new FormData).append("customer_sgroup_id",t.customer_sgroup_id),r.append("type","avatar"),r.append("file",s),[4,f.Z.post("/index.php?route=account/group/addGroupImage",r,{})];case 3:return a=o.sent(),(null===(l=a.data)||void 0===l||null===(i=l.error)||void 0===i?void 0:i.file)?((0,p.P)(l.error.file),E(!1),[2]):200!==a.status?((0,p.P)(n.error_add_image_cover),E(!1),[2]):[4,f.Z.get("/index.php?route=account/group/info&slug=".concat(encodeURI(C.id)))];case 4:return c=o.sent(),d=c.data,j(d.profile_image),E(!1),(0,p.b)(n.succes_update_image_cover),[3,6];case 5:return o.sent(),(0,p.P)(n.error_add_image_cover),E(!1),[3,6];case 6:return[2]}}))}));return function(t){return e.apply(this,arguments)}}();return(0,i.jsxs)("div",{className:"social-feed-head shadow-sm social-feed-head-mobile mb-0-mobile",children:[(0,i.jsx)("div",{className:"social-feed-head-cover",style:{backgroundImage:"url('"+l+"')"},children:M&&(0,i.jsxs)(i.Fragment,{children:[g&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"image-loading-spinner-cont",children:(0,i.jsx)(m.Z,{height:200})})}),(0,i.jsxs)("div",{className:"social-feed-head-upload-image-cover",onMouseEnter:function(e){S({opacity:1})},onMouseLeave:function(e){S({opacity:0})},children:[(0,i.jsx)("input",{type:"file",id:"cover-upload-image",accept:"image/png, image/jpeg",onChange:O}),(0,i.jsxs)("div",{className:"cover-upload-image-button",style:P,onClick:function(){var e;null===(e=null===document||void 0===document?void 0:document.getElementById("cover-upload-image"))||void 0===e||e.click()},children:[(0,i.jsx)("i",{className:"far fa-images"}),(0,i.jsx)("span",{children:n.text_change_cover_image})]})]})]})}),(0,i.jsx)("ul",{className:"social-feed-head-group-links social-feed-head-links d-none",children:[{name:"Profil",href:""}].map((function(e,t){return(0,i.jsx)("li",{children:(0,i.jsx)("span",{className:"btn".concat(Z.includes(e.href)?" active":""),children:e.name})},t)}))}),(0,i.jsx)("div",{className:"social-feed-head-profile-container social-feed-head-padding-mobile",children:(0,i.jsx)("div",{className:"social-feed-head-profile-container-inner d-flex justify-content-between",children:(0,i.jsxs)("div",{className:"d-flex main-flex-profile-user-cont",children:[(0,i.jsxs)("div",{className:"social-feed-friends-list-image-container shadow-sm",children:[(0,i.jsx)("div",{className:"social-feed-head-profile-picture",children:(0,i.jsx)(u.Z,{src:x,alt:"profile-image",width:400,height:400,objectFit:"cover",nowidthcheck:!0})}),M&&(0,i.jsxs)(i.Fragment,{children:[I&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"image-loading-spinner-cont",children:(0,i.jsx)(m.Z,{height:200})})}),(0,i.jsxs)("div",{className:"social-feed-head-upload-image-avatar",onMouseEnter:function(e){N({opacity:1})},onMouseLeave:function(e){N({opacity:0})},children:[(0,i.jsx)("input",{type:"file",id:"avatar-upload-image",accept:"image/png, image/jpeg",onChange:T}),(0,i.jsx)("div",{className:"avatar-upload-image-button",style:y,onClick:function(){var e;!g&&(null===(e=null===document||void 0===document?void 0:document.getElementById("avatar-upload-image"))||void 0===e||e.click())},children:(0,i.jsx)("i",{className:"far fa-images"})})]})]})]}),(0,i.jsx)("div",{className:"social-feed-head-profile-text ms-3 mt-2",children:(0,i.jsxs)("div",{className:"d-flex flex-column",children:[(0,i.jsx)("h6",{children:t.title}),(0,i.jsx)("p",{style:{width:300,fontSize:12},children:"\xa0"})]})})]})})})]})},g=n(41664),_=n.n(g),v=n(50452),x=n(40996);function j(){return{width:window.innerWidth,height:window.innerHeight}}var b=function(e){var t=e.group,n=e.profile,a=e.texts,l=(0,x.mx)(),c=l.setOpenChatWidget,d=l.setOpenChat,h=l.setFriendsToggle,g=l.setChatLoading,b=l.setChatMessagesLoading,y=(0,r.useState)(null),N=y[0],w=y[1],P=(0,r.useState)(!0),S=P[0],k=P[1];(0,r.useEffect)((function(){Z()}),[t]);var Z=function(){var e=(0,s.Z)((function(){var e;return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return k(!0),[4,f.Z.get("/index.php?route=account/group/getMembers&customer_sgroup_id=".concat(t.customer_sgroup_id),{})];case 1:return(e=n.sent().data).members?w(e.members):w([]),k(!1),[2]}}))}));return function(){return e.apply(this,arguments)}}(),C=function(){var e=(0,s.Z)((function(e){return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return k(!0),[4,f.Z.get("/index.php?route=account/group/removeFromGroup&customer_sgroup_id=".concat(t.customer_sgroup_id,"&customer_id=").concat(e.customer_id),{})];case 1:return n.sent(),Z(),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),F="0"===t.visibility,I=F&&t.in_group,E=(0,r.useState)(!1),M=E[0],O=E[1],T=(0,r.useState)(!1),L=T[0],D=T[1],V=(0,r.useState)(""),R=V[0],q=V[1],z=(0,v.Ok)().sendNotification,U=function(){var e=(0,s.Z)((function(e){var t,n,s;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return(t=new FormData).append("customer_id",String(e)),[4,f.Z.post("/index.php?route=account/friend/addFriend",t,{})];case 1:return n=o.sent(),(s=n.data).success&&((0,p.b)(s.success),Z(),z(e,"friend_request"),q("")),s.error&&(0,p.P)(s.error),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),B=function(){var e=(0,s.Z)((function(e){var t,n,s;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return(t=new FormData).append("customer_id",String(e)),[4,f.Z.post("/index.php?route=account/friend/confirmFriend",t,{})];case 1:return n=o.sent(),(s=n.data).error?((0,p.P)(s.error),[2]):(s.success&&((0,p.b)(s.success),Z(),z(e,"friend_confirm"),q("")),[2])}}))}));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=(0,s.Z)((function(e){var t,n,s;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return(t=new FormData).append("customer_id",String(e)),[4,f.Z.post("/index.php?route=account/friend/removeFriend",t,{})];case 1:return n=o.sent(),(s=n.data).error?((0,p.P)(s.error),[2]):(s.success&&((0,p.b)(s.success),Z(),q("")),[2])}}))}));return function(t){return e.apply(this,arguments)}}();(0,r.useEffect)((function(){var e,t;M?null===(e=null===document||void 0===document?void 0:document.getElementsByTagName("body")[0])||void 0===e||e.classList.add("open-modal-cancel-friend-requests"):null===(t=null===document||void 0===document?void 0:document.getElementsByTagName("body")[0])||void 0===t||t.classList.remove("open-modal-cancel-friend-requests")}),[M]),(0,r.useEffect)((function(){var e,t;L?null===(e=null===document||void 0===document?void 0:document.getElementsByTagName("body")[0])||void 0===e||e.classList.add("open-modal-cancel-friend-requests"):null===(t=null===document||void 0===document?void 0:document.getElementsByTagName("body")[0])||void 0===t||t.classList.remove("open-modal-cancel-friend-requests")}),[L]);var G=(0,r.useState)(j),J=G[0],W=G[1];return(0,r.useEffect)((function(){var e=function(){W(j())};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),(0,i.jsxs)("div",{className:"social-feed-profile-details card social-card social-feed-detail
1s-mobile shadow-sm mt-4 mt-2-mobile",children:[(0,i.jsx)("h5",{className:"card-header",children:a.text_members+"("+t.total_members+")"}),(0,i.jsx)("div",{className:"card-body",children:S?(0,i.jsx)(m.Z,{height:300}):(0,i.jsxs)(i.Fragment,{children:[(I||!F)&&(0,i.jsx)("ul",{className:"discover-list",children:N&&N.map((function(e,s){var o=t.is_admin&&String(n.customer_id)!==String(e.customer_id);return(0,i.jsxs)("li",{className:"d-flex d-flex align-items-center justify-content-between w-100",children:[(0,i.jsx)(_(),{href:e.profile_url,children:(0,i.jsx)("a",{className:"btn position-relative w-100",href:e.profile_url,children:(0,i.jsxs)("div",{className:"d-flex align-items-center",children:[(0,i.jsxs)("div",{className:"position-relative",children:[(0,i.jsx)(u.Z,{src:e.profile_avatar,alt:"cover-image",className:"social-feed-item-profile",width:40,height:40,objectFit:"cover"}),e.is_admin&&(0,i.jsxs)("span",{className:"position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger",children:[a.text_admin,(0,i.jsx)("span",{className:"visually-hidden",children:a.text_admin})]})]}),(0,i.jsx)("div",{className:"ms-3 text-start",children:(0,i.jsx)("b",{children:e.profile_username})})]})})}),(0,i.jsx)("div",{className:"w-100",children:String(null===n||void 0===n?void 0:n.customer_id)!==String(e.customer_id)&&(0,i.jsx)(i.Fragment,{children:1==e.is_friend?(0,i.jsx)(i.Fragment,{children:J.width>991?(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("a",{href:"/chat?friend_id=".concat(e.customer_id,"&username=").concat(e.profile_username),children:(0,i.jsxs)("div",{className:"d-flex justify-content-center align-items-center btn btn-primary p-1 ms-1",children:[(0,i.jsx)("i",{className:"fas fa-comment-alt align-self-center"}),(0,i.jsxs)("div",{className:"event-members-actionbtn-text",children:[" ",null===a||void 0===a?void 0:a.button_send_message]})]})})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{onClick:function(){g(!0),b(!0),h(!1),c(!0),setTimeout((function(){d({friend_id:e.customer_id,username:e.profile_username})}),500)},children:(0,i.jsxs)("div",{className:"d-flex justify-content-center align-items-center btn btn-primary p-1 ms-1",children:[(0,i.jsx)("i",{className:"fas fa-comment-alt align-self-center"}),(0,i.jsxs)("div",{className:"event-members-actionbtn-text",children:[" ",null===a||void 0===a?void 0:a.button_send_message]})]})})})}):2==e.is_friend?(0,i.jsx)(i.Fragment,{children:e.my_request?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"d-flex justify-content-center align-items-center btn btn-outline-secondary p-1 ms-1",onClick:function(){O(!0),q(e.customer_id)},children:[(0,i.jsx)("i",{className:"fas fa-user-slash align-self-center"}),(0,i.jsxs)("div",{className:"event-members-actionbtn-text",children:[" ",null===a||void 0===a?void 0:a.button_cancel_request]})]}),(0,i.jsx)("div",{className:"".concat(M?"modal-feed-post-likes-actions":"d-none"),children:(0,i.jsxs)("div",{className:"modal-feed-post-likes-actions-cont",children:[(0,i.jsxs)("div",{className:"modal-feed-post-likes-header",children:[(0,i.jsxs)("div",{className:"modal-title",children:[" ",null===a||void 0===a?void 0:a.button_cancel_request]}),(0,i.jsx)("div",{className:"modal-feed-post-likes-close-btn",onClick:function(){O(!1),q("")},children:(0,i.jsx)("i",{className:"fas fa-times"})})]}),(0,i.jsx)("div",{className:"p-0",children:(0,i.jsxs)("div",{className:"modal-feed-post-likes-body",children:[(0,i.jsx)("div",{className:"p-3",children:null===a||void 0===a?void 0:a.text_confirm_cancel_request}),(0,i.jsxs)("div",{className:"d-flex flex-row justify-content-between p-3",children:[(0,i.jsx)("div",{className:"d-flex w-100 justify-content-center btn btn-primary p-2 me-3",onClick:function(){A(R),O(!1),q("")},children:(0,i.jsxs)("div",{children:[" ",null===a||void 0===a?void 0:a.button_cancel_request]})}),(0,i.jsx)("div",{className:"d-flex w-100 justify-content-center btn btn-outline-secondary p-2",onClick:function(){O(!1),q("")},children:(0,i.jsx)("div",{children:null===a||void 0===a?void 0:a.button_close})})]})]})})]})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"d-flex flex-column ms-1",children:[(0,i.jsxs)("div",{className:"d-flex justify-content-center align-items-center btn btn-primary p-1",onClick:function(){B(e.customer_id)},children:[(0,i.jsx)("i",{className:"fas fa-check align-self-center"}),(0,i.jsx)("div",{className:"event-members-actionbtn-text",children:null===a||void 0===a?void 0:a.button_accept_request})]}),(0,i.jsxs)("div",{className:"d-flex justify-content-center align-items-center btn btn-outline-secondary p-1 mt-2",onClick:function(){D(!0),q(e.customer_id)},children:[(0,i.jsx)("i",{className:"fas fa-ban align-self-center"}),(0,i.jsx)("div",{className:"event-members-actionbtn-text",children:null===a||void 0===a?void 0:a.button_deny})]})]}),(0,i.jsx)("div",{className:"".concat(L?"modal-feed-post-likes-actions":"d-none"),children:(0,i.jsxs)("div",{className:"modal-feed-post-likes-actions-cont",children:[(0,i.jsxs)("div",{className:"modal-feed-post-likes-header",children:[(0,i.jsx)("div",{className:"modal-title",children:null===a||void 0===a?void 0:a.button_deny_request}),(0,i.jsx)("div",{className:"modal-feed-post-likes-close-btn",onClick:function(){D(!1),q("")},children:(0,i.jsx)("i",{className:"fas fa-times"})})]}),(0,i.jsx)("div",{className:"p-0",children:(0,i.jsxs)("div",{className:"modal-feed-post-likes-body",children:[(0,i.jsx)("div",{className:"p-3",children:null===a||void 0===a?void 0:a.text_confirm_deny_request}),(0,i.jsxs)("div",{className:"d-flex flex-row justify-content-between p-3",children:[(0,i.jsx)("div",{className:"d-flex w-100 justify-content-center btn btn-primary p-2 me-3",onClick:function(){A(R),D(!1),q("")},children:(0,i.jsx)("div",{children:null===a||void 0===a?void 0:a.button_deny_request})}),(0,i.jsx)("div",{className:"d-flex w-100 justify-content-center btn btn-outline-secondary p-2",onClick:function(){D(!1),q("")},children:(0,i.jsx)("div",{children:null===a||void 0===a?void 0:a.button_close})})]})]})})]})})]})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"d-flex justify-content-center align-items-center btn btn-primary p-1 ms-1",onClick:function(){U(e.customer_id)},children:[(0,i.jsx)("i",{className:"fas fa-users align-self-center"}),(0,i.jsx)("div",{className:"event-members-actionbtn-text",children:null===a||void 0===a?void 0:a.button_add_friend})]})})})}),o&&(0,i.jsx)("div",{onClick:function(){return C(e)},className:"ms-2",style:{cursor:"pointer"}
1,children:(0,i.jsx)("i",{className:"fas fa-trash"})})]},"".concat(e.profile_username,"-").concat(s))}))}),F&&!t.in_group&&(0,i.jsxs)("div",{style:{textAlign:"center"},children:[(0,i.jsx)("i",{className:"fas fa-lock"}),(0,i.jsx)("span",{className:"ms-2",children:a.text_private_group})]})]})})]})},y=n(29534),N=n(29815),w=n(30268),P=n(84005),S=function(e){var t=e.profile,n=e.group,a=e.actions,l=e.texts,c=a.handleNewPost,d=(0,r.useState)(""),m=d[0],h=d[1],g=(0,r.useState)(null),_=(g[0],g[1],(0,r.useState)([])),v=_[0],x=_[1],j=(0,r.useState)(!1),b=j[0],y=j[1],w=(0,r.useState)({opacity:0}),S=(w[0],w[1]),k=function(){var e=(0,s.Z)((function(e){var t,n,s,i,r,a,c,d,u,m,f,h;return(0,o.__generator)(this,(function(o){if(e.target.files.size>2e7)(0,p.P)(l.error_file_too_big_single);else{t=[],v.map((function(e,n){t.push({index:n,postImageData:{name:n>0?String("file_"+n):"file",filename:e.postImageData.filename,type:e.postImageData.type,data:e.postImageData.data}})})),n=!1,s=!1,i=0,r=!0,a=!1,c=void 0;try{for(d=e.target.files[Symbol.iterator]();!(r=(u=d.next()).done);r=!0)m=u.value,(f=i+(v.length>0?v.length:0))<10&&(m.size&&m.size>2e7?n=!0:m.type.includes("video")?s=!0:(h={name:f>0?String("file_"+f):"file",filename:m.name,type:m.type,data:m},t.push({index:f,postImageData:h}))),i++}catch(g){a=!0,c=g}finally{try{r||null==d.return||d.return()}finally{if(a)throw c}}n&&(0,p.P)(null===l||void 0===l?void 0:l.error_file_too_big),s&&(0,p.P)(null===l||void 0===l?void 0:l.error_file_type_invalid),t.length>0&&x(t)}return[2]}))}));return function(t){return e.apply(this,arguments)}}(),Z=function(){var e=(0,s.Z)((function(){var e,t,s,i,r,a;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:y(!0),o.label=1;case 1:return o.trys.push([1,6,,7]),t=v.length>0?"1":"0",v.length>0?((i=new FormData).append("description",m?C(m):""),i.append("has_image",t),i.append("total_images",String(v.length)),i.append("customer_sgroup_id",n.customer_sgroup_id),v.map((function(e){i.append(String(e.postImageData.name),e.postImageData.data)})),[4,f.Z.post("/index.php?route=account/group/addPost",i,{})]):[3,3];case 2:return s=o.sent(),[3,5];case 3:return(r=new FormData).append("description",m?C(m):""),r.append("has_image",t),r.append("total_images","0"),r.append("customer_sgroup_id",n.customer_sgroup_id),[4,f.Z.post("/index.php?route=account/group/addPost",r,{})];case 4:s=o.sent(),o.label=5;case 5:return(null===(a=s.data)||void 0===a||null===(e=a.error)||void 0===e?void 0:e.file)?((0,p.P)(a.error.file),y(!1),[2]):(null===a||void 0===a?void 0:a.error)?(y(!1),(0,p.P)(l.error_post_the_post),[2]):(y(!1),h(""),x([]),c(),[3,7]);case 6:return o.sent(),y(!1),[3,7];case 7:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}(),C=function(e){return e.replace("www.youtube.com/embed/","https://youtu.be/").replace('<iframe width="100%" height="350" src="//'," ").replace('" allowfullscreen>',"").replace("</iframe>","").replace(/<[^>]*>/g,"")};return t?(0,i.jsx)(i.Fragment,{children:b?(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(P.Z,{})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"social-card card shadow-sm mt-4 social-card-mobile mt-2-mobile",children:(0,i.jsxs)("div",{className:"card-body",children:[(0,i.jsxs)("div",{className:"d-flex align-items-start",children:[(0,i.jsx)("div",{className:"social-item-icon social-item-icon-sm me-2",children:(0,i.jsx)(u.Z,{src:t.profile_image,alt:"profile-thumb-image",width:400,height:400,objectFit:"cover"})}),(0,i.jsx)("div",{className:"post-item-comment input-group",children:(0,i.jsx)("textarea",{className:"form-control",placeholder:l.placeholder_comment_post,"aria-label":"post-item-text","aria-describedby":"basic-addon1",rows:3,value:C(m),onChange:function(e){h(e.target.value)}})})]}),v.length>0?(0,i.jsx)(i.Fragment,{children:Object.values(v).map((function(e,t){return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"post-item-comment",children:(0,i.jsxs)("div",{className:"position-relative mt-4",children:[(0,i.jsx)(u.Z,{src:URL.createObjectURL(e.postImageData.data),alt:"cover-image",className:"social-feed-item-image",objectFit:"responsive",width:800,height:400,nowidthcheck:!0}),(0,i.jsx)("div",{className:"post-image-actions",onMouseEnter:function(e){S({opacity:1})},onMouseLeave:function(e){S({opacity:0})},children:(0,i.jsx)("div",{className:"post-upload-remove-image-button",onClick:function(){!function(e){var t,n=[];(t=n).push.apply(t,(0,N.Z)(v)),n.splice(e,1),x(n)}(t)},children:(0,i.jsx)("i",{className:"fas fa-times"})})})]})},t)})}))}):(0,i.jsx)(i.Fragment,{}),(0,i.jsxs)("div",{className:"d-flex justify-content-between mt-4",children:[(0,i.jsx)("div",{}),(0,i.jsxs)("div",{className:"d-flex flex-row-reverse",children:[(0,i.jsx)("button",{className:"btn btn-primary ms-2",onClick:Z,disabled:b||v.length<1&&!(m.length>0&&m.length<3e3),children:l.button_post}),(0,i.jsx)("input",{type:"file",multiple:!0,style:{display:"none"},onChange:k,id:"social-post-add-image-to-post"}),v.length<11&&(0,i.jsxs)("button",{className:"btn btn-outline-dark",onClick:function(){var e;null===(e=null===document||void 0===document?void 0:document.getElementById("social-post-add-image-to-post"))||void 0===e||e.click()},disabled:b,children:[(0,i.jsx)("i",{className:"far fa-images"}),(0,i.jsx)("span",{children:v.length>0?(0,i.jsx)(i.Fragment,{children:null===l||void 0===l?void 0:l.button_add_more}):(0,i.jsx)(i.Fragment,{children:l.entry_photo})})]})]})]})]})})})}):null},k=n(58533),Z=n(305),C=n(74990),F=n(75009),I=n(26042),E=n(42235),M=n(72007),O=n(53411),T=n(29831),L=n(45517),D=n(92696);var V=function(e){var t=e.header,n=e.myProfile,a=e.currentPostId,l=e.externalRefreshFunction,c=e.currentPostIndexIncrementor,d=e.postType,u=e.texts,m=e.postRespOpen,h=e.isDesktopSize,g=e.isPostType,_=e.getMoreTimline,x=e.isModalPostView,j=e.setModalPostView,b=e.isModalFullPostView,y=e.setModalFullPostView,w=e.fullFeedPostOpen,P=e.setFullFeedPostOpen,S=e.handlePostViewLikeModalOpen,k=e.setCurrentPostId,Z=e.setCurrentPostIndexIncrementor,C=e.setPostType,F=e.group,V=e.profile,R=(0,v.Ok)(),q=R.connection,z=R.sendNewComment,U=R.newCommentIsTyping,B=R.newIncomingLikes,A=R.setNewIncomingLikes,G=R.sendNewLike,J=R.newIncomingShares,W=R.setNewIncomingShares,X=(0,r.useState)(null),H=X[0],K=X[1],Q=function(){var e=(0,s.Z)((function(e){var t;return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return[4,f.Z.get("/index.php?route=account/group/getPost&sgroup_post_id=".concat(e))];case 1:return(t=n.sent()).data.post&&K(t.data.post),[2]}}))}));return function(t){return e.apply(this,arguments)}}();(0,r.useEffect)((function(){parseInt(a)>0?Q(a):Y()}),[c,a]);var Y=function(){K(null),te(!1),oe(""),ae(!1),de(!1),me("0"),ge(0),xe(0),ye(""),Se(null),Ze(!1),Ie(null),Oe(null),De(null),qe(null),Be(!1),Je(null),He(!1),Ye(null),tt(!1),ot(!1),j(!1),y(!1),at([])},$=(0,r.useState)(!1),ee=$[0],te=$[1],ne=(0,r.useState)(""),se=ne[0],oe=ne[1],ie=(0,r.useState)(!1),re=ie[0],ae=ie[1],le=(0,r.useState)(!1),ce=le[0],de=le[1],ue=(0,r.useState)("0"),pe=ue[0],me=ue[1],fe=(0,r.useState)(0),he
1=fe[0],ge=fe[1],_e=(0,r.useState)(0),ve=_e[0],xe=_e[1],je=(0,r.useState)(""),be=je[0],ye=je[1];(0,r.useEffect)((function(){H&&(te(String(null===n||void 0===n?void 0:n.customer_id)===String(H.customer_id)),oe(H.image_url),de(H.liked),me((null===H||void 0===H?void 0:H.like_count)||0),ge((null===H||void 0===H?void 0:H.comment_count)||0),xe((null===H||void 0===H?void 0:H.share_count)||0),ye(H.description),Gt(1))}),[H]);var Ne=function(e,t,n,s){var o=(0,I.Z)({},t);s?(o[e.sgroup_post_comment_id]=!0,n(o)):(delete o[e.sgroup_post_comment_id],n(o))},we=(0,r.useState)(null),Pe=we[0],Se=we[1],ke=(0,r.useState)(!1),Ze=(ke[0],ke[1]),Ce=(0,r.useState)(null),Fe=Ce[0],Ie=Ce[1],Ee=(0,r.useState)(null),Me=Ee[0],Oe=Ee[1],Te=(0,r.useState)(null),Le=Te[0],De=Te[1],Ve=(0,r.useState)(null),Re=Ve[0],qe=Ve[1],ze=(0,r.useState)(!1),Ue=ze[0],Be=ze[1],Ae=(0,r.useState)(null),Ge=Ae[0],Je=Ae[1],We=(0,r.useState)(!1),Xe=We[0],He=We[1],Ke=(0,r.useState)(null),Qe=Ke[0],Ye=Ke[1],$e=(0,r.useState)(!1),et=$e[0],tt=$e[1],nt=(0,r.useState)(!1),st=nt[0],ot=nt[1],it=(0,r.useState)([]),rt=it[0],at=it[1],lt=(0,r.useState)(""),ct=lt[0],dt=lt[1],ut=(0,r.useState)({}),pt=ut[0],mt=ut[1],ft=(0,r.useState)(null),ht=ft[0],gt=ft[1],_t=(0,r.useState)(""),vt=_t[0],xt=_t[1],jt=(0,r.useState)(0),bt=jt[0],yt=jt[1],Nt=(0,r.useState)(!0),wt=Nt[0],Pt=Nt[1],St=(0,r.useState)(!0),kt=(St[0],St[1]),Zt=function(){var e,t,n;(Y(),h)?null===(e=null===document||void 0===document?void 0:document.getElementById("bn close-modal-post-full"))||void 0===e||e.click():(null===(t=null===document||void 0===document?void 0:document.getElementById("close-modal-post-view"))||void 0===t||t.click(),null===(n=null===document||void 0===document?void 0:document.getElementById("close-modal-full-post-view-group"))||void 0===n||n.click())},Ct=function(){var e=(0,s.Z)((function(){var e;return(0,o.__generator)(this,(function(t){switch(t.label){case 0:return[4,f.Z.get("/index.php?route=account/group/getPost&sgroup_post_id=".concat(a))];case 1:return(e=t.sent()).data.post&&(K(e.data.post),l("UPDATE"),_(1)),[2]}}))}));return function(){return e.apply(this,arguments)}}(),Ft=function(){var e=(0,s.Z)((function(){var e;return(0,o.__generator)(this,(function(t){switch(t.label){case 0:return[4,f.Z.get("/index.php?route=account/group/getPost&sgroup_post_id=".concat(a))];case 1:return(e=t.sent()).data.post&&(K(e.data.post),_(1)),[2]}}))}));return function(){return e.apply(this,arguments)}}(),It=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Oe(null),Ie(null),1==e?Oe(null===Me?null===H||void 0===H?void 0:H.sgroup_post_id:null):Ie(null===Fe?null===H||void 0===H?void 0:H.sgroup_post_id:null)},Et=(0,r.useCallback)((function(e){j(!1),function(e){ye(e.description),oe(e.image_url)}(e),ae(!0)}),[]),Mt=function(){var e=(0,s.Z)((function(e){var t,n,s,i,r;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),Ze(!0),n=se&&(null===e||void 0===e?void 0:e.image_url)!==se||null===(null===e||void 0===e?void 0:e.image_url)&&se,(s=new FormData).append("sgroup_post_id",null===e||void 0===e?void 0:e.sgroup_post_id),s.append("description",be?(a=be)?a.replace("www.youtube.com/embed/","https://youtu.be/").replace('<iframe width="100%" height="350" src="//'," ").replace('" allowfullscreen>',"").replace("</iframe>","").replace(/<[^>]*>/g,""):"":""),s.append("new_image",n?"1":"0"),s.append("remove_image",se?"0":"1"),n&&s.append("file",Pe),[4,f.Z.post("/index.php?route=account/group/editPost",s,{})];case 1:return(i=o.sent()).data.error?(void 0!==i.data.error[0]?(0,p.P)(i.data.error[0]):(0,p.P)(u.error_update_post),Y(),[2]):(null===(t=null===document||void 0===document?void 0:document.getElementById("close-modal-post-edit-".concat(7)))||void 0===t||t.click(),Y(),Ct(),(0,p.b)(u.success_update_post),[3,3]);case 2:return o.sent(),null===(r=null===document||void 0===document?void 0:document.getElementById("close-modal-post-edit-".concat(7)))||void 0===r||r.click(),Y(),(0,p.P)(u.error_update_post),[3,3];case 3:return[2]}var a}))}));return function(t){return e.apply(this,arguments)}}(),Ot=function(){var e,t;(Y(),b)?(null===(e=document.getElementById("close-modal-full-post-view"))||void 0===e||e.click(),y(!1)):(null===(t=document.getElementById("close-modal-post-view"))||void 0===t||t.click(),j(!1));l("DELETE"),_(1)},Tt=function(){var e=(0,s.Z)((function(){var e=arguments;return(0,o.__generator)(this,(function(t){switch(t.label){case 0:e.length>0&&void 0!==e[0]&&e[0],t.label=1;case 1:return t.trys.push([1,3,,4]),Ze(!0),[4,f.Z.get("/index.php?route=account/group/deletePost&sgroup_post_id=".concat(H.sgroup_post_id),{})];case 2:return t.sent().data.error?((0,p.P)(u.error_delete_post),Ze(!1),[2]):(Ot(),Ze(!1),(0,p.b)(u.succes_delete_post),[3,4]);case 3:return t.sent(),(0,p.P)(u.error_delete_post),Ze(!1),[3,4];case 4:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}(),Lt=function(){var e=(0,s.Z)((function(){return(0,o.__generator)(this,(function(e){switch(e.label){case 0:me(String(ce?Number(pe)-1:Number(pe)+1)),de(!ce),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,f.Z.get("/index.php?route=account/group/setPostLike&sgroup_post_id=".concat(H.sgroup_post_id),{})];case 2:return 200!==e.sent().status?((0,p.P)(u.error_like),Dt(),[2]):(G(H.sgroup_post_id,"group_post"),Ct(),[3,4]);case 3:return e.sent(),(0,p.P)(u.error_like_post),Dt(),[3,4];case 4:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),Dt=function(){var e=(0,s.Z)((function(){return(0,o.__generator)(this,(function(e){return me(String(ce?Number(pe)+1:Number(pe)-1)),de(!ce),[2]}))}));return function(){return e.apply(this,arguments)}}(),Vt=function(e){De(e)},Rt=function(){De(null)},qt=function(){ot(!1),Ye(null),Ie(null),Oe(null)},zt=function(){kt(!0),_(1)},Ut=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Ie(null),Oe(null),setTimeout((function(){Ye(e),ot(!0),tt(t)}),500)},Bt=(0,r.useCallback)((function(e){Zt(),setTimeout((function(){Ut(e)}),500)}),[]),At=function(e){ge(Number(he)+e),Ct(),Ie(null),Oe(null)},Gt=function(){var e=(0,s.Z)((function(e){var t,n,s;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return e&&at([]),(null===H||void 0===H?void 0:H.sgroup_post_id)?[4,f.Z.get("/index.php?route=account/group/getComments&sgroup_post_id=".concat(H.sgroup_post_id,"&page=").concat(null!==e&&void 0!==e?e:bt+1),{})]:[3,2];case 1:if(t=o.sent().data,!(n=t.comments)||0===n.length)return Pt(!1),kt(!1),[2];s=1===e?(0,N.Z)(n):(0,N.Z)(rt).concat((0,N.Z)(n)),at(s),yt(e?1:bt+1),Pt(!0),kt(!1),o.label=2;case 2:return[2]}}
1))}));return function(t){return e.apply(this,arguments)}}(),Jt=(0,r.useState)(!1),Wt=Jt[0],Xt=Jt[1];(0,r.useEffect)((function(){if(q&&Wt){var e=JSON.stringify({from_customer_id:null===n||void 0===n?void 0:n.customer_id,post_id:"sgroup_post_share"==(null===H||void 0===H?void 0:H.post_type)?null===H||void 0===H?void 0:H.sgroup_post_shared_id:null===H||void 0===H?void 0:H.sgroup_post_id,post_type:"group_post",message_type:"comment_typing"});q.send(JSON.stringify({action:"CommentsIsTyping",message:e}))}}),[Wt]);var Ht=function(e){dt(e.target.value),Wt||(Xt(!0),setTimeout((function(){Xt(!1)}),2500))},Kt=function(){var e=(0,s.Z)((function(){var e,t,n,s,i;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===ct.length||ct.length>3e3?[2]:((t=new FormData).append("sgroup_post_id",H.sgroup_post_id),t.append("description",ct),[4,f.Z.post("/index.php?route=account/group/addComment",t,{})]);case 1:return 200!==(n=o.sent()).status?((0,p.P)(u.error_add_comment),[2]):((null===n||void 0===n||null===(e=n.data)||void 0===e?void 0:e.comment_info)?(z(null===H||void 0===H?void 0:H.sgroup_post_id,"group_post",n.data.comment_info),s=rt,(i=n.data.comment_info).my_comment=!0,s.unshift(i),at(s)):(kt(!0),at([]),yt(0),Pt(!0),Gt(1)),dt(""),At(1),[3,3]);case 2:return o.sent(),(0,p.P)(u.error_add_comment),[3,3];case 3:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}(),Qt=function(){var e=(0,s.Z)((function(e){var t,n,s,i,r;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:-1!==(t=rt.findIndex((function(t){return String(t.sgroup_post_comment_id)===String(e.sgroup_post_comment_id)})))&&(n=rt[t],rt[t].liked_comment?(n.liked_comment=!1,n.like_count=String(parseInt(n.like_count)-1)):(n.liked_comment=!0,n.like_count=String(parseInt(n.like_count)+1)),s=(0,N.Z)(rt.slice(0,t)).concat([n],(0,N.Z)(rt.slice(t+1,rt.length))),at(s)),o.label=1;case 1:return o.trys.push([1,3,,4]),(i=new FormData).append("sgroup_post_comment_id",e.sgroup_post_comment_id),[4,f.Z.post("/index.php?route=account/group/setCommentLike",i,{})];case 2:return r=o.sent(),r.data.error?((0,p.P)(u.error_like),[2]):[3,4];case 3:return o.sent(),(0,p.P)(u.error_like_comment),[3,4];case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),Yt=function(e){gt(e),xt(e.description)},$t=function(){gt(null),xt("")},en=function(e){xt(e.target.value)},tn=function(){var e=(0,s.Z)((function(e){var t;return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),0===vt.length||vt.length>3e3?[2]:((t=new FormData).append("sgroup_post_comment_id",e.sgroup_post_comment_id),t.append("description",vt),Ne(e,pt,mt,!0),[4,f.Z.post("/index.php?route=account/group/editComment",t,{})]);case 1:return n.sent().data.error?((0,p.P)(u.error_update_comment),Ne(e,pt,mt,!1),[2]):(function(e){var t=(0,N.Z)(rt).map((function(t){return t.sgroup_post_comment_id!==e.sgroup_post_comment_id||(t.description=vt),t}));at(t)}(e),$t(),Ne(e,pt,mt,!1),(0,p.b)(u.success_update_comment),[3,3]);case 2:return n.sent(),(0,p.P)(u.error_update_comment),Ne(e,pt,mt,!1),[3,3];case 3:return[2]}}
1))}));return function(t){return e.apply(this,arguments)}}(),nn=function(){var e=(0,s.Z)((function(e,t){return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),Ne(e,pt,mt,!0),[4,f.Z.get("/index.php?route=account/group/".concat(t?"deleteCommentAsPostOwner":"deleteComment","&sgroup_post_comment_id=").concat(e.sgroup_post_comment_id),{})];case 1:return n.sent().data.error?((0,p.P)(u.error_delete_comment),Ne(e,pt,mt,!1),[2]):(function(e){var t=(0,N.Z)(rt).filter((function(t){return t.sgroup_post_comment_id!==e.sgroup_post_comment_id}));at(t)}(e),Ne(e,pt,mt,!1),At(-1),(0,p.b)(u.success_delete_comment),[3,3]);case 2:return n.sent(),(0,p.P)(u.error_delete_comment),Ne(e,pt,mt,!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}(),sn=(0,r.useState)(!1),on=sn[0],rn=sn[1];(0,r.useEffect)((function(){if(U&&void 0!=U){var e=null===H||void 0===H?void 0:H.sgroup_post_id;"sgroup_post_share"==(null===H||void 0===H?void 0:H.post_type)&&(e=null===H||void 0===H?void 0:H.sgroup_post_shared_id),parseInt(null===U||void 0===U?void 0:U.post_id)==parseInt(e)&&"group_post"==(null===U||void 0===U?void 0:U.post_type)&&(rn(!0),setTimeout((function(){rn(!1)}),2500))}}),[U]);var an=function(e){f.Z.get("/index.php?route=account/group/getPost&sgroup_post_id=".concat(e)).then((function(e){var t,n,s;e.data.post&&(me((null===(t=e.data.post)||void 0===t?void 0:t.like_count)||0),xe((null===(n=e.data.post)||void 0===n?void 0:n.share_count)||0),ge((null===(s=e.data.post)||void 0===s?void 0:s.comment_count)||0))})).catch((function(e){}))};return(0,r.useEffect)((function(){B&&void 0!==B&&(null===B||void 0===B?void 0:B.post_id)==(null===H||void 0===H?void 0:H.sgroup_post_id)&&"group_post"==(null===B||void 0===B?void 0:B.post_type)&&(an(null===B||void 0===B?void 0:B.post_id),setTimeout((function(){A([])}),50)),J&&void 0!==J&&(null===J||void 0===J?void 0:J.post_id)==(null===H||void 0===H?void 0:H.sgroup_post_id)&&"group_post"==(null===J||void 0===J?void 0:J.post_type)&&(an(null===J||void 0===J?void 0:J.post_id),setTimeout((function(){W([])}),50))}),[B,J]),(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"feed-timeline-container position-relative",children:[(0,i.jsx)(E.Z,{header:t,post:H,myProfile:n,handlePostClose:Zt,handleDeletePost:Ot,handleUpdatePost:Ct,handlePostViewLikeOpen:Vt,postType:"group",texts:u,postRespOpen:m,externalRefreshFunction:l,fullFeedPostOpen:w,setFullFeedPostOpen:P,group:F,profile:V}),(0,i.jsx)(M.Z,{post:H,currentPostId:a,myProfile:n,postType:d,isPostType:g,handlePostClose:Zt,toggleModal:It,handleLikePost:Lt,texts:u,isSharedPost:!1,comments:rt,isShare:"post_share"==(null===H||void 0===H?void 0:H.post_type),setComments:at,updateCommentCount:At,getMoreComments:Gt,hasMore:wt,handleNewCommentEdit:Ht,newComment:ct,editedComment:ht,handleLikeComment:Qt,handleSubmitComment:Kt,handleEditComment:Yt,handleEditReset:$t,actionUpdate:tn,editedCommentDescription:vt,handleEditedCommentEdit:en,actionDeleteComment:nn,actionDelete:Tt,handleSharePostOpen:function(e){qe(e),Be(!0)},postShareView:Re,handlePostShareClose:function(){qe(null),Be(!1),Ie(null)},handleSharePost:zt,postShareModalView:Ue,isPostOwner:ee,isPostOptionsModalVisible:Fe,setPostOptionsModalVisible:Ie,handlePostReportClose:qt,onOpen2ndReportModal:Bt,isModalPostView:x,onOpen3rdModal:Et,someoneIsTyping:on,uniqueId:7}),(0,i.jsx)(O.Z,{post:H,setPost:K,isModalFullPostView:b,setModalFullPostView:y,removePostData:Y,toggleModal:It,isSharedPost:!1,postImage:se,likeCount:pe,commentCount:he,updateCommentCount:At,shareCount:ve,postLiked:ce,handleLikePost:Lt,myProfile:n,handleNewCommentEdit:Ht,newComment:ct,handleSubmitComment:Kt,comments:rt,setComments:at,getMoreComments:Gt,hasMore:wt,editedComment:ht,handleEditedCommentEdit:en,editedCommentDescription:vt,handleEditReset:$t,actionUpdate:tn,handleEditComment:Yt,actionDeleteComment:nn,handleLikeComment:Qt,commentLocks:pt,handleSharePostOpen:function(e){Je(e),He(!0)},postShareView:Ge,postShareModalView:Xe,handlePostShareClose:function(){Je(null),He(!1),Oe(null)},handleSharePost:zt,isPostFullOptionsModalVisible:Me,setPostFullOptionsModalVisible:Oe,isPostOwner:ee,actionDelete:Tt,onOpen3rdModal:Et,onOpen2ndReportModal:Bt,postViewLikeView:Le,handlePostViewLikeOpen:Vt,handlePostViewLikeClose:Rt,header:t,handleUpdatePost:Ct,handleUpdateAlbumPost:Ft,handleDeletePost:Ot,handleReportPostOpen:Ut,handlePostViewLikeModalOpen:S,setCurrentPostId:k,setCurrentPostIndexIncrementor:Z,currentPostIndexIncrementor:c,setPostType:C,setModalPostView:j,isDesktopSize:h,setFullFeedPostOpen:P,group:F,profile:V,uniqueId:7,someoneIsTyping:on,texts:u}),(0,i.jsx)(T.Z,{post:Le,postType:"group",handlePostViewLikeClose:Rt,texts:u}),(0,i.jsx)(L.Z,{post:Qe,postType:"group",handlePostReportClose:qt,handleReportPost:function(){Ct()},postShareReportView:et,postReportModalView:st,texts:u}),(0,i.jsx)(D.Z,{item:H,postEdited:re,isSharedPost:!1,handleCancelEditPost:function(e){oe(e.image_url),Se(null),ye(e.description),ae(!1)},editedDescription:be,onEditedDescriptionChange:function(e){ye(e.target.value)},postImage:se,handleChangePostImage:function(e){if(e.target.files[0].size>2e7)(0,p.P)(u.error_file_too_big_single);else{var t=e.target.files[0],n=URL.createObjectURL(e.target.files[0]);Se(t),oe(n)}},handleRemovePostImage:function(){oe(null),Se(null)},actionUpdatePost:Mt,isShare:!1,isModalFullPostView:b,setModalFullPostView:y,postEditedIsShared:!1,actionUpdateSharedPost:function(){},onEditedShareDescriptionChange:function(){},editedShareDescription:function(){},handleCancelEditPostFull:function(e){ae(!1),Oe(null),Ie(null),y(!1),Y()},uniqueId:7,postType:"group",texts:u})]})})},R=n(8004),q=n(69396),z=n(828),U=n(97998),B=n(81472),A=n(23213),G=function(e){var t=e.isModalFeedPostOptions,n=e.setModalFeedPostOptions,s=e.isModalPostOwner,o=e.editablePost,a=e.actionDelete,l=e.onOpen3rdModal,c=e.onOpen2ndReportModal,d=e.post,u=e.texts;(0,r.useEffect)((function(){t?g({canceled:!1}):_()}),[t]);var p=2e3,m=(0,z.Z)((0,B.useSpring)((function(){return{y:p}})),2),f=m[0].y,h=m[1],g=function(e){var t=e.canceled;h.start({y:0,immediate:!1,config:t?B.config.wobbly:B.config.stiff})},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;n(null),h.start({y:p,immediate:!1,config:(0,q.Z)((0,I.Z)({},B.config.stiff),{velocity:e})})},v=(0,U.useDrag)((function(e){var t=e.last,n=(0,z.Z)(e.velocity,2)[1],s=(0,z.Z)(e.direction,2)[1],o=(0,z.Z)(e.movement,2)[1],i=e.cancel,r=e.canceled;o<-70&&i(),t?o>800||n>1.2&&s>0?_(n):g({canceled:r}):h.start({y:o,immediate:!0})}),{from:function(){return[0,f.get()]},filterTaps:!0,bounds:{top:0},rubberband:!0}),x=f.to((function(e){return e<p?"flex":"none"})),j=(0,r.useState)(!1),b=j[0],y=j[1];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"flex modal
1-feed-head-options",style:{overflow:"hidden"},children:(0,i.jsx)(B.a.div,(0,q.Z)((0,I.Z)({className:"modal-feed-head-options-cont"},v()),{style:{display:x,bottom:"0px",y:f,backgroundColor:"rgba(34, 41, 47, 0.4)"},children:(0,i.jsxs)("div",{className:"modal-feed-head-options-main",children:[(0,i.jsx)("div",{className:"modal-feed-head-options-grip-line mt-2 mb-2"}),(0,i.jsxs)("div",{className:"ps-2 pe-2 w-100",children:[(0,i.jsxs)("div",{className:"modal-feed-head-options-btn-cont p-3 mb-3",children:[s&&o.includes(null===d||void 0===d?void 0:d.post_type)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"modal-feed-head-options-btn mb-2",onClick:function(){_(),setTimeout((function(){l(d)}),200)},"data-bs-toggle":"modal","data-bs-target":"#modal-feed-post-edit-".concat(d.sgroup_post_id),children:[(0,i.jsx)("div",{className:"social-feed-head-profile-options-icon",children:(0,i.jsx)("i",{className:"fas fa-pen",style:{fontSize:14}})}),(0,i.jsx)("span",{className:"ms-2",children:u.button_edit})]})}),s&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"modal-feed-head-options-btn",onClick:function(){setTimeout((function(){y(!0)}),200)},children:[(0,i.jsx)("div",{className:"social-feed-head-profile-options-icon",children:(0,i.jsx)("i",{className:"fas fa-minus",style:{fontSize:14}})}),(0,i.jsx)("span",{className:"ms-2",children:u.button_delete})]})}),!s&&(0,i.jsx)(i.Fragment,{children:(null===d||void 0===d?void 0:d.reported)?(0,i.jsxs)("div",{className:"modal-feed-head-options-btn",children:[(0,i.jsx)("div",{className:"social-feed-head-profile-options-icon social-feed-head-profile-options-icon-reported",children:(0,i.jsx)("i",{className:"fas fa-exclamation",style:{fontSize:14}})}),(0,i.jsx)("span",{className:"ms-2 social-feed-head-profile-options-text-reported",children:u.button_report_sent})]}):(0,i.jsxs)("div",{className:"modal-feed-head-options-btn",onClick:function(){_(),setTimeout((function(){c(d)}),200)},"data-bs-toggle":"modal","data-bs-target":"#modal-post-report",children:[(0,i.jsx)("div",{className:"social-feed-head-profile-options-icon",children:(0,i.jsx)("i",{className:"fas fa-exclamation",style:{fontSize:14}})}),(0,i.jsx)("span",{className:"ms-2",children:u.button_report})]})})]}),(0,i.jsx)("div",{className:"modal-feed-head-options-btn-cont p-3",children:(0,i.jsxs)("div",{className:"modal-feed-head-options-btn",onClick:function(){_()},children:[(0,i.jsx)("div",{className:"social-feed-head-profile-options-icon",children:(0,i.jsx)("i",{className:"fas fa-times",style:{fontSize:14}})}),(0,i.jsx)("span",{className:"ms-2",children:u.button_cancel})]})})]})]})}))}),(0,i.jsx)(A.Z,{isModalDeleteConfirmation:b,setModalDeleteConfirmation:y,actionDelete:function(){_(),setTimeout((function(){a()}),150)}})]})},J=["post","uploaded_image","post_share","sgroup_post_share","event_post_share","album_share"];var W=function(e){var t,n,a=function(){return window.innerWidth>=992},l=e.group,c=e.profile,d=e.myProfile,u=e.header,m=(0,r.useState)([]),h=m[0],g=m[1],_=(0,r.useState)(!0),v=_[0],x=_[1],j=(0,r.useState)(0),b=j[0],y=j[1],I=(0,r.useState)(!0),E=I[0],M=I[1],O=(0,r.useState)(null),T=O[0],L=O[1],D=(0,r.useState)(!1),q=D[0],z=(D[1],(0,r.useState)(!1)),U=z[0],B=z[1],A=(0,r.useState)(null),W=A[0],X=A[1],H=(0,r.useState)(null),K=H[0],Q=H[1],Y=(0,r.useState)(null),$=Y[0],ee=Y[1],te=(0,r.useState)(!1),ne=te[0],se=te[1],oe=(0,r.useState)(!1),ie=oe[0],re=oe[1],ae=(0,r.useState)(null),le=ae[0],ce=ae[1],de=(0,r.useState)(!1),ue=de[0],pe=de[1],me=(0,r.useState)(!1),fe=me[0],he=me[1];(0,r.useEffect)((function(){x(!0),ge(1)}),[]),(0,r.useEffect)((function(){!0===U?setTimeout((function(){document.body.style.overflow="hidden"}),150):setTimeout((function(){document.body.style.overflow="auto"}),150)}),[U]);var ge=function(){var e=(0,s.Z)((function(e){var t,n,s;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return[4,f.Z.get("/index.php?route=account/group/getTimeline&customer_sgroup_id=".concat(l.customer_sgroup_id,"&page=").concat(null!==e&&void 0!==e?e:b+1,"&version=2"))];case 1:return t=o.sent().data,(n=t.timeline)&&0!==n.length?(s=1===e?(0,N.Z)(n):(0,N.Z)(h).concat((0,N.Z)(n)),g(s),y(b+1),x(!1),[2]):(M(!1),x(!1),[2])}}))}));return function(t){return e.apply(this,arguments)}}(),_e=function(){var e=(0,s.Z)((function(e){var t,n,s;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return[4,f.Z.get("/index.php?route=account/group/getPost&sgroup_post_id=".concat(null===e||void 0===e?void 0:e.sgroup_post_id))];case 1:return(t=o.sent().data).post&&(n=h.findIndex((function(t){return String(t.sgroup_post_id)===String(null===e||void 0===e?void 0:e.sgroup_post_id)})),(s=(0,N.Z)(h))[n]=t.post,g(s)),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),ve=function(e){var t=h.findIndex((function(t){return String(t.sgroup_post_id)===String(e)})),n=(0,N.Z)(h.slice(0,t)).concat((0,N.Z)(h.slice(t+1,h.length)));g(n)},xe=function(e){X(e)},je=function(e){Q(e)},be=function(e){var t;null===(t=null===document||void 0===document?void 0:document.getElementsByTagName("body")[0])||void 0===t||t.classList.add("open-like-mobile"),ee(e),se(!0)},ye=function(e){Q(e),re(!0)},Ne=(0,r.useState)("0"),we=Ne[0],Pe=Ne[1],Se=(0,r.useState)(0),ke=Se[0],Ze=Se[1],Ce=(0,r.useState)(!1),Fe=Ce[0],Ie=Ce[1],Ee=(0,r.useState)(!1),Me=Ee[0],Oe=Ee[1],Te=(0,r.useState)(!1),Le=Te[0],De=Te[1],Ve=function(){var e=(0,r.useState)(a),t=e[0],n=e[1];return(0,r.useEffect)((function(){function e(){n(a())}return window.addEventListener("resize",e),e(),function(){return window.removeEventListener("resize",e)}}),[]),t}(),Re=function(){var e=(0,s.Z)((function(){return(0,o.__generator)(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,f.Z.get("/index.php?route=account/group/deletePost&sgroup_post_id=".concat(null===le||void 0===le?void 0:le.sgroup_post_id),{})];case 1:return e.sent().data.error?((0,p.P)(l.texts.error_delete_post),[2]):(ve(null===le||void 0===le?void 0:le.sgroup_post_id),(0,p.b)(l.texts.succes_delete_post),[3,3]);case 2:return e.sent(),(0,p.P)(l.texts.error_delete_post),[3,3];case 3:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}(),qe=(0,r.useCallback)((function(e){ze(e)}),[]),ze=function(e){he(!0)},Ue=(0,r.useCallback)((function(e){setTimeout((function(){xe(e)}),500)}),[]);return(0,i.jsxs)("div",{className:"feed-timeline-container position-relative mb-4",children:[(l.is_admin||l.in_group)&&(0,i.jsx)(i.Fragment,{children:parseInt(d.access_permissions)>0&&(0,i.jsx)(S,{profile:c,group:l,actions:{handleNewPost:function(){x(!0),g([]),y(0),M(!0),ge(1)}},texts:l.texts})}),v?(0,i.jsx)(P.Z,{}):h.length>0?(0,i.jsx)(k.Z,{dataLength:h.length,next:ge,hasMore:E,loader:(0,i.jsx)(P.Z,{}),style:{overflow:"visible"},endMessage:(0,i.jsxs)("div",{className:"scroll-end-cont",children:[(0,i.jsx)("div",{className:"scroll-end-text-first",children:null===u||void 0===u||null===(t=u.texts)||void 0===t?void 0:t.text_navigation_end_first}),(0,i.jsx)("div",{className:"scroll-end-text",children:null===u||void 0===u||null===(n=u.texts)||void 0===n?void 0:n.text_navigation_end})]}),children:h.map((function(e,t){return(0,i.jsx)(w.Z,{item:e,group:l,myProfile:d,actions:{handleUpdatePost:_e,handleDeletePost:ve,handleReportPostOpen:xe,handlePostViewLikeOpen:je,handlePostViewLikeModalOpen:ye,handleSharePostOpen:be,setCurrentPostId:Pe,setCurrentPostIndexIncrementor:Ze,currentPostIndexIncrementor:ke,setPostView:L,setPostType:De,setModalPostView:Ie,setModalFullPostView:Oe,isDesktopSize:Ve,setFullFeedPostOpen:B},modalOptions:{isModalFeedPostOptions:le,setModalFeedPostOptions:ce,setModalPostOwner:pe,postModalEdited:fe,setPostModalEdited:he},header:u,texts:l.texts},e.sgroup_post_id)}))}):null,(0,i.jsx)(V,{header:u,myProfile:d,currentPostIndexIncrementor:ke,currentPostId:we,externalRefreshFunction:function(e){"DELETE"==e?ve(we):"UPDATE"==e&&_e(T)},postRespOpen:q,isDesktopSize:Ve,isPostType:Le,getMoreTimline:ge,postType:"group",isModalPostView:Fe,setModalPostView:Ie,isModalFullPostView:Me,setModalFullPostView:Oe,fullFeedPostOpen:U,setFullFeedPostOpen:B,handlePostViewLikeModalOpen:ye,setCurrentPostId:Pe,setCurrentPostIndexIncrementor:Ze,setPostType:De,group:l,profile:c,texts:l.texts}),(0,i.jsx)(Z.Z,{post:W,postType:"group",handlePostReportClose:function(){X(null)},handleReportPost:function(e){var t=h.findIndex((function(t){return String(t.sgroup_post_id)===String(e.sgroup_post_id)})),n=(0,N.Z)(h.slice(0,t)).concat([e],(0,N.Z)(h.slice(t+1,h.length)));g(n)},texts:l.texts}),(0,i.jsx)(C.Z,{post:K,postType:"group",handlePostViewLikeClose:function(){Q(null)},texts:l.texts,myProfile:d}),(0,i.jsx)(R.Z,{post:K,postType:"group",isShare:!1,openLikes:ie,setOpenLikes:re,handlePostViewLikeModalClose:function(){Q(null),re(!1)},myProfile:d,texts:l.texts}),(0,i.jsx)(F.Z,{post:$,postShareOpen:ne,postType:"group",handlePostShareClose:function(){var e;null===(e=null===document||void 0===document?void 0:document.getElementsByTagName("body")[0])||void 0===e||e.classList.remove("open-like-mobile"),ee(null),se(!1)},texts:l.texts}),(0,i.jsx)(G,{isModalFeedPostOptions:le,setModalFeedPostOptions:ce,isModalPostOwner:ue,editablePost:J,actionDelete:Re,onOpen3rdModal:qe,onOpen2ndReportModal:Ue,post:le,texts:l.texts})]})},X=n(66435),H=n(17435),K=n(31267);var Q=!0,Y=function(e){var t=e.session_token,n=e.group,a=e.myProfile;(0,H.Z)({session_token:t});var u=(0,X.SJ)().nav,m=(0,r.useState)(n),g=m[0],v=m[1],x=(0,r.useState)(null),j=x[0],N=x[1],w=(0,r.useState)(!0),P=(w[0],w[1]),S=(0,d.useRouter)();(0,r.useEffect)((function(){var e=S.asPath;(0,K.Z)({redirect_url:e})}),[]);var k=S.query;(0,r.useEffect)((function(){Z()}),[]);var Z=function(){var e=(0,s.Z)((function(){var e;return(0,o.__generator)(this,(function(t){switch(t.label){case 0:return P(!0),[4,f.Z.get("/index.php?route=account/profile&customer_id=".concat(g.my_customer_id))];case 1:return(e=t.sent().data)&&N(e),P(!1),[2]}}))}));return function(){return e.apply(this,arguments)}}(),C=function(){var e=(0,s.Z)((function(){var e;return(0,o.__generator)(this,(function(t){switch(t.label){case 0:return[4,f.Z.get("/index.php?route=account/group/info&slug=".concat(encodeURI(k.id)))];case 1:return e=t.sent().data,v(e),[2]}}))}));return function(){return e.apply(this,arguments)}}(),F=function(){var e=(0,s.Z)((function(e){return(0,o.__generator)(this,(function(t){switch(t.label){case 0:return[4,f.Z.get("/index.php?route=account/group/joinGroup&customer_sgroup_id=".concat(e.customer_sgroup_id))];case 1:return t.sent().data.success?((0,p.b)(e.texts.succes_group_toast_1+e.title+e.texts.succes__group_toast_1_1),C()):(0,p.P)(e.texts.error_group_toast_1+e.title+e.texts.error_group_toast_1_1),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),I="0"===g.visibility;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(l(),{children:[(0,i.jsx)("meta",{httpEquiv:"C
1ontent-Type",content:"text/html; charset=utf-8"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,i.jsx)("meta",{httpEquiv:"X-UA-Compatible",content:"IE=edge"}),(0,i.jsx)("title",{children:g.title}),(0,i.jsx)("meta",{name:"description",content:g.description.slice(0,110)+"..."}),(0,i.jsx)("meta",{property:"og:image",content:g.profile_image}),(0,i.jsx)("meta",{property:"og:image:width",content:"400"}),(0,i.jsx)("meta",{property:"og:image:height",content:"400"}),(0,i.jsx)("meta",{property:"og:title",content:g.title}),(0,i.jsx)("meta",{property:"og:type",content:"website"}),(0,i.jsx)("meta",{property:"og:description",content:g.description.slice(0,110)+"..."})]}),(0,i.jsx)(c.Z,{}),(0,i.jsx)("main",{id:"content",children:(0,i.jsx)("div",{className:"container",children:(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("div",{className:"col-12 mt-4 mt-0-mobile container-mobile",children:(0,i.jsx)(h,{profile:g,texts:g.texts})}),(0,i.jsx)("div",{className:"col-12",children:(0,i.jsxs)("div",{className:"row row-half",children:[(0,i.jsxs)("div",{className:"col-lg-3 col-12 col-half feed-order-1 container-mobile",children:[(0,i.jsxs)("button",{className:"btn btn-primary btn-sm mt-4 mt-2-mobile",onClick:function(){return S.back()},children:[(0,i.jsx)("i",{className:"fas fa-arrow-left"}),(0,i.jsx)("span",{children:g.texts.button_back})]}),a.logged?(0,i.jsxs)(i.Fragment,{children:[!g.is_admin&&!g.in_group&&parseInt(a.access_permissions)>0?(0,i.jsx)("div",{className:"social-feed-profile-details card shadow-sm mt-4",children:(0,i.jsx)("div",{className:"card-body",children:(0,i.jsx)("button",{className:"btn btn-primary w-100",onClick:function(){return F(g)},children:g.texts.button_enter_group})})}):(0,i.jsx)(i.Fragment,{}),!g.is_admin&&g.in_group&&(0,i.jsx)("div",{className:"social-feed-profile-details card social-card shadow-sm mt-4",children:(0,i.jsxs)("div",{className:"card-body",children:[(0,i.jsx)(y.Z,{refreshGroups:C,group:g,texts:g.texts}),(0,i.jsx)("button",{className:"btn btn-primary w-100","data-bs-toggle":"modal","data-bs-target":"#modal-group-leave",children:g.texts.button_leave_group})]})})]}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"social-feed-profile-details card shadow-sm mt-4",children:(0,i.jsxs)("div",{className:"card-body text-center",children:[(0,i.jsx)("div",{children:g.texts.text_login_to_enter_group}),(0,i.jsx)(_(),{href:"/login",children:(0,i.jsx)("a",{className:"btn btn-primary w-100 mt-4",children:g.texts.button_login})})]})})}),(0,i.jsxs)("div",{className:"social-feed-profile-details card social-card shadow-sm social-feed-details-mobile mt-4 mt-2-mobile",children:[(0,i.jsx)("h5",{className:"card-header",children:g.texts.text_group_details}),(0,i.jsxs)("div",{className:"card-body",children:[(0,i.jsx)("p",{className:"card-text",children:(0,i.jsx)("b",{children:"".concat(g.title)})}),(0,i.jsx)("p",{className:"card-text",children:(0,i.jsx)("b",{children:"".concat("0"===g.visibility?g.texts.entry_visibility_private:g.texts.entry_visibility_public)})}),(0,i.jsxs)("p",{className:"card-text mt-2",children:[g.texts.entry_posts," ","".concat(g.total_posts)]}),(0,i.jsxs)("p",{className:"card-text",children:[g.texts.entry_comments," ","".concat(g.total_comments)]}),(0,i.jsx)("p",{className:"card-text mt-2",children:(0,i.jsx)("b",{children:g.texts.entry_description})}),(0,i.jsx)("p",{className:"card-text mt-2",dangerouslySetInnerHTML:{__html:g.description}})]})]})]}),(0,i.jsx)("div",{className:"".concat(a.logged?"col-lg-6":"col-lg-9"," col-12 col-half feed-order-3 container-mobile"),children:a.logged?(0,i.jsx)(i.Fragment,{children:j&&(0,i.jsx)(i.Fragment,{children:I&&g.in_group||!I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{id:"trigger-modal-group-post-full","data-bs-toggle":"modal","data-bs-target":"#modal-post-full"}),(0,i.jsx)(W,{group:g,profile:j,myProfile:a,header:null===u||void 0===u?void 0:u.header})]}):(0,i.jsx)("div",{className:"card social-card shadow-sm mt-4",children:(0,i.jsx)("div",{className:"card-body",children:(0,i.jsxs)("p",{className:"mt-2",style:{textAlign:"center"},children:[(0,i.jsx)("i",{className:"fas fa-lock"}),(0,i.jsx)("b",{className:"ms-2",children:g.texts.text_enter_group_private})]})})})})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"social-feed-profile-details card shadow-sm mt-4",children:(0,i.jsxs)("div",{className:"card-body text-center",children:[(0,i.jsx)("div",{children:g.texts.text_login_to_see_posts}),(0,i.jsx)(_(),{href:"/login",children:(0,i.jsx)("a",{className:"btn btn-primary mt-4",children:g.texts.button_login})})]})})})}),a.logged&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"col-lg-3 col-12 col-half feed-order-2 container-mobile",children:j&&(0,i.jsx)(b,{group:g,profile:j,texts:g.texts})})})]})})]})})})]})}}},function(e){e.O(0,[3996,5675,9127,3663,3863,7917,8561,264,9738,5548,5273,2003,975,9774,2888,179],(function(){return t=72213,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.