Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / chatMessage / chatMessage.controller.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xf753=['limit','count','set','Content-Range','apply','save','update','sendStatus','stack','name','index','map','ChatMessage','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','keys','includeAll','find','create','body','destroy','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','User','reject','rejectmessage','rimraf','zip-dir','fast-json-patch','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','json','offset','undefined'];(function(_0x2d069d,_0x52790a){var _0x8a2ada=function(_0x2798f2){while(--_0x2798f2){_0x2d069d['push'](_0x2d069d['shift']());}};_0x8a2ada(++_0x52790a);}(_0xf753,0xd9));var _0x3f75=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xf753[_0x4e7d25];return _0x526fe6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f75('0x0'));var zipdir=require(_0x3f75('0x1'));var jsonpatch=require(_0x3f75('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3f75('0x3'));var Mustache=require('mustache');var util=require(_0x3f75('0x4'));var path=require(_0x3f75('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f75('0x6'));var fs=require('fs');var fs_extra=require(_0x3f75('0x7'));var _=require(_0x3f75('0x8'));var squel=require(_0x3f75('0x9'));var crypto=require(_0x3f75('0xa'));var jsforce=require(_0x3f75('0xb'));var deskjs=require(_0x3f75('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3f75('0xd'));var Papa=require(_0x3f75('0xe'));var Redis=require('ioredis');var authService=require(_0x3f75('0xf'));var qs=require(_0x3f75('0x10'));var as=require(_0x3f75('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f75('0x12'))('api');var utils=require(_0x3f75('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3f75('0x14'))['db'];config[_0x3f75('0x15')]=_['defaults'](config[_0x3f75('0x15')],{'host':_0x3f75('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3f75('0x17'))[_0x3f75('0x18')](socket);var jayson=require(_0x3f75('0x19'));var client=jayson[_0x3f75('0x1a')][_0x3f75('0x1b')]({'port':0x232c});var client9002=jayson[_0x3f75('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x288775,_0x2e486b,_0x41f55d,_0x42881b){return new BPromise(function(_0x119b1f,_0x2ed751){var _0x4d4407=_0x42881b||client;return _0x4d4407[_0x3f75('0x1c')](_0x288775,_0x41f55d)[_0x3f75('0x1d')](function(_0x309314){logger[_0x3f75('0x1e')](_0x3f75('0x1f'),_0x2e486b,_0x3f75('0x20'));logger['debug'](_0x3f75('0x21'),_0x2e486b,'request\x20sent',JSON[_0x3f75('0x22')](_0x309314));if(_0x309314[_0x3f75('0x23')]){if(_0x309314[_0x3f75('0x23')]['code']===0x1f4){logger[_0x3f75('0x23')](_0x3f75('0x1f'),_0x2e486b,_0x309314[_0x3f75('0x23')]['message']);return _0x2ed751(_0x309314['error'][_0x3f75('0x24')]);}logger[_0x3f75('0x23')](_0x3f75('0x1f'),_0x2e486b,_0x309314[_0x3f75('0x23')][_0x3f75('0x24')]);return _0x119b1f(_0x309314[_0x3f75('0x23')]['message']);}else{logger[_0x3f75('0x1e')](_0x3f75('0x1f'),_0x2e486b,_0x3f75('0x20'));_0x119b1f(_0x309314['result'][_0x3f75('0x24')]);}})[_0x3f75('0x25')](function(_0x7652d6){logger['error']('ChatMessage,\x20%s,\x20%s',_0x2e486b,_0x7652d6);_0x2ed751(_0x7652d6);});});}function respondWithStatusCode(_0x1e11fd,_0x3af1a0){_0x3af1a0=_0x3af1a0||0xcc;return function(_0x492aad){if(_0x492aad){return _0x1e11fd['sendStatus'](_0x3af1a0);}return _0x1e11fd[_0x3f75('0x26')](_0x3af1a0)[_0x3f75('0x27')]();};}function respondWithResult(_0x372893,_0x5ec901){_0x5ec901=_0x5ec901||0xc8;return function(_0x208917){if(_0x208917){return _0x372893['status'](_0x5ec901)[_0x3f75('0x28')](_0x208917);}};}function respondWithFilteredResult(_0x42d372,_0x7ee4e0){return function(_0x182be4){if(_0x182be4){var _0x4967dc=typeof _0x7ee4e0[_0x3f75('0x29')]===_0x3f75('0x2a')&&typeof _0x7ee4e0[_0x3f75('0x2b')]==='undefined';var _0x587acd=_0x182be4[_0x3f75('0x2c')];var _0x143b9c=_0x4967dc?0x0:_0x7ee4e0[_0x3f75('0x29')];var _0x5d8d66=_0x4967dc?_0x182be4[_0x3f75('0x2c')]:_0x7ee4e0[_0x3f75('0x29')]+_0x7ee4e0[_0x3f75('0x2b')];var _0x516db4;if(_0x5d8d66>=_0x587acd){_0x5d8d66=_0x587acd;_0x516db4=0xc8;}else{_0x516db4=0xce;}_0x42d372[_0x3f75('0x26')](_0x516db4);return _0x42d372[_0x3f75('0x2d')](_0x3f75('0x2e'),_0x143b9c+'-'+_0x5d8d66+'/'+_0x587acd)['json'](_0x182be4);}return null;};}function patchUpdates(_0x1cfcb6){return function(_0x2f37ab){try{jsonpatch[_0x3f75('0x2f')](_0x2f37ab,_0x1cfcb6,!![]);}catch(_0x52e409){return BPromise['reject'](_0x52e409);}return _0x2f37ab[_0x3f75('0x30')]();};}function saveUpdates(_0x339135,_0x1eeb58){return function(_0x319228){if(_0x319228){return _0x319228[_0x3f75('0x31')](_0x339135)[_0x3f75('0x1d')](function(_0x161786){return _0x161786;});}return null;};}function removeEntity(_0x52cabc,_0x340c51){return function(_0x56e010){if(_0x56e010){return _0x56e010['destroy']()[_0x3f75('0x1d')](function(){_0x52cabc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37a824,_0x40a651){return function(_0x49269f){if(!_0x49269f){_0x37a824[_0x3f75('0x32')](0x194);}return _0x49269f;};}function handleError(_0x221014,_0x18192e){_0x18192e=_0x18192e||0x1f4;return function(_0x389d47){logger[_0x3f75('0x23')](_0x389d47[_0x3f75('0x33')]);if(_0x389d47[_0x3f75('0x34')]){delete _0x389d47[_0x3f75('0x34')];}_0x221014['status'](_0x18192e)['send'](_0x389d47);};}exports[_0x3f75('0x35')]=function(_0x1aa009,_0x3a832c){var _0x529662={},_0x118d5b={},_0x375e22={'count':0x0,'rows':[]};var _0x4e5d83=_[_0x3f75('0x36')](db[_0x3f75('0x37')][_0x3f75('0x38')],function(_0xff7726){return{'name':_0xff7726['fieldName'],'type':_0xff7726[_0x3f75('0x39')]['key']};});_0x118d5b['model']=_[_0x3f75('0x36')](_0x4e5d83,_0x3f75('0x34'));_0x118d5b['query']=_['keys'](_0x1aa009[_0x3f75('0x3a')]);_0x118d5b[_0x3f75('0x3b')]=_[_0x3f75('0x3c')](_0x118d5b[_0x3f75('0x3d')],_0x118d5b['query']);_0x529662[_0x3f75('0x3e')]=_['intersection'](_0x118d5b['model'],qs[_0x3f75('0x3f')](_0x1aa009[_0x3f75('0x3a')][_0x3f75('0x3f')]));_0x529662[_0x3f75('0x3e')]=_0x529662[_0x3f75('0x3e')][_0x3f75('0x40')]?_0x529662['attributes']:_0x118d5b[_0x3f75('0x3d')];if(!_0x1aa009[_0x3f75('0x3a')][_0x3f75('0x41')](_0x3f75('0x42'))){_0x529662[_0x3f75('0x2b')]=qs[_0x3f75('0x2b')](_0x1aa009[_0x3f75('0x3a')][_0x3f75('0x2b')]);_0x529662['offset']=qs[_0x3f75('0x29')](_0x1aa009[_0x3f75('0x3a')]['offset']);}_0x529662[_0x3f75('0x43')]=qs[_0x3f75('0x44')](_0x1aa009[_0x3f75('0x3a')]['sort']);_0x529662[_0x3f75('0x45')]=qs[_0x3f75('0x3b')](_[_0x3f75('0x46')](_0x1aa009[_0x3f75('0x3a')],_0x118d5b[_0x3f75('0x3b')]),_0x4e5d83);if(_0x1aa009[_0x3f75('0x3a')][_0x3f75('0x47')]){_0x529662[_0x3f75('0x45')]=_[_0x3f75('0x48')](_0x529662['where'],{'$or':_['map'](_0x4e5d83,function(_0x513899){if(_0x513899[_0x3f75('0x39')]!==_0x3f75('0x49')){var _0x2e87f0={};_0x2e87f0[_0x513899[_0x3f75('0x34')]]={'$like':'%'+_0x1aa009[_0x3f75('0x3a')][_0x3f75('0x47')]+'%'};return _0x2e87f0;}})});}_0x529662=_[_0x3f75('0x48')]({},_0x529662,_0x1aa009[_0x3f75('0x4a')]);var _0x497f77={'where':_0x529662[_0x3f75('0x45')]};return db[_0x3f75('0x37')][_0x3f75('0x2c')](_0x497f77)[_0x3f75('0x1d')](function(_0x2f1054){_0x375e22[_0x3f75('0x2c')]=_0x2f1054;if(_0x1aa009[_0x3f75('0x3a')]['includeAll']){_0x529662[_0x3f75('0x4b')]=[{'all':!![]}];}return db[_0x3f75('0x37')]['findAll'](_0x529662);})[_0x3f75('0x1d')](function(_0x2be58e){_0x375e22[_0x3f75('0x4c')]=_0x2be58e;return _0x375e22;})[_0x3f75('0x1d')](respondWithFilteredResult(_0x3a832c,_0x529662))[_0x3f75('0x25')](handleError(_0x3a832c,null));};exports[_0x3f75('0x4d')]=function(_0x4bed43,_0x40e7b3){var _0x3fbd23={'raw':!![],'where':{'id':_0x4bed43[_0x3f75('0x4e')]['id']}},_0x33c4ca={};_0x33c4ca[_0x3f75('0x3d')]=_[_0x3f75('0x4f')](db[_0x3f75('0x37')][_0x3f75('0x38')]);_0x33c4ca[_0x3f75('0x3a')]=_[_0x3f75('0x4f')](_0x4bed43['query']);_0x33c4ca[_0x3f75('0x3b')]=_[_0x3f75('0x3c')](_0x33c4ca[_0x3f75('0x3d')],_0x33c4ca[_0x3f75('0x3a')]);_0x3fbd23['attributes']=_[_0x3f75('0x3c')](_0x33c4ca[_0x3f75('0x3d')],qs[_0x3f75('0x3f')](_0x4bed43[_0x3f75('0x3a')][_0x3f75('0x3f')]));_0x3fbd23[_0x3f75('0x3e')]=_0x3fbd23[_0x3f75('0x3e')][_0x3f75('0x40')]?_0x3fbd23[_0x3f75('0x3e')]:_0x33c4ca[_0x3f75('0x3d')];if(_0x4bed43[_0x3f75('0x3a')][_0x3f75('0x50')]){_0x3fbd23[_0x3f75('0x4b')]=[{'all':!![]}];}_0x3fbd23=_[_0x3f75('0x48')]({},_0x3fbd23,_0x4bed43[_0x3f75('0x4a')]);return db[_0x3f75('0x37')][_0x3f75('0x51')](_0x3fbd23)[_0x3f75('0x1d')](handleEntityNotFound(_0x40e7b3,null))[_0x3f75('0x1d')](respondWithResult(_0x40e7b3,null))['catch'](handleError(_0x40e7b3,null));};exports[_0x3f75('0x52')]=function(_0x88e95a,_0x4807ae){return db['ChatMessage'][_0x3f75('0x52')](_0x88e95a[_0x3f75('0x53')],{})['then'](respondWithResult(_0x4807ae,0xc9))[_0x3f75('0x25')](handleError(_0x4807ae,null));};exports['update']=function(_0x2b8dea,_0x4966c5){if(_0x2b8dea[_0x3f75('0x53')]['id']){delete _0x2b8dea[_0x3f75('0x53')]['id'];}return db[_0x3f75('0x37')][_0x3f75('0x51')]({'where':{'id':_0x2b8dea['params']['id']}})[_0x3f75('0x1d')](handleEntityNotFound(_0x4966c5,null))[_0x3f75('0x1d')](saveUpdates(_0x2b8dea[_0x3f75('0x53')],null))[_0x3f75('0x1d')](respondWithResult(_0x4966c5,null))[_0x3f75('0x25')](handleError(_0x4966c5,null));};exports[_0x3f75('0x54')]=function(_0x431729,_0x3a3980){return db[_0x3f75('0x37')][_0x3f75('0x51')]({'where':{'id':_0x431729[_0x3f75('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a3980,null))[_0x3f75('0x1d')](removeEntity(_0x3a3980,null))['catch'](handleError(_0x3a3980,null));};exports[_0x3f75('0x55')]=function(_0x4fc22a,_0x16df12){return db[_0x3f75('0x37')][_0x3f75('0x55')]()[_0x3f75('0x1d')](respondWithResult(_0x16df12,null))[_0x3f75('0x25')](handleError(_0x16df12,null));};var interaction_log=require(_0x3f75('0x12'))(_0x3f75('0x56'));exports[_0x3f75('0x57')]=function(_0x17b5cf,_0x1b5806,_0x53f618){var _0x36df3b={'agent':{},'channel':_0x3f75('0x58')};if(_0x17b5cf[_0x3f75('0x53')]['id']){delete _0x17b5cf['body']['id'];}_0x17b5cf['body'][_0x3f75('0x59')]=!![];_0x17b5cf[_0x3f75('0x53')][_0x3f75('0x5a')]=moment()[_0x3f75('0x5b')](_0x3f75('0x5c'));_0x17b5cf[_0x3f75('0x53')][_0x3f75('0x5d')]=_0x17b5cf[_0x3f75('0x53')][_0x3f75('0x5d')]||_0x17b5cf[_0x3f75('0x5e')]['id'];_0x36df3b[_0x3f75('0x5f')]['id']=_0x17b5cf[_0x3f75('0x53')][_0x3f75('0x5d')];return db[_0x3f75('0x37')]['find']({'where':{'id':_0x17b5cf[_0x3f75('0x4e')]['id'],'UserId':null}})[_0x3f75('0x1d')](handleEntityNotFound(_0x1b5806,null))['then'](saveUpdates(_0x17b5cf[_0x3f75('0x53')],null))[_0x3f75('0x1d')](function(_0x187c43){if(_0x187c43){_0x36df3b[_0x3f75('0x24')]=_0x187c43[_0x3f75('0x60')]({'plain':!![]});return db[_0x3f75('0x61')][_0x3f75('0x51')]({'where':{'id':_0x187c43[_0x3f75('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1b5806,null))['then'](function(_0xc207b7){if(_0xc207b7){return _0xc207b7[_0x3f75('0x31')]({'UserId':_0x17b5cf[_0x3f75('0x53')]['UserId'],'read1stAt':_['isNil'](_0xc207b7[_0x3f75('0x63')])?moment()[_0x3f75('0x5b')](_0x3f75('0x5c')):undefined});}return null;})[_0x3f75('0x1d')](function(_0x339e9b){if(_0x339e9b){_0x36df3b[_0x3f75('0x64')]=_0x339e9b[_0x3f75('0x60')]({'plain':!![]});interaction_log[_0x3f75('0x1e')](_0x3f75('0x65'),_0x17b5cf['user']['id'],_0x17b5cf[_0x3f75('0x5e')]['name'],_0x17b5cf[_0x3f75('0x5e')][_0x3f75('0x66')],_0x36df3b[_0x3f75('0x64')]['id'],_0x17b5cf[_0x3f75('0x53')]?JSON[_0x3f75('0x22')](_0x17b5cf[_0x3f75('0x53')]):_0x3f75('0x67'));return respondWithRpcPromise(_0x3f75('0x68'),'acceptMessage',_0x36df3b);}return null;})[_0x3f75('0x1d')](function(_0x44a8b8){var _0x1ec4b4=_0x3f75('0x69')+_0x44a8b8[_0x3f75('0x24')][_0x3f75('0x6a')];return db[_0x3f75('0x6b')][_0x3f75('0x3a')](_0x1ec4b4,{'type':db[_0x3f75('0x6c')]['QueryTypes'][_0x3f75('0x6d')],'raw':!![]})[_0x3f75('0x1d')](function(_0x142c36){return _0x142c36;});})['then'](function(_0x4f2d00){if(_0x4f2d00){_0x36df3b['message'][_0x3f75('0x6e')]=_0x4f2d00[0x0];if(!_0x17b5cf[_0x3f75('0x53')][_0x3f75('0x5d')])return;return db['User']['find']({'where':{'id':_0x17b5cf[_0x3f75('0x53')][_0x3f75('0x5d')],'role':'agent'},'attributes':['id',_0x3f75('0x34'),_0x3f75('0x6f'),_0x3f75('0x70'),_0x3f75('0x71')],'raw':!![]});}return null;})[_0x3f75('0x1d')](function(_0x5f5922){if(!_0x5f5922)return null;_0x36df3b[_0x3f75('0x24')][_0x3f75('0x5f')]=_0x5f5922;return _0x36df3b;})[_0x3f75('0x1d')](function(_0x4c629b){if(_0x4c629b){if(_0x17b5cf['body'][_0x3f75('0x72')]){_0x36df3b[_0x3f75('0x24')][_0x3f75('0x73')]=util[_0x3f75('0x5b')](_0x3f75('0x74'),_0x17b5cf['user'][_0x3f75('0x34')]);_0x36df3b[_0x3f75('0x24')]['channel']=_0x36df3b[_0x3f75('0x75')];_0x36df3b['message'][_0x3f75('0x76')]=_0x36df3b['channel'];_0x36df3b[_0x3f75('0x24')][_0x3f75('0x77')]=_0x3f75('0x57');return respondWithRpcPromise(_0x3f75('0x78'),'EventManager',{'event':_0x3f75('0x79'),'message':_[_0x3f75('0x48')](_0x36df3b['message'],JSON[_0x3f75('0x7a')](_0x36df3b['interaction'][_0x3f75('0x7b')]))},client9002)[_0x3f75('0x1d')](function(){return _0x36df3b;});}return _0x36df3b;}return null;})['then'](respondWithResult(_0x1b5806,null))['catch'](handleError(_0x1b5806,null));};var interaction_log=require(_0x3f75('0x12'))(_0x3f75('0x56'));exports['reject']=function(_0x365917,_0x53b864,_0x4ecd53){var _0x53d420={'agent':{},'channel':_0x3f75('0x58')};if(_0x365917[_0x3f75('0x53')]['id']){delete _0x365917[_0x3f75('0x53')]['id'];}_0x365917['body'][_0x3f75('0x5d')]=_0x365917[_0x3f75('0x53')][_0x3f75('0x5d')]||_0x365917[_0x3f75('0x5e')]['id'];_0x53d420[_0x3f75('0x5f')]['id']=_0x365917['body'][_0x3f75('0x5d')];return db['ChatMessage'][_0x3f75('0x51')]({'where':{'id':_0x365917['params']['id'],'UserId':null}})[_0x3f75('0x1d')](handleEntityNotFound(_0x53b864,null))[_0x3f75('0x1d')](function(_0x34e8bf){if(_0x34e8bf){_0x53d420[_0x3f75('0x24')]=_0x34e8bf[_0x3f75('0x60')]({'plain':!![]});return db[_0x3f75('0x61')]['find']({'where':{'id':_0x34e8bf['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x53b864,null))['then'](function(_0x105c90){if(_0x105c90){_0x53d420[_0x3f75('0x64')]=_0x105c90[_0x3f75('0x60')]({'plain':!![]});interaction_log[_0x3f75('0x1e')](_0x3f75('0x7c'),_0x365917[_0x3f75('0x5e')]['id'],_0x365917[_0x3f75('0x5e')]['name'],_0x365917[_0x3f75('0x5e')][_0x3f75('0x66')],_0x53d420[_0x3f75('0x64')]['id'],_0x365917['body']?JSON[_0x3f75('0x22')](_0x365917[_0x3f75('0x53')]):_0x3f75('0x67'));return respondWithRpcPromise(_0x3f75('0x7d'),'rejectMessage',_0x53d420);}return null;})[_0x3f75('0x1d')](function(_0x479c69){var _0x2d2db0=_0x3f75('0x69')+_0x479c69['message'][_0x3f75('0x6a')];return db['sequelize'][_0x3f75('0x3a')](_0x2d2db0,{'type':db[_0x3f75('0x6c')][_0x3f75('0x7e')][_0x3f75('0x6d')],'raw':!![]})[_0x3f75('0x1d')](function(_0x244ff1){return _0x244ff1;});})[_0x3f75('0x1d')](function(_0x1c8207){if(_0x1c8207){_0x53d420[_0x3f75('0x24')][_0x3f75('0x6e')]=_0x1c8207[0x0];if(!_0x365917[_0x3f75('0x53')]['UserId'])return;return db[_0x3f75('0x7f')][_0x3f75('0x51')]({'where':{'id':_0x365917[_0x3f75('0x53')][_0x3f75('0x5d')],'role':_0x3f75('0x5f')},'attributes':['id',_0x3f75('0x34'),_0x3f75('0x6f'),_0x3f75('0x70'),_0x3f75('0x71')],'raw':!![]});}return null;})[_0x3f75('0x1d')](function(_0x2924e6){if(!_0x2924e6)return null;_0x53d420[_0x3f75('0x24')]['agent']=_0x2924e6;return _0x53d420;})[_0x3f75('0x1d')](function(_0x4ba416){if(_0x4ba416){_0x4ba416[_0x3f75('0x24')]['interface']=util[_0x3f75('0x5b')](_0x3f75('0x74'),_0x365917[_0x3f75('0x5e')]['name']);_0x4ba416[_0x3f75('0x24')][_0x3f75('0x75')]=_0x53d420[_0x3f75('0x75')];_0x4ba416[_0x3f75('0x24')]['motionChannel']=_0x53d420[_0x3f75('0x75')];_0x4ba416[_0x3f75('0x24')][_0x3f75('0x77')]=_0x3f75('0x80');respondWithRpcPromise(_0x3f75('0x78'),_0x3f75('0x78'),{'event':_0x3f75('0x81'),'message':_[_0x3f75('0x48')](_0x53d420[_0x3f75('0x24')],JSON[_0x3f75('0x7a')](_0x53d420[_0x3f75('0x64')]['formData']))},client9002);return _0x53d420;}return null;})[_0x3f75('0x1d')](respondWithResult(_0x53b864,null))[_0x3f75('0x25')](handleError(_0x53b864,null));};