Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / chatQueue / chatQueue.controller.js
index e7c6d34..85b8d17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff22=['set','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','offset','sort','where','pick','merge','VIRTUAL','filter','options','ChatQueue','count','includeAll','findAll','rows','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','status','json','limit'];(function(_0x1a9459,_0x5cafca){var _0x31440c=function(_0x5cd50b){while(--_0x5cd50b){_0x1a9459['push'](_0x1a9459['shift']());}};_0x31440c(++_0x5cafca);}(_0xff22,0x1a0));var _0x2ff2=function(_0x3b8ee3,_0x56cd4b){_0x3b8ee3=_0x3b8ee3-0x0;var _0x21b39a=_0xff22[_0x3b8ee3];return _0x21b39a;};'use strict';var pdf=require(_0x2ff2('0x0'));var emlformat=require(_0x2ff2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2ff2('0x2'));var jsonpatch=require(_0x2ff2('0x3'));var rp=require(_0x2ff2('0x4'));var moment=require(_0x2ff2('0x5'));var BPromise=require(_0x2ff2('0x6'));var Mustache=require(_0x2ff2('0x7'));var util=require(_0x2ff2('0x8'));var path=require(_0x2ff2('0x9'));var sox=require(_0x2ff2('0xa'));var csv=require('to-csv');var ejs=require(_0x2ff2('0xb'));var fs=require('fs');var _=require(_0x2ff2('0xc'));var squel=require(_0x2ff2('0xd'));var crypto=require(_0x2ff2('0xe'));var jsforce=require(_0x2ff2('0xf'));var deskjs=require(_0x2ff2('0x10'));var toCsv=require(_0x2ff2('0x11'));var querystring=require('querystring');var Papa=require(_0x2ff2('0x12'));var Redis=require(_0x2ff2('0x13'));var authService=require(_0x2ff2('0x14'));var qs=require(_0x2ff2('0x15'));var as=require(_0x2ff2('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2ff2('0x17'));var config=require(_0x2ff2('0x18'));var db=require(_0x2ff2('0x19'))['db'];config[_0x2ff2('0x1a')]=_[_0x2ff2('0x1b')](config[_0x2ff2('0x1a')],{'host':_0x2ff2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ff2('0x1a')]));require(_0x2ff2('0x1d'))[_0x2ff2('0x1e')](socket);var jayson=require(_0x2ff2('0x1f'));var client=jayson[_0x2ff2('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x48baff,_0x39053f,_0x54d58f){if(_0x54d58f){var _0x401f66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x401f66[_0x2ff2('0x21')](_0x39053f)){return _0x48baff;}else{throw new db[(_0x2ff2('0x22'))][(_0x2ff2('0x23'))](_0x2ff2('0x24'));}}else{return _0x48baff;}}function respondWithRpcPromise(_0x2f2476,_0xca38d7,_0x5c95fa,_0x321b0a){return new BPromise(function(_0x598e53,_0xe7b8f4){var _0x112d37=_0x321b0a||client;return _0x112d37[_0x2ff2('0x25')](_0x2f2476,_0x5c95fa)[_0x2ff2('0x26')](function(_0x1ca301){logger[_0x2ff2('0x27')](_0x2ff2('0x28'),_0xca38d7,_0x2ff2('0x29'));logger[_0x2ff2('0x2a')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xca38d7,'request\x20sent',JSON['stringify'](_0x1ca301));if(_0x1ca301['error']){if(_0x1ca301[_0x2ff2('0x2b')]['code']===0x1f4){logger[_0x2ff2('0x2b')]('ChatQueue,\x20%s,\x20%s',_0xca38d7,_0x1ca301[_0x2ff2('0x2b')]['message']);return _0xe7b8f4(_0x1ca301['error'][_0x2ff2('0x2c')]);}logger[_0x2ff2('0x2b')](_0x2ff2('0x28'),_0xca38d7,_0x1ca301[_0x2ff2('0x2b')][_0x2ff2('0x2c')]);return _0x598e53(_0x1ca301[_0x2ff2('0x2b')]['message']);}else{logger['info'](_0x2ff2('0x28'),_0xca38d7,_0x2ff2('0x29'));_0x598e53(_0x1ca301['result'][_0x2ff2('0x2c')]);}})[_0x2ff2('0x2d')](function(_0x248742){logger[_0x2ff2('0x2b')](_0x2ff2('0x28'),_0xca38d7,_0x248742);_0xe7b8f4(_0x248742);});});}function respondWithStatusCode(_0x2af017,_0x126b80){_0x126b80=_0x126b80||0xcc;return function(_0x8cdbb7){if(_0x8cdbb7){return _0x2af017['sendStatus'](_0x126b80);}return _0x2af017[_0x2ff2('0x2e')](_0x126b80)['end']();};}function respondWithResult(_0x1e1957,_0x49b954){_0x49b954=_0x49b954||0xc8;return function(_0x354dff){if(_0x354dff){return _0x1e1957[_0x2ff2('0x2e')](_0x49b954)[_0x2ff2('0x2f')](_0x354dff);}};}function respondWithFilteredResult(_0xadd615,_0x29aa02){return function(_0x3b8e3b){if(_0x3b8e3b){var _0x116f9d=_0x3b8e3b['count'],_0x2a9e81=_0x29aa02['offset'],_0x5f0e29=_0x29aa02['offset']+_0x29aa02[_0x2ff2('0x30')],_0x3d9bde;if(_0x5f0e29>=_0x116f9d){_0x5f0e29=_0x116f9d;_0x3d9bde=0xc8;}else{_0x3d9bde=0xce;}_0xadd615['status'](_0x3d9bde);return _0xadd615[_0x2ff2('0x31')]('Content-Range',_0x2a9e81+'-'+_0x5f0e29+'/'+_0x116f9d)['json'](_0x3b8e3b);}return null;};}function patchUpdates(_0x1b93a9){return function(_0x482d6a){try{jsonpatch['apply'](_0x482d6a,_0x1b93a9,!![]);}catch(_0x29958b){return BPromise[_0x2ff2('0x32')](_0x29958b);}return _0x482d6a[_0x2ff2('0x33')]();};}function saveUpdates(_0x4b8082,_0x216451){return function(_0x4192b5){if(_0x4192b5){return _0x4192b5[_0x2ff2('0x34')](_0x4b8082)[_0x2ff2('0x26')](function(_0x34161d){return _0x34161d;});}return null;};}function removeEntity(_0x3d8f5b,_0x201805){return function(_0x2d45d5){if(_0x2d45d5){return _0x2d45d5[_0x2ff2('0x35')]()[_0x2ff2('0x26')](function(){var _0x5e553c=_0x2d45d5[_0x2ff2('0x36')]({'plain':!![]});var _0x3e6e72=_0x2ff2('0x37');return db[_0x2ff2('0x38')]['destroy']({'where':{'type':_0x3e6e72,'resourceId':_0x5e553c['id']}})[_0x2ff2('0x26')](function(){return _0x2d45d5;});})[_0x2ff2('0x26')](function(){_0x3d8f5b[_0x2ff2('0x2e')](0xcc)[_0x2ff2('0x39')]();});}};}function handleEntityNotFound(_0x58463d,_0x5aa782){return function(_0x7cc4ae){if(!_0x7cc4ae){_0x58463d[_0x2ff2('0x3a')](0x194);}return _0x7cc4ae;};}function handleError(_0x2fabe5,_0x5a757f){_0x5a757f=_0x5a757f||0x1f4;return function(_0x4f4547){logger[_0x2ff2('0x2b')](_0x4f4547[_0x2ff2('0x3b')]);if(_0x4f4547[_0x2ff2('0x3c')]){delete _0x4f4547['name'];}_0x2fabe5[_0x2ff2('0x2e')](_0x5a757f)[_0x2ff2('0x3d')](_0x4f4547);};}exports[_0x2ff2('0x3e')]=function(_0x43c5f1,_0x36b9c8){var _0x857d96={},_0x203085={},_0x3fd022={'count':0x0,'rows':[]};var _0x31b105=_[_0x2ff2('0x3f')](db['ChatQueue'][_0x2ff2('0x40')],function(_0x10edfa){return{'name':_0x10edfa[_0x2ff2('0x41')],'type':_0x10edfa[_0x2ff2('0x42')][_0x2ff2('0x43')]};});_0x203085[_0x2ff2('0x44')]=_[_0x2ff2('0x3f')](_0x31b105,'name');_0x203085[_0x2ff2('0x45')]=_[_0x2ff2('0x46')](_0x43c5f1['query']);_0x203085[_0x2ff2('0x47')]=_['intersection'](_0x203085[_0x2ff2('0x44')],_0x203085['query']);_0x857d96[_0x2ff2('0x48')]=_['intersection'](_0x203085[_0x2ff2('0x44')],qs[_0x2ff2('0x49')](_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x49')]));_0x857d96[_0x2ff2('0x48')]=_0x857d96[_0x2ff2('0x48')][_0x2ff2('0x4a')]?_0x857d96[_0x2ff2('0x48')]:_0x203085[_0x2ff2('0x44')];if(!_0x43c5f1['query'][_0x2ff2('0x4b')]('nolimit')){_0x857d96[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x30')]);_0x857d96[_0x2ff2('0x4c')]=qs[_0x2ff2('0x4c')](_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x4c')]);}_0x857d96['order']=qs[_0x2ff2('0x4d')](_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x4d')]);_0x857d96[_0x2ff2('0x4e')]=qs[_0x2ff2('0x47')](_[_0x2ff2('0x4f')](_0x43c5f1[_0x2ff2('0x45')],_0x203085['filters']));if(_0x43c5f1['query']['filter']){_0x857d96[_0x2ff2('0x4e')]=_[_0x2ff2('0x50')](_0x857d96[_0x2ff2('0x4e')],{'$or':_[_0x2ff2('0x3f')](_0x31b105,function(_0x19916a){if(_0x19916a['type']!==_0x2ff2('0x51')){var _0x502990={};_0x502990[_0x19916a[_0x2ff2('0x3c')]]={'$like':'%'+_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x52')]+'%'};return _0x502990;}})});}_0x857d96=_['merge']({},_0x857d96,_0x43c5f1[_0x2ff2('0x53')]);var _0x4e99cf={'where':_0x857d96[_0x2ff2('0x4e')]};return db[_0x2ff2('0x54')][_0x2ff2('0x55')](_0x4e99cf)[_0x2ff2('0x26')](function(_0x4f18b2){_0x3fd022['count']=_0x4f18b2;if(_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x56')]){_0x857d96['include']=[{'all':!![]}];}return db[_0x2ff2('0x54')][_0x2ff2('0x57')](_0x857d96);})[_0x2ff2('0x26')](function(_0x2b9e44){_0x3fd022[_0x2ff2('0x58')]=_0x2b9e44;return _0x3fd022;})[_0x2ff2('0x26')](respondWithFilteredResult(_0x36b9c8,_0x857d96))[_0x2ff2('0x2d')](handleError(_0x36b9c8,null));};exports['show']=function(_0x2b7967,_0x8c952d){var _0x159f6a={'raw':!![],'where':{'id':_0x2b7967[_0x2ff2('0x59')]['id']}},_0x312c98={};_0x312c98[_0x2ff2('0x44')]=_['keys'](db[_0x2ff2('0x54')][_0x2ff2('0x40')]);_0x312c98[_0x2ff2('0x45')]=_[_0x2ff2('0x46')](_0x2b7967[_0x2ff2('0x45')]);_0x312c98[_0x2ff2('0x47')]=_[_0x2ff2('0x5a')](_0x312c98[_0x2ff2('0x44')],_0x312c98[_0x2ff2('0x45')]);_0x159f6a['attributes']=_[_0x2ff2('0x5a')](_0x312c98['model'],qs['fields'](_0x2b7967[_0x2ff2('0x45')][_0x2ff2('0x49')]));_0x159f6a[_0x2ff2('0x48')]=_0x159f6a[_0x2ff2('0x48')][_0x2ff2('0x4a')]?_0x159f6a[_0x2ff2('0x48')]:_0x312c98['model'];if(_0x2b7967[_0x2ff2('0x45')]['includeAll']){_0x159f6a[_0x2ff2('0x5b')]=[{'all':!![]}];}_0x159f6a=_[_0x2ff2('0x50')]({},_0x159f6a,_0x2b7967[_0x2ff2('0x53')]);return db[_0x2ff2('0x54')][_0x2ff2('0x5c')](_0x159f6a)[_0x2ff2('0x26')](handleEntityNotFound(_0x8c952d,null))[_0x2ff2('0x26')](respondWithResult(_0x8c952d,null))[_0x2ff2('0x2d')](handleError(_0x8c952d,null));};exports[_0x2ff2('0x5d')]=function(_0x48421e,_0x5b852d){return db[_0x2ff2('0x54')][_0x2ff2('0x5d')](_0x48421e[_0x2ff2('0x5e')],{})[_0x2ff2('0x26')](function(_0x52685e){var _0x4f01b8=_0x48421e[_0x2ff2('0x5f')][_0x2ff2('0x36')]({'plain':!![]});if(!_0x4f01b8)throw new Error(_0x2ff2('0x60'));if(_0x4f01b8[_0x2ff2('0x61')]===_0x2ff2('0x5f')){var _0x3337ba=_0x52685e[_0x2ff2('0x36')]({'plain':!![]});var _0x5a84c6=_0x2ff2('0x37');return db[_0x2ff2('0x62')][_0x2ff2('0x5c')]({'where':{'name':_0x5a84c6,'userProfileId':_0x4f01b8[_0x2ff2('0x63')]},'raw':!![]})['then'](function(_0x1bd379){if(_0x1bd379&&_0x1bd379[_0x2ff2('0x64')]===0x0){return db[_0x2ff2('0x38')]['create']({'name':_0x3337ba['name'],'resourceId':_0x3337ba['id'],'type':_0x1bd379['name'],'sectionId':_0x1bd379['id']},{})[_0x2ff2('0x26')](function(){return _0x52685e;});}else{return _0x52685e;}})[_0x2ff2('0x2d')](function(_0x44e9c1){logger[_0x2ff2('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44e9c1);throw _0x44e9c1;});}return _0x52685e;})[_0x2ff2('0x26')](respondWithResult(_0x5b852d,0xc9))[_0x2ff2('0x2d')](handleError(_0x5b852d,null));};exports[_0x2ff2('0x34')]=function(_0x29a3b3,_0x54bc6c){if(_0x29a3b3[_0x2ff2('0x5e')]['id']){delete _0x29a3b3[_0x2ff2('0x5e')]['id'];}return db['ChatQueue'][_0x2ff2('0x5c')]({'where':{'id':_0x29a3b3[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x54bc6c,null))[_0x2ff2('0x26')](saveUpdates(_0x29a3b3['body'],null))[_0x2ff2('0x26')](respondWithResult(_0x54bc6c,null))[_0x2ff2('0x2d')](handleError(_0x54bc6c,null));};exports[_0x2ff2('0x35')]=function(_0x653c82,_0x261d68){return db[_0x2ff2('0x54')]['find']({'where':{'id':_0x653c82[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x261d68,null))['then'](removeEntity(_0x261d68,null))[_0x2ff2('0x2d')](handleError(_0x261d68,null));};exports['describe']=function(_0x439b01,_0x4de92e){return db[_0x2ff2('0x54')]['describe']()[_0x2ff2('0x26')](respondWithResult(_0x4de92e,null))[_0x2ff2('0x2d')](handleError(_0x4de92e,null));};exports[_0x2ff2('0x65')]=function(_0x44384f,_0x262ec6,_0x18d486){var _0x5f1b4a={'raw':!![],'where':{}},_0x2aac3b={},_0x490811;return db['ChatQueue'][_0x2ff2('0x66')]({'where':{'id':_0x44384f[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x262ec6,null))['then'](function(_0x51a770){if(_0x51a770){_0x490811=_0x51a770[_0x2ff2('0x36')]({'plain':!![]});_0x2aac3b['model']=_[_0x2ff2('0x46')](db[_0x2ff2('0x67')][_0x2ff2('0x40')]);_0x2aac3b[_0x2ff2('0x45')]=_[_0x2ff2('0x46')](_0x44384f[_0x2ff2('0x45')]);_0x2aac3b[_0x2ff2('0x47')]=_['intersection'](_0x2aac3b[_0x2ff2('0x44')],_0x2aac3b[_0x2ff2('0x45')]);_0x5f1b4a[_0x2ff2('0x48')]=_[_0x2ff2('0x5a')](_0x2aac3b[_0x2ff2('0x44')],qs[_0x2ff2('0x49')](_0x44384f[_0x2ff2('0x45')][_0x2ff2('0x49')]));_0x5f1b4a['attributes']=_0x5f1b4a['attributes'][_0x2ff2('0x4a')]?_0x5f1b4a['attributes']:_0x2aac3b[_0x2ff2('0x44')];if(!_0x44384f[_0x2ff2('0x45')]['hasOwnProperty'](_0x2ff2('0x68'))){_0x5f1b4a[_0x2ff2('0x30')]=qs['limit'](_0x44384f['query'][_0x2ff2('0x30')]);_0x5f1b4a[_0x2ff2('0x4c')]=qs[_0x2ff2('0x4c')](_0x44384f['query'][_0x2ff2('0x4c')]);}_0x5f1b4a[_0x2ff2('0x69')]=qs[_0x2ff2('0x4d')](_0x44384f[_0x2ff2('0x45')][_0x2ff2('0x4d')]);_0x5f1b4a[_0x2ff2('0x4e')]=qs[_0x2ff2('0x47')](_[_0x2ff2('0x4f')](_0x44384f[_0x2ff2('0x45')],_0x2aac3b['filters']));_0x5f1b4a[_0x2ff2('0x4e')][_0x2ff2('0x6a')]=_0x51a770['id'];if(_0x44384f['query'][_0x2ff2('0x52')]){_0x5f1b4a[_0x2ff2('0x4e')]=_['merge'](_0x5f1b4a[_0x2ff2('0x4e')],{'$or':_[_0x2ff2('0x3f')](_0x5f1b4a['attributes'],function(_0xeba062){var _0x24b8f7={};_0x24b8f7[_0xeba062]={'$like':'%'+_0x44384f[_0x2ff2('0x45')][_0x2ff2('0x52')]+'%'};return _0x24b8f7;})});}_0x5f1b4a=_[_0x2ff2('0x50')]({},_0x5f1b4a,_0x44384f['options']);return db[_0x2ff2('0x67')][_0x2ff2('0x57')](_0x5f1b4a);}})['then'](function(_0x47321a){if(_0x47321a){return db[_0x2ff2('0x6b')][_0x2ff2('0x6c')]({'where':{'id':_[_0x2ff2('0x3f')](_0x47321a,_0x2ff2('0x6d')),'role':_0x2ff2('0x6e')},'attributes':['id',_0x2ff2('0x3c'),_0x2ff2('0x6f'),_0x2ff2('0x70'),_0x2ff2('0x71')]});}})[_0x2ff2('0x26')](function(_0x222bcf){if(_0x222bcf){return{'count':_0x222bcf[_0x2ff2('0x55')],'rows':_[_0x2ff2('0x3f')](_0x222bcf[_0x2ff2('0x58')],function(_0x4df077){return{'membername':_0x4df077['name'],'UserId':_0x4df077['id'],'queue_name':_0x490811[_0x2ff2('0x3c')],'ChatQueueId':_0x490811['id'],'interface':util['format'](_0x2ff2('0x72'),_0x2ff2('0x73'),_0x4df077[_0x2ff2('0x3c')]),'penalty':0x0,'paused':_0x4df077[_0x2ff2('0x6f')],'createdAt':_0x4df077[_0x2ff2('0x71')],'updatedAt':_0x4df077[_0x2ff2('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2ff2('0x26')](respondWithFilteredResult(_0x262ec6,_0x5f1b4a))['catch'](handleError(_0x262ec6,null));};exports[_0x2ff2('0x74')]=function(_0x4aca4e,_0x22c251,_0x5032f2){var _0x339ca1={};var _0x6dac6c={};var _0x11d777;var _0x545dcb;return db['ChatQueue'][_0x2ff2('0x66')]({'where':{'id':_0x4aca4e[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x22c251,null))['then'](function(_0x4d18f4){if(_0x4d18f4){_0x11d777=_0x4d18f4;_0x6dac6c['model']=_[_0x2ff2('0x46')](db[_0x2ff2('0x75')][_0x2ff2('0x40')]);_0x6dac6c['query']=_['keys'](_0x4aca4e['query']);_0x6dac6c[_0x2ff2('0x47')]=_[_0x2ff2('0x5a')](_0x6dac6c[_0x2ff2('0x44')],_0x6dac6c[_0x2ff2('0x45')]);_0x339ca1[_0x2ff2('0x48')]=_['intersection'](_0x6dac6c['model'],qs['fields'](_0x4aca4e[_0x2ff2('0x45')][_0x2ff2('0x49')]));_0x339ca1[_0x2ff2('0x48')]=_0x339ca1['attributes'][_0x2ff2('0x4a')]?_0x339ca1['attributes']:_0x6dac6c[_0x2ff2('0x44')];_0x339ca1[_0x2ff2('0x69')]=qs[_0x2ff2('0x4d')](_0x4aca4e[_0x2ff2('0x45')][_0x2ff2('0x4d')]);_0x339ca1[_0x2ff2('0x4e')]=qs[_0x2ff2('0x47')](_[_0x2ff2('0x4f')](_0x4aca4e[_0x2ff2('0x45')],_0x6dac6c['filters']));if(_0x4aca4e['query'][_0x2ff2('0x52')]){_0x339ca1['where']=_[_0x2ff2('0x50')](_0x339ca1[_0x2ff2('0x4e')],{'$or':_['map'](_0x339ca1[_0x2ff2('0x48')],function(_0x316414){var _0x27786d={};_0x27786d[_0x316414]={'$like':'%'+_0x4aca4e['query']['filter']+'%'};return _0x27786d;})});}_0x339ca1=_['merge']({},_0x339ca1,_0x4aca4e[_0x2ff2('0x53')]);return _0x11d777['getTeams'](_0x339ca1);}})[_0x2ff2('0x26')](function(_0x229b4f){if(_0x229b4f){_0x545dcb=_0x229b4f[_0x2ff2('0x4a')];if(!_0x4aca4e[_0x2ff2('0x45')]['hasOwnProperty'](_0x2ff2('0x68'))){_0x339ca1[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x4aca4e['query'][_0x2ff2('0x30')]);_0x339ca1['offset']=qs[_0x2ff2('0x4c')](_0x4aca4e['query']['offset']);}return _0x11d777[_0x2ff2('0x74')](_0x339ca1);}})[_0x2ff2('0x26')](function(_0x248baf){if(_0x248baf){return _0x248baf?{'count':_0x545dcb,'rows':_0x248baf}:null;}})[_0x2ff2('0x26')](respondWithResult(_0x22c251,null))[_0x2ff2('0x2d')](handleError(_0x22c251,null));};exports[_0x2ff2('0x76')]=function(_0x222785,_0x3ff440,_0x1634a3){var _0xfeaf80=_0x222785[_0x2ff2('0x5e')][_0x2ff2('0x77')];return db[_0x2ff2('0x75')][_0x2ff2('0x57')]({'where':{'id':_0xfeaf80},'attributes':['id'],'include':[{'model':db[_0x2ff2('0x6b')],'as':_0x2ff2('0x78'),'attributes':['id',_0x2ff2('0x3c'),_0x2ff2('0x79'),_0x2ff2('0x7a'),_0x2ff2('0x7b')],'raw':!![]}]})[_0x2ff2('0x26')](function(_0x3d2349){if(_0x3d2349){var _0xc2eff5=_[_0x2ff2('0x7c')](_0x3d2349,function(_0x5060be){var _0x1658a4=_0x5060be[_0x2ff2('0x36')]({'plain':!![]});return _0x1658a4[_0x2ff2('0x78')];});return db[_0x2ff2('0x54')][_0x2ff2('0x5c')]({'where':{'id':_0x222785[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](function(_0x4024f0){return db[_0x2ff2('0x7d')][_0x2ff2('0x7e')](function(_0x35da11){return _0x4024f0['addTeams'](_0xfeaf80,{'transaction':_0x35da11})[_0x2ff2('0x26')](function(){return BPromise[_0x2ff2('0x7f')](_0xc2eff5,function(_0x241308){return db[_0x2ff2('0x67')][_0x2ff2('0x80')]({'where':{'UserId':_0x241308['id'],'ChatQueueId':_0x222785['params']['id']},'transaction':_0x35da11});});})['then'](function(){_0xc2eff5[_0x2ff2('0x81')](function(_0x5eed58){socket[_0x2ff2('0x82')](_0x2ff2('0x83'),{'UserId':_0x5eed58['id'],'ChatQueueId':_0x4024f0['id']});});});});});}})[_0x2ff2('0x26')](respondWithStatusCode(_0x3ff440,null))[_0x2ff2('0x2d')](handleError(_0x3ff440,null));};exports['removeTeams']=function(_0x421e39,_0x6f7e09,_0x1177f9){return db[_0x2ff2('0x75')][_0x2ff2('0x57')]({'where':{'id':_0x421e39[_0x2ff2('0x45')][_0x2ff2('0x77')]},'attributes':['id'],'include':[{'model':db[_0x2ff2('0x6b')],'as':_0x2ff2('0x78'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x6f7e09,null))[_0x2ff2('0x26')](function(_0x39a8ec){var _0x123466=_[_0x2ff2('0x3f')](_0x39a8ec,'id');var _0x4ce54e=[];var _0x52c361=[];var _0x453a0d=squel['select']();_0x453a0d[_0x2ff2('0x84')](_0x2ff2('0x85'))[_0x2ff2('0x86')](_0x2ff2('0x87'),'tq')[_0x2ff2('0x88')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2ff2('0x89'),_0x421e39[_0x2ff2('0x59')]['id']);for(var _0x4c09b6=0x0;_0x4c09b6<_0x39a8ec[_0x2ff2('0x4a')];_0x4c09b6+=0x1){let _0x1ff945=_0x39a8ec[_0x4c09b6];for(var _0x14ff82=0x0;_0x14ff82<_0x1ff945[_0x2ff2('0x78')]['length'];_0x14ff82+=0x1){let _0x2f98b3=_0x1ff945['Agents'][_0x14ff82];var _0x149973=_0x453a0d[_0x2ff2('0x8a')]();_0x149973['where'](_0x2ff2('0x8b'),_0x2f98b3['id']);_0x52c361[_0x2ff2('0x8c')](db[_0x2ff2('0x7d')][_0x2ff2('0x45')](_0x149973[_0x2ff2('0x8d')](),{'type':db['sequelize'][_0x2ff2('0x8e')]['SELECT']})[_0x2ff2('0x26')](function(_0x24c81b){if(_0x24c81b[_0x2ff2('0x4a')]===0x1){return _0x2f98b3['id'];}else{var _0x22fc5c=_[_0x2ff2('0x8f')](_[_0x2ff2('0x3f')](_0x24c81b,_0x2ff2('0x90')),function(_0x38a344){return _[_0x2ff2('0x91')](_0x123466,_0x38a344);});if(_0x22fc5c){return _0x2f98b3['id'];}}}));}}return BPromise[_0x2ff2('0x92')](_0x52c361)[_0x2ff2('0x26')](function(_0x30fc3a){_0x4ce54e=_(_0x4ce54e)['union'](_0x30fc3a)[_0x2ff2('0x93')]()['value']();return db['ChatQueue'][_0x2ff2('0x5c')]({'where':{'id':_0x421e39[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](function(_0x4f86ff){return db['sequelize'][_0x2ff2('0x7e')](function(_0x41092e){return _0x4f86ff[_0x2ff2('0x94')](_0x421e39[_0x2ff2('0x45')]['ids'],{'transaction':_0x41092e})[_0x2ff2('0x26')](function(){if(!_['isEmpty'](_0x4ce54e)){return _0x4f86ff[_0x2ff2('0x95')](_0x4ce54e,{'transaction':_0x41092e});}})[_0x2ff2('0x26')](function(){_0x4ce54e['forEach'](function(_0xfd3319){socket[_0x2ff2('0x82')](_0x2ff2('0x96'),{'UserId':_0xfd3319,'ChatQueueId':_0x4f86ff['id']});});});});});});})[_0x2ff2('0x26')](respondWithStatusCode(_0x6f7e09,null))[_0x2ff2('0x2d')](handleError(_0x6f7e09,null));};exports['addAgents']=function(_0x27e426,_0x462fb5,_0x1cad08){return db[_0x2ff2('0x54')]['find']({'where':{'id':_0x27e426[_0x2ff2('0x59')]['id']}})['then'](handleEntityNotFound(_0x462fb5,null))[_0x2ff2('0x26')](function(_0xa7c085){if(_0xa7c085){return _0xa7c085[_0x2ff2('0x97')](_0x27e426[_0x2ff2('0x5e')][_0x2ff2('0x77')],_[_0x2ff2('0x98')](_0x27e426[_0x2ff2('0x5e')],['ids','id'])||{})[_0x2ff2('0x99')](function(_0x1bde9d){for(var _0xfbfe7a=0x0;_0xfbfe7a<_0x27e426[_0x2ff2('0x5e')][_0x2ff2('0x77')][_0x2ff2('0x4a')];_0xfbfe7a+=0x1){socket[_0x2ff2('0x82')](_0x2ff2('0x83'),{'UserId':_0x27e426[_0x2ff2('0x5e')][_0x2ff2('0x77')][_0xfbfe7a],'ChatQueueId':_0x27e426[_0x2ff2('0x59')]['id']});}return _0x1bde9d;});}})[_0x2ff2('0x26')](respondWithResult(_0x462fb5,null))['catch'](handleError(_0x462fb5,null));};exports['removeAgents']=function(_0x5f1b5f,_0x3423ef,_0x4af3b7){return db['ChatQueue'][_0x2ff2('0x5c')]({'where':{'id':_0x5f1b5f[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x3423ef,null))['then'](function(_0x4d4c7e){if(_0x4d4c7e){return _0x4d4c7e['removeAgents'](_0x5f1b5f[_0x2ff2('0x45')]['ids'])[_0x2ff2('0x26')](function(){if(_['isArray'](_0x5f1b5f[_0x2ff2('0x45')][_0x2ff2('0x77')])){for(var _0x3e89b4=0x0;_0x3e89b4<_0x5f1b5f[_0x2ff2('0x45')][_0x2ff2('0x77')]['length'];_0x3e89b4+=0x1){socket[_0x2ff2('0x82')]('userChatQueue:remove',{'UserId':Number(_0x5f1b5f[_0x2ff2('0x45')]['ids'][_0x3e89b4]),'ChatQueueId':Number(_0x5f1b5f[_0x2ff2('0x59')]['id'])});}}else{socket[_0x2ff2('0x82')](_0x2ff2('0x96'),{'UserId':Number(_0x5f1b5f[_0x2ff2('0x45')][_0x2ff2('0x77')]),'ChatQueueId':Number(_0x5f1b5f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3423ef,null))[_0x2ff2('0x2d')](handleError(_0x3423ef,null));};exports['getAgents']=function(_0x41d76e,_0x327466,_0x303212){var _0x397ac4={};var _0x302943={};var _0xb1c06c;var _0x2eda6e;return db[_0x2ff2('0x54')][_0x2ff2('0x66')]({'where':{'id':_0x41d76e[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x327466,null))[_0x2ff2('0x26')](function(_0x408914){if(_0x408914){_0xb1c06c=_0x408914;_0x302943[_0x2ff2('0x44')]=_[_0x2ff2('0x46')](db[_0x2ff2('0x6b')][_0x2ff2('0x40')]);_0x302943[_0x2ff2('0x45')]=_['keys'](_0x41d76e[_0x2ff2('0x45')]);_0x302943['filters']=_[_0x2ff2('0x5a')](_0x302943[_0x2ff2('0x44')],_0x302943['query']);_0x397ac4['attributes']=_[_0x2ff2('0x5a')](_0x302943[_0x2ff2('0x44')],qs[_0x2ff2('0x49')](_0x41d76e[_0x2ff2('0x45')]['fields']));_0x397ac4[_0x2ff2('0x48')]=_0x397ac4[_0x2ff2('0x48')][_0x2ff2('0x4a')]?_0x397ac4[_0x2ff2('0x48')]:_0x302943['model'];_0x397ac4['order']=qs[_0x2ff2('0x4d')](_0x41d76e[_0x2ff2('0x45')][_0x2ff2('0x4d')]);_0x397ac4['where']=qs[_0x2ff2('0x47')](_[_0x2ff2('0x4f')](_0x41d76e[_0x2ff2('0x45')],_0x302943['filters']));if(_0x41d76e[_0x2ff2('0x45')][_0x2ff2('0x52')]){_0x397ac4[_0x2ff2('0x4e')]=_[_0x2ff2('0x50')](_0x397ac4['where'],{'$or':_[_0x2ff2('0x3f')](_0x397ac4[_0x2ff2('0x48')],function(_0x5a21d7){var _0x2c3b6b={};_0x2c3b6b[_0x5a21d7]={'$like':'%'+_0x41d76e['query'][_0x2ff2('0x52')]+'%'};return _0x2c3b6b;})});}_0x397ac4=_['merge']({},_0x397ac4,_0x41d76e[_0x2ff2('0x53')]);return _0xb1c06c[_0x2ff2('0x9a')](_0x397ac4);}})[_0x2ff2('0x26')](function(_0x20d6b9){if(_0x20d6b9){_0x2eda6e=_0x20d6b9[_0x2ff2('0x4a')];if(!_0x41d76e['query'][_0x2ff2('0x4b')](_0x2ff2('0x68'))){_0x397ac4[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x41d76e['query'][_0x2ff2('0x30')]);_0x397ac4[_0x2ff2('0x4c')]=qs[_0x2ff2('0x4c')](_0x41d76e[_0x2ff2('0x45')][_0x2ff2('0x4c')]);}return _0xb1c06c[_0x2ff2('0x9a')](_0x397ac4);}})['then'](function(_0x3986b3){if(_0x3986b3){return _0x3986b3?{'count':_0x2eda6e,'rows':_0x3986b3}:null;}})[_0x2ff2('0x26')](respondWithResult(_0x327466,null))[_0x2ff2('0x2d')](handleError(_0x327466,null));};
\ No newline at end of file
+var _0x173f=['register','jayson/promise','client','http','test','Sequelize','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','save','UserProfileResource','destroy','stack','name','send','index','map','ChatQueue','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','rows','show','rawAttributes','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','chatPause','Team','getTeams','ids','Agents','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','every','TeamId','includes','all','compact','value','removeAgents','forEach','emit','userChatQueue:remove','addAgents','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x4146b4,_0x274b03){var _0x5133de=function(_0x12c37e){while(--_0x12c37e){_0x4146b4['push'](_0x4146b4['shift']());}};_0x5133de(++_0x274b03);}(_0x173f,0x19b));var _0xf173=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x173f[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf173('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf173('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf173('0x2'));var moment=require(_0xf173('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf173('0x4'));var util=require(_0xf173('0x5'));var path=require('path');var sox=require(_0xf173('0x6'));var csv=require(_0xf173('0x7'));var ejs=require(_0xf173('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf173('0x9'));var deskjs=require(_0xf173('0xa'));var toCsv=require(_0xf173('0x7'));var querystring=require(_0xf173('0xb'));var Papa=require('papaparse');var Redis=require(_0xf173('0xc'));var authService=require(_0xf173('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf173('0xe'))('api');var utils=require('../../config/utils');var config=require(_0xf173('0xf'));var db=require(_0xf173('0x10'))['db'];config[_0xf173('0x11')]=_[_0xf173('0x12')](config['redis'],{'host':_0xf173('0x13'),'port':0x18eb});var socket=require(_0xf173('0x14'))(new Redis(config[_0xf173('0x11')]));require('./chatQueue.socket')[_0xf173('0x15')](socket);var jayson=require(_0xf173('0x16'));var client=jayson[_0xf173('0x17')][_0xf173('0x18')]({'port':0x232a});function checkPasswordPattern(_0x28d1e5,_0xcb07db,_0x52b763){if(_0x52b763){var _0x3f4269=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f4269[_0xf173('0x19')](_0xcb07db)){return _0x28d1e5;}else{throw new db[(_0xf173('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x28d1e5;}}function respondWithRpcPromise(_0x21efe1,_0x2db2e4,_0x230262,_0x335dbd){return new BPromise(function(_0x353338,_0x2438ce){var _0x159278=_0x335dbd||client;return _0x159278[_0xf173('0x1b')](_0x21efe1,_0x230262)[_0xf173('0x1c')](function(_0x43f603){logger[_0xf173('0x1d')](_0xf173('0x1e'),_0x2db2e4,_0xf173('0x1f'));logger['debug'](_0xf173('0x20'),_0x2db2e4,_0xf173('0x1f'),JSON[_0xf173('0x21')](_0x43f603));if(_0x43f603[_0xf173('0x22')]){if(_0x43f603[_0xf173('0x22')]['code']===0x1f4){logger[_0xf173('0x22')](_0xf173('0x1e'),_0x2db2e4,_0x43f603[_0xf173('0x22')][_0xf173('0x23')]);return _0x2438ce(_0x43f603[_0xf173('0x22')][_0xf173('0x23')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2db2e4,_0x43f603['error'][_0xf173('0x23')]);return _0x353338(_0x43f603[_0xf173('0x22')]['message']);}else{logger[_0xf173('0x1d')](_0xf173('0x1e'),_0x2db2e4,_0xf173('0x1f'));_0x353338(_0x43f603[_0xf173('0x24')][_0xf173('0x23')]);}})[_0xf173('0x25')](function(_0x573e43){logger[_0xf173('0x22')]('ChatQueue,\x20%s,\x20%s',_0x2db2e4,_0x573e43);_0x2438ce(_0x573e43);});});}function respondWithStatusCode(_0x317d91,_0x5ab8ef){_0x5ab8ef=_0x5ab8ef||0xcc;return function(_0x57be37){if(_0x57be37){return _0x317d91[_0xf173('0x26')](_0x5ab8ef);}return _0x317d91[_0xf173('0x27')](_0x5ab8ef)[_0xf173('0x28')]();};}function respondWithResult(_0x4103c8,_0x3b07ca){_0x3b07ca=_0x3b07ca||0xc8;return function(_0x4a3a1a){if(_0x4a3a1a){return _0x4103c8[_0xf173('0x27')](_0x3b07ca)[_0xf173('0x29')](_0x4a3a1a);}};}function respondWithFilteredResult(_0xc96af5,_0xaee760){return function(_0x37d97d){if(_0x37d97d){var _0xa0b406=_0x37d97d[_0xf173('0x2a')],_0x32a2fe=_0xaee760[_0xf173('0x2b')],_0x56854a=_0xaee760[_0xf173('0x2b')]+_0xaee760[_0xf173('0x2c')],_0x2cc2c7;if(_0x56854a>=_0xa0b406){_0x56854a=_0xa0b406;_0x2cc2c7=0xc8;}else{_0x2cc2c7=0xce;}_0xc96af5['status'](_0x2cc2c7);return _0xc96af5[_0xf173('0x2d')]('Content-Range',_0x32a2fe+'-'+_0x56854a+'/'+_0xa0b406)['json'](_0x37d97d);}return null;};}function patchUpdates(_0x2b35ba){return function(_0x415f52){try{jsonpatch[_0xf173('0x2e')](_0x415f52,_0x2b35ba,!![]);}catch(_0x18fd56){return BPromise['reject'](_0x18fd56);}return _0x415f52[_0xf173('0x2f')]();};}function saveUpdates(_0x1195f9,_0x1b78ae){return function(_0x2765c3){if(_0x2765c3){return _0x2765c3['update'](_0x1195f9)[_0xf173('0x1c')](function(_0x4fff7c){return _0x4fff7c;});}return null;};}function removeEntity(_0xef0d36,_0x2e476b){return function(_0x2f4f60){if(_0x2f4f60){return _0x2f4f60['destroy']()['then'](function(){var _0x47c569=_0x2f4f60['get']({'plain':!![]});var _0x3fc4e4='ChatQueues';return db[_0xf173('0x30')][_0xf173('0x31')]({'where':{'type':_0x3fc4e4,'resourceId':_0x47c569['id']}})[_0xf173('0x1c')](function(){return _0x2f4f60;});})[_0xf173('0x1c')](function(){_0xef0d36['status'](0xcc)[_0xf173('0x28')]();});}};}function handleEntityNotFound(_0x4eda49,_0x5d1ef7){return function(_0x1896d2){if(!_0x1896d2){_0x4eda49[_0xf173('0x26')](0x194);}return _0x1896d2;};}function handleError(_0x430603,_0x1c9a0d){_0x1c9a0d=_0x1c9a0d||0x1f4;return function(_0x34952e){logger[_0xf173('0x22')](_0x34952e[_0xf173('0x32')]);if(_0x34952e[_0xf173('0x33')]){delete _0x34952e[_0xf173('0x33')];}_0x430603[_0xf173('0x27')](_0x1c9a0d)[_0xf173('0x34')](_0x34952e);};}exports[_0xf173('0x35')]=function(_0x3f5972,_0x58e33d){var _0x3f3002={},_0x413feb={},_0x291458={'count':0x0,'rows':[]};var _0x5cde5f=_[_0xf173('0x36')](db[_0xf173('0x37')]['rawAttributes'],function(_0x1c4cd8){return{'name':_0x1c4cd8['fieldName'],'type':_0x1c4cd8['type'][_0xf173('0x38')]};});_0x413feb[_0xf173('0x39')]=_['map'](_0x5cde5f,_0xf173('0x33'));_0x413feb[_0xf173('0x3a')]=_[_0xf173('0x3b')](_0x3f5972[_0xf173('0x3a')]);_0x413feb[_0xf173('0x3c')]=_[_0xf173('0x3d')](_0x413feb[_0xf173('0x39')],_0x413feb['query']);_0x3f3002[_0xf173('0x3e')]=_[_0xf173('0x3d')](_0x413feb[_0xf173('0x39')],qs[_0xf173('0x3f')](_0x3f5972[_0xf173('0x3a')]['fields']));_0x3f3002[_0xf173('0x3e')]=_0x3f3002[_0xf173('0x3e')][_0xf173('0x40')]?_0x3f3002[_0xf173('0x3e')]:_0x413feb[_0xf173('0x39')];if(!_0x3f5972[_0xf173('0x3a')][_0xf173('0x41')](_0xf173('0x42'))){_0x3f3002[_0xf173('0x2c')]=qs[_0xf173('0x2c')](_0x3f5972['query'][_0xf173('0x2c')]);_0x3f3002[_0xf173('0x2b')]=qs[_0xf173('0x2b')](_0x3f5972['query'][_0xf173('0x2b')]);}_0x3f3002[_0xf173('0x43')]=qs[_0xf173('0x44')](_0x3f5972[_0xf173('0x3a')][_0xf173('0x44')]);_0x3f3002[_0xf173('0x45')]=qs[_0xf173('0x3c')](_[_0xf173('0x46')](_0x3f5972['query'],_0x413feb['filters']),_0x5cde5f);if(_0x3f5972[_0xf173('0x3a')][_0xf173('0x47')]){_0x3f3002[_0xf173('0x45')]=_['merge'](_0x3f3002[_0xf173('0x45')],{'$or':_[_0xf173('0x36')](_0x5cde5f,function(_0x4001a9){if(_0x4001a9[_0xf173('0x48')]!==_0xf173('0x49')){var _0x25cb6a={};_0x25cb6a[_0x4001a9['name']]={'$like':'%'+_0x3f5972[_0xf173('0x3a')][_0xf173('0x47')]+'%'};return _0x25cb6a;}})});}_0x3f3002=_[_0xf173('0x4a')]({},_0x3f3002,_0x3f5972['options']);var _0x541bc1={'where':_0x3f3002['where']};return db[_0xf173('0x37')][_0xf173('0x2a')](_0x541bc1)[_0xf173('0x1c')](function(_0x1ca7f6){_0x291458['count']=_0x1ca7f6;if(_0x3f5972[_0xf173('0x3a')][_0xf173('0x4b')]){_0x3f3002[_0xf173('0x4c')]=[{'all':!![]}];}return db[_0xf173('0x37')]['findAll'](_0x3f3002);})['then'](function(_0x4856a1){_0x291458[_0xf173('0x4d')]=_0x4856a1;return _0x291458;})[_0xf173('0x1c')](respondWithFilteredResult(_0x58e33d,_0x3f3002))['catch'](handleError(_0x58e33d,null));};exports[_0xf173('0x4e')]=function(_0x5dfbd2,_0x26f537){var _0x3706a2={'raw':!![],'where':{'id':_0x5dfbd2['params']['id']}},_0x47ad3d={};_0x47ad3d[_0xf173('0x39')]=_[_0xf173('0x3b')](db[_0xf173('0x37')][_0xf173('0x4f')]);_0x47ad3d[_0xf173('0x3a')]=_[_0xf173('0x3b')](_0x5dfbd2['query']);_0x47ad3d[_0xf173('0x3c')]=_[_0xf173('0x3d')](_0x47ad3d[_0xf173('0x39')],_0x47ad3d[_0xf173('0x3a')]);_0x3706a2[_0xf173('0x3e')]=_['intersection'](_0x47ad3d[_0xf173('0x39')],qs[_0xf173('0x3f')](_0x5dfbd2[_0xf173('0x3a')][_0xf173('0x3f')]));_0x3706a2[_0xf173('0x3e')]=_0x3706a2[_0xf173('0x3e')]['length']?_0x3706a2[_0xf173('0x3e')]:_0x47ad3d[_0xf173('0x39')];if(_0x5dfbd2[_0xf173('0x3a')][_0xf173('0x4b')]){_0x3706a2[_0xf173('0x4c')]=[{'all':!![]}];}_0x3706a2=_[_0xf173('0x4a')]({},_0x3706a2,_0x5dfbd2[_0xf173('0x50')]);return db['ChatQueue'][_0xf173('0x51')](_0x3706a2)[_0xf173('0x1c')](handleEntityNotFound(_0x26f537,null))[_0xf173('0x1c')](respondWithResult(_0x26f537,null))[_0xf173('0x25')](handleError(_0x26f537,null));};exports[_0xf173('0x52')]=function(_0x3b059d,_0x478d56){return db[_0xf173('0x37')][_0xf173('0x52')](_0x3b059d[_0xf173('0x53')],{})[_0xf173('0x1c')](function(_0x214d4a){var _0x3484ee=_0x3b059d['user'][_0xf173('0x54')]({'plain':!![]});if(!_0x3484ee)throw new Error(_0xf173('0x55'));if(_0x3484ee[_0xf173('0x56')]===_0xf173('0x57')){var _0x2407a2=_0x214d4a[_0xf173('0x54')]({'plain':!![]});var _0x4e9546=_0xf173('0x58');return db['UserProfileSection'][_0xf173('0x51')]({'where':{'name':_0x4e9546,'userProfileId':_0x3484ee['userProfileId']},'raw':!![]})[_0xf173('0x1c')](function(_0x398ac8){if(_0x398ac8&&_0x398ac8[_0xf173('0x59')]===0x0){return db[_0xf173('0x30')][_0xf173('0x52')]({'name':_0x2407a2[_0xf173('0x33')],'resourceId':_0x2407a2['id'],'type':_0x398ac8['name'],'sectionId':_0x398ac8['id']},{})['then'](function(){return _0x214d4a;});}else{return _0x214d4a;}})[_0xf173('0x25')](function(_0xb5a9ef){logger[_0xf173('0x22')](_0xf173('0x5a'),_0xb5a9ef);throw _0xb5a9ef;});}return _0x214d4a;})[_0xf173('0x1c')](respondWithResult(_0x478d56,0xc9))[_0xf173('0x25')](handleError(_0x478d56,null));};exports[_0xf173('0x5b')]=function(_0x47b54d,_0x3c9d68){if(_0x47b54d[_0xf173('0x53')]['id']){delete _0x47b54d[_0xf173('0x53')]['id'];}return db['ChatQueue'][_0xf173('0x51')]({'where':{'id':_0x47b54d[_0xf173('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3c9d68,null))['then'](saveUpdates(_0x47b54d[_0xf173('0x53')],null))[_0xf173('0x1c')](respondWithResult(_0x3c9d68,null))['catch'](handleError(_0x3c9d68,null));};exports['destroy']=function(_0x5ed73b,_0x26788a){return db[_0xf173('0x37')][_0xf173('0x51')]({'where':{'id':_0x5ed73b['params']['id']}})[_0xf173('0x1c')](handleEntityNotFound(_0x26788a,null))['then'](removeEntity(_0x26788a,null))['catch'](handleError(_0x26788a,null));};exports[_0xf173('0x5d')]=function(_0x1516b3,_0xf47e80){return db[_0xf173('0x37')]['describe']()[_0xf173('0x1c')](respondWithResult(_0xf47e80,null))['catch'](handleError(_0xf47e80,null));};exports['getMembers']=function(_0x4a3201,_0x476830,_0x3de514){var _0x4ccb6a={'raw':!![],'where':{}},_0x37165d={},_0x202557;return db['ChatQueue'][_0xf173('0x5e')]({'where':{'id':_0x4a3201[_0xf173('0x5c')]['id']}})[_0xf173('0x1c')](handleEntityNotFound(_0x476830,null))[_0xf173('0x1c')](function(_0x3d4b08){if(_0x3d4b08){_0x202557=_0x3d4b08['get']({'plain':!![]});_0x37165d[_0xf173('0x39')]=_['keys'](db[_0xf173('0x5f')]['rawAttributes']);_0x37165d[_0xf173('0x3a')]=_[_0xf173('0x3b')](_0x4a3201[_0xf173('0x3a')]);_0x37165d['filters']=_['intersection'](_0x37165d[_0xf173('0x39')],_0x37165d[_0xf173('0x3a')]);_0x4ccb6a['attributes']=_[_0xf173('0x3d')](_0x37165d[_0xf173('0x39')],qs[_0xf173('0x3f')](_0x4a3201[_0xf173('0x3a')][_0xf173('0x3f')]));_0x4ccb6a[_0xf173('0x3e')]=_0x4ccb6a['attributes']['length']?_0x4ccb6a[_0xf173('0x3e')]:_0x37165d[_0xf173('0x39')];if(!_0x4a3201[_0xf173('0x3a')][_0xf173('0x41')](_0xf173('0x42'))){_0x4ccb6a[_0xf173('0x2c')]=qs['limit'](_0x4a3201[_0xf173('0x3a')][_0xf173('0x2c')]);_0x4ccb6a[_0xf173('0x2b')]=qs[_0xf173('0x2b')](_0x4a3201[_0xf173('0x3a')][_0xf173('0x2b')]);}_0x4ccb6a[_0xf173('0x43')]=qs['sort'](_0x4a3201[_0xf173('0x3a')]['sort']);_0x4ccb6a[_0xf173('0x45')]=qs['filters'](_[_0xf173('0x46')](_0x4a3201[_0xf173('0x3a')],_0x37165d[_0xf173('0x3c')]));_0x4ccb6a[_0xf173('0x45')][_0xf173('0x60')]=_0x3d4b08['id'];if(_0x4a3201[_0xf173('0x3a')][_0xf173('0x47')]){_0x4ccb6a[_0xf173('0x45')]=_[_0xf173('0x4a')](_0x4ccb6a[_0xf173('0x45')],{'$or':_[_0xf173('0x36')](_0x4ccb6a['attributes'],function(_0x3cc0da){var _0x2e37df={};_0x2e37df[_0x3cc0da]={'$like':'%'+_0x4a3201['query']['filter']+'%'};return _0x2e37df;})});}_0x4ccb6a=_[_0xf173('0x4a')]({},_0x4ccb6a,_0x4a3201[_0xf173('0x50')]);return db[_0xf173('0x5f')][_0xf173('0x61')](_0x4ccb6a);}})[_0xf173('0x1c')](function(_0x369f38){if(_0x369f38){return db[_0xf173('0x62')][_0xf173('0x63')]({'where':{'id':_['map'](_0x369f38,_0xf173('0x64')),'role':'agent'},'attributes':['id',_0xf173('0x33'),'chatPause',_0xf173('0x65'),_0xf173('0x66')]});}})[_0xf173('0x1c')](function(_0x28064c){if(_0x28064c){return{'count':_0x28064c['count'],'rows':_[_0xf173('0x36')](_0x28064c['rows'],function(_0x41f948){return{'membername':_0x41f948[_0xf173('0x33')],'UserId':_0x41f948['id'],'queue_name':_0x202557[_0xf173('0x33')],'ChatQueueId':_0x202557['id'],'interface':util[_0xf173('0x67')](_0xf173('0x68'),_0xf173('0x69'),_0x41f948[_0xf173('0x33')]),'penalty':0x0,'paused':_0x41f948[_0xf173('0x6a')],'createdAt':_0x41f948[_0xf173('0x66')],'updatedAt':_0x41f948[_0xf173('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf173('0x1c')](respondWithFilteredResult(_0x476830,_0x4ccb6a))[_0xf173('0x25')](handleError(_0x476830,null));};exports['getTeams']=function(_0x941fa8,_0x74e19c,_0xffc10a){var _0xaa29f7={};var _0x172b30={};var _0x2bf823;var _0x32d416;return db[_0xf173('0x37')][_0xf173('0x5e')]({'where':{'id':_0x941fa8[_0xf173('0x5c')]['id']}})[_0xf173('0x1c')](handleEntityNotFound(_0x74e19c,null))[_0xf173('0x1c')](function(_0x4b93c8){if(_0x4b93c8){_0x2bf823=_0x4b93c8;_0x172b30[_0xf173('0x39')]=_[_0xf173('0x3b')](db[_0xf173('0x6b')][_0xf173('0x4f')]);_0x172b30['query']=_[_0xf173('0x3b')](_0x941fa8['query']);_0x172b30['filters']=_[_0xf173('0x3d')](_0x172b30[_0xf173('0x39')],_0x172b30[_0xf173('0x3a')]);_0xaa29f7[_0xf173('0x3e')]=_[_0xf173('0x3d')](_0x172b30[_0xf173('0x39')],qs[_0xf173('0x3f')](_0x941fa8[_0xf173('0x3a')][_0xf173('0x3f')]));_0xaa29f7[_0xf173('0x3e')]=_0xaa29f7['attributes'][_0xf173('0x40')]?_0xaa29f7[_0xf173('0x3e')]:_0x172b30[_0xf173('0x39')];_0xaa29f7[_0xf173('0x43')]=qs[_0xf173('0x44')](_0x941fa8[_0xf173('0x3a')][_0xf173('0x44')]);_0xaa29f7[_0xf173('0x45')]=qs[_0xf173('0x3c')](_[_0xf173('0x46')](_0x941fa8[_0xf173('0x3a')],_0x172b30[_0xf173('0x3c')]));if(_0x941fa8['query'][_0xf173('0x47')]){_0xaa29f7['where']=_[_0xf173('0x4a')](_0xaa29f7['where'],{'$or':_[_0xf173('0x36')](_0xaa29f7[_0xf173('0x3e')],function(_0x29ad1a){var _0x3c66d9={};_0x3c66d9[_0x29ad1a]={'$like':'%'+_0x941fa8[_0xf173('0x3a')][_0xf173('0x47')]+'%'};return _0x3c66d9;})});}_0xaa29f7=_[_0xf173('0x4a')]({},_0xaa29f7,_0x941fa8[_0xf173('0x50')]);return _0x2bf823[_0xf173('0x6c')](_0xaa29f7);}})[_0xf173('0x1c')](function(_0x453bef){if(_0x453bef){_0x32d416=_0x453bef[_0xf173('0x40')];if(!_0x941fa8[_0xf173('0x3a')]['hasOwnProperty'](_0xf173('0x42'))){_0xaa29f7[_0xf173('0x2c')]=qs[_0xf173('0x2c')](_0x941fa8[_0xf173('0x3a')][_0xf173('0x2c')]);_0xaa29f7[_0xf173('0x2b')]=qs['offset'](_0x941fa8[_0xf173('0x3a')]['offset']);}return _0x2bf823[_0xf173('0x6c')](_0xaa29f7);}})['then'](function(_0x3202e2){if(_0x3202e2){return _0x3202e2?{'count':_0x32d416,'rows':_0x3202e2}:null;}})[_0xf173('0x1c')](respondWithResult(_0x74e19c,null))[_0xf173('0x25')](handleError(_0x74e19c,null));};exports['addTeams']=function(_0x1be031,_0x50de82,_0x475b46){var _0x2ad2d1=_0x1be031[_0xf173('0x53')][_0xf173('0x6d')];return db[_0xf173('0x6b')][_0xf173('0x61')]({'where':{'id':_0x2ad2d1},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf173('0x6e'),'attributes':['id',_0xf173('0x33'),'online',_0xf173('0x6f'),_0xf173('0x70')],'raw':!![]}]})['then'](function(_0x9cb5ce){if(_0x9cb5ce){var _0xb00c7f=_[_0xf173('0x71')](_0x9cb5ce,function(_0x542002){var _0x3485ab=_0x542002['get']({'plain':!![]});return _0x3485ab['Agents'];});return db[_0xf173('0x37')][_0xf173('0x51')]({'where':{'id':_0x1be031[_0xf173('0x5c')]['id']}})['then'](function(_0x3e9c7a){return db['sequelize'][_0xf173('0x72')](function(_0x56c7cf){return _0x3e9c7a[_0xf173('0x73')](_0x2ad2d1,{'transaction':_0x56c7cf})[_0xf173('0x1c')](function(){return BPromise[_0xf173('0x74')](_0xb00c7f,function(_0x2d773c){return db[_0xf173('0x5f')][_0xf173('0x75')]({'where':{'UserId':_0x2d773c['id'],'ChatQueueId':_0x1be031[_0xf173('0x5c')]['id']},'transaction':_0x56c7cf});});})[_0xf173('0x1c')](function(){_0xb00c7f['forEach'](function(_0x52e5b7){socket['emit'](_0xf173('0x76'),{'UserId':_0x52e5b7['id'],'ChatQueueId':_0x3e9c7a['id']});});});});});}})[_0xf173('0x1c')](respondWithStatusCode(_0x50de82,null))[_0xf173('0x25')](handleError(_0x50de82,null));};exports[_0xf173('0x77')]=function(_0x20327e,_0x246b1b,_0xd5f277){return db['Team'][_0xf173('0x61')]({'where':{'id':_0x20327e[_0xf173('0x3a')][_0xf173('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xf173('0x62')],'as':_0xf173('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x246b1b,null))['then'](function(_0x3b92b6){var _0x48cbb0=_['map'](_0x3b92b6,'id');var _0x44500e=[];var _0x5940ac=[];var _0x2f9ab6=squel[_0xf173('0x78')]();_0x2f9ab6[_0xf173('0x79')](_0xf173('0x7a'))['from'](_0xf173('0x7b'),'tq')[_0xf173('0x7c')](_0xf173('0x7d'),'ut',_0xf173('0x7e'))[_0xf173('0x45')]('ChatQueueId\x20=\x20?',_0x20327e['params']['id']);for(var _0xb86386=0x0;_0xb86386<_0x3b92b6[_0xf173('0x40')];_0xb86386+=0x1){let _0x504f47=_0x3b92b6[_0xb86386];for(var _0x579015=0x0;_0x579015<_0x504f47[_0xf173('0x6e')][_0xf173('0x40')];_0x579015+=0x1){let _0x5e08ff=_0x504f47['Agents'][_0x579015];var _0x1a463c=_0x2f9ab6[_0xf173('0x7f')]();_0x1a463c[_0xf173('0x45')](_0xf173('0x80'),_0x5e08ff['id']);_0x5940ac[_0xf173('0x81')](db[_0xf173('0x82')][_0xf173('0x3a')](_0x1a463c[_0xf173('0x83')](),{'type':db[_0xf173('0x82')]['QueryTypes']['SELECT']})['then'](function(_0x3a5101){if(_0x3a5101[_0xf173('0x40')]===0x1){return _0x5e08ff['id'];}else{var _0x4ef5ec=_[_0xf173('0x84')](_['map'](_0x3a5101,_0xf173('0x85')),function(_0x4d265f){return _[_0xf173('0x86')](_0x48cbb0,_0x4d265f);});if(_0x4ef5ec){return _0x5e08ff['id'];}}}));}}return BPromise[_0xf173('0x87')](_0x5940ac)[_0xf173('0x1c')](function(_0x3d00b4){_0x44500e=_(_0x44500e)['union'](_0x3d00b4)[_0xf173('0x88')]()[_0xf173('0x89')]();return db[_0xf173('0x37')][_0xf173('0x51')]({'where':{'id':_0x20327e[_0xf173('0x5c')]['id']}})[_0xf173('0x1c')](function(_0x3392c1){return db[_0xf173('0x82')]['transaction'](function(_0x173070){return _0x3392c1[_0xf173('0x77')](_0x20327e[_0xf173('0x3a')]['ids'],{'transaction':_0x173070})[_0xf173('0x1c')](function(){if(!_['isEmpty'](_0x44500e)){return _0x3392c1[_0xf173('0x8a')](_0x44500e,{'transaction':_0x173070});}})[_0xf173('0x1c')](function(){_0x44500e[_0xf173('0x8b')](function(_0x3deea3){socket[_0xf173('0x8c')](_0xf173('0x8d'),{'UserId':_0x3deea3,'ChatQueueId':_0x3392c1['id']});});});});});});})[_0xf173('0x1c')](respondWithStatusCode(_0x246b1b,null))[_0xf173('0x25')](handleError(_0x246b1b,null));};exports[_0xf173('0x8e')]=function(_0x657807,_0x4e7679,_0x522c2d){return db[_0xf173('0x37')][_0xf173('0x51')]({'where':{'id':_0x657807[_0xf173('0x5c')]['id']}})[_0xf173('0x1c')](handleEntityNotFound(_0x4e7679,null))[_0xf173('0x1c')](function(_0x4830a4){if(_0x4830a4){return _0x4830a4['addAgents'](_0x657807[_0xf173('0x53')][_0xf173('0x6d')],_['omit'](_0x657807[_0xf173('0x53')],[_0xf173('0x6d'),'id'])||{})['spread'](function(_0x20cbc5){for(var _0x421885=0x0;_0x421885<_0x657807[_0xf173('0x53')][_0xf173('0x6d')][_0xf173('0x40')];_0x421885+=0x1){socket['emit'](_0xf173('0x76'),{'UserId':_0x657807[_0xf173('0x53')][_0xf173('0x6d')][_0x421885],'ChatQueueId':_0x657807['params']['id']});}return _0x20cbc5;});}})[_0xf173('0x1c')](respondWithResult(_0x4e7679,null))[_0xf173('0x25')](handleError(_0x4e7679,null));};exports[_0xf173('0x8a')]=function(_0x379d59,_0x192a7b,_0x146f44){return db[_0xf173('0x37')][_0xf173('0x51')]({'where':{'id':_0x379d59[_0xf173('0x5c')]['id']}})[_0xf173('0x1c')](handleEntityNotFound(_0x192a7b,null))['then'](function(_0x412421){if(_0x412421){return _0x412421[_0xf173('0x8a')](_0x379d59['query'][_0xf173('0x6d')])[_0xf173('0x1c')](function(){if(_['isArray'](_0x379d59[_0xf173('0x3a')][_0xf173('0x6d')])){for(var _0x55910e=0x0;_0x55910e<_0x379d59[_0xf173('0x3a')][_0xf173('0x6d')][_0xf173('0x40')];_0x55910e+=0x1){socket[_0xf173('0x8c')](_0xf173('0x8d'),{'UserId':Number(_0x379d59[_0xf173('0x3a')]['ids'][_0x55910e]),'ChatQueueId':Number(_0x379d59[_0xf173('0x5c')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x379d59[_0xf173('0x3a')][_0xf173('0x6d')]),'ChatQueueId':Number(_0x379d59[_0xf173('0x5c')]['id'])});}});}})[_0xf173('0x1c')](respondWithStatusCode(_0x192a7b,null))[_0xf173('0x25')](handleError(_0x192a7b,null));};exports['getAgents']=function(_0x4ae11c,_0x511720,_0x4df1b6){var _0x51d26b={};var _0x28e4a3={};var _0x1c240d;var _0x1b49df;return db[_0xf173('0x37')][_0xf173('0x5e')]({'where':{'id':_0x4ae11c[_0xf173('0x5c')]['id']}})[_0xf173('0x1c')](handleEntityNotFound(_0x511720,null))[_0xf173('0x1c')](function(_0x332233){if(_0x332233){_0x1c240d=_0x332233;_0x28e4a3['model']=_[_0xf173('0x3b')](db['User']['rawAttributes']);_0x28e4a3[_0xf173('0x3a')]=_[_0xf173('0x3b')](_0x4ae11c[_0xf173('0x3a')]);_0x28e4a3[_0xf173('0x3c')]=_[_0xf173('0x3d')](_0x28e4a3[_0xf173('0x39')],_0x28e4a3['query']);_0x51d26b[_0xf173('0x3e')]=_[_0xf173('0x3d')](_0x28e4a3[_0xf173('0x39')],qs[_0xf173('0x3f')](_0x4ae11c['query'][_0xf173('0x3f')]));_0x51d26b[_0xf173('0x3e')]=_0x51d26b[_0xf173('0x3e')][_0xf173('0x40')]?_0x51d26b['attributes']:_0x28e4a3[_0xf173('0x39')];_0x51d26b[_0xf173('0x43')]=qs[_0xf173('0x44')](_0x4ae11c[_0xf173('0x3a')][_0xf173('0x44')]);_0x51d26b[_0xf173('0x45')]=qs[_0xf173('0x3c')](_['pick'](_0x4ae11c[_0xf173('0x3a')],_0x28e4a3[_0xf173('0x3c')]));if(_0x4ae11c['query'][_0xf173('0x47')]){_0x51d26b[_0xf173('0x45')]=_[_0xf173('0x4a')](_0x51d26b['where'],{'$or':_[_0xf173('0x36')](_0x51d26b[_0xf173('0x3e')],function(_0x11b2a0){var _0x18f63b={};_0x18f63b[_0x11b2a0]={'$like':'%'+_0x4ae11c[_0xf173('0x3a')][_0xf173('0x47')]+'%'};return _0x18f63b;})});}_0x51d26b=_['merge']({},_0x51d26b,_0x4ae11c['options']);return _0x1c240d[_0xf173('0x8f')](_0x51d26b);}})['then'](function(_0x3f1cd8){if(_0x3f1cd8){_0x1b49df=_0x3f1cd8['length'];if(!_0x4ae11c['query'][_0xf173('0x41')](_0xf173('0x42'))){_0x51d26b[_0xf173('0x2c')]=qs['limit'](_0x4ae11c['query'][_0xf173('0x2c')]);_0x51d26b[_0xf173('0x2b')]=qs[_0xf173('0x2b')](_0x4ae11c[_0xf173('0x3a')][_0xf173('0x2b')]);}return _0x1c240d[_0xf173('0x8f')](_0x51d26b);}})[_0xf173('0x1c')](function(_0x912cfa){if(_0x912cfa){return _0x912cfa?{'count':_0x1b49df,'rows':_0x912cfa}:null;}})[_0xf173('0x1c')](respondWithResult(_0x511720,null))[_0xf173('0x25')](handleError(_0x511720,null));};
\ No newline at end of file