Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/mixin/dist/ |
Upload File : |
this.BX=this.BX||{};this.BX.Messenger=this.BX.Messenger||{};(function(e,t,i,n,s,a,r,o,l,d){"use strict";function u(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?u(Object(i),!0).forEach((function(t){babelHelpers.defineProperty(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var g={data:function e(){return{dialogState:o.DialogState.loading}},created:function e(){this.timer=new n.Timer},methods:{getController:function e(){return this.$Bitrix.Data.get("controller")},getApplicationController:function e(){return this.getController().application},getApplication:function e(){return this.$Bitrix.Application.get()},getRestClient:function e(){return this.$Bitrix.RestClient.get()},getCurrentUser:function e(){return this.$store.getters["users/get"](this.application.common.userId,true)},executeRestAnswer:function e(t,i,n){this.getController().executeRestAnswer(t,i,n)},isUnreadMessagesLoaded:function e(){if(!this.dialog){return true}if(this.dialog.lastMessageId<=0){return true}if(!this.messageCollection||this.messageCollection.length<=0){return true}var t=0;for(var i=this.messageCollection.length-1;i>=0;i--){var n=this.messageCollection[i];if(typeof n.id==="number"){t=n.id;break}}return t>=this.dialog.lastMessageId},openDialog:function e(){}},computed:c(c({dialog:function e(){var e=this.$store.getters["dialogues/get"](this.application.dialog.dialogId);return e?e:this.$store.getters["dialogues/getBlank"]()},chatId:function e(){if(this.application){return this.application.dialog.chatId}},diskFolderId:function e(){return this.application.dialog.diskFolderId},messageCollection:function e(){return this.$store.getters["messages/get"](this.application.dialog.chatId)},isDialogShowingMessages:function e(){var t=this.messageCollection&&this.messageCollection.length>0;if(t){this.dialogState=o.DialogState.show}else if(this.dialog&&this.dialog.init){this.dialogState=o.DialogState.empty}else{this.dialogState=o.DialogState.loading}return t},isDarkBackground:function e(){return this.application.options.darkBackground}},t.Vuex.mapState({application:function e(t){return t.application}})),{},{localize:function e(){return i.BitrixVue.getFilteredPhrases(["IM_DIALOG_","IM_UTILS_","IM_MESSENGER_DIALOG_","IM_QUOTE_"],this)}})};function h(e,t){var i=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=f(e))||t&&e&&typeof e.length==="number"){if(i)e=i;var n=0;var s=function e(){};return{s:s,n:function t(){if(n>=e.length)return{done:true};return{done:false,value:e[n++]}},e:function e(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a=true,r=false,o;return{s:function t(){i=i.call(e)},n:function e(){var t=i.next();a=t.done;return t},e:function e(t){r=true;o=t},f:function e(){try{if(!a&&i["return"]!=null)i["return"]()}finally{if(r)throw o}}}}function f(e,t){if(!e)return;if(typeof e==="string")return p(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor)i=e.constructor.name;if(i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return p(e,t)}function p(e,t){if(t==null||t>e.length)t=e.length;for(var i=0,n=new Array(t);i<t;i++){n[i]=e[i]}return n}var m={data:function e(){return{lastMessageToRead:null,messagesToRead:[]}},created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.readMessage,this.onReadMessage)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.readMessage,this.onReadMessage)},methods:{onReadMessage:function e(t){var i=t.data;this.readMessage(i.id).then((function(){return d.Logger.log("Read message complete")}))["catch"]((function(){return d.Logger.error("Read message failed")}))},readMessage:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(i){this.messagesToRead.push(parseInt(i))}this.timer.stop("readMessage",this.chatId,true);this.timer.stop("readMessageServer",this.chatId,true);if(n){return this.readMessageRequest(s)}return new Promise((function(e,i){t.timer.start("readMessage",t.chatId,.1,(function(){t.readMessageRequest(s).then((function(t){return e(t)}))["catch"](i)}))}))},readMessageRequest:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;return new Promise((function(e,n){var s=h(t.messagesToRead),a;try{for(s.s();!(a=s.n()).done;){var r=a.value;if(!t.lastMessageToRead){t.lastMessageToRead=r}else if(t.lastMessageToRead<r){t.lastMessageToRead=r}}}catch(e){s.e(e)}finally{s.f()}t.messagesToRead=[];var l=t.lastMessageToRead||0;if(l<=0){return e({lastId:0})}t.$store.dispatch("messages/readMessages",{chatId:t.chatId,readId:l}).then((function(e){return t.$store.dispatch("dialogues/decreaseCounter",{dialogId:t.dialogId,count:e.count})})).then((function(){if(i){return e({lastId:l})}t.timer.start("readMessageServer",t.chatId,.5,(function(){t.getRestClient().callMethod(o.RestMethod.imDialogRead,{DIALOG_ID:t.dialogId,MESSAGE_ID:l}).then((function(){return e({lastId:l})}))["catch"](n)}))}))["catch"](n)}))}}};var v={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.quoteMessage,this.onQuoteMessage);r.EventEmitter.subscribe(o.EventType.dialog.quotePanelClose,this.onQuotePanelClose)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.quoteMessage,this.onQuoteMessage);r.EventEmitter.unsubscribe(o.EventType.dialog.quotePanelClose,this.onQuotePanelClose)},methods:{onQuoteMessage:function e(t){var i=t.data;this.quoteMessage({id:i.message.id})},onQuotePanelClose:function e(){this.quoteMessageClear()},quoteMessage:function e(t){var i=t.id;this.$store.dispatch("dialogues/update",{dialogId:this.dialogId,fields:{quoteId:i}})},quoteMessageClear:function e(){this.$store.dispatch("dialogues/update",{dialogId:this.dialogId,fields:{quoteId:0}})}}};var E={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnCommand,this.onClickOnCommand)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnCommand,this.onClickOnCommand)},methods:{onClickOnCommand:function e(t){var i=t.data;if(i.type==="put"){this.insertText({text:i.value+" "})}else if(i.type==="send"){this.addMessageOnClient(i.value)}else{d.Logger.warn("Unprocessed command",i)}}}};var b={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnMention,this.onClickOnMention)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnMention,this.onClickOnMention)},methods:{onClickOnMention:function e(t){var i=t.data;if(i.type==="USER"){this.openProfile(i.value)}else if(i.type==="CHAT"){this.openDialog(i.value)}else if(i.type==="CALL"){this.openPhoneMenu(i.value)}},openProfile:function e(){},openPhoneMenu:function e(){}}};var M={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnUserName,this.onClickOnUserName)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnUserName,this.onClickOnUserName)},methods:{onClickOnUserName:function e(t){var i=t.data;this.replyToUser(i.user.id,i.user)},replyToUser:function e(){}}};var C={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnMessageMenu,this.onClickOnMessageMenu)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnMessageMenu,this.onClickOnMessageMenu)},methods:{onClickOnMessageMenu:function e(t){var i=t.data;this.openMessageMenu(i.message)},openMessageMenu:function e(){}}};var I={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnMessageRetry,this.onClickOnMessageRetry)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnMessageRetry,this.onClickOnMessageRetry)},methods:{onClickOnMessageRetry:function e(t){var i=t.data;this.retrySendMessage(i.message)},retrySendMessage:function e(){}}};var y={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnUploadCancel,this.onClickOnUploadCancel)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnUploadCancel,this.onClickOnUploadCancel)},methods:{onClickOnUploadCancel:function e(t){var i=t.data;this.cancelUploadFile(i.file.id)},cancelUploadFile:function e(){}}};var T={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnReadList,this.onClickOnReadList)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnReadList,this.onClickOnReadList)},methods:{onClickOnReadList:function e(t){var i=t.data;this.openReadList(i.list)},openReadList:function e(){}}};var D={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.setMessageReaction,this.onSetMessageReaction)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.setMessageReaction,this.onSetMessageReaction)},methods:{onSetMessageReaction:function e(t){var i=t.data;this.reactMessage(i.message.id,i.reaction)},reactMessage:function e(t){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"auto";this.getRestClient().callMethod(o.RestMethod.imMessageLike,{MESSAGE_ID:t,ACTION:i==="auto"?"auto":i==="set"?"plus":"minus"})}}};var O={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.openMessageReactionList,this.onOpenMessageReactionList)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.openMessageReactionList,this.onOpenMessageReactionList)},methods:{onOpenMessageReactionList:function e(t){var i=t.data;this.openMessageReactionList(i.message.id,i.values)},openMessageReactionList:function e(){}}};var k={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnKeyboardButton,this.onClickOnKeyboardButton)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnKeyboardButton,this.onClickOnKeyboardButton)},methods:{onClickOnKeyboardButton:function e(t){var i=this;var n=t.data;if(n.action==="ACTION"){var a=n.params,l=a.dialogId,d=a.messageId,u=a.botId,c=a.action,g=a.value;if(c==="SEND"){this.addMessageOnClient(g);setTimeout((function(){r.EventEmitter.emit(o.EventType.dialog.scrollToBottom,{chatId:i.chatId,duration:300,cancelIfScrollChange:false})}),300)}else if(c==="PUT"){this.insertText({text:g+" "})}else if(c==="CALL");else if(c==="COPY"){s.Clipboard.copy(g);BX.UI.Notification.Center.notify({content:this.localize["IM_DIALOG_CLIPBOARD_COPY_SUCCESS"],autoHideDelay:4e3})}return true}if(n.action==="COMMAND"){var h=n.params,f=h.dialogId,p=h.messageId,m=h.botId,v=h.command,E=h.params;this.getRestClient().callMethod(o.RestMethod.imMessageCommand,{MESSAGE_ID:p,DIALOG_ID:f,BOT_ID:m,COMMAND:v,COMMAND_PARAMS:E});return true}return false}}};var S={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnChatTeaser,this.onClickOnChatTeaser)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnChatTeaser,this.onClickOnChatTeaser)},methods:{onClickOnChatTeaser:function e(t){var i=this;var n=t.data;this.joinParentChat(n.message.id,"chat"+n.message.params.CHAT_ID).then((function(e){i.openDialog(e)}))["catch"]((function(){}));return true},joinParentChat:function e(t,i){var n=this;return new Promise((function(e,s){if(!t||!i){return s()}if(typeof n.tempJoinChat==="undefined"){n.tempJoinChat={}}else if(n.tempJoinChat["wait"]){return s()}n.tempJoinChat["wait"]=true;n.getRestClient().callMethod(o.RestMethod.imChatParentJoin,{DIALOG_ID:i,MESSAGE_ID:t}).then((function(){n.tempJoinChat["wait"]=false;n.tempJoinChat[i]=true;return e(i)}))["catch"]((function(){n.tempJoinChat["wait"]=false;return s()}))}))}}};var R={created:function e(){r.EventEmitter.subscribe(o.EventType.dialog.clickOnDialog,this.onClickOnDialog)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.dialog.clickOnDialog,this.onClickOnDialog)},methods:{onClickOnDialog:function e(t){var i=t.data;return true}}};var x={data:function e(){return{messagesToSend:[]}},created:function e(){r.EventEmitter.subscribe(o.EventType.textarea.sendMessage,this.onSendMessage);r.EventEmitter.subscribe(o.EventType.textarea.startWriting,this.onTextareaStartWriting);r.EventEmitter.subscribe(o.EventType.textarea.appButtonClick,this.onTextareaAppButtonClick);r.EventEmitter.subscribe(o.EventType.textarea.focus,this.onTextareaFocus);r.EventEmitter.subscribe(o.EventType.textarea.blur,this.onTextareaBlur);r.EventEmitter.subscribe(o.EventType.textarea.keyUp,this.onTextareaKeyUp);r.EventEmitter.subscribe(o.EventType.textarea.edit,this.onTextareaEdit)},beforeDestroy:function e(){r.EventEmitter.unsubscribe(o.EventType.textarea.sendMessage,this.onSendMessage);r.EventEmitter.unsubscribe(o.EventType.textarea.startWriting,this.onTextareaStartWriting);r.EventEmitter.unsubscribe(o.EventType.textarea.appButtonClick,this.onTextareaAppButtonClick);r.EventEmitter.unsubscribe(o.EventType.textarea.focus,this.onTextareaFocus);r.EventEmitter.unsubscribe(o.EventType.textarea.blur,this.onTextareaBlur);r.EventEmitter.unsubscribe(o.EventType.textarea.keyUp,this.onTextareaKeyUp);r.EventEmitter.unsubscribe(o.EventType.textarea.edit,this.onTextareaEdit)},methods:{onSendMessage:function e(t){var i=t.data;if(!i.text){return false}this.addMessageOnClient(i.text)},onTextareaStartWriting:function e(t){var i=t.data;this.startWriting()},onTextareaAppButtonClick:function e(t){var i=t.data},onTextareaFocus:function e(t){var i=t.data},onTextareaBlur:function e(t){var i=t.data},onTextareaKeyUp:function e(t){var i=t.data},onTextareaEdit:function e(t){var i=t.data},addMessageOnClient:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(!i&&!n){return false}var s=this.$store.getters["dialogues/getQuoteId"](this.dialogId);if(s){var l=this.$store.getters["messages/getMessage"](this.chatId,s);if(l){var d=null;if(l.authorId){d=this.$store.getters["users/get"](l.authorId)}var u=this.$store.getters["files/getList"](this.chatId);var c=[];c.push("-".repeat(54));c.push((d&&d.name?d.name:this.localize["IM_QUOTE_PANEL_DEFAULT_TITLE"])+" ["+a.Utils.date.format(l.date,null,this.localize)+"]");c.push(a.Utils.text.quote(l.text,l.params,u,this.localize));c.push("-".repeat(54));c.push(i);i=c.join("\n");this.quoteMessageClear()}}if(!this.isUnreadMessagesLoaded()){this.addMessageOnServer({id:0,chatId:this.chatId,dialogId:this.dialogId,text:i,file:n});this.processMessagesToSendQueue();return true}var g={};if(n){g.FILE_ID=[n.id]}this.$store.dispatch("messages/add",{chatId:this.chatId,authorId:this.userId,text:i,params:g,sending:!n}).then((function(e){r.EventEmitter.emit(o.EventType.dialog.scrollToBottom,{chatId:t.chatId,cancelIfScrollChange:true});t.messagesToSend.push({id:e,chatId:t.chatId,dialogId:t.dialogId,text:i,file:n,sending:false});t.processMessagesToSendQueue()}));return true},processMessagesToSendQueue:function e(){var t=this;if(!this.diskFolderId){this.requestDiskFolderId().then((function(){t.processMessagesToSendQueue()}))["catch"]((function(e){d.Logger.warn("processMessagesToSendQueue error",e);return false}));return false}this.messagesToSend.filter((function(e){return!e.sending})).forEach((function(e){e.sending=true;if(e.file){t.addMessageWithFile(e)}else{t.addMessageOnServer(e)}}));return true},addMessageOnServer:function e(t){var i=this;this.stopWriting();var n=this.$store.getters["dialogues/getQuoteId"](this.dialogId);if(n){var s=this.$store.getters["messages/getMessage"](this.chatId,n);if(s){var a=this.$store.getters["users/get"](s.authorId);var r=[];r.push("------------------------------------------------------");r.push(a.name?a.name:this.localize["IM_QUOTE_PANEL_DEFAULT_TITLE"]);r.push(s.text);r.push("------------------------------------------------------");r.push(t.text);t.text=r.join("\n");this.quoteMessageClear()}}this.getRestClient().callMethod(o.RestMethod.imMessageAdd,{TEMPLATE_ID:t.id,DIALOG_ID:t.dialogId,MESSAGE:t.text},null,null).then((function(e){i.$store.dispatch("messages/update",{id:t.id,chatId:t.chatId,fields:{id:e.data(),sending:false,error:false}}).then((function(){i.$store.dispatch("messages/actionFinish",{id:e.data(),chatId:t.chatId})}))}))["catch"]((function(e){d.Logger.warn("Error during adding message")}));return true},stopWriting:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.dialogId;this.timer.stop("writes",t,true);this.timer.stop("writesSend",t,true)},startWriting:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.dialogId;if(a.Utils.dialog.isEmptyDialogId(i)||this.timer.has("writes",i)){return false}this.timer.start("writes",i,28);this.timer.start("writesSend",i,5,(function(){t.getRestClient().callMethod(o.RestMethod.imDialogWriting,{DIALOG_ID:i})["catch"]((function(){t.timer.stop("writes",i)}))}))},insertText:function e(t){r.EventEmitter.emit(o.EventType.textarea.insertText,t)},requestDiskFolderId:function e(){var t=this;if(this.requestDiskFolderPromise){return this.requestDiskFolderPromise}this.requestDiskFolderPromise=new Promise((function(e,i){if(t.flagRequestDiskFolderIdSended||t.diskFolderId){t.flagRequestDiskFolderIdSended=false;e();return true}t.flagRequestDiskFolderIdSended=true;t.getRestClient().callMethod(o.RestMethod.imDiskFolderGet,{chat_id:t.chatId}).then((function(i){t.flagRequestDiskFolderIdSended=false;t.executeRestAnswer(o.RestMethodHandler.imDiskFolderGet,i);e()}))["catch"]((function(e){t.flagRequestDiskFolderIdSended=false;t.executeRestAnswer(o.RestMethodHandler.imDiskFolderGet,e);i()}))}));return this.requestDiskFolderPromise}}};var L={created:function e(){r.EventEmitter.subscribe(o.EventType.textarea.fileSelected,this.onTextareaFileSelected)},beforeDestroy:function e(){if(this.uploader){this.uploader.unsubscribeAll()}r.EventEmitter.unsubscribe(o.EventType.textarea.fileSelected,this.onTextareaFileSelected)},computed:{dialogInited:function e(){if(!this.dialog){return false}return this.dialog.init}},watch:{dialogInited:function e(t){if(t===true){this.initUploader()}}},methods:{onTextareaFileSelected:function e(t){var i=t.data;var n=i&&i.fileChangeEvent&&i.fileChangeEvent.target.files.length>0?i.fileChangeEvent:"";if(!n){return false}this.uploadFile(n)},addMessageWithFile:function e(t){this.stopWriting();this.uploader.addTask({taskId:t.file.id,fileData:t.file.source.file,fileName:t.file.source.file.name,generateUniqueName:true,diskFolderId:this.diskFolderId,previewBlob:t.file.previewBlob})},uploadFile:function e(t){if(!t){return false}this.uploader.addFilesFromEvent(t)},initUploader:function e(){var t=this;this.uploader=new l.Uploader({generatePreview:true,sender:{actionUploadChunk:this.actionUploadChunk,actionCommitFile:this.actionCommitFile}});this.uploader.subscribe("onStartUpload",(function(e){var i=e.getData();d.Logger.log("Uploader: onStartUpload",i);t.$store.dispatch("files/update",{chatId:t.chatId,id:i.id,fields:{status:o.FileStatus.upload,progress:0}})}));this.uploader.subscribe("onProgress",(function(e){var i=e.getData();d.Logger.log("Uploader: onProgress",i);t.$store.dispatch("files/update",{chatId:t.chatId,id:i.id,fields:{status:o.FileStatus.upload,progress:i.progress===100?99:i.progress}})}));this.uploader.subscribe("onSelectFile",(function(e){var i=e.getData();var n=i.file;d.Logger.log("Uploader: onSelectFile",i);var s="file";if(n.type.toString().startsWith("image")){s="image"}else if(n.type.toString().startsWith("video")){s="video"}t.$store.dispatch("files/add",{chatId:t.chatId,authorId:t.userId,name:n.name,type:s,extension:n.name.split(".").splice(-1)[0],size:n.size,image:!i.previewData?false:{width:i.previewDataWidth,height:i.previewDataHeight},status:o.FileStatus.wait,progress:0,authorName:t.getCurrentUser().name,urlPreview:i.previewData?URL.createObjectURL(i.previewData):""}).then((function(e){t.addMessageOnClient("",{id:e,source:i,previewBlob:i.previewData})}))}));this.uploader.subscribe("onComplete",(function(e){var i=e.getData();d.Logger.log("Uploader: onComplete",i);t.$store.dispatch("files/update",{chatId:t.chatId,id:i.id,fields:{status:o.FileStatus.wait,progress:100}});var n=t.messagesToSend.find((function(e){if(e.file){return e.file.id===i.id}return false}));var s=t.$store.getters["files/get"](t.chatId,n.file.id,true).type;t.fileCommit({chatId:t.chatId,uploadId:i.result.data.file.id,messageText:n.text,messageId:n.id,fileId:n.file.id,fileType:s},n)}));this.uploader.subscribe("onUploadFileError",(function(e){var i=e.getData();d.Logger.log("Uploader: onUploadFileError",i);var n=t.messagesToSend.find((function(e){if(e.file){return e.file.id===i.id}return false}));t.fileError(t.chatId,n.file.id,n.id)}));this.uploader.subscribe("onCreateFileError",(function(e){var i=e.getData();d.Logger.log("Uploader: onCreateFileError",i);var n=t.messagesToSend.find((function(e){if(e.file){return e.file.id===i.id}return false}));t.fileError(t.chatId,n.file.id,n.id)}));return new Promise((function(e,t){return e()}))},fileCommit:function e(t,i){var n=this;this.getRestClient().callMethod(o.RestMethod.imDiskFileCommit,{chat_id:t.chatId,upload_id:t.uploadId,message:t.messageText,template_id:t.messageId,file_template_id:t.fileId},null,null).then((function(e){n.executeRestAnswer(o.RestMethodHandler.imDiskFileCommit,e,i)}))["catch"]((function(e){n.executeRestAnswer(o.RestMethodHandler.imDiskFileCommit,e,i)}));return true},fileError:function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;this.$store.dispatch("files/update",{chatId:t,id:i,fields:{status:o.FileStatus.error,progress:0}});if(n){this.$store.dispatch("messages/actionError",{chatId:t,id:n,retry:false})}}}};e.DialogCore=g;e.DialogReadMessages=m;e.DialogQuoteMessage=v;e.DialogClickOnCommand=E;e.DialogClickOnMention=b;e.DialogClickOnUserName=M;e.DialogClickOnMessageMenu=C;e.DialogClickOnMessageRetry=I;e.DialogClickOnUploadCancel=y;e.DialogClickOnReadList=T;e.DialogSetMessageReaction=D;e.DialogOpenMessageReactionList=O;e.DialogClickOnKeyboardButton=k;e.DialogClickOnChatTeaser=S;e.DialogClickOnDialog=R;e.TextareaCore=x;e.TextareaUploadFile=L})(this.BX.Messenger.Mixin=this.BX.Messenger.Mixin||{},BX,BX,BX.Messenger.Lib,BX.Messenger.Lib,BX.Messenger.Lib,BX.Event,BX.Messenger.Const,BX.Messenger.Lib,BX.Messenger.Lib); //# sourceMappingURL=registry.bundle.map.js