1(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{VYmf:function(t,e,i){"use strict";i.d(e,"a",(function(){return c}));var r=i("mrSG"),s=i("A1Tq"),n=i("wDu7"),o=i("tk/3"),a=i("fXoL");let c=(()=>{class t{constructor(t,e){this.httpService=t,this.appdataService=e,this.BUDDYPRESS_RESTBASE_V1="wp-json/buddypress/v1/",this.APPCOMMUNITY_RESTBASE_V2="wp-json/ap-bp/v2/"}getActivities(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.get(i.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"activity",t,e?{Authorization:"Bearer "+e.access_token}:{})}))}getActivity(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.get(i.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"activity/"+t,{display_comments:"threaded"},e?{Authorization:"Bearer "+e.access_token}:{})}))}favoriteActivity(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=(yield this.appdataService.getAppdata()).wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"activity/"+t+"/favorite",r=e?{Authorization:"Bearer "+e.access_token}:{};return yield this.httpService.post(i,{context:"edit"},r)}))}flagActivity(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=(yield this.appdataService.getAppdata()).wordpress_url+this.APPCOMMUNITY_RESTBASE_V2+"activity/"+t,r=e?{Authorization:"Bearer "+e.access_token}:{};return yield this.httpService.post(i,{action:"activity_flag"},r)}))}commentActivity(t,e,i,s){return Object(r.a)(this,void 0,void 0,(function*(){const r=yield this.appdataService.getAppdata();return this.httpService.post(r.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"activity",{content:t,type:"activity_comment",primary_item_id:e,secondary_item_id:i},s?{Authorization:"Bearer "+s.access_token}:{})}))}createActivity(t,e,i,s=null){return Object(r.a)(this,void 0,void 0,(function*(){const r=(yield this.appdataService.getAppdata()).wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"activity",n={context:"edit",user_id:e,component:"activity",type:"activity_update",content:t};return s&&Object.assign(n,{primary_item_id:parseInt(s),component:"groups"}),this.httpService.post(r,n,i?{Authorization:"Bearer "+i.access_token}:{})}))}createActivityWithMedia(t,e,i,s,n=null){return Object(r.a)(this,void 0,void 0,(function*(){const r=(yield this.appdataService.getAppdata()).wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"activity";let a;return a=n?(new o.c).set("context","edit").set("user_id",i).set("component","activity").set("type","activity_update").set("content",t).set("primary_item_id",n).set("component","groups"):(new o.c).set("context","edit").set("user_id",i).set("component","activity").set("type","activity_update").set("content",t),this.httpService.postWithFormData(r,a,e,s?{Authorization:"Bearer "+s.access_token}:{})}))}getMembers(t){return Object(r.a)(this,void 0,void 0,(function*(){const e=yield this.appdataService.getAppdata();return this.httpService.get(e.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"members",t)}))}getFriends(t){return Object(r.a)(this,void 0,void 0,(function*(){const e=yield this.appdataService.getAppdata();return this.httpService.get(e.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"members",{context:"view",user_id:t,per_page:99})}))}getMember(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.get(i.wordpress_url+this.APPCOMMUNITY_RESTBASE_V2+"members/"+t,e?{user_id:e.user_id}:{},e?{Authorization:"Bearer "+e.access_token}:{})}))}updateMemberAvatar(t,e,i){return Object(r.a)(this,void 0,void 0,(function*(){const r=(yield this.appdataService.getAppdata()).wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"members/"+e+"/avatar",s=new o.c;return this.httpService.postWithFormData(r,s,t,i?{Authorization:"Bearer "+i.access_token}:{})}))}getNotifications(t){return Object(r.a)(this,void 0,void 0,(function*(){const e=yield this.appdataService.getAppdata();return this.httpService.get(e.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"notifications",{},t?{Authorization:"Bearer "+t.access_token}:{})}))}changeNotificationToNotNew(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.put(i.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"notifications/"+t,{context:"edit",is_new:0},e?{Authorization:"Bearer "+e.access_token}:{})}))}addFriend(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.post(i.wordpress_url+this.APPCOMMUNITY_RESTBASE_V2+"friends/"+t,{},e?{Authorization:"Bearer "+e.access_token}:{})}))}removeFriend(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.delete(i.wordpress_url+this.APPCOMMUNITY_RESTBASE_V2+"friends/"+t,e?{Authorization:"Bearer "+e.access_token}:{})}))}acceptFriendship(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.post(i.wordpress_url+this.APPCOMMUNITY_RESTBASE_V2+"friends/requests/accept/"+t,{},e?{Authorization:"Bearer "+e.access_token}:{})}))}rejectFriendship(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.post(i.wordpress_url+this.APPCOMMUNITY_RESTBASE_V2+"friends/requests/reject/"+t,{},e?{Authorization:"Bearer "+e.access_token}:{})}))}getGroups(t,e=null){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.get(i.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"groups",t,e?{Authorization:"Bearer "+e.access_token}:{})}))}
1getGroupDetails(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=(yield this.appdataService.getAppdata()).wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"groups/"+t;let r={context:"edit"};return e&&Object.assign(r,{user_id:e.user_id}),this.httpService.get(i,r,e?{Authorization:"Bearer "+e.access_token}:{})}))}getGroupMembers(t,e=null,i={}){return Object(r.a)(this,void 0,void 0,(function*(){const r=(yield this.appdataService.getAppdata()).wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"groups/"+t+"/members";return e&&Object.assign(i,{user_id:e.user_id}),this.httpService.get(r,i,e?{Authorization:"Bearer "+e.access_token}:{})}))}joinPublicGroup(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.post(i.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"groups/"+t+"/members",{context:"view"},e?{Authorization:"Bearer "+e.access_token}:{})}))}requestGroupMembership(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.post(i.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"groups/membership-requests",{context:"edit",group_id:t},e?{Authorization:"Bearer "+e.access_token}:{})}))}getMessages(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.get(i.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"messages",t,e?{Authorization:"Bearer "+e.access_token}:{})}))}createMessage(t,e,i,s){return Object(r.a)(this,void 0,void 0,(function*(){const r=yield this.appdataService.getAppdata();return this.httpService.post(r.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"messages",{context:"edit",subject:t,message:e,recipients:i},s?{Authorization:"Bearer "+s.access_token}:{})}))}getThread(t,e){return Object(r.a)(this,void 0,void 0,(function*(){const i=yield this.appdataService.getAppdata();return this.httpService.get(i.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"messages/"+t,{},e?{Authorization:"Bearer "+e.access_token}:{})}))}replyMessage(t,e,i,s){return Object(r.a)(this,void 0,void 0,(function*(){const r=yield this.appdataService.getAppdata();return this.httpService.postWithUrlencoded(r.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"messages",{context:"edit",recipients:e,id:t,message:i},s?{Authorization:"Bearer "+s.access_token}:{})}))}replyMessageWithImage(t,e,i,s){return Object(r.a)(this,void 0,void 0,(function*(){const e=(yield this.appdataService.getAppdata()).wordpress_url+"wp-json/ap-bp/v1/messages/send",r=(new o.c).set("user_id",s.user_id
1).set("recipients",s.user_id).set("thread_id",t.toString()).set("token",s.token);return this.httpService.postWithFormData(e,r,i)}))}getXprofileFields(t){return Object(r.a)(this,void 0,void 0,(function*(){const e=yield this.appdataService.getAppdata();return this.httpService.get(e.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"xprofile/fields",{context:"view",fetch_field_data:!0},t?{Authorization:"Bearer "+t.access_token}:{})}))}updateXprofileFields(t,e,i){return Object(r.a)(this,void 0,void 0,(function*(){const r=yield this.appdataService.getAppdata();return this.httpService.post(r.wordpress_url+this.BUDDYPRESS_RESTBASE_V1+"xprofile/"+e+"/data/"+i.user_id,{context:"edit",value:t},i?{Authorization:"Bearer "+i.access_token}:{})}))}}return t.\u0275fac=function(e){return new(e||t)(a.Tb(s.a),a.Tb(n.a))},t.\u0275prov=a.Ib({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},sIUr:function(t,e,i){"use strict";i.r(e);var r=i("ofXK"),s=i("3Pt+"),n=i("tyNb"),o=i("TEn/"),a=i("sYmb"),c=i("mrSG"),d=i("gZlD"),p=i("VYmf"),h=i("wDu7"),u=i("XSfJ"),l=i("fXoL"),g=i("jhN1");function v(t,e){if(1&t&&l.Nb(0,"img",12),2&t){const t=l.bc().$implicit,e=l.bc(2);l.gc("src",e.formatAvatarUrl(t.avatar_urls.full),l.rc)}}function b(t,e){1&t&&l.Nb(0,"img",13)}function S(t,e){if(1&t){const t=l.Qb();l.Pb(0,"ion-item",6),l.Pb(1,"ion-avatar",7),l.Xb("click",(function(i){l.oc(t);const r=e.$implicit;return l.bc(2).openMember(r.sender_id)})),l.vc(2,v,1,1,"img",8),l.vc(3,b,1,0,"img",9),l.Ob(),l.Pb(4,"ion-label",10),l.Nb(5,"div",11),l.Ob(),l.Ob()}if(2&t){const t=e.$implicit,i=l.bc(2);l.gc("ngClass",t.sender_id===i.currentUserId?"sender-message":"recipient-message"),l.Bb(1),l.gc("slot",t.sender_id===i.currentUserId?"end":"start"),l.Bb(1),l.gc("ngIf",t.avatar_urls),l.Bb(1),l.gc("ngIf",!t.avatar_urls),l.Bb(2),l.gc("ngClass",t.sender_id===i.currentUserId?"ion-text-end ion-float-end ion-margin-start":"ion-text-start ion-float-start ion-margin-end")("innerHtml",t.message.rendered,l.pc)}}function _(t,e){if(1&t&&(l.Pb(0,"div",14),l.Pb(1,"span",15),l.wc(2),l.Ob(),l.Ob()),2&t){const t=l.bc(2);l.Bb(2),l.xc(t.progressMessage)}}function m(t,e){if(1&t&&(l.Pb(0,"ion-list"),l.vc(1,S,6,6,"ion-item",4),l.vc(2,_,3,1,"div",5),l.Ob()),2&t){const t=l.bc();l.Bb(1),l.gc("ngForOf",t.item.messages),l.Bb(1),l.gc("ngIf",t.progressMessage)}}function f(t,e){if(1&t){const t=l.Qb();l.Pb(0,"form",16),l.Pb(1,"ion-toolbar"),l.Nb(2,"ion-input",17),l.Pb(3,"ion-button",18),l.Xb("click",(function(e){return l.oc(t),l.bc().selectImage()})),l.Nb(4,"ion-icon",19),l.Ob(),l.Pb(5,"ion-button",20),l.Xb("click",(function(e){return l.oc(t),l.bc().replyToThread()})),l.Nb(6,"ion-icon",21),l.Ob(),l.Ob(),l.Ob()}if(2&t){const t=l.bc();l.gc("formGroup",t.form),l.Bb(5),l.gc("disabled",!t.isValid)}}let y=(()=>{class t{constructor(t,e,i,r,s,n,o,a,c,d,p,h){this.formBuilder=t,this.activatedRoute=e,this.actionSheetController=i,this.loginService=r,this.buddypressService=s,this.appdataService=n,this.imageService=o,this.toastController=a,this.translateService=c,this.loadingController=d,this.sanitizer=p,this.ngZone=h,this.menu_slot="start"}ngOnInit(){this._initializeForm(),this._loadPage()}ionViewDidEnter(){this._scrollToContentBottom()}_scrollToContentBottom(){setTimeout(()=>{this.ionContent.scrollToBottom()},200)}_initializeForm(){this.form=this.formBuilder.group({message:["",s.m.required]}),this.formSubscription=this.form.valueChanges.subscribe(t=>{this.ngZone.run(()=>{this.isValid=!(!this.form.valid||""===t.message.trim())})})}_loadPage(){return Object(c.a)(this,void 0,void 0,(function*(){this._handleSettings();const t=yield this.loadingController.create({showBackdrop:!1});yield t.present();try{const t=parseInt(this.activatedRoute.snapshot.paramMap.get("threadId")),e=yield this.loginService.getLoginData(),i=yield this.buddypressService.getThread(t,e);this.item=i[0],this.title=this.item.subject.rendered,this.currentUserId=e.user_id,this._scrollToContentBottom()}catch(e){console.error(e)}yield t.dismiss()}))}_handleSettings(){return Object(c.a)(this,void 0,void 0,(function*(){(yield this.appdataService.getAppdata()).menus.menu_right&&(this.menu_slot="end")}))}formatAvatarUrl(t){return t.indexOf("http")>=0?t:"https:"+t}openMember(t){this.appdataService.navigateForwardToRoute("bp-profile/"+t)}replyToThread(){return Object(c.a)(this,void 0,void 0,(function*(){try{this.progressMessage=this.translateService.instant("Sending...");const t=yield this.loginService.getLoginData();this._addMessageToThread(t,this.form.value.message);const e=Object.keys(this.item.recipients);yield this.buddypressService.replyMessage(this.item.id,e,this.form.value.message,t)}catch(t){console.error(t),this.item.messages.splice(-1,1);let e=this.translateService.instant("Message not delivered.");this._presentToast(e)}delete this.progressMessage,this.form.reset()}))}_prepareImage(t){return Object(c.a)(this,void 0,void 0,(function*(){try{this.progressMessage=this.translateService.instant("Uploading...");const e=yield this.loginService.getLoginData(),i=this.imageService.convertFileSrc(t),r=this.sanitizer.bypassSecurityTrustHtml('<img src="'+i+'">');
1this._addMessageToThread(e,r),(yield this.imageService.resolveLocalFilesystemUrl(t)).file(t=>{const e=new FileReader;e.onerror=t=>console.error(t),e.onload=()=>{const i=new FormData,r=new Blob([e.result],{type:t.type});i.append("message_image",r,t.name),this.ngZone.run(()=>this.replyToThreadWithImage(i))},e.readAsArrayBuffer(t)})}catch(e){console.error(e)}}))}replyToThreadWithImage(t){return Object(c.a)(this,void 0,void 0,(function*(){try{const e=yield this.loginService.getLoginData(),i=Object.keys(this.item.recipients);yield this.buddypressService.replyMessageWithImage(this.item.id,i,t,e)}catch(e){console.error(e),this.item.messages.splice(-1,1);let t=this.translateService.instant("Message not delivered.");this._presentToast(t)}delete this.progressMessage}))}selectImage(){return Object(c.a)(this,void 0,void 0,(function*(){const t=yield this.actionSheetController.create({header:this.translateService.instant("Choose an image"),buttons:[{text:this.translateService.instant("Take Photo"),handler:()=>{this._getPictureFromCamera()}},{text:this.translateService.instant("Photo Library"),handler:()=>{this._getPictureFromLibrary()}},{text:"Cancel",role:"cancel"}]});yield t.present()}))}_getPictureFromCamera(){return Object(c.a)(this,void 0,void 0,(function*(){const t=yield this.imageService.getImageUrlFromCamera();this._prepareImage(t)}))}_getPictureFromLibrary(){return Object(c.a)(this,void 0,void 0,(function*(){const t=yield this.imageService.getImageUrlFromLibrary();this._prepareImage(t)}))}_addMessageToThread(t,e){this.item.messages.push({sender_id:t.user_id,avatar_urls:{full:t.avatar},message:{rendered:e}}),this._scrollToContentBottom()}_presentToast(t){return Object(c.a)(this,void 0,void 0,(function*(){(yield this.toastController.create({message:t,duration:3e3,position:"bottom"})).present()}))}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(l.Mb(s.b),l.Mb(n.a),l.Mb(o.a),l.Mb(d.a),l.Mb(p.a),l.Mb(h.a),l.Mb(u.a),l.Mb(o.wb),l.Mb(a.e),l.Mb(o.mb),l.Mb(g.b),l.Mb(l.z))},t.\u0275cmp=l.Gb({type:t,selectors:[["app-bp-message-details"]],viewQuery:function(t,e){var i;1&t&&l.tc(o.r,!0),2&t&&l.mc(i=l.Yb())&&(e.ionContent=i.first)},decls:12,vars:7,consts:[[3,"slot"],[3,"scrollEvents"],[4,"ngIf"],[3,"formGroup",4,"ngIf"],["lines","none","class","message-block",3,"ngClass",4,"ngFor","ngForOf"],["class","progress-message","lines","none",4,"ngIf"],["lines","none",1,"message-block",3,"ngClass"],[3,"slot","click"],[3,"src",4,"ngIf"],["src"," assets/default.png",4,"ngIf"],[1,"ion-text-wrap"],[3,"ngClass","innerHtml"],[3,"src"],["src"," assets/default.png"],["lines","none",1,"progress-message"],[1,"ion-text-end"],[3,"formGroup"],["formControlName","message",1,"reply-message"],["slot","end",3,"click"],["slot","icon-only","name","camera"],["slot","end",3,"disabled","click"],["slot","icon-only","name","paper-plane"]],template:function(t,e){1&t&&(l.Pb(0,"ion-header"),l.Pb(1,"ion-toolbar"),l.Pb(2,"ion-buttons",0),l.Nb(3,"ion-back-button"),l.Nb(4,"ion-menu-button"),l.Ob(),l.Pb(5,"ion-title"),l.wc(6),l.cc(7,"translate"),l.Ob(),l.Ob(),l.Ob(),l.Pb(8,"ion-content",1),l.vc(9,m,3,2,"ion-list",2),l.Ob(),l.Pb(10,"ion-footer"),l.vc(11,f,7,2,"form",3),l.Ob()),2&t&&(l.Bb(2),l.gc("slot",e.menu_slot),l.Bb(4),l.xc(l.dc(7,5,e.title)),l.Bb(2),l.gc("scrollEvents",!0),l.Bb(1),l.gc("ngIf",e.item),l.Bb(2),l.gc("ngIf",e.form))},directives:[o.w,o.jb,o.k,o.g,o.h,o.J,o.hb,o.r,r.k,o.u,o.H,r.j,o.C,r.i,o.f,o.G,s.n,s.i,s.d,o.B,o.vb,s.h,s.c,o.j,o.x],pipes:[a.d],styles:[".list-ios[_ngcontent-%COMP%]{background:none}.message-block[_ngcontent-%COMP%] ion-label[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{padding:10px 15px;border-radius:10px}.recipient-message[_ngcontent-%COMP%] ion-label[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{background-color:#eee}.sender-message[_ngcontent-%COMP%] ion-label[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{background-color:#3aa6fc;color:#fff}.progress-message[_ngcontent-%COMP%]{color:#ccc;font-size:12px}.progress-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;margin:0 16px 10px}ion-footer[_ngcontent-%COMP%] .reply-message[_ngcontent-%COMP%]{border:1px solid #eee;border-radius:20px;--padding-start:15px;--padding-end:15px;--background:#fff;--color:#333}ion-footer[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%]{--border-radius:25px;--padding-start:0.5em;--padding-end:0.5em}"]}),t})();i.d(e,"BpMessageDetailsPageModule",(function(){return B}));const A=[{path:"",component:y}];let B=(()=>{class t{}return t.\u0275mod=l.Kb({type:t}),t.\u0275inj=l.Jb({factory:function(e){return new(e||t)},imports:[[r.b,s.e,s.l,o.kb,n.j.forChild(A),a.c.forChild()]]}),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.