(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5a35a77a"],{"0782":function(e,t,a){"use strict";a("969c")},2674:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return Vt}));var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("messages-view",{ref:"messagesView",attrs:{loading:e.loading,authUserId:e.authUserStrict.id,messageThread:e.messageThread,threadFirst:!!e.threadId,messages:e.messageList,minUnreadMessageId:e.minUnreadMessageId,user:e.user,userCallOptions:e.userCallOptions,enableScroll:e.enableScroll,"payment-packages":e.paymentPackages,"can-send-messages":e.canSendMessages,"can-send-attachment":e.canSendAttachment},on:{togglePin:e.togglePin,markRead:function(t){return e.markRead(t)},prev:e.getPrevMessages,addMessage:e.addMessage}})},n=[],r=(a("99af"),a("4de4"),a("7db0"),a("a630"),a("caad"),a("d81d"),a("45fc"),a("a9e3"),a("d3b7"),a("ac1f"),a("3ca3"),a("841c"),a("ddb0"),a("2909")),i=a("5530"),c=(a("96cf"),a("1da1")),o=a("d4ec"),u=a("bee2"),l=a("262e"),d=a("2caf"),m=a("a34a"),h=a.n(m),p=a("9ab4"),f=a("60a3"),g=a("2fe1"),v=a("9b43"),b=a("e3ec"),_=a("31cf"),O=a("78f9"),y=a("fe95"),j=a("ff07"),k=a("51ce"),S=a("a5de"),I=a("d70b"),M=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("base-page",{attrs:{loading:e.loading}},[a("div",{staticClass:"messages"},[a("page-title",{staticClass:"px-4 py-0 messages__title",attrs:{"default-back":{name:"messageThreads"}}},[a(e.titleComponent,{tag:"component",staticClass:"messages__name-wrapper mr-2",attrs:{to:e.profileTo}},[a("base-avatar",{staticClass:"messages__online",attrs:{size:40,user:e.user}}),a("span",{staticClass:"messages__name ml-2"},[e._v(e._s(e.screenName))])],1),e.isCallable||e.messageThread?a("div",{staticClass:"d-flex mr-n2"},[e.isCallable?a("base-icon",{staticClass:"messages__icon-button __call",on:{click:e.handleCall}},[e._v("sci-phone")]):e._e(),e.messageThread?a("base-icon",{staticClass:"messages__icon-button __pin",class:{__active:e.pinned},attrs:{fontSize:24},on:{click:function(t){return e.$emit("togglePin")}}},[e._v("sci-star")]):e._e()],1):e._e()],1),a("div",{ref:"list",staticClass:"messages__list",on:{wheel:e.reverseScroll}},[0!==e.messages.length?a("message-list",{staticClass:"messages__list-mirror pa-2",attrs:{messages:e.messages,authUserId:e.authUserId,minUnreadMessageId:e.minUnreadMessageId,enableScroll:e.enableScroll,userId:e.userId,"payment-packages":e.paymentPackages},on:{markRead:function(t){return e.$emit("markRead",t)},prev:e.$listeners.prev}}):e._e()],1),e.user&&e.canSendMessages?a("message-send-with-attachment",{staticClass:"messages__input",attrs:{"can-send-attachment":e.canSendAttachment,"recipient-ids":e.threadFirst?[]:[e.user.id],"thread-ids":e.threadIds},on:{addMessage:e.addMessage}}):e._e()],1)])},C=[],x=a("2b0e"),T=a("8902"),w=a("b1ec"),P=a("64ae"),A=a("0e5a"),E=a("9058"),U=a("855c"),$=a("1031"),R=a("7fc7"),N=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("infinite-scroll",{attrs:{enable:e.enableScroll},on:{prev:e.$listeners.prev}},[e._l(e.messages,(function(t,s){return[e.isNextDayMessage(e.messages,s)?a("div",{key:"date-"+t.id,staticClass:"message-day"},[e._v(" "+e._s(e.date(t.time))+" ")]):e._e(),a("message-item",{key:t.id,ref:e.isUnreadMessage(t)?"unreadMessages":void 0,refInFor:!0,attrs:{message:t,authUserId:e.authUserId,id:"message-"+t.id,userId:e.userId,"payment-packages":e.paymentPackages},on:{rendered:e.setObserve}})]}))],2)},B=[],q=(a("4160"),a("25f0"),a("1276"),a("159b"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a(e.viewComponent,{tag:"component",attrs:{message:e.message,"auth-user-id":e.authUserId,"payment-packages":e.paymentPackages,userId:e.userId},on:{purchase:e.purchase,rendered:function(t){return e.$emit("rendered",t)}}})}),D=[],L=a("b98d"),V=a("556c"),G=(a("4d63"),a("466d"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-item",class:{__opponent:e.opponentMessage}},[e.message.link?a("message-item-link",{staticClass:"message-item__link",attrs:{"message-link":e.message.link}}):e._e(),a("div",{staticClass:"message-item__text"},[e.message.text?a("linkified-text",{attrs:{links:e.linksValidation}},[e._v(" "+e._s(e.message.text)+" ")]):e._e(),e.message.attachment.length?a("message-item-attachment",{attrs:{message:e.message,available:e.available,authUserId:e.authUserId,price:e.price},on:{click:e.attachmentClick}}):e._e(),e.hasPrice&&e.isAuthor?a("div",{staticClass:"message-item__purchase py-1",class:{__purchased:e.available}},[e._v(" "+e._s(e.purchasedStatText)+" ")]):e._e()],1),a("div",{staticClass:"message-item__time"},[e._v(e._s(e.hoursMinutes))]),a("portal",{attrs:{to:"modal"}},[e.available?e._e():a("purchase-confirmation",{attrs:{packageId:e.message.attachmentPricePackageId},on:{purchase:function(t){return e.$emit("purchase",t)}},model:{value:e.showUnlock,callback:function(t){e.showUnlock=t},expression:"showUnlock"}})],1)],1)}),F=[],W=a("2007"),z=a("a32c"),H=a("8e3c"),K=a("5608"),Y=a("9310"),J=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("message-media-gallery",{attrs:{attachment:e.sortedAttachment,price:e.price,isAuthor:e.isAuthor,isAvailable:e.available},on:{unlock:e.onUnlock}})},Z=[],Q=(a("a623"),a("a6f4")),X=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("full-screen",{staticClass:"message-media-gallery",attrs:{scalable:e.scalable,"list-length":e.listLength},on:{close:function(t){e.clicked=!1},changeIndex:function(t){e.itemIndex=t}},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.isFullScreen,n=t.currentItem,r=t.openFullScreen;return[a("div",{staticClass:"message-media-gallery__items",class:{"__full-screen":s},style:{left:-100*n+"%"}},[e._l(e.accessedAttachments,(function(t,i){return a("div",{key:t.file.fileId.subjectId+"-"+t.file.fileId.fileNumber,staticClass:"message-media-gallery__item-wrapper",style:s?{}:e.galleryItemStyle},[a("message-media-item",{staticClass:"message-media-gallery__item",attrs:{attachment:t,processingStatus:t.file.processingStatus,"is-full-screen":s,"is-author":e.isAuthor,"is-active":i===n},on:{click:r}})],1)})),e.privateAttachments.length>0?a("div",{staticClass:"message-media-gallery__item-wrapper",class:{__inactive:n!==e.accessedAttachments.length},style:s?{}:e.galleryItemStyle},[a("message-gallery-locked",{staticClass:"message-media-gallery__item",attrs:{"locked-attachments":e.privateAttachments,price:e.price,"show-blur":e.showBlur,"is-author":e.isAuthor},on:{unlock:e.onUnlock}})],1):e._e()],2)]}},{key:"outZoomer",fn:function(t){var s=t.canGoBack,n=t.canGoNext,r=t.moveBack,i=t.moveNext,c=t.currentItem,o=t.isFullScreen;return[a("gallery-total-items",{directives:[{name:"show",rawName:"v-show",value:e.attachment.length>1&&0===c&&!o,expression:"attachment.length > 1 && currentItem === 0 && !isFullScreen"}],staticClass:"message-media-gallery__total",attrs:{files:e.attachment}}),s||n?[s?a("div",{staticClass:"message-media-gallery__prev-wrapper",on:{click:r}},[a("div",{staticClass:"message-media-gallery__prev"},[a("base-icon",{staticClass:"message-media-gallery__icon"},[e._v(" sci-chevron-left ")])],1)]):e._e(),n?a("div",{staticClass:"message-media-gallery__next-wrapper",on:{click:i}},[a("div",{staticClass:"message-media-gallery__next"},[a("base-icon",{staticClass:"message-media-gallery__icon"},[e._v(" sci-chevron-right ")])],1)]):e._e()]:e._e()]}}])})},ee=[],te=a("bc5a"),ae=a("d56d"),se=a("c18d"),ne=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-gallery-locked",class:{__blurred:e.showBlur},on:{click:function(t){return e.$emit("unlock")}}},[e.converging?a("message-media-item-status",{attrs:{"multiple-files":e.lockedAttachments.length>1,attachment:e.attachment,"is-author":e.isAuthor}}):[e.src?a("img",{staticClass:"message-gallery-locked__cover",attrs:{src:e.src,alt:"locked file"}}):e._e(),a("div",{staticClass:"message-gallery-locked__content d-center __column text-center body-2"},[a("base-icon",{attrs:{"font-size":24}},[e._v("sci-lock")]),e.count>1?a("span",{staticClass:"mt-1"},[e._v(e._s(e.$tc("item",e.count)))]):e._e(),a("div",{staticClass:"mt-2"},[e._v(e._s(e.$t("Locked for {0}",[e.price])))])],1)]],2)},re=[],ie=function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.processing?a("div",{staticClass:"message-media-item-status d-flex __column d-center",on:{click:function(e){e.stopPropagation()}}},[a("div",{staticClass:"message-media-item-status__placeholder d-flex __column d-center text-center body-2"},[e.error?[e.multipleFiles?a("strong",{staticClass:"message-media-item-status__broken subtitle-1 mb-2"},[e._v(e._s(e.$t("Some files are broken.")))]):a("strong",{staticClass:"message-media-item-status__broken subtitle-1 mb-2"},[e._v(e._s(e.$t("This file is broken.")))]),e.isAuthor?a("span",[e._v(e._s(e.$t("It will not be displayed to the recipient.")))]):e._e()]:[a("strong",{staticClass:"subtitle-1 mb-2"},[e._v(e._s(e.$t("Please wait.")))]),e.multipleFiles?a("span",[e._v(e._s(e.$t("Your files are uploading...")))]):a("span",[e._v(e._s(e.$t("Your file is uploading...")))]),a("span",[e._v(e._s(e.$t("This can take a few minutes.")))]),a("base-spinner",{staticClass:"portal-modal",attrs:{size:"48px"}})]],2)]):e._e()},ce=[],oe=Object(Q["c"])({name:"MessageMediaItemStatus",components:{BaseIcon:E["a"]},props:{attachment:{type:Object,required:!0},isAuthor:{type:Boolean,required:!0},multipleFiles:{type:Boolean,default:!1}},setup:function(e){var t=Object(Q["a"])((function(){return"OK"!==e.attachment.file.processingStatus})),a=Object(Q["a"])((function(){return"ERROR"===e.attachment.file.processingStatus}));return{processing:t,error:a}}}),ue=oe,le=(a("794d"),a("2877")),de=Object(le["a"])(ue,ie,ce,!1,null,"754f9065",null),me=de.exports,he=Object(Q["c"])({name:"MessageGalleryLocked",components:{MessageMediaItemStatus:me,BaseIcon:E["a"]},props:{lockedAttachments:{type:Array,required:!0},price:{type:String,required:!0},isAuthor:{type:Boolean,required:!0},showBlur:{type:Boolean,default:!1}},setup:function(e){var t=Object(Q["a"])((function(){return e.lockedAttachments.length})),a=Object(Q["a"])((function(){var t=e.lockedAttachments.find((function(e){return"ERROR"===e.file.processingStatus}));return t||e.lockedAttachments.find((function(e){return!!e.file}))})),s=Object(Q["a"])((function(){var e;return"OK"!==(null===(e=a.value)||void 0===e?void 0:e.file.processingStatus)})),n=Object(Q["a"])((function(){return a.value&&Object(P["d"])(a.value.file,a.value.file.urlPart,"1080p")||""}));return{count:t,attachment:a,src:n,converging:s}}}),pe=he,fe=(a("483c"),Object(le["a"])(pe,ne,re,!1,null,"608dc2f7",null)),ge=fe.exports,ve=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-media-item",on:{click:e.click}},[e.isProcessed?[a("img",{directives:[{name:"show",rawName:"v-show",value:e.isImage||!e.videoStarted,expression:"isImage || !videoStarted"}],staticClass:"message-media-item__zoomer",attrs:{active:e.isFullScreen&&!e.isVideo,src:e.attachmentThumbnail,alt:e.$t("Your attachment")}}),e.isVideo&&e.videoStarted?a("video",{ref:"videoElement",attrs:{poster:e.attachmentThumbnail,src:e.videoSrc,controls:""}}):e._e(),e.isVideo&&!e.videoStarted?a("base-icon",{staticClass:"message-media-item__play-icon"},[e._v(" sci-play ")]):e._e()]:a("message-media-item-status",{attrs:{attachment:e.attachment,"is-author":e.isAuthor}})],2)},be=[],_e=a("dfc7"),Oe=function(e,t,a,s){var n=Object(Q["a"])((function(){return Object(te["i"])(e.value.file)})),r=Object(Q["o"])(null),i=Object(Q["o"])(!1),o=Object(Q["a"])((function(){return n.value?_e["a"].getVideoUrl(e.value.file.urlPart):""})),u=Object(Q["a"])((function(){return n.value?_e["a"].getVideoThumbnail(e.value.file.urlPart,"1080p"):""})),l=function(){var e=Object(c["a"])(h.a.mark((function e(){return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i.value=!0,e.next=3,Object(Q["g"])();case 3:if(!r.value){e.next=6;break}return e.next=6,r.value.play();case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),d=function(){r.value&&r.value.pause(),i.value=!1},m=Object(Q["a"])((function(){return!i.value&&n.value&&s.value&&a.value}));return Object(Q["t"])((function(){t.value&&a.value||d()})),{isVideo:n,videoSrc:o,videoThumbnail:u,videoStarted:i,shouldPlayVideo:m,playVideo:l,videoElement:r}},ye=function(e){var t=Object(Q["a"])((function(){return Object(te["f"])(e.value.file)})),a=Object(Q["a"])((function(){return t.value?_e["a"].getImageThumbnail(e.value.file.urlPart,"1080p"):""}));return{isImage:t,imageThumbnail:a}},je=Object(Q["c"])({name:"MessageMediaItem",components:{MessageMediaItemStatus:me,BaseConfirm:K["a"],BaseIcon:E["a"],BaseButton:Y["a"]},props:{attachment:{type:Object,required:!0},isAuthor:{type:Boolean,required:!0},isFullScreen:{type:Boolean,required:!0},isActive:{type:Boolean,required:!0}},setup:function(e,t){var a=t.emit,s=Object(Q["q"])(e),n=s.attachment,r=s.isFullScreen,i=s.isActive,c=Object(Q["a"])((function(){return"OK"===e.attachment.file.processingStatus})),o=Oe(n,i,r,c),u=o.isVideo,l=o.videoSrc,d=o.videoThumbnail,m=o.shouldPlayVideo,h=o.playVideo,p=o.videoStarted,f=o.videoElement,g=ye(n),v=g.isImage,b=g.imageThumbnail,_=Object(Q["a"])((function(){return v.value?b.value:u.value?d.value:""})),O=function(){m.value?h():r.value||a("click")};return{isProcessed:c,attachmentThumbnail:_,isImage:v,isVideo:u,videoSrc:l,videoStarted:p,click:O,videoElement:f}}}),ke=je,Se=(a("8d2a"),Object(le["a"])(ke,ve,be,!1,null,"812569ca",null)),Ie=Se.exports,Me=function(e,t){var a=Object(Q["o"])(!1),s=Object(Q["a"])((function(){return!a.value&&t.value&&!e.value})),n=Object(Q["a"])((function(){return t.value?!s.value:e.value}));return Object(Q["t"])((function(){e.value&&(a.value=!1)})),{contentAvailable:n,clicked:a,showBlur:s}},Ce=Object(Q["c"])({name:"MessageMediaGallery",components:{BaseIcon:E["a"],MessageGalleryLocked:ge,MessageMediaItem:Ie,GalleryTotalItems:ae["a"],FullScreen:se["a"]},props:{attachment:{type:Array,required:!0},price:{type:String,required:!0},isAuthor:{type:Boolean,required:!0},isAvailable:{type:Boolean,required:!0}},setup:function(e,t){var a=t.emit,s=Object(Q["q"])(e),n=s.isAuthor,r=s.isAvailable,i=Me(r,n),c=i.contentAvailable,o=i.clicked,u=i.showBlur,l=Object(Q["a"])((function(){return c.value?e.attachment:e.attachment.filter((function(e){return e.publicAccess}))})),d=Object(Q["a"])((function(){return e.attachment.filter((function(e){return!e.publicAccess}))})),m=Object(Q["a"])((function(){return l.value.length+(e.attachment.length>l.value.length?1:0)})),h=Object(Q["o"])(0),p=Object(Q["a"])((function(){var e;return!(null===(e=l.value[h.value])||void 0===e||!e.file)&&!Object(te["i"])(l.value[h.value].file)})),f=Object(Q["a"])((function(){var e,t,a=l.value.length>0?l.value:d.value,s=a.find((function(e){return!!e})),n=Number(null!==(e=null===s||void 0===s?void 0:s.file.metadata.width)&&void 0!==e?e:0),r=Number(null!==(t=null===s||void 0===s?void 0:s.file.metadata.height)&&void 0!==t?t:0);if(n>0&&r>0){var i=150,c=45,o=Math.ceil(r/n*100);return{"padding-bottom":"".concat(Math.min(Math.max(o,c),i),"%")}}return{}})),g=function(){e.isAuthor?o.value=!0:a("unlock")};return{clicked:o,accessedAttachments:l,privateAttachments:d,galleryItemStyle:f,onUnlock:g,contentAvailable:c,showBlur:u,listLength:m,scalable:p,itemIndex:h}}}),xe=Ce,Te=(a("e74d"),Object(le["a"])(xe,X,ee,!1,null,"78441ad7",null)),we=Te.exports,Pe=Object(Q["c"])({name:"MessageItemAttachment",components:{MessageMediaGallery:we},props:{message:{type:Object,required:!0},available:{type:Boolean,required:!0},authUserId:{type:String,required:!0},price:{type:String,required:!0}},setup:function(e,t){var a=t.emit,s=Object(Q["a"])((function(){return e.message.senderId===e.authUserId})),n=function(){e.message.attachment.every((function(e){return"ERROR"!==e.file.processingStatus}))&&a("click")},r=Object(Q["a"])((function(){return e.message.attachment.sort((function(e,t){return e.file.fileId.fileNumber-t.file.fileId.fileNumber}))}));return{isAuthor:s,onUnlock:n,sortedAttachment:r}}}),Ae=Pe,Ee=Object(le["a"])(Ae,J,Z,!1,null,null,null),Ue=Ee.exports,$e=function(){var e=this,t=e.$createElement,a=e._self._c||t;return null!==e.contentSet?a("message-item-link-view",{attrs:{contentSet:e.contentSet}}):e._e()},Re=[],Ne=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a(e.to?"router-link":"div",{tag:"component",staticClass:"message-item-link",class:{__deleted:!e.contentSet},attrs:{to:e.to}},[e.contentSet?a("content-feed-cover",{attrs:{"post-data":e.contentSet,"hide-icon":""}}):a("span",{staticClass:"message-item-link__deleted"},[e._v(e._s(e.$t("Deleted post")))])],1)},Be=[],qe=a("0fb2"),De=a("b745"),Le=function(e){Object(l["a"])(a,e);var t=Object(d["a"])(a);function a(){return Object(o["a"])(this,a),t.apply(this,arguments)}return Object(u["a"])(a,[{key:"to",get:function(){if(this.contentSet)return Object(P["e"])(this.contentSet.userId,{feedId:this.contentSet.id})}}]),a}(x["default"]);Object(p["__decorate"])([Object(f["e"])({required:!0})],Le.prototype,"contentSet",void 0),Le=Object(p["__decorate"])([Object(g["b"])({name:"MessageItemLinkView",components:{BaseImage:qe["a"],ContentFeedCover:De["a"]}})],Le);var Ve=Le,Ge=Ve,Fe=(a("75d5"),Object(le["a"])(Ge,Ne,Be,!1,null,"2c95a222",null)),We=Fe.exports,ze=function(e){Object(l["a"])(a,e);var t=Object(d["a"])(a);function a(){var e;return Object(o["a"])(this,a),e=t.apply(this,arguments),e.contentSet=null,e.loading=!1,e}return Object(u["a"])(a,[{key:"created",value:function(){var e=Object(c["a"])(h.a.mark((function e(){return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,j["a"].ContentSetProvider.setReceiveErrors(!1),e.next=5,j["a"].ContentSetProvider.findById({id:this.messageLink.subject.subjectId});case 5:this.contentSet=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),this.contentSet=!1;case 11:return e.prev=11,this.loading=!1,e.finish(11);case 14:case"end":return e.stop()}}),e,this,[[0,8,11,14]])})));function t(){return e.apply(this,arguments)}return t}()}]),a}(x["default"]);Object(p["__decorate"])([Object(f["e"])({required:!0})],ze.prototype,"messageLink",void 0),ze=Object(p["__decorate"])([Object(g["b"])({name:"MessageItemLink",components:{MessageItemLinkView:We}})],ze);var He=ze,Ke=He,Ye=Object(le["a"])(Ke,$e,Re,!1,null,null,null),Je=Ye.exports,Ze=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("purchase-confirmation-view",{attrs:{value:e.value,"package-id":e.packageId,"payment-packages":e.paymentPackages},on:{input:function(t){return e.$emit("input",t)},purchase:function(t){return e.$emit("purchase",t)}}})},Qe=[],Xe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("base-confirm",{attrs:{value:e.value,title:e.$t("Get access to this media")},on:{input:function(t){return e.$emit("input",!1)}},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.close;return[a("base-button",{staticClass:"button-purchase mt-8",attrs:{fullWidth:"",loading:e.loading},on:{click:function(t){return t.stopPropagation(),e.purchase(s)}}},[e._v(e._s(e.$t("{0} for {1}",[e.$t("Unlock"),e.price])))]),a("base-button",{staticClass:"button-cancel mt-4",attrs:{fullWidth:"",secondary:""},on:{click:function(e){return e.stopPropagation(),s.apply(null,arguments)}}},[e._v(e._s(e.$t("Cancel")))])]}}])})},et=[],tt=function(e){Object(l["a"])(a,e);var t=Object(d["a"])(a);function a(){var e;return Object(o["a"])(this,a),e=t.apply(this,arguments),e.loading=!1,e}return Object(u["a"])(a,[{key:"purchase",value:function(e){var t=this;this.loading=!0,this.$emit("purchase",(function(){var a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t.loading=!1,a&&e()}))}},{key:"price",get:function(){var e,t,a=this,s=null===(e=this.paymentPackages.find((function(e){return e.id===a.packageId})))||void 0===e?void 0:null===(t=e.costs.find((function(e){return e.currency===Object(z["d"])()})))||void 0===t?void 0:t.cost;return s&&Object(z["f"])(s,Object(z["d"])())||""}}]),a}(x["default"]);Object(p["__decorate"])([Object(f["e"])({required:!0,type:Boolean})],tt.prototype,"value",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0,type:String})],tt.prototype,"packageId",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0,type:Array})],tt.prototype,"paymentPackages",void 0),tt=Object(p["__decorate"])([Object(g["b"])({name:"PurchaseConfirmationView",components:{BaseConfirm:K["a"],BaseButton:Y["a"]}})],tt);var at=tt,st=at,nt=Object(le["a"])(st,Xe,et,!1,null,null,null),rt=nt.exports,it=function(e){Object(l["a"])(a,e);var t=Object(d["a"])(a);function a(){var e;return Object(o["a"])(this,a),e=t.apply(this,arguments),e.paymentPackages=[],e}return Object(u["a"])(a,[{key:"onValueChange",value:function(){var e=Object(c["a"])(h.a.mark((function e(t){return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t||0!==this.paymentPackages.length){e.next=4;break}return e.next=3,j["a"].PaymentPackageProvider.findAll({type:[b["PaymentPackageEnum"].MESSAGE_ATTACHMENT]});case 3:this.paymentPackages=e.sent;case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()}]),a}(x["default"]);Object(p["__decorate"])([Object(f["e"])({required:!0,type:Boolean})],it.prototype,"value",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0,type:String})],it.prototype,"packageId",void 0),Object(p["__decorate"])([Object(f["i"])("value")],it.prototype,"onValueChange",null),it=Object(p["__decorate"])([Object(g["b"])({name:"PurchaseConfirmation",components:{PurchaseConfirmationView:rt}})],it);var ct=it,ot=ct,ut=Object(le["a"])(ot,Ze,Qe,!1,null,null,null),lt=ut.exports,dt=a("8a52"),mt=function(e){Object(l["a"])(a,e);var t=Object(d["a"])(a);function a(){var e;return Object(o["a"])(this,a),e=t.apply(this,arguments),e.showUnlock=!1,e}return Object(u["a"])(a,[{key:"attachmentClick",value:function(){var e=Object(c["a"])(h.a.mark((function e(){return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!this.available&&!this.isAuthor){e.next=2;break}return e.abrupt("return");case 2:this.showUnlock=!0;case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"isAuthor",get:function(){return this.message.senderId===this.authUserId}},{key:"available",get:function(){var e,t,a=this;if(!this.isAuthor)return null!==(t=this.message.attachmentAvailable)&&void 0!==t&&t;var s=!(null===(e=this.message.attachmentPurchasers)||void 0===e||!e.find((function(e){return e===a.userId})));return!this.hasPrice||s}},{key:"price",get:function(){var e,t,a=this,s=Object(W["formatMoney"])((null===(e=this.paymentPackages.find((function(e){return e.id===a.message.attachmentPricePackageId})))||void 0===e?void 0:null===(t=e.costs.find((function(e){return e.currency===Object(z["d"])()})))||void 0===t?void 0:t.cost)||0,{currencyCode:Object(z["d"])()});return s?"".concat(s.symbol).concat(s.wholePart).concat(s.separator).concat(s.fractionalPart):""}},{key:"purchasedStatText",get:function(){return this.available?Object(O["a"])("Purchased for {0}",[this.price]):Object(O["a"])("Not purchased yet")}},{key:"hasPrice",get:function(){return"0"!==this.message.attachmentPricePackageId}},{key:"linksValidation",get:function(){return I["a"].featureClickableUserLinks}}]),a}(Object(g["c"])(dt["a"]));Object(p["__decorate"])([Object(f["e"])({required:!0,type:Array})],mt.prototype,"paymentPackages",void 0),Object(p["__decorate"])([Object(f["e"])({type:String,required:!0})],mt.prototype,"userId",void 0),Object(p["__decorate"])([Object(f["e"])({type:String,required:!0})],mt.prototype,"authUserId",void 0),mt=Object(p["__decorate"])([Object(g["b"])({name:"MessageItemView",components:{MessageItemLink:Je,PurchaseConfirmation:lt,BaseConfirm:K["a"],BaseButton:Y["a"],MessageItemAttachment:Ue,LinkifiedText:H["a"]}})],mt);var ht=mt,pt=ht,ft=(a("d9c8"),Object(le["a"])(pt,G,F,!1,null,"a105021e",null)),gt=ft.exports,vt=a("bfb2");function bt(e){if(Number(e.senderId)>0)return gt;if(e.details){var t=e.details.type,a=vt.keys().find((function(e){return e.match(new RegExp("SystemMessage".concat(t.substr(0,1).toUpperCase()).concat(t.substr(1),".vue$")))}));if(a)return vt(a).default}return x["default"].extend({functional:!0,render:function(e){return e()}})}var _t=function(e){Object(l["a"])(a,e);var t=Object(d["a"])(a);function a(){return Object(o["a"])(this,a),t.apply(this,arguments)}return Object(u["a"])(a,[{key:"purchase",value:function(){var e=Object(c["a"])(h.a.mark((function e(t){return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,this.message.attachmentPricePackageId){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,j["a"].ContentPriceProvider.setReceiveErrors(!1),e.next=7,j["a"].ContentPriceProvider.purchase({data:{subjectId:this.message.id,subjectType:L["ContentPriceSubjectTypeEnum"].MESSAGE_ATTACHMENT}});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e["catch"](3),Object(V["a"])(e.t0,(function(e){var t;return"{com.scrile.money.validation.SpendingBalanceValidator.message}"===(null===(t=e.details)||void 0===t?void 0:t.messageTemplate)}),(function(){return y["a"].emit(S["b"].BALANCE_REFILL_SHOW,!0)}));case 12:y["a"].emit(S["b"].MESSAGES_UPDATE_MESSAGE,this.message.id),t(!0),e.next=19;break;case 16:e.prev=16,e.t1=e["catch"](0),t(!1);case 19:case"end":return e.stop()}}),e,this,[[0,16],[3,9]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"viewComponent",get:function(){return bt(this.message)}}]),a}(x["default"]);Object(p["__decorate"])([Object(f["e"])({required:!0})],_t.prototype,"message",void 0),Object(p["__decorate"])([Object(f["e"])({type:String,required:!0})],_t.prototype,"authUserId",void 0),Object(p["__decorate"])([Object(f["e"])({type:String,required:!0})],_t.prototype,"userId",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0,type:Array})],_t.prototype,"paymentPackages",void 0),_t=Object(p["__decorate"])([Object(f["a"])({name:"MessageItem"})],_t);var Ot=_t,yt=Ot,jt=Object(le["a"])(yt,q,D,!1,null,null,null),kt=jt.exports,St=a("24a8"),It=a("1ba4"),Mt=a("e3ee"),Ct=a("76da"),xt=function(e){Object(l["a"])(a,e);var t=Object(d["a"])(a);function a(){var e;return Object(o["a"])(this,a),e=t.apply(this,arguments),e.observer=new IntersectionObserver(e.onObserve,{rootMargin:"-64px 0px -56px 0px"}),e}return Object(u["a"])(a,[{key:"date",value:function(e){return Object(Ct["formatDate"])(new Date(e),{month:"long",day:"2-digit",year:"numeric"})}},{key:"isNextDayMessage",value:function(e,t){return 0===t||!Object(It["a"])(Object(Mt["a"])(e[t-1].time),Object(Mt["a"])(e[t].time))}},{key:"isUnreadMessage",value:function(e){return"0"!==this.minUnreadMessageId&&Number(e.id)>=Number(this.minUnreadMessageId)}},{key:"setObserve",value:function(){var e=Object(c["a"])(h.a.mark((function e(t){var a;return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:a=t.el,this.observer.observe(a);case 2:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"stopObserve",value:function(){var e=this.observer;this.$refs.unreadMessages&&e&&Object(w["a"])(this.$refs.unreadMessages,(function(t){t instanceof Element&&e.unobserve(t)}))}},{key:"onObserve",value:function(e,t){var a=this;e.forEach((function(e){if(e&&e.isIntersecting){var s=Number(e.target.id.split("message-")[1]),n=Number(a.minUnreadMessageId);if(n>0&&n<=s){var r=a.messages.find((function(e){return e.id===s.toString()}));r&&a.$emit("markRead",r)}t.unobserve(e.target)}}))}},{key:"destroyed",value:function(){this.stopObserve(),this.observer&&this.observer.disconnect()}}]),a}(x["default"]);Object(p["__decorate"])([Object(f["e"])({type:String,required:!0})],xt.prototype,"authUserId",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0})],xt.prototype,"messages",void 0),Object(p["__decorate"])([Object(f["e"])({type:String,required:!0})],xt.prototype,"minUnreadMessageId",void 0),Object(p["__decorate"])([Object(f["e"])({type:Boolean,default:!1})],xt.prototype,"enableScroll",void 0),Object(p["__decorate"])([Object(f["e"])({type:String,required:!0})],xt.prototype,"userId",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0,type:Array})],xt.prototype,"paymentPackages",void 0),xt=Object(p["__decorate"])([Object(g["b"])({name:"MessageList",components:{MessageItem:kt,InfiniteScroll:St["a"]}})],xt);var Tt=xt,wt=Tt,Pt=(a("2b24"),Object(le["a"])(wt,N,B,!1,null,"3e5a6ebf",null)),At=Pt.exports,Et=function(e){Object(l["a"])(a,e);var t=Object(d["a"])(a);function a(){return Object(o["a"])(this,a),t.apply(this,arguments)}return Object(u["a"])(a,[{key:"handleCall",value:function(){this.isWebRTCSupported?y["a"].emit(S["b"].CALL_OUTGOING,{opponentUser:this.user}):y["a"].emit(S["b"].NOTIFICATION_SHOW,{text:Object(O["a"])("This browser does not support WebRTC")})}},{key:"addMessage",value:function(e){this.$emit("addMessage",e),this.messagesListElement.scrollTo({top:0})}},{key:"receivedMessage",value:function(){this.messagesListElement.scrollTop<100&&this.messagesListElement.scrollTo({top:0})}},{key:"reverseScroll",value:function(e){e.preventDefault(),this.messagesListElement.scrollBy({top:-e.deltaY})}},{key:"created",value:function(){this.$on("receivedMessage",this.receivedMessage)}},{key:"beforeDestroy",value:function(){this.$off("receivedMessage",this.receivedMessage)}},{key:"messagesListElement",get:function(){return Object(w["c"])(this.$refs.list)}},{key:"screenName",get:function(){var e,t;return null!==(e=null===(t=this.user)||void 0===t?void 0:t.screenName)&&void 0!==e?e:""}},{key:"pinned",get:function(){var e;return!(null===(e=this.messageThread)||void 0===e||!e.pinTime)}},{key:"titleComponent",get:function(){return this.user?"router-link":"div"}},{key:"profileTo",get:function(){return this.user?Object(P["e"])(this.user):void 0}},{key:"isCallable",get:function(){var e;return I["a"].featureCalling&&this.user&&this.user.id!==this.authUserId&&(null===(e=this.userCallOptions)||void 0===e?void 0:e.enabled)}},{key:"isWebRTCSupported",get:function(){return Object(T["b"])()&&Object(T["a"])()}},{key:"userId",get:function(){var e,t;return null!==(e=null===(t=this.user)||void 0===t?void 0:t.id)&&void 0!==e?e:""}},{key:"threadIds",get:function(){var e;return this.messageThread?[null===(e=this.messageThread)||void 0===e?void 0:e.id]:void 0}}]),a}(x["default"]);Object(p["__decorate"])([Object(f["e"])({required:!0})],Et.prototype,"loading",void 0),Object(p["__decorate"])([Object(f["e"])({type:String,required:!0})],Et.prototype,"authUserId",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0})],Et.prototype,"messageThread",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0})],Et.prototype,"messages",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0})],Et.prototype,"minUnreadMessageId",void 0),Object(p["__decorate"])([Object(f["e"])({type:Boolean,default:!1})],Et.prototype,"enableScroll",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0})],Et.prototype,"user",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0})],Et.prototype,"userCallOptions",void 0),Object(p["__decorate"])([Object(f["e"])({required:!0,type:Array})],Et.prototype,"paymentPackages",void 0),Object(p["__decorate"])([Object(f["e"])({type:Boolean})],Et.prototype,"threadFirst",void 0),Object(p["__decorate"])([Object(f["e"])({type:Boolean})],Et.prototype,"canSendMessages",void 0),Object(p["__decorate"])([Object(f["e"])({type:Boolean})],Et.prototype,"canSendAttachment",void 0),Et=Object(p["__decorate"])([Object(g["b"])({name:"MessagesView",components:{MessageList:At,BasePage:U["a"],PageTitle:$["a"],BaseAvatar:R["a"],MessageSendWithAttachment:A["a"],BaseIcon:E["a"]}})],Et);var Ut=Et,$t=Ut,Rt=(a("0782"),Object(le["a"])($t,M,C,!1,null,"cffdd8be",null)),Nt=Rt.exports,Bt=function(e){Object(l["a"])(a,e);var t=Object(d["a"])(a);function a(){var e;return Object(o["a"])(this,a),e=t.apply(this,arguments),e.loading=!1,e.enableScroll=!1,e.processingPin=!1,e.checkConvertingStatusTimeoutId=null,e.messagesSearchResult=null,e.messageThread=null,e.user=null,e.userCallOptions=null,e.paymentPackages=[],e.providedData={user:null},e}return Object(u["a"])(a,[{key:"onUserChanged",value:function(e){this.providedData.user=e}},{key:"togglePin",value:function(){var e=Object(c["a"])(h.a.mark((function e(){var t;return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.messageThread&&!this.processingPin){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,this.processingPin=!0,e.next=6,j["a"].MessageThreadsProvider.togglePin({threadId:this.messageThread.id});case 6:t=e.sent,y["a"].emit(S["b"].NOTIFICATION_SHOW,{text:t?Object(O["a"])("Marked as important"):Object(O["a"])("Marked as common"),timeout:2e3}),this.$set(this.messageThread,"pinTime",t?(new Date).toISOString():null);case 9:return e.prev=9,this.processingPin=!1,e.finish(9);case 12:case"end":return e.stop()}}),e,this,[[2,,9,12]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"watchingMessages",value:function(){var e,t=(null!==(e=this.convertingMessages)&&void 0!==e?e:[]).map((function(e){return e.id}));t.length>0&&!this.checkConvertingStatusTimeoutId&&this.checkConvertingStatus()}},{key:"markRead",value:function(e){y["a"].emit(S["b"].MESSAGES_MARK_READ,e)}},{key:"cleanTimeout",value:function(){this.checkConvertingStatusTimeoutId&&clearTimeout(this.checkConvertingStatusTimeoutId),this.checkConvertingStatusTimeoutId=null}},{key:"checkConvertingStatus",value:function(){var e=this;this.cleanTimeout(),this.checkConvertingStatusTimeoutId=setTimeout(Object(c["a"])(h.a.mark((function t(){var a,s,n;return h.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(s=(null!==(a=e.convertingMessages)&&void 0!==a?a:[]).map((function(e){return e.id})),0!==s.length){t.next=4;break}return e.cleanTimeout(),t.abrupt("return");case 4:return t.next=6,j["a"].MessagesProvider.find({data:{ids:s}});case 6:n=t.sent,n.result.length>0&&e.messagesSearchResult&&e.$set(e.messagesSearchResult,"result",e.messagesSearchResult.result.map((function(e){var t;return null!==(t=n.result.find((function(t){return t.id===e.id})))&&void 0!==t?t:e}))),e.checkConvertingStatus();case 9:case"end":return t.stop()}}),t)}))),3e3)}},{key:"markedRead",value:function(e){if(this.messageThread){var t=Number(e.id),a=Number(this.minUnreadMessageId);if(a>0||a<t){var s=this.messageList[this.messageList.length-1];s.id===e.id&&(t=-1),this.$set(this.messageThread,"minUnreadMessageId",t+1+"")}}}},{key:"getPrevMessages",value:function(){var e=Object(c["a"])(h.a.mark((function e(t){return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,this.messagesSearchResult){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.getMessages(this.messagesSearchResult.page+1,!1);case 5:return e.prev=5,t(),e.finish(5);case 8:case"end":return e.stop()}}),e,this,[[0,,5,8]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getMessages",value:function(){var e=Object(c["a"])(h.a.mark((function e(){var t,a,s,n,r,c,o=this,u=arguments;return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:0,a=!(u.length>1&&void 0!==u[1])||u[1],this.enableScroll=!1,e.prev=3,this.messageThread){e.next=25;break}if(e.prev=5,j["a"].MessagesProvider.setReceiveErrors(!1),!this.userId){e.next=14;break}return e.next=10,j["a"].MessageThreadsProvider.findPersonal({opponentId:this.userId});case 10:this.messageThread=e.sent,this.user=this.messageThread.users.find((function(e){return e.id===o.userId}))||null,e.next=21;break;case 14:if(!this.threadId){e.next=21;break}return e.next=17,j["a"].MessageThreadsProvider.find({data:{ids:[this.threadId],userId:this.authUserStrict.id}});case 17:return this.messageThread=e.sent.result[0],e.next=20,this.getMemberMasterThreadUser(this.messageThread);case 20:this.user=e.sent;case 21:e.next=25;break;case 23:e.prev=23,e.t0=e["catch"](5);case 25:if(this.user||!this.userId){e.next=30;break}return e.next=28,j["a"].UserPublicDataProvider.search({data:{id:[this.userId]}});case 28:s=e.sent,this.user=s.result.find((function(e){return e.id===o.userId}))||null;case 30:if(this.user){e.next=33;break}return this.$router.push({name:"messageThreads"}),e.abrupt("return");case 33:if(this.messageThread){e.next=35;break}return e.abrupt("return");case 35:return e.next=37,j["a"].MessagesProvider.find({data:{threadId:this.messageThread.id,sort:"TIME,DESC",page:t}});case 37:n=e.sent,this.messagesSearchResult=Object(i["a"])(Object(i["a"])({},n),{},{result:!a&&this.messagesSearchResult?this.messagesSearchResult.result.concat(n.result):n.result});case 39:return e.prev=39,this.enableScroll=null!==(r=null===(c=this.messagesSearchResult)||void 0===c?void 0:c.hasNextPage)&&void 0!==r&&r,e.finish(39);case 42:case"end":return e.stop()}}),e,this,[[3,,39,42],[5,23]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"getMemberMasterThreadUser",value:function(){var e=Object(c["a"])(h.a.mark((function e(t){var a,s,n=this;return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return s=null!==(a=t.users.find((function(e){return e.id===n.authUserStrict.id})))&&void 0!==a?a:null,s||(s=t.users.find((function(e){return e.id!==n.authUserStrict.id}))||null),e.abrupt("return",s);case 3:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"addMessage",value:function(e){if(!this.messageThread||!this.messagesSearchResult)return this.getMessages();var t=this.messagesSearchResult.result;this.$set(this.messagesSearchResult,"result",[e].concat(Object(r["a"])(t))),this.messagesSearchResult.hasNextPage&&this.messagesSearchResult.result.pop()}},{key:"receivedMessage",value:function(){var e=Object(c["a"])(h.a.mark((function e(t){var a;return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("0"!==t.senderId||this.messageThread){e.next=3;break}return e.next=3,this.getMessages();case 3:if(t.senderId!==this.authUserStrict.id&&(null===(a=this.messageThread)||void 0===a?void 0:a.id)===t.threadId&&!this.messageList.find((function(e){return e.id===t.id}))){e.next=5;break}return e.abrupt("return");case 5:return this.addMessage(t),e.next=8,this.$nextTick();case 8:this.$refs.messagesView.$emit("receivedMessage"),this.messageThread&&"0"===this.messageThread.minUnreadMessageId&&this.$set(this.messageThread,"minUnreadMessageId",t.id);case 10:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"updatePurchasedMessage",value:function(){var e=Object(c["a"])(h.a.mark((function e(t){var a,s;return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.messagesSearchResult){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,j["a"].MessagesProvider.find({data:{ids:[t]}});case 4:a=e.sent,s=a.result[0],this.$set(this.messagesSearchResult,"result",this.messagesSearchResult.result.map((function(e){return e.id===s.id?s:e})));case 7:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getPageData",value:function(){var e=Object(c["a"])(h.a.mark((function e(){var t,a=this;return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,t=function(){var e=Object(c["a"])(h.a.mark((function e(){var t;return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(I["a"].featureCalling&&a.userId){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,j["a"].CallOptionsProvider.find({userIds:[a.userId]});case 4:if(e.t1=t=e.sent.find((function(e){return e.userId===a.userId})),e.t0=null!==e.t1,!e.t0){e.next=8;break}e.t0=void 0!==t;case 8:if(!e.t0){e.next=12;break}e.t2=t,e.next=13;break;case 12:e.t2=null;case 13:a.userCallOptions=e.t2;case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.next=5,Promise.all([this.getMessages(),t(),j["a"].PaymentPackageProvider.findAll({type:[b["PaymentPackageEnum"].MESSAGE_ATTACHMENT]}).then((function(e){a.paymentPackages=e}))]);case 5:return e.prev=5,this.loading=!1,e.finish(5);case 8:case"end":return e.stop()}}),e,this,[[0,,5,8]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"watchUserId",value:function(){this.loading=!1,this.enableScroll=!1,this.messagesSearchResult=null,this.messageThread=null,this.user=null,this.userCallOptions=null,this.paymentPackages=[],this.getPageData()}},{key:"created",value:function(){var e=Object(c["a"])(h.a.mark((function e(){return h.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getPageData();case 2:y["a"].on(S["b"].MESSAGES_NEW_MESSAGE,this.receivedMessage),y["a"].on(S["b"].MESSAGES_MARKED_READ,this.markedRead),y["a"].on(S["b"].MESSAGES_UPDATE_MESSAGE,this.updatePurchasedMessage);case 5:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"mounted",value:function(){y["a"].emit(S["b"].MAIN_MENU_HIDE,{hide:!0})}},{key:"beforeDestroy",value:function(){y["a"].off(S["b"].MESSAGES_NEW_MESSAGE,this.receivedMessage),y["a"].off(S["b"].MESSAGES_MARKED_READ,this.markedRead),y["a"].off(S["b"].MESSAGES_UPDATE_MESSAGE,this.updatePurchasedMessage),y["a"].emit(S["b"].MAIN_MENU_HIDE,{hide:!1}),this.cleanTimeout()}},{key:"canSendMessages",get:function(){var e,t=this;return!!(this.threadId&&this.messageThread&&null!==(e=this.messageThread)&&void 0!==e&&e.users.find((function(e){return e.id===t.authUserStrict.id}))||this.userId)}},{key:"canSendAttachment",get:function(){var e;return!Object(v["checkRole"])((null===(e=this.authUser)||void 0===e?void 0:e.role)||"","member")}},{key:"messageList",get:function(){var e,t;return Array.from(null!==(e=null===(t=this.messagesSearchResult)||void 0===t?void 0:t.result)&&void 0!==e?e:[]).reverse()}},{key:"convertingMessages",get:function(){var e,t;return(null!==(e=null===(t=this.messagesSearchResult)||void 0===t?void 0:t.result)&&void 0!==e?e:[]).filter((function(e){return e.attachment.length>0&&e.attachment.some((function(e){return["NEW","CONVERTING"].includes(e.file.processingStatus)}))}))}},{key:"minUnreadMessageId",get:function(){var e,t;return null!==(e=null===(t=this.messageThread)||void 0===t?void 0:t.minUnreadMessageId)&&void 0!==e?e:"0"}}]),a}(Object(g["c"])(k["a"]));Object(p["__decorate"])([Object(f["e"])({type:String})],Bt.prototype,"userId",void 0),Object(p["__decorate"])([Object(f["e"])({type:String})],Bt.prototype,"threadId",void 0),Object(p["__decorate"])([Object(f["f"])("messageData")],Bt.prototype,"providedData",void 0),Object(p["__decorate"])([Object(f["i"])("user")],Bt.prototype,"onUserChanged",null),Object(p["__decorate"])([Object(f["i"])("messagesSearchResult",{deep:!0})],Bt.prototype,"watchingMessages",null),Object(p["__decorate"])([Object(_["e"])(1e3,{leading:!1})],Bt.prototype,"markRead",null),Object(p["__decorate"])([Object(f["i"])("userId")],Bt.prototype,"watchUserId",null),Bt=Object(p["__decorate"])([Object(g["b"])({name:"PageMessages",components:{MessagesView:Nt}})],Bt);var qt=Bt,Dt=qt,Lt=Object(le["a"])(Dt,s,n,!1,null,null,null),Vt=Lt.exports},"27e0":function(e,t,a){},"2b24":function(e,t,a){"use strict";a("dd51")},"2fcd":function(e,t,a){"use strict";a("d98a")},"483c":function(e,t,a){"use strict";a("6bd2")},"619e":function(e,t,a){},"6bd2":function(e,t,a){},"6fee":function(e,t,a){},"75d5":function(e,t,a){"use strict";a("9869")},"780f":function(e,t,a){},"794d":function(e,t,a){"use strict";a("780f")},"89a4":function(e,t,a){"use strict";a("619e")},"8a52":function(e,t,a){"use strict";var s=a("d4ec"),n=a("bee2"),r=a("262e"),i=a("2caf"),c=a("9ab4"),o=a("2b0e"),u=a("2fe1"),l=a("60a3"),d=a("b166"),m=a("e3ee"),h=function(e){Object(r["a"])(a,e);var t=Object(i["a"])(a);function a(){return Object(s["a"])(this,a),t.apply(this,arguments)}return Object(n["a"])(a,[{key:"mounted",value:function(){this.$emit("rendered",{el:this.$el})}},{key:"hoursMinutes",get:function(){return Object(d["a"])(Object(m["a"])(this.message.time),"HH:mm")}},{key:"opponentMessage",get:function(){return this.message.senderId!==this.authUserId}}]),a}(o["default"]);Object(c["__decorate"])([Object(l["e"])({required:!0})],h.prototype,"message",void 0),Object(c["__decorate"])([Object(l["e"])({type:String,required:!0})],h.prototype,"authUserId",void 0),h=Object(c["__decorate"])([Object(u["b"])({name:"MessageView"})],h),t["a"]=h},"8cd2":function(e,t,a){},"8d2a":function(e,t,a){"use strict";a("be46")},"969c":function(e,t,a){},9869:function(e,t,a){},b745:function(e,t,a){"use strict";a.d(t,"a",(function(){return C}));a("7db0"),a("c975"),a("c96a");var s=a("5530"),n=a("2b0e"),r=a("1675"),i=a("9b43"),c=a("ef28"),o=a("bc5a"),u=a("dfc7"),l=a("76da"),d=a("78f9"),m=a("0fb2"),h=a("b06d"),p=a("9058"),f=a("1763"),g=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("router-link",{staticClass:"content-feed-cover-author pa-4",attrs:{to:e.getProfileUrl(e.user)}},[a("base-avatar",{staticClass:"content-feed-cover-author__avatar",attrs:{size:40,user:e.user,"hide-online-status":""}}),a("span",{staticClass:"content-feed-cover-author__username ml-2"},[e._v(e._s(e.user.screenName)+" ")])],1)},v=[],b=a("a6f4"),_=a("64ae"),O=a("7fc7"),y=Object(b["c"])({name:"ContentFeedCoverAuthor",components:{BaseAvatar:O["a"]},props:{user:{type:Object,required:!0}},data:function(){return{getProfileUrl:_["e"]}}}),j=y,k=(a("2fcd"),a("2877")),S=Object(k["a"])(j,g,v,!1,null,"6e62fefe",null),I=S.exports;function M(e){return"files"in e}var C=n["default"].extend({functional:!0,props:{postData:{type:Object,required:!0},small:{type:Boolean,default:!1},hideIcon:{type:Boolean,default:!1},authUserId:{type:String,default:""},currentAuthorities:{type:Array,default:function(){return[]}},withAuthor:{type:Boolean,default:!1},withProportion:{type:Boolean,default:!1}},render:function(e,t){var a=t.props,n=a.postData,g=a.authUserId,v=a.currentAuthorities,b=M(n)?n.files.find((function(e){return Object(o["g"])(e)})):n.cover,_=b&&Object(o["i"])(b)?"getVideoThumbnail":"getImageThumbnail",O=b?u["a"][_](b.urlPart,"480p"):"",y=[],j=g===n.userId,k=!0;j?"ERROR"===n.processingStatus?y.push(e(p["a"],{props:{fontSize:24},staticClass:"content-feed-cover__gradient-icon mr-1 mb-1"},["sci-color-error"]),e(p["a"],{staticClass:"content-feed-cover__main-icon"},["sci-eye-off"])):["NEW","CONVERTING"].indexOf(n.processingStatus)>-1?y.push(e(f["a"],{props:{small:!0},staticClass:"content-feed-cover__gradient-icon link mr-1 mb-1"},[Object(d["a"])("Processing...")]),e(p["a"],{staticClass:"content-feed-cover__main-icon"},["sci-processing"])):n.scheduleTime&&Object(c["parseISO"])(n.scheduleTime).getTime()>=Date.now()?y.push(e(f["a"],{props:{small:!0},staticClass:"content-feed-cover__gradient-icon link mr-1 mb-1"},[Object(l["format"])(Object(c["parseISO"])(n.scheduleTime),"MM.dd.yy")]),e(p["a"],{staticClass:"content-feed-cover__main-icon"},["sci-watch"])):n.publishTime?k=!1:y.push(e(p["a"],{staticClass:"content-feed-cover__main-icon"},["sci-eye-off"])):k=!1;var S="sci-file-multiple";n.type===r["ContentFeedTypeEnum"].EVENT?S="sci-calendar":n.type===r["ContentFeedTypeEnum"].MEDIA&&M(n)&&(S=Object(o["b"])(n.files));var C=function(){if(!t.props.hideIcon)return e(p["a"],{staticClass:"content-feed-cover__icon"},[S])},x=!(!M(n)||!Object(i["checkAuthorities"])(v,j?["updateMyContentSet"]:["updateAnyContentSet"]))&&("0"!==n.subscriptionLevelId||"0"!==n.pricePackageId),T=function(){if(x)return e(p["a"],{staticClass:"content-feed-cover__icon"},["sci-lock"])},w=function(){if(!(!M(n)||M(n)&&n.purchased))return e(p["a"],{staticClass:"content-feed-cover__icon",props:{fontSize:"34"}},["sci-lock"])},P=b?Math.ceil(b.height/b.width*100):100;return e("div",Object(s["a"])(Object(s["a"])({},t.data),{},{class:Object(s["a"])({"content-feed-cover":!0,__small:t.props.small,__gradient:k},t.data.class),style:t.props.withProportion?{"padding-bottom":"".concat(P,"%"),"grid-row":"span ".concat(Math.floor(P/10))}:{},on:Object(s["a"])({},t.listeners)}),[O&&e(m["a"],{class:{"content-feed-cover__image":!0},props:{src:O,topRightIcon:!t.props.hideIcon,bottomLeftIcon:x,centerIcon:!j},scopedSlots:{"top-right":C,"bottom-left":T,"center-icon":w}}),!O&&e(h["a"],{class:{"content-feed-cover__image":!0},props:{type:n.type},scopedSlots:{"top-right":C,"bottom-left":T,center:w}}),k&&e("div",{staticClass:"content-feed-cover__gradient"},y)||y,t.props.withAuthor&&M(n)&&e(I,{class:{"content-feed-cover__author":!0},props:{user:n.user}})])}})},be46:function(e,t,a){},bfb2:function(e,t,a){var s={"./SystemMessageCall.vue":"db3d","./SystemMessageTip.vue":"def5"};function n(e){var t=r(e);return a(t)}function r(e){if(!a.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}n.keys=function(){return Object.keys(s)},n.resolve=r,e.exports=n,n.id="bfb2"},d98a:function(e,t,a){},d9c8:function(e,t,a){"use strict";a("8cd2")},db3d:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-item",class:{__opponent:e.opponentMessage}},[a("div",{staticClass:"message-item__text system-message-call d-center"},[a("div",[a("div",[e._v(e._s(e.text))]),e.callDuration?a("div",{staticClass:"system-message-call__time"},[e._v(e._s(e.callDuration))]):e._e()]),a("base-icon",{staticClass:"system-message-call__icon",attrs:{"font-size":"24",color:"var(--palette-secondary)"}},[e._v("sci-phone")])],1),a("div",{staticClass:"message-item__time"},[e._v(e._s(e.hoursMinutes))])])},n=[],r=(a("a9e3"),a("d4ec")),i=a("bee2"),c=a("262e"),o=a("2caf"),u=a("9ab4"),l=a("2fe1"),d=a("8a52"),m=a("392c"),h=a("78f9"),p=a("76da"),f=a("9058"),g=function(e){Object(c["a"])(a,e);var t=Object(o["a"])(a);function a(){return Object(r["a"])(this,a),t.apply(this,arguments)}return Object(i["a"])(a,[{key:"opponentMessage",get:function(){return!!Object(m["isCallMessageDetails"])(this.message.details)&&this.message.details.callerId!==Number(this.authUserId)}},{key:"text",get:function(){if(Object(m["isCallMessageDetails"])(this.message.details)){var e=this.message.details.status;if(e===m["CallStatus"].ENDED)return this.opponentMessage?Object(h["a"])("{0} call",[Object(h["a"])("Incoming")]):Object(h["a"])("{0} call",[Object(h["a"])("Outgoing")]);if(this.opponentMessage)return Object(h["a"])("{0} call",[Object(h["a"])("Missed")]);if(e===m["CallStatus"].CANCELLED)return Object(h["a"])("{0} call",[Object(h["a"])("Cancelled")]);if(e===m["CallStatus"].DECLINED)return Object(h["a"])("{0} call",[Object(h["a"])("Declined")])}return""}},{key:"callDuration",get:function(){if(Object(m["isCallMessageDetails"])(this.message.details)&&this.message.details.startTime&&this.message.details.endTime){var e=new Date(this.message.details.endTime).getTime()-new Date(this.message.details.startTime).getTime();return Object(p["toTimePassed"])(e)}return""}}]),a}(Object(l["c"])(d["a"]));g=Object(u["__decorate"])([Object(l["b"])({name:"SystemMessageCall",components:{BaseIcon:f["a"]}})],g);var v=g,b=v,_=(a("f4d6"),a("2877")),O=Object(_["a"])(b,s,n,!1,null,"09c1482d",null);t["default"]=O.exports},dd51:function(e,t,a){},def5:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.details?a("div",{staticClass:"message-item",class:{__opponent:e.opponentMessage}},[a("div",{staticClass:"message-item__text d-flex px-4 py-4"},[a("base-icon",{staticClass:"mr-4 message-item__icon",attrs:{"font-size":"24"}},[e._v("sci-tip")]),a("format-money",{attrs:{cost:e.details.amount,hideNumberSymbol:!1},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.symbol,n=t.amount,r=t.separator;return[a("span",{staticClass:"subtitle-3 message-item__price"},[e._v(e._s(e.$t("I sent you a {0} tip!",[""+s+n[0]+r+n[1]])))])]}}],null,!1,2976029155)})],1),a("div",{staticClass:"message-item__time"},[e._v(e._s(e.hoursMinutes))])]):e._e()},n=[],r=a("a6f4"),i=a("6a2d"),c=a("76da"),o=a("eae9"),u=a("9058"),l=Object(r["c"])({name:"SystemMessageTip",inheritAttrs:!1,components:{FormatMoney:o["a"],BaseIcon:u["a"]},props:{message:{type:Object,required:!0},authUserId:{type:String,required:!0}},computed:{details:function(){return Object(i["isTipMessageDetails"])(this.message.details)?this.message.details:null},hoursMinutes:function(){return Object(c["formatDate"])(new Date(this.message.time),{hour:"2-digit",minute:"2-digit",hour12:!1})},opponentMessage:function(){var e;return(null===(e=this.message.senderUser)||void 0===e?void 0:e.id)!==this.authUserId}},mounted:function(){this.$emit("rendered",{el:this.$el})}}),d=l,m=(a("89a4"),a("2877")),h=Object(m["a"])(d,s,n,!1,null,"6e7e56fc",null);t["default"]=h.exports},e74d:function(e,t,a){"use strict";a("6fee")},f4d6:function(e,t,a){"use strict";a("27e0")}}]);