File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/8884.24f9f255e2da9c94.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8884,5553,7934,315],{55553:(E,b,e)=>{e.d(b,{h:()=>r});var t=e(77897),c=e(56610),P=e(41683),v=e(13721),C=e(22882),d=e(37222),f=e(36594),l=e(2978);let r=(()=>{class a{static#t=this.\u0275fac=function(h){return new(h||a)};static#e=this.\u0275mod=l.$C({type:a});static#n=this.\u0275inj=l.G2t({imports:[c.MD,t.bv,v.h,P.Y,C.h.forChild(),d.YN,f.rJ]})}return a})()},18884:(E,b,e)=>{e.r(b),e.d(b,{ClubContentCommentsPageModule:()=>p});var t=e(22882),c=e(56610),P=e(37222),v=e(77897),C=e(36075),d=e(85985),f=e(2978);const l=[{path:"",component:d.P}];let r=(()=>{class i{static#t=this.\u0275fac=function(g){return new(g||i)};static#e=this.\u0275mod=f.$C({type:i});static#n=this.\u0275inj=f.G2t({imports:[C.iI.forChild(l),C.iI]})}return i})();var a=e(55553);let p=(()=>{class i{static#t=this.\u0275fac=function(g){return new(g||i)};static#e=this.\u0275mod=f.$C({type:i});static#n=this.\u0275inj=f.G2t({imports:[c.MD,P.YN,v.bv,r,t.h,a.h]})}return i})()},85985:(E,b,e)=>{e.d(b,{P:()=>M});var t=e(2978),c=e(77897),P=e(77299),v=e(54171),C=e(22882),d=e(7125),f=e(56610),l=e(37222);function r(u,T){if(1&u){const n=t.RV6();t.j41(0,"app-publication-comment",10),t.bIt("replieCommentOutput",function(o){t.eBV(n);const _=t.XpG();return t.Njj(_.replieComment(o))}),t.k0s()}if(2&u){const n=T.$implicit,s=t.XpG();t.Y8G("comment",n)("commentPrefix","@"+s.comment.user.first_name+" "+s.comment.user.last_name)}}let a=(()=>{class u{constructor(n,s){this.cityProvider=n,this.utilsService=s,this.commentPrefix="",this.replieCommentOutput=new t.bkB}ngOnInit(){}replieComment(n){this.replieCommentOutput.emit(n)}static#t=this.\u0275fac=function(s){return new(s||u)(t.rXU(d.h),t.rXU(v.T))};static#e=this.\u0275cmp=t.VBU({type:u,selectors:[["app-publication-comment"]],inputs:{comment:"comment",commentPrefix:"commentPrefix"},outputs:{replieCommentOutput:"replieCommentOutput"},decls:22,vars:10,consts:[["size","1"],[2,"height","25px","width","25px"],[3,"src"],["size","10"],[2,"font-weight","bold"],[1,"blue-text"],[1,"ion-no-padding"],["size","3",1,"commentActions","ion-text-start"],["size","8",1,"commentActions",3,"click"],[3,"comment","commentPrefix","replieCommentOutput",4,"ngFor","ngForOf"],[3,"comment","commentPrefix","replieCommentOutput"]],template:function(s,o){1&s&&(t.j41(0,"ion-grid")(1,"ion-row")(2,"ion-col",0)(3,"ion-avatar",1),t.nrm(4,"img",2),t.k0s()(),t.j41(5,"ion-col",3)(6,"div")(7,"span",4),t.EFF(8),t.k0s(),t.nrm(9,"br"),t.j41(10,"span")(11,"span",5),t.EFF(12),t.k0s(),t.EFF(13),t.k0s(),t.j41(14,"ion-grid",6)(15,"ion-row",6)(16,"ion-col",7),t.EFF(17),t.k0s(),t.j41(18,"ion-col",8),t.bIt("click",function(){return o.replieComment(o.comment)}),t.EFF(19),t.nI1(20,"translate"),t.k0s()()()()()()(),t.DNE(21,r,1,2,"app-publication-comment",9)),2&s&&(t.R7$(4),t.FS9("src",o.comment.user.user_info.photo?o.cityProvider._urlGallery+"avatars/"+o.comment.user.user_info.photo:"https://ionicframework.com/docs/img/demos/avatar.svg",t.B4B),t.R7$(4),t.Lme("",o.comment.user.first_name," ",o.comment.user.last_name,""),t.R7$(4),t.JRh(o.commentPrefix),t.R7$(1),t.SpI(" ",o.comment.comments_club_id_text,""),t.R7$(4),t.SpI(" ",o.utilsService.timeSince(o.comment.created_at)," "),t.R7$(2),t.SpI(" ",t.bMT(20,8,"CLUB_CONTENT.REPLIE")," "),t.R7$(2),t.Y8G("ngForOf",o.comment.replies))},dependencies:[f.Sq,c.mC,c.hU,c.lO,c.ln,u,C.D9],styles:[".comment[_ngcontent-%COMP%]{border-radius:10px;background:#E7E4E4;width:-moz-fit-content;width:fit-content;padding:5px;min-width:30vw}.commentActions[_ngcontent-%COMP%]{font-size:smaller;font-weight:700;color:#445e93}.blue-text[_ngcontent-%COMP%]{color:#445e93}"]})}return u})();const p=["commentArea"],i=["content"];function h(u,T){if(1&u){const n=t.RV6();t.j41(0,"app-publication-comment",13),t.bIt("replieCommentOutput",function(o){t.eBV(n);const _=t.XpG();return t.Njj(_.replieComment(o))}),t.k0s()}2&u&&t.Y8G("comment",T.$implicit)}function m(u,T){if(1&u){const n=t.RV6();t.j41(0,"label",14),t.EFF(1),t.nI1(2,"translate"),t.j41(3,"span",15),t.EFF(4),t.k0s(),t.j41(5,"span",16),t.bIt("click",function(){t.eBV(n);const o=t.XpG();return t.Njj(o.cancelReplieComment())}),t.EFF(6),t.nI1(7,"translate"),t.k0s()()}if(2&u){const n=t.XpG();t.R7$(1),t.SpI(" ",t.bMT(2,4,"CLUB_CONTENT.REPLYING_TO")," "),t.R7$(3),t.Lme("",n.commentToReplie.user.first_name," ",n.commentToReplie.user.last_name,". "),t.R7$(2),t.SpI(" ",t.bMT(7,6,"all.cancel")," ")}}function g(u,T){if(1&u){const n=t.RV6();t.j41(0,"ion-icon",17),t.bIt("click",function(){t.eBV(n);const o=t.XpG();return t.Njj(o.setComment())}),t.k0s()}}let M=(()=>{class u{constructor(n,s,o,_,O){this.modalCtrl=n,this.publicationClubService=s,this.utilsService=o,this.translateService=_,this.cityProvider=O,this.comment="",this.comments=[]}ngOnInit(){this.loadInit()}ngAfterViewInit(){this.commentArea.setFocus()}loadInit(n=0){this.time=(new Date).getTime(),setTimeout(()=>new Promise((s,o)=>{this.utilsService.presentLoading(this.translateService.instant("all.loading")).then(()=>{Promise.all([this.publicationClubService.getComments(this.contentId).then(_=>{this.comments=_})]).then(()=>{this.utilsService.dismissLoading(),this.utilsService.loadingPage=!1,s(!1)}).catch(_=>{this.utilsService.dismissLoading(),this.utilsService.loadingPage=!1,o(_)})})}),n)}cancel(n,s){this.modalCtrl.dismiss({status:n,valueOrder:s})}setComment(){let n={comments_club_id_text:this.comment,publication_content_id:this.contentId};this.commentToReplie&&(n.comment_club_id=this.commentToReplie.id),this.publicationClubService.setComment(n).then(s=>{this.commentToReplie||this.scrollToTop(),this.comment="",this.loadInit(),this.cancelReplieComment()})}replieComment(n){this.commentToReplie=n,this.commentArea.setFocus()}cancelReplieComment(){this.commentToReplie=null}scrollToTop(){setTimeout(()=>{this.content.scrollToTop(500)},200)}static#t=this.\u0275fac=function(s){return new(s||u)(t.rXU(c.W3),t.rXU(P.i),t.rXU(v.T),t.rXU(C.c$),t.rXU(d.h))};static#e=this.\u0275cmp=t.VBU({type:u,selectors:[["app-club-content-comments"]],viewQuery:function(s,o){if(1&s&&(t.GBs(p,5),t.GBs(i,5)),2&s){let _;t.mGM(_=t.lsd())&&(o.commentArea=_.first),t.mGM(_=t.lsd())&&(o.content=_.first)}},decls:19,vars:12,consts:[[2,"--background","white","color","black"],["slot","start"],[1,"ion-text-center"],["slot","end"],["strong","","color","dark",3,"click"],["content",""],[3,"comment","replieCommentOutput",4,"ngFor","ngForOf"],[1,"footer"],["style","color: black;","class","ion-margin-start",4,"ngIf"],["lines","none",1,"roundedInput"],["autofocus","",2,"margin","auto",3,"placeholder","autoGrow","rows","ngModel","ngModelChange"],["commentArea",""],["name","send","style","margin: auto;","color","primary",3,"click",4,"ngIf"],[3,"comment","replieCommentOutput"],[1,"ion-margin-start",2,"color","black"],[2,"font-weight","bold"],[2,"font-weight","bold","color","darkslategray",3,"click"],["name","send","color","primary",2,"margin","auto",3,"click"]],template:function(s,o){1&s&&(t.j41(0,"ion-header")(1,"ion-toolbar",0),t.nrm(2,"ion-back-button",1),t.j41(3,"ion-title",2),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"ion-buttons",3)(7,"ion-button",4),t.bIt("click",function(){return o.cancel(!1)}),t.EFF(8,"X"),t.k0s()()()(),t.j41(9,"ion-content",null,5),t.DNE(11,h,1,1,"app-publication-comment",6),t.k0s(),t.j41(12,"ion-footer",7),t.DNE(13,m,8,8,"label",8),t.j41(14,"ion-item",9)(15,"ion-textarea",10,11),t.bIt("ngModelChange",function(O){return o.comment=O}),t.nI1(17,"translate"),t.k0s(),t.DNE(18,g,1,0,"ion-icon",12),t.k0s()()),2&s&&(t.R7$(4),t.JRh(t.bMT(5,8,"CLUB_CONTENT.COMMENTS")),t.R7$(7),t.Y8G("ngForOf",o.comments),t.R7$(2),t.Y8G("ngIf",o.commentToReplie),t.R7$(2),t.FS9("placeholder",t.bMT(17,10,"CLUB_CONTENT.COMMENT")),t.Y8G("autoGrow",!0)("rows",1)("ngModel",o.comment),t.R7$(3),t.Y8G("ngIf",o.comment.length))},dependencies:[f.Sq,f.bT,l.BC,l.vS,c.el,c.Jm,c.QW,c.W9,c.M0,c.eU,c.iq,c.uz,c.nc,c.BC,c.ai,c.Gw,c.tY,a,C.D9],styles:[".roundedInput[_ngcontent-%COMP%]{--border-radius: 45px;--border-width: 1px;--box-shadow: 2px gray;--highlight-height: 0;--background: #f8f9fa;margin:5px}@media only screen and (max-device-width: 414px){.footer[_ngcontent-%COMP%]{margin-bottom:15px}}"]})}return u})()},77299:(E,b,e)=>{e.d(b,{i:()=>C});var t=e(73308),c=e(2978),P=e(3366),v=e(54171);let C=(()=>{class d{constructor(l,r){this.api=l,this.utilsService=r,this.types={photo:"photo"}}get(l,r){var a=this;return(0,t.A)(function*(){return new Promise(function(){var p=(0,t.A)(function*(i,h){(yield a.api.get("publication_club/get/"+(l??"all")+"/"+(r??1),yield a.utilsService.getAccessToken())).subscribe(g=>{i(g)},g=>{h(g)})});return function(i,h){return p.apply(this,arguments)}}())})()}setReaction(l){var r=this;return(0,t.A)(function*(){return new Promise(function(){var a=(0,t.A)(function*(p,i){(yield r.api.post("publication_club/setPublicationClubIterations",l,yield r.utilsService.getAccessToken())).subscribe(m=>{p(m)},m=>{i(m)})});return function(p,i){return a.apply(this,arguments)}}())})()}deleteReaction(l){var r=this;return(0,t.A)(function*(){return new Promise(function(){var a=(0,t.A)(function*(p,i){(yield r.api.post("publication_club/deleteReaction/"+l,{},yield r.utilsService.getAccessToken())).subscribe(m=>{p(m)},m=>{i(m)})});return function(p,i){return a.apply(this,arguments)}}())})()}setComment(l){var r=this;return(0,t.A)(function*(){return new Promise(function(){var a=(0,t.A)(function*(p,i){(yield r.api.post("publication_club/setPublicationClubComments",l,yield r.utilsService.getAccessToken())).subscribe(m=>{p(m)},m=>{i(m)})});return function(p,i){return a.apply(this,arguments)}}())})()}getComments(l){var r=this;return(0,t.A)(function*(){return new Promise(function(){var a=(0,t.A)(function*(p,i){(yield r.api.get("publication_club/getComments/"+l,yield r.utilsService.getAccessToken())).subscribe(m=>{p(m)},m=>{i(m)})});return function(p,i){return a.apply(this,arguments)}}())})()}getById(l){var r=this;return(0,t.A)(function*(){return new Promise(function(){var a=(0,t.A)(function*(p,i){(yield r.api.get("publication_club/getById/"+l,yield r.utilsService.getAccessToken())).subscribe(m=>{p(m)},m=>{i(m)})});return function(p,i){return a.apply(this,arguments)}}())})()}static#t=this.\u0275fac=function(r){return new(r||d)(c.KVO(P.G),c.KVO(v.T))};static#e=this.\u0275prov=c.jDH({token:d,factory:d.\u0275fac,providedIn:"root"})}return d})()}}]);