From: support
Date: Fri, 28 Oct 2022 05:22:38 +0000 (+0000)
Subject: Built motion from commit dddd5827.|2.6.19
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=89c8a79a62a59a4072bc8e5d1fb208019b80e9ba;p=motion2.git
Built motion from commit dddd5827.|2.6.19
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 1a9ff3f..bc2b834 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-26T13:25:58.962Z",
+ "time": "2022-10-28T05:14:06.369Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index cb526c2..a6387a0 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-26T13:25:58.962Z",
+ "time": "2022-10-28T05:14:06.369Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/public/app/main/apps/staff/i18n/it.json b/public/app/main/apps/staff/i18n/it.json
index 9515685..5d106f4 100644
--- a/public/app/main/apps/staff/i18n/it.json
+++ b/public/app/main/apps/staff/i18n/it.json
@@ -412,17 +412,17 @@
"AD_SSO_ENABLED": "SSO di Active Directory",
"AUTHENTICATION": "Autenticazione",
"AUTO_ANSWER": "Risposta automatica",
- "CHAT_AUTOANSWER": "Risposta automatica della chat",
- "CHAT_AUTOANSWERDELAY": "Ritardo risposta automatica chat [s]",
- "EMAIL_AUTOANSWER": "Risposta automatica via e-mail",
- "EMAIL_AUTOANSWERDELAY": "Ritardo risposta automatica e-mail [i]",
- "FAX_AUTOANSWER": "Risposta automatica via fax",
- "FAX_AUTOANSWERDELAY": "Ritardo risposta automatica fax [s]",
- "OPENCHANNEL_AUTOANSWER": "Risposta automatica a canale aperto",
- "OPENCHANNEL_AUTOANSWERDELAY": "Ritardo risposta automatica canale aperto [s]",
- "SMS_AUTOANSWER": "Sms risposta automatica",
- "SMS_AUTOANSWERDELAY": "Ritardo risposta automatica SMS [s]",
- "WHATSAPP_AUTOANSWER": "Whatsapp risposta automatica",
- "WHATSAPP_AUTOANSWERDELAY": "Ritardo risposta automatica Whatsapp [s]"
+ "CHAT_AUTOANSWER": "Risposta automatica via Chat",
+ "CHAT_AUTOANSWERDELAY": "Ritardo risposta automatica via Chat [s]",
+ "EMAIL_AUTOANSWER": "Risposta automatica via Email",
+ "EMAIL_AUTOANSWERDELAY": "Ritardo risposta automatica via Email [i]",
+ "FAX_AUTOANSWER": "Risposta automatica via Fax",
+ "FAX_AUTOANSWERDELAY": "Ritardo risposta automatica Fax [s]",
+ "OPENCHANNEL_AUTOANSWER": "Risposta automatica via Openchannel",
+ "OPENCHANNEL_AUTOANSWERDELAY": "Ritardo risposta automatica via Openchannel [s]",
+ "SMS_AUTOANSWER": "Risposta automatica via Sms",
+ "SMS_AUTOANSWERDELAY": "Ritardo risposta automatica via Sms [s]",
+ "WHATSAPP_AUTOANSWER": "Risposta automatica via Whatsapp",
+ "WHATSAPP_AUTOANSWERDELAY": "Ritardo risposta automatica via Whatsapp [s]"
}
}
diff --git a/public/app/toolbar/i18n/it.json b/public/app/toolbar/i18n/it.json
index 0d9949a..4796dd7 100644
--- a/public/app/toolbar/i18n/it.json
+++ b/public/app/toolbar/i18n/it.json
@@ -117,14 +117,14 @@
"AUTOANSWER_NOTIFICATIONS": "Notifiche di risposta automatica",
"CHANNEL": "Canale",
"CHANNELS": "Canali",
- "CHAT": "Chiacchierata",
+ "CHAT": "Chat",
"DELAY": "Ritardo risposta automatica [sec]",
"EMAIL": "E-mail",
"FAX": "Fax",
"NOTIFICATIONS": "Risposta automatica abilitata",
"NUM_NOTIFICATIONS": "Notifiche",
- "OPENCHANNEL": "Canale aperto",
- "SMS": "sms",
+ "OPENCHANNEL": "Openchannel",
+ "SMS": "Sms",
"WHATSAPP": "WhatsApp",
"NO_AUTOANSWER_CONFIGURED": "Nessuna risposta automatica configurata per i canali",
"BOSNIAN": "bosniaco",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 1931fa6..ee363b8 100644
--- a/server/api/action/action.attributes.js
+++ b/server/api/action/action.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa65=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar'];(function(_0x4cdcba,_0x34b28e){var _0x285181=function(_0x462f53){while(--_0x462f53){_0x4cdcba['push'](_0x4cdcba['shift']());}};_0x285181(++_0x34b28e);}(_0xaa65,0x90));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5aa6('0x0'));module[_0x5aa6('0x1')]={'name':{'type':Sequelize[_0x5aa6('0x2')],'get':function(_0xcc6470){return this['getDataValue'](_0x5aa6('0x3'));}},'action':{'type':Sequelize[_0x5aa6('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5aa6('0x5'),_0x5aa6('0x6'),_0x5aa6('0x7'),'jscripty','urlForward',_0x5aa6('0x8'),_0x5aa6('0x9'),_0x5aa6('0xa')]],'msg':_0x5aa6('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comment':_0x5aa6('0xc')},'data2':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comment':_0x5aa6('0xd')},'data3':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comment':_0x5aa6('0xe')},'data4':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comments':_0x5aa6('0xf')},'data5':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comments':_0x5aa6('0x10')},'data6':{'type':Sequelize[_0x5aa6('0x4')],'comments':_0x5aa6('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0x5aa6('0x12')}};
\ No newline at end of file
+var _0x4b57=['sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0xabb865,_0x1a4197){var _0x1519e8=function(_0x5c8b0d){while(--_0x5c8b0d){_0xabb865['push'](_0xabb865['shift']());}};_0x1519e8(++_0x1a4197);}(_0x4b57,0xaa));var _0x74b5=function(_0xbf8ec1,_0x9169c8){_0xbf8ec1=_0xbf8ec1-0x0;var _0xc84567=_0x4b57[_0xbf8ec1];return _0xc84567;};'use strict';var Sequelize=require(_0x74b5('0x0'));module[_0x74b5('0x1')]={'name':{'type':Sequelize[_0x74b5('0x2')],'get':function(_0x12582c){return this['getDataValue'](_0x74b5('0x3'));}},'action':{'type':Sequelize[_0x74b5('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x74b5('0x5'),_0x74b5('0x6'),_0x74b5('0x7'),'jscripty',_0x74b5('0x8'),_0x74b5('0x9'),'bot','script']],'msg':_0x74b5('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comment':_0x74b5('0xb')},'data2':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comment':_0x74b5('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comments':_0x74b5('0xd')},'data5':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comments':_0x74b5('0xe')},'data6':{'type':Sequelize[_0x74b5('0x4')],'comments':_0x74b5('0xf')},'data7':{'type':Sequelize[_0x74b5('0x10')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 42fe1e6..d703a2b 100644
--- a/server/api/action/action.controller.js
+++ b/server/api/action/action.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91e8=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','name','send','body','Action','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x3564d6,_0x37d1cb){var _0x1f2267=function(_0xbf7dfb){while(--_0xbf7dfb){_0x3564d6['push'](_0x3564d6['shift']());}};_0x1f2267(++_0x37d1cb);}(_0x91e8,0x122));var _0x891e=function(_0x140261,_0x2b2d9b){_0x140261=_0x140261-0x0;var _0x12e4f0=_0x91e8[_0x140261];return _0x12e4f0;};'use strict';var emlformat=require(_0x891e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x891e('0x1'));var jsonpatch=require(_0x891e('0x2'));var rp=require(_0x891e('0x3'));var moment=require(_0x891e('0x4'));var BPromise=require(_0x891e('0x5'));var Mustache=require(_0x891e('0x6'));var util=require(_0x891e('0x7'));var path=require(_0x891e('0x8'));var sox=require('sox');var csv=require(_0x891e('0x9'));var ejs=require(_0x891e('0xa'));var fs=require('fs');var fs_extra=require(_0x891e('0xb'));var _=require(_0x891e('0xc'));var squel=require(_0x891e('0xd'));var crypto=require(_0x891e('0xe'));var jsforce=require(_0x891e('0xf'));var deskjs=require(_0x891e('0x10'));var toCsv=require(_0x891e('0x9'));var querystring=require(_0x891e('0x11'));var Papa=require(_0x891e('0x12'));var Redis=require(_0x891e('0x13'));var authService=require(_0x891e('0x14'));var qs=require(_0x891e('0x15'));var as=require(_0x891e('0x16'));var hardwareService=require(_0x891e('0x17'));var logger=require(_0x891e('0x18'))(_0x891e('0x19'));var utils=require(_0x891e('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x891e('0x1b'))['db'];function respondWithStatusCode(_0x1f7e47,_0x347a93){_0x347a93=_0x347a93||0xcc;return function(_0x1a2599){if(_0x1a2599){return _0x1f7e47[_0x891e('0x1c')](_0x347a93);}return _0x1f7e47[_0x891e('0x1d')](_0x347a93)[_0x891e('0x1e')]();};}function respondWithResult(_0x157ad4,_0x34d633){_0x34d633=_0x34d633||0xc8;return function(_0x31ae7a){if(_0x31ae7a){return _0x157ad4[_0x891e('0x1d')](_0x34d633)['json'](_0x31ae7a);}};}function respondWithFilteredResult(_0x5b3233,_0x482a92){return function(_0x3ca096){if(_0x3ca096){var _0x45ee65=typeof _0x482a92[_0x891e('0x1f')]===_0x891e('0x20')&&typeof _0x482a92[_0x891e('0x21')]===_0x891e('0x20');var _0x9d5627=_0x3ca096[_0x891e('0x22')];var _0x19bc2a=_0x45ee65?0x0:_0x482a92[_0x891e('0x1f')];var _0x5060bf=_0x45ee65?_0x3ca096[_0x891e('0x22')]:_0x482a92[_0x891e('0x1f')]+_0x482a92[_0x891e('0x21')];var _0xd8f555;if(_0x5060bf>=_0x9d5627){_0x5060bf=_0x9d5627;_0xd8f555=0xc8;}else{_0xd8f555=0xce;}_0x5b3233[_0x891e('0x1d')](_0xd8f555);return _0x5b3233[_0x891e('0x23')]('Content-Range',_0x19bc2a+'-'+_0x5060bf+'/'+_0x9d5627)[_0x891e('0x24')](_0x3ca096);}return null;};}function patchUpdates(_0x460370){return function(_0x7eff7a){try{jsonpatch[_0x891e('0x25')](_0x7eff7a,_0x460370,!![]);}catch(_0x2c44d7){return BPromise[_0x891e('0x26')](_0x2c44d7);}return _0x7eff7a[_0x891e('0x27')]();};}function saveUpdates(_0x1f0b66,_0x414be8){return function(_0x31d01c){if(_0x31d01c){return _0x31d01c[_0x891e('0x28')](_0x1f0b66)[_0x891e('0x29')](function(_0x1c3986){return _0x1c3986;});}return null;};}function removeEntity(_0x3d36d7,_0xacd550){return function(_0xe02029){if(_0xe02029){return _0xe02029[_0x891e('0x2a')]()['then'](function(){_0x3d36d7[_0x891e('0x1d')](0xcc)[_0x891e('0x1e')]();});}};}function handleEntityNotFound(_0x3d7178,_0x5cacc5){return function(_0x380cdb){if(!_0x380cdb){_0x3d7178[_0x891e('0x1c')](0x194);}return _0x380cdb;};}function handleError(_0x5ba7eb,_0xb2ea0){_0xb2ea0=_0xb2ea0||0x1f4;return function(_0x12e3bf){logger[_0x891e('0x2b')](_0x12e3bf['stack']);if(_0x12e3bf[_0x891e('0x2c')]){delete _0x12e3bf[_0x891e('0x2c')];}_0x5ba7eb[_0x891e('0x1d')](_0xb2ea0)[_0x891e('0x2d')](_0x12e3bf);};}exports[_0x891e('0x28')]=function(_0x338f1e,_0x45ddf5){if(_0x338f1e[_0x891e('0x2e')]['id']){delete _0x338f1e[_0x891e('0x2e')]['id'];}return db[_0x891e('0x2f')][_0x891e('0x30')]({'where':{'id':_0x338f1e[_0x891e('0x31')]['id']}})[_0x891e('0x29')](handleEntityNotFound(_0x45ddf5,null))[_0x891e('0x29')](saveUpdates(_0x338f1e[_0x891e('0x2e')],null))[_0x891e('0x29')](respondWithResult(_0x45ddf5,null))['catch'](handleError(_0x45ddf5,null));};exports[_0x891e('0x2a')]=function(_0x481a08,_0x5b168a){return db[_0x891e('0x2f')][_0x891e('0x30')]({'where':{'id':_0x481a08[_0x891e('0x31')]['id']}})[_0x891e('0x29')](handleEntityNotFound(_0x5b168a,null))['then'](removeEntity(_0x5b168a,null))['catch'](handleError(_0x5b168a,null));};
\ No newline at end of file
+var _0x51fc=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','name','send','body','Action','find','params','catch','destroy','rimraf','zip-dir'];(function(_0x32f8a2,_0x49c502){var _0x258cca=function(_0x1040e4){while(--_0x1040e4){_0x32f8a2['push'](_0x32f8a2['shift']());}};_0x258cca(++_0x49c502);}(_0x51fc,0x1c0));var _0xc51f=function(_0x293055,_0x10e0b1){_0x293055=_0x293055-0x0;var _0x19c83a=_0x51fc[_0x293055];return _0x19c83a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc51f('0x0'));var zipdir=require(_0xc51f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc51f('0x2'));var BPromise=require(_0xc51f('0x3'));var Mustache=require(_0xc51f('0x4'));var util=require(_0xc51f('0x5'));var path=require('path');var sox=require(_0xc51f('0x6'));var csv=require(_0xc51f('0x7'));var ejs=require(_0xc51f('0x8'));var fs=require('fs');var fs_extra=require(_0xc51f('0x9'));var _=require(_0xc51f('0xa'));var squel=require(_0xc51f('0xb'));var crypto=require(_0xc51f('0xc'));var jsforce=require(_0xc51f('0xd'));var deskjs=require(_0xc51f('0xe'));var toCsv=require(_0xc51f('0x7'));var querystring=require(_0xc51f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc51f('0x10'));var qs=require(_0xc51f('0x11'));var as=require(_0xc51f('0x12'));var hardwareService=require(_0xc51f('0x13'));var logger=require('../../config/logger')(_0xc51f('0x14'));var utils=require(_0xc51f('0x15'));var config=require(_0xc51f('0x16'));var licenseUtil=require(_0xc51f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15692e,_0x47b162){_0x47b162=_0x47b162||0xcc;return function(_0x49de0d){if(_0x49de0d){return _0x15692e[_0xc51f('0x18')](_0x47b162);}return _0x15692e[_0xc51f('0x19')](_0x47b162)['end']();};}function respondWithResult(_0x27c8bf,_0x21245d){_0x21245d=_0x21245d||0xc8;return function(_0x4c9572){if(_0x4c9572){return _0x27c8bf[_0xc51f('0x19')](_0x21245d)['json'](_0x4c9572);}};}function respondWithFilteredResult(_0x776feb,_0x54987d){return function(_0x23bce4){if(_0x23bce4){var _0x5137af=typeof _0x54987d[_0xc51f('0x1a')]===_0xc51f('0x1b')&&typeof _0x54987d[_0xc51f('0x1c')]===_0xc51f('0x1b');var _0x471bd5=_0x23bce4[_0xc51f('0x1d')];var _0x312728=_0x5137af?0x0:_0x54987d[_0xc51f('0x1a')];var _0x9330c3=_0x5137af?_0x23bce4['count']:_0x54987d['offset']+_0x54987d[_0xc51f('0x1c')];var _0xec821c;if(_0x9330c3>=_0x471bd5){_0x9330c3=_0x471bd5;_0xec821c=0xc8;}else{_0xec821c=0xce;}_0x776feb['status'](_0xec821c);return _0x776feb['set'](_0xc51f('0x1e'),_0x312728+'-'+_0x9330c3+'/'+_0x471bd5)['json'](_0x23bce4);}return null;};}function patchUpdates(_0x296cc6){return function(_0x4e7c2b){try{jsonpatch[_0xc51f('0x1f')](_0x4e7c2b,_0x296cc6,!![]);}catch(_0x267636){return BPromise['reject'](_0x267636);}return _0x4e7c2b[_0xc51f('0x20')]();};}function saveUpdates(_0x3d0693,_0x3ea232){return function(_0x5eb2c6){if(_0x5eb2c6){return _0x5eb2c6[_0xc51f('0x21')](_0x3d0693)[_0xc51f('0x22')](function(_0x42b6c6){return _0x42b6c6;});}return null;};}function removeEntity(_0x441566,_0x412f81){return function(_0x1634ed){if(_0x1634ed){return _0x1634ed['destroy']()[_0xc51f('0x22')](function(){_0x441566[_0xc51f('0x19')](0xcc)[_0xc51f('0x23')]();});}};}function handleEntityNotFound(_0x2df61e,_0x5b22ba){return function(_0x5136b9){if(!_0x5136b9){_0x2df61e[_0xc51f('0x18')](0x194);}return _0x5136b9;};}function handleError(_0x19c448,_0x5c7ee1){_0x5c7ee1=_0x5c7ee1||0x1f4;return function(_0x1ddca9){logger[_0xc51f('0x24')](_0x1ddca9['stack']);if(_0x1ddca9[_0xc51f('0x25')]){delete _0x1ddca9[_0xc51f('0x25')];}_0x19c448[_0xc51f('0x19')](_0x5c7ee1)[_0xc51f('0x26')](_0x1ddca9);};}exports[_0xc51f('0x21')]=function(_0x122f01,_0x3e156d){if(_0x122f01[_0xc51f('0x27')]['id']){delete _0x122f01['body']['id'];}return db[_0xc51f('0x28')][_0xc51f('0x29')]({'where':{'id':_0x122f01[_0xc51f('0x2a')]['id']}})[_0xc51f('0x22')](handleEntityNotFound(_0x3e156d,null))[_0xc51f('0x22')](saveUpdates(_0x122f01[_0xc51f('0x27')],null))[_0xc51f('0x22')](respondWithResult(_0x3e156d,null))[_0xc51f('0x2b')](handleError(_0x3e156d,null));};exports[_0xc51f('0x2c')]=function(_0x31f561,_0x2cc0f4){return db[_0xc51f('0x28')][_0xc51f('0x29')]({'where':{'id':_0x31f561[_0xc51f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2cc0f4,null))[_0xc51f('0x22')](removeEntity(_0x2cc0f4,null))[_0xc51f('0x2b')](handleError(_0x2cc0f4,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 3ebab0f..c36fa28 100644
--- a/server/api/action/action.model.js
+++ b/server/api/action/action.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f88=['exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./action.attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4f88,0x173));var _0x84f8=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0x4f88[_0x38c652];return _0x218a37;};'use strict';var _=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var logger=require(_0x84f8('0x2'))(_0x84f8('0x3'));var moment=require('moment');var BPromise=require(_0x84f8('0x4'));var rp=require(_0x84f8('0x5'));var fs=require('fs');var path=require(_0x84f8('0x6'));var rimraf=require(_0x84f8('0x7'));var config=require('../../config/environment');var attributes=require(_0x84f8('0x8'));module[_0x84f8('0x9')]=function(_0x38d913,_0x5cf8bd){return _0x38d913['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb789=['path','rimraf','../../config/environment','./action.attributes','define','tools_actions','lodash','../../config/logger','api','request-promise'];(function(_0x2d3f1d,_0x2a0715){var _0x19b6fc=function(_0x58bec8){while(--_0x58bec8){_0x2d3f1d['push'](_0x2d3f1d['shift']());}};_0x19b6fc(++_0x2a0715);}(_0xb789,0x1c8));var _0x9b78=function(_0xd3978b,_0x5cf5de){_0xd3978b=_0xd3978b-0x0;var _0x4c7145=_0xb789[_0xd3978b];return _0x4c7145;};'use strict';var _=require(_0x9b78('0x0'));var util=require('util');var logger=require(_0x9b78('0x1'))(_0x9b78('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9b78('0x3'));var fs=require('fs');var path=require(_0x9b78('0x4'));var rimraf=require(_0x9b78('0x5'));var config=require(_0x9b78('0x6'));var attributes=require(_0x9b78('0x7'));module['exports']=function(_0x3ecd87,_0x4231f6){return _0x3ecd87[_0x9b78('0x8')]('Action',attributes,{'tableName':_0x9b78('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index a534b11..2c904b9 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0xf494,0x1c6));var _0x4f49=function(_0x33ee6a,_0x456591){_0x33ee6a=_0x33ee6a-0x0;var _0x1311df=_0xf494[_0x33ee6a];return _0x1311df;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2da8a2,_0x2f7bf1){var _0x1d7a1b=function(_0x45d295){while(--_0x45d295){_0x2da8a2['push'](_0x2da8a2['shift']());}};_0x1d7a1b(++_0x2f7bf1);}(_0x1261,0x144));var _0x1126=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x1261[_0x352d28];return _0x387d7e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 9628995..5c48453 100644
--- a/server/api/action/index.js
+++ b/server/api/action/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2d5=['/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','put'];(function(_0x236ca4,_0x92402a){var _0x4e8a9a=function(_0x523b03){while(--_0x523b03){_0x236ca4['push'](_0x236ca4['shift']());}};_0x4e8a9a(++_0x92402a);}(_0xc2d5,0xa2));var _0x5c2d=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xc2d5[_0x128bef];return _0x1ba862;};'use strict';var multer=require(_0x5c2d('0x0'));var util=require('util');var path=require(_0x5c2d('0x1'));var timeout=require(_0x5c2d('0x2'));var express=require(_0x5c2d('0x3'));var router=express[_0x5c2d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./action.controller');router[_0x5c2d('0x5')](_0x5c2d('0x6'),auth[_0x5c2d('0x7')](),controller[_0x5c2d('0x8')]);router[_0x5c2d('0x9')]('/:id',auth[_0x5c2d('0x7')](),controller[_0x5c2d('0xa')]);module[_0x5c2d('0xb')]=router;
\ No newline at end of file
+var _0x9c0f=['Router','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','connect-timeout'];(function(_0x2e6ab8,_0x4ea85c){var _0x16cba0=function(_0x4b3776){while(--_0x4b3776){_0x2e6ab8['push'](_0x2e6ab8['shift']());}};_0x16cba0(++_0x4ea85c);}(_0x9c0f,0x199));var _0xf9c0=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x9c0f[_0x121886];return _0x20ca01;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf9c0('0x0'));var express=require('express');var router=express[_0xf9c0('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf9c0('0x2'));var config=require(_0xf9c0('0x3'));var controller=require(_0xf9c0('0x4'));router[_0xf9c0('0x5')](_0xf9c0('0x6'),auth[_0xf9c0('0x7')](),controller['update']);router[_0xf9c0('0x8')](_0xf9c0('0x6'),auth[_0xf9c0('0x7')](),controller[_0xf9c0('0x9')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 069d07f..d8eb1df 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x1bca21,_0x16484c){var _0x585671=function(_0x131f5b){while(--_0x131f5b){_0x1bca21['push'](_0x1bca21['shift']());}};_0x585671(++_0x16484c);}(_0xe14b,0x93));var _0xbe14=function(_0x152759,_0x451cca){_0x152759=_0x152759-0x0;var _0x379a1d=_0xe14b[_0x152759];return _0x379a1d;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
+var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0xa0139d,_0x3f1109){var _0x5b6d49=function(_0x5cddfc){while(--_0x5cddfc){_0xa0139d['push'](_0xa0139d['shift']());}};_0x5b6d49(++_0x3f1109);}(_0xeec6,0x1c2));var _0x6eec=function(_0x180bc5,_0x17fd8d){_0x180bc5=_0x180bc5-0x0;var _0x310566=_0xeec6[_0x180bc5];return _0x310566;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 9c6d9e0..378a2d2 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.controller.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb5e=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','count','includeAll','AnalyticCustomReport','findAll','catch','show','params','length','include','options','create','body','role','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','table','foreignTable','conditions','clone','toString','sequelize','SELECT','left_join','right_join','DATE(%s)','IS\x20NULL','value','keyBy','output','web','fullPath','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','savename','COUNT(*)','QueryTypes','run','Please\x20insert\x20at\x20least\x20one\x20field','debug','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x393f01,_0x2dba17){var _0x2adc57=function(_0x52c9b6){while(--_0x52c9b6){_0x393f01['push'](_0x393f01['shift']());}};_0x2adc57(++_0x2dba17);}(_0xeb5e,0x134));var _0xeeb5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xeb5e[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeeb5('0x0'));var zipdir=require(_0xeeb5('0x1'));var jsonpatch=require(_0xeeb5('0x2'));var rp=require(_0xeeb5('0x3'));var moment=require(_0xeeb5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeeb5('0x5'));var util=require(_0xeeb5('0x6'));var path=require('path');var sox=require(_0xeeb5('0x7'));var csv=require(_0xeeb5('0x8'));var ejs=require(_0xeeb5('0x9'));var fs=require('fs');var fs_extra=require(_0xeeb5('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeeb5('0xb'));var jsforce=require(_0xeeb5('0xc'));var deskjs=require(_0xeeb5('0xd'));var toCsv=require(_0xeeb5('0x8'));var querystring=require(_0xeeb5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeeb5('0xf'));var qs=require(_0xeeb5('0x10'));var as=require(_0xeeb5('0x11'));var hardwareService=require(_0xeeb5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xeeb5('0x13'));var config=require(_0xeeb5('0x14'));var licenseUtil=require(_0xeeb5('0x15'));var db=require(_0xeeb5('0x16'))['db'];var dbH=require(_0xeeb5('0x16'))[_0xeeb5('0x17')];function respondWithStatusCode(_0xc681fc,_0x539677){_0x539677=_0x539677||0xcc;return function(_0x14d7f7){if(_0x14d7f7){return _0xc681fc['sendStatus'](_0x539677);}return _0xc681fc[_0xeeb5('0x18')](_0x539677)['end']();};}function respondWithResult(_0x4a4b47,_0x3a6205){_0x3a6205=_0x3a6205||0xc8;return function(_0x24daa5){if(_0x24daa5){return _0x4a4b47[_0xeeb5('0x18')](_0x3a6205)[_0xeeb5('0x19')](_0x24daa5);}};}function respondWithFilteredResult(_0xd3ac3d,_0x145ae8){return function(_0x482ed7){if(_0x482ed7){var _0x201020=typeof _0x145ae8[_0xeeb5('0x1a')]===_0xeeb5('0x1b')&&typeof _0x145ae8[_0xeeb5('0x1c')]===_0xeeb5('0x1b');var _0x5db57a=_0x482ed7['count'];var _0xd8433b=_0x201020?0x0:_0x145ae8['offset'];var _0x97bb78=_0x201020?_0x482ed7['count']:_0x145ae8[_0xeeb5('0x1a')]+_0x145ae8[_0xeeb5('0x1c')];var _0xc639ce;if(_0x97bb78>=_0x5db57a){_0x97bb78=_0x5db57a;_0xc639ce=0xc8;}else{_0xc639ce=0xce;}_0xd3ac3d[_0xeeb5('0x18')](_0xc639ce);return _0xd3ac3d[_0xeeb5('0x1d')]('Content-Range',_0xd8433b+'-'+_0x97bb78+'/'+_0x5db57a)[_0xeeb5('0x19')](_0x482ed7);}return null;};}function patchUpdates(_0x115bed){return function(_0x1c507b){try{jsonpatch[_0xeeb5('0x1e')](_0x1c507b,_0x115bed,!![]);}catch(_0x1fb3a8){return BPromise[_0xeeb5('0x1f')](_0x1fb3a8);}return _0x1c507b[_0xeeb5('0x20')]();};}function saveUpdates(_0x144173,_0x54049a){return function(_0x36b1ea){if(_0x36b1ea){return _0x36b1ea[_0xeeb5('0x21')](_0x144173)['then'](function(_0x9bfb84){return _0x9bfb84;});}return null;};}function removeEntity(_0x4482ab,_0x4c2cc6){return function(_0x5206d9){if(_0x5206d9){return _0x5206d9[_0xeeb5('0x22')]()[_0xeeb5('0x23')](function(){var _0x1bb6d9=_0x5206d9[_0xeeb5('0x24')]({'plain':!![]});var _0x57e16b=_0xeeb5('0x25');return db[_0xeeb5('0x26')][_0xeeb5('0x22')]({'where':{'type':_0x57e16b,'resourceId':_0x1bb6d9['id']}})['then'](function(){return _0x5206d9;});})[_0xeeb5('0x23')](function(){_0x4482ab[_0xeeb5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7ca2,_0x4270ab){return function(_0x51d3dc){if(!_0x51d3dc){_0x3b7ca2[_0xeeb5('0x27')](0x194);}return _0x51d3dc;};}function handleError(_0x175301,_0x158adf){_0x158adf=_0x158adf||0x1f4;return function(_0x1bfeb6){logger[_0xeeb5('0x28')](_0x1bfeb6[_0xeeb5('0x29')]);if(_0x1bfeb6[_0xeeb5('0x2a')]){delete _0x1bfeb6['name'];}_0x175301[_0xeeb5('0x18')](_0x158adf)[_0xeeb5('0x2b')](_0x1bfeb6);};}exports[_0xeeb5('0x2c')]=function(_0x5b2174,_0x142d64){var _0x46de1c={},_0x1518a7={},_0x1fcc37={'count':0x0,'rows':[]};var _0x3eaa2f=_['map'](db['AnalyticCustomReport'][_0xeeb5('0x2d')],function(_0x77064a){return{'name':_0x77064a[_0xeeb5('0x2e')],'type':_0x77064a['type']['key']};});_0x1518a7['model']=_['map'](_0x3eaa2f,_0xeeb5('0x2a'));_0x1518a7[_0xeeb5('0x2f')]=_[_0xeeb5('0x30')](_0x5b2174[_0xeeb5('0x2f')]);_0x1518a7[_0xeeb5('0x31')]=_['intersection'](_0x1518a7[_0xeeb5('0x32')],_0x1518a7[_0xeeb5('0x2f')]);_0x46de1c[_0xeeb5('0x33')]=_[_0xeeb5('0x34')](_0x1518a7[_0xeeb5('0x32')],qs['fields'](_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x35')]));_0x46de1c[_0xeeb5('0x33')]=_0x46de1c[_0xeeb5('0x33')]['length']?_0x46de1c[_0xeeb5('0x33')]:_0x1518a7[_0xeeb5('0x32')];if(!_0x5b2174['query'][_0xeeb5('0x36')](_0xeeb5('0x37'))){_0x46de1c[_0xeeb5('0x1c')]=qs[_0xeeb5('0x1c')](_0x5b2174[_0xeeb5('0x2f')]['limit']);_0x46de1c[_0xeeb5('0x1a')]=qs[_0xeeb5('0x1a')](_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x1a')]);}_0x46de1c[_0xeeb5('0x38')]=qs[_0xeeb5('0x39')](_0x5b2174[_0xeeb5('0x2f')]['sort']);_0x46de1c[_0xeeb5('0x3a')]=qs[_0xeeb5('0x31')](_[_0xeeb5('0x3b')](_0x5b2174[_0xeeb5('0x2f')],_0x1518a7['filters']),_0x3eaa2f);if(_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x3c')]){_0x46de1c[_0xeeb5('0x3a')]=_['merge'](_0x46de1c[_0xeeb5('0x3a')],{'$or':_[_0xeeb5('0x3d')](_0x3eaa2f,function(_0x4f9021){if(_0x4f9021[_0xeeb5('0x3e')]!==_0xeeb5('0x3f')){var _0xa92a9f={};_0xa92a9f[_0x4f9021[_0xeeb5('0x2a')]]={'$like':'%'+_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x3c')]+'%'};return _0xa92a9f;}})});}_0x46de1c=_[_0xeeb5('0x40')]({},_0x46de1c,_0x5b2174['options']);var _0x57a0cf={'where':_0x46de1c[_0xeeb5('0x3a')]};return db['AnalyticCustomReport'][_0xeeb5('0x41')](_0x57a0cf)[_0xeeb5('0x23')](function(_0x5a157c){_0x1fcc37[_0xeeb5('0x41')]=_0x5a157c;if(_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x42')]){_0x46de1c['include']=[{'all':!![]}];}return db[_0xeeb5('0x43')][_0xeeb5('0x44')](_0x46de1c);})[_0xeeb5('0x23')](function(_0xadb3a4){_0x1fcc37['rows']=_0xadb3a4;return _0x1fcc37;})[_0xeeb5('0x23')](respondWithFilteredResult(_0x142d64,_0x46de1c))[_0xeeb5('0x45')](handleError(_0x142d64,null));};exports[_0xeeb5('0x46')]=function(_0x527651,_0x3021c0){var _0x4bd15f={'raw':![],'where':{'id':_0x527651[_0xeeb5('0x47')]['id']}},_0x1b177b={};_0x1b177b['model']=_[_0xeeb5('0x30')](db[_0xeeb5('0x43')][_0xeeb5('0x2d')]);_0x1b177b['query']=_[_0xeeb5('0x30')](_0x527651[_0xeeb5('0x2f')]);_0x1b177b[_0xeeb5('0x31')]=_[_0xeeb5('0x34')](_0x1b177b[_0xeeb5('0x32')],_0x1b177b['query']);_0x4bd15f['attributes']=_[_0xeeb5('0x34')](_0x1b177b[_0xeeb5('0x32')],qs['fields'](_0x527651[_0xeeb5('0x2f')][_0xeeb5('0x35')]));_0x4bd15f[_0xeeb5('0x33')]=_0x4bd15f[_0xeeb5('0x33')][_0xeeb5('0x48')]?_0x4bd15f[_0xeeb5('0x33')]:_0x1b177b[_0xeeb5('0x32')];if(_0x527651[_0xeeb5('0x2f')][_0xeeb5('0x42')]){_0x4bd15f[_0xeeb5('0x49')]=[{'all':!![]}];}_0x4bd15f=_['merge']({},_0x4bd15f,_0x527651[_0xeeb5('0x4a')]);return db[_0xeeb5('0x43')]['find'](_0x4bd15f)[_0xeeb5('0x23')](handleEntityNotFound(_0x3021c0,null))['then'](respondWithResult(_0x3021c0,null))[_0xeeb5('0x45')](handleError(_0x3021c0,null));};exports['create']=function(_0x5199f1,_0x1da7b0){return db[_0xeeb5('0x43')][_0xeeb5('0x4b')](_0x5199f1[_0xeeb5('0x4c')],{})[_0xeeb5('0x23')](function(_0x5c3c0f){var _0xe3aa24=_0x5199f1['user'][_0xeeb5('0x24')]({'plain':!![]});if(!_0xe3aa24)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe3aa24[_0xeeb5('0x4d')]===_0xeeb5('0x4e')){var _0x37cc77=_0x5c3c0f[_0xeeb5('0x24')]({'plain':!![]});var _0x291245=_0xeeb5('0x4f');return db[_0xeeb5('0x50')][_0xeeb5('0x51')]({'where':{'name':_0x291245,'userProfileId':_0xe3aa24[_0xeeb5('0x52')]},'raw':!![]})[_0xeeb5('0x23')](function(_0x43470a){if(_0x43470a&&_0x43470a[_0xeeb5('0x53')]===0x0){return db[_0xeeb5('0x26')][_0xeeb5('0x4b')]({'name':_0x37cc77[_0xeeb5('0x2a')],'resourceId':_0x37cc77['id'],'type':'CustomReports','sectionId':_0x43470a['id']},{})[_0xeeb5('0x23')](function(){return _0x5c3c0f;});}else{return _0x5c3c0f;}})[_0xeeb5('0x45')](function(_0x149724){logger['error'](_0xeeb5('0x54'),_0x149724);throw _0x149724;});}return _0x5c3c0f;})['then'](respondWithResult(_0x1da7b0,0xc9))[_0xeeb5('0x45')](handleError(_0x1da7b0,null));};exports[_0xeeb5('0x21')]=function(_0x2277cc,_0x355eff){if(_0x2277cc[_0xeeb5('0x4c')]['id']){delete _0x2277cc['body']['id'];}return db[_0xeeb5('0x43')]['find']({'where':{'id':_0x2277cc[_0xeeb5('0x47')]['id']}})[_0xeeb5('0x23')](handleEntityNotFound(_0x355eff,null))['then'](saveUpdates(_0x2277cc[_0xeeb5('0x4c')],null))[_0xeeb5('0x23')](respondWithResult(_0x355eff,null))[_0xeeb5('0x45')](handleError(_0x355eff,null));};exports[_0xeeb5('0x22')]=function(_0x83dcd4,_0x4b3568){return db[_0xeeb5('0x43')]['find']({'where':{'id':_0x83dcd4['params']['id']}})[_0xeeb5('0x23')](handleEntityNotFound(_0x4b3568,null))['then'](removeEntity(_0x4b3568,null))[_0xeeb5('0x45')](handleError(_0x4b3568,null));};exports[_0xeeb5('0x55')]=function(_0x226056,_0x1725b8){var _0xe8f999=0xa;var _0x348209=[_0xeeb5('0x56'),'left_join','right_join',_0xeeb5('0x57')];var _0x25aee1={'SUM':_0xeeb5('0x58'),'COUNT':_0xeeb5('0x59'),'COUNT DISTINCT':_0xeeb5('0x5a'),'MAX':_0xeeb5('0x5b'),'MIN':_0xeeb5('0x5c'),'AVG':_0xeeb5('0x5d'),'GROUP_CONCAT':_0xeeb5('0x5e'),'GROUP_CONCAT ASC':_0xeeb5('0x5f'),'GROUP_CONCAT DESC':_0xeeb5('0x60')};var _0x3b4846={'SEC_TO_TIME':_0xeeb5('0x61'),'DATE':'DATE(%s)','HOUR':_0xeeb5('0x62'),'ROUND':_0xeeb5('0x63'),'UNIX_TIMESTAMP':_0xeeb5('0x64')};var _0x539a8a=function(_0x1e624e){return!_[_0xeeb5('0x65')](['IS\x20NULL',_0xeeb5('0x66'),_0xeeb5('0x67'),_0xeeb5('0x68')],_0x1e624e);};var _0x47ec23=function(_0x17a858){if(!_0x17a858||!_0x17a858[_0xeeb5('0x69')][_0xeeb5('0x48')]){return'';}for(var _0x334f6f='(',_0x153485=0x0;_0x153485<_0x17a858[_0xeeb5('0x69')][_0xeeb5('0x48')];_0x153485+=0x1){_0x153485>0x0&&(_0x334f6f+='\x20'+_0x17a858[_0xeeb5('0x6a')]+'\x20');_0x334f6f+=_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6b')]?_0x47ec23(_0x17a858[_0xeeb5('0x69')][_0x153485]['group']):_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6c')]+'\x20'+_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6d')]+(_0x539a8a(_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6d')])?'\x20'+_0x17a858[_0xeeb5('0x69')][_0x153485]['value']:'');}return _0x334f6f+')';};var _0x68d3a7={'where':{'id':_0x226056[_0xeeb5('0x47')]['id']}},_0x4414e5,_0x34edeb,_0x5edf4f,_0x3fcd6e,_0x17a6b4;_0x68d3a7=_['merge']({},_0x68d3a7,_0x226056[_0xeeb5('0x4a')]);return db[_0xeeb5('0x43')][_0xeeb5('0x51')](_0x68d3a7)[_0xeeb5('0x23')](function(_0x52c262){if(_0x52c262){_0x4414e5=_0x52c262;return _0x52c262[_0xeeb5('0x6e')]();}return null;})[_0xeeb5('0x23')](function(_0x5d3e32){if(_0x5d3e32){if(!_0x5d3e32[_0xeeb5('0x48')]){throw new db[(_0xeeb5('0x6f'))][(_0xeeb5('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x34edeb=_0x5d3e32;return db[_0xeeb5('0x71')]['findAll']({'raw':!![]});}return null;})[_0xeeb5('0x23')](function(_0x166577){if(_0x166577){_0x5edf4f=_['keyBy'](_0x166577,'id');var _0x40e58b;var _0x18bdb7=squel[_0xeeb5('0x72')]();_0x18bdb7[_0xeeb5('0x73')](_0x4414e5['table']);for(var _0x10f8fd=0x0;_0x10f8fd<_0x34edeb['length'];_0x10f8fd+=0x1){_0x40e58b=_0x34edeb[_0x10f8fd]['MetricId']?_0x5edf4f[_0x34edeb[_0x10f8fd][_0xeeb5('0x74')]][_0xeeb5('0x75')]:_0x34edeb[_0x10f8fd][_0xeeb5('0x6c')];_0x40e58b=_0x34edeb[_0x10f8fd][_0xeeb5('0x76')]?_[_0xeeb5('0x77')](_0x25aee1[_0x34edeb[_0x10f8fd][_0xeeb5('0x76')]],'%s',_0x40e58b):_0x40e58b;_0x40e58b=_0x34edeb[_0x10f8fd][_0xeeb5('0x78')]?_[_0xeeb5('0x77')](_0x3b4846[_0x34edeb[_0x10f8fd]['format']],'%s',_0x40e58b):_0x40e58b;if(_0x34edeb[_0x10f8fd][_0xeeb5('0x79')]){_0x18bdb7['group'](_0x40e58b);}_0x34edeb[_0x10f8fd]['orderBy']&&_0x18bdb7['order'](_0x40e58b,_0x34edeb[_0x10f8fd][_0xeeb5('0x7a')]===_0xeeb5('0x7b')?![]:!![]);_0x18bdb7[_0xeeb5('0x6c')](_0x40e58b,_0x34edeb[_0x10f8fd][_0xeeb5('0x7c')]||_0x40e58b);}if(_0x4414e5[_0xeeb5('0x7d')]){_0x4414e5[_0xeeb5('0x7d')]=JSON[_0xeeb5('0x7e')](_0x4414e5[_0xeeb5('0x7d')]);for(var _0x3c5892=0x0;_0x3c5892<_0x4414e5[_0xeeb5('0x7d')][_0xeeb5('0x48')];_0x3c5892+=0x1){if(_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x3e')]&&_[_0xeeb5('0x65')](_0x348209,_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['type'])&&_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x7f')]&&_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['foreignTable']&&_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x80')]){_0x18bdb7[_0x4414e5['joins'][_0x3c5892][_0xeeb5('0x3e')]](_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['foreignTable'],null,util[_0xeeb5('0x78')](_0xeeb5('0x81'),_0x4414e5[_0xeeb5('0x82')],_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['parentKey'],_0x4414e5['joins'][_0x3c5892][_0xeeb5('0x83')],_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x80')]));}}}if(_0x4414e5['conditions']){_0x4414e5[_0xeeb5('0x84')]=JSON[_0xeeb5('0x7e')](_0x4414e5['conditions']);_0x18bdb7[_0xeeb5('0x3a')](_0x47ec23(_0x4414e5[_0xeeb5('0x84')][_0xeeb5('0x6b')]));}_0x17a6b4=_0x18bdb7[_0xeeb5('0x85')]();_0x18bdb7['limit'](_0xe8f999);_0x18bdb7[_0xeeb5('0x1a')](0x0);logger['debug']('Limited\x20Query:',_0x18bdb7[_0xeeb5('0x86')]());return dbH[_0xeeb5('0x87')][_0xeeb5('0x2f')](_0x18bdb7[_0xeeb5('0x86')](),{'type':dbH[_0xeeb5('0x87')]['QueryTypes'][_0xeeb5('0x88')]});}})[_0xeeb5('0x23')](respondWithResult(_0x1725b8,null))[_0xeeb5('0x45')](handleError(_0x1725b8,null));};function runReport(_0x539bcf,_0x1ad28a,_0x3396ec){var _0x17ba20=_0x1ad28a[_0xeeb5('0x2a')];var _0x1df7ca=0xa;var _0x159ef3=[_0xeeb5('0x56'),_0xeeb5('0x89'),_0xeeb5('0x8a'),_0xeeb5('0x57')];var _0x2491bf={'SUM':_0xeeb5('0x58'),'COUNT':_0xeeb5('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xeeb5('0x5b'),'MIN':_0xeeb5('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xeeb5('0x5e'),'GROUP_CONCAT ASC':_0xeeb5('0x5f'),'GROUP_CONCAT DESC':_0xeeb5('0x60')};var _0x3ed4c5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeeb5('0x8b'),'HOUR':'HOUR(%s)','ROUND':_0xeeb5('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x13070a=function(_0x37a844){return!_['includes']([_0xeeb5('0x8c'),_0xeeb5('0x66'),_0xeeb5('0x67'),_0xeeb5('0x68')],_0x37a844);};var _0x3c43a3=function(_0x376a51){if(!_0x376a51||!_0x376a51['rules'][_0xeeb5('0x48')]){return'';}for(var _0x5989f4='(',_0xf85c70=0x0;_0xf85c70<_0x376a51[_0xeeb5('0x69')]['length'];_0xf85c70+=0x1){_0xf85c70>0x0&&(_0x5989f4+='\x20'+_0x376a51[_0xeeb5('0x6a')]+'\x20');_0x5989f4+=_0x376a51['rules'][_0xf85c70]['group']?_0x3c43a3(_0x376a51[_0xeeb5('0x69')][_0xf85c70][_0xeeb5('0x6b')]):_0x376a51['rules'][_0xf85c70][_0xeeb5('0x6c')]+'\x20'+_0x376a51[_0xeeb5('0x69')][_0xf85c70][_0xeeb5('0x6d')]+(_0x13070a(_0x376a51['rules'][_0xf85c70][_0xeeb5('0x6d')])?'\x20'+_0x376a51[_0xeeb5('0x69')][_0xf85c70][_0xeeb5('0x8d')]:'');}return _0x5989f4+')';};var _0x72926a={'where':{'id':_0x539bcf['id']}},_0x45a35c,_0x55629a,_0x4f1e70,_0x1830d0,_0x5db4aa;_0x72926a=_[_0xeeb5('0x40')]({},_0x72926a,_0x3396ec);return db[_0xeeb5('0x43')][_0xeeb5('0x51')](_0x72926a)[_0xeeb5('0x23')](function(_0xd013ed){if(_0xd013ed){_0x45a35c=_0xd013ed;return _0xd013ed[_0xeeb5('0x6e')]();}return null;})[_0xeeb5('0x23')](function(_0x56c10f){if(_0x56c10f){if(!_0x56c10f[_0xeeb5('0x48')]){throw new db['Sequelize'][(_0xeeb5('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x55629a=_0x56c10f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x5aa3b6){if(_0x5aa3b6){_0x4f1e70=_[_0xeeb5('0x8e')](_0x5aa3b6,'id');var _0xf27fe0;var _0x1e1e19=squel[_0xeeb5('0x72')]();_0x1e1e19[_0xeeb5('0x73')](_0x45a35c[_0xeeb5('0x82')]);for(var _0x1a9d69=0x0;_0x1a9d69<_0x55629a[_0xeeb5('0x48')];_0x1a9d69+=0x1){_0xf27fe0=_0x55629a[_0x1a9d69][_0xeeb5('0x74')]?_0x4f1e70[_0x55629a[_0x1a9d69][_0xeeb5('0x74')]]['metric']:_0x55629a[_0x1a9d69][_0xeeb5('0x6c')];_0xf27fe0=_0x55629a[_0x1a9d69][_0xeeb5('0x76')]?_[_0xeeb5('0x77')](_0x2491bf[_0x55629a[_0x1a9d69]['function']],'%s',_0xf27fe0):_0xf27fe0;_0xf27fe0=_0x55629a[_0x1a9d69][_0xeeb5('0x78')]?_[_0xeeb5('0x77')](_0x3ed4c5[_0x55629a[_0x1a9d69]['format']],'%s',_0xf27fe0):_0xf27fe0;if(_0x55629a[_0x1a9d69]['groupBy']){_0x1e1e19[_0xeeb5('0x6b')](_0xf27fe0);}_0x55629a[_0x1a9d69][_0xeeb5('0x7a')]&&_0x1e1e19['order'](_0xf27fe0,_0x55629a[_0x1a9d69][_0xeeb5('0x7a')]===_0xeeb5('0x7b')?![]:!![]);_0x1e1e19[_0xeeb5('0x6c')](_0xf27fe0,_0x55629a[_0x1a9d69]['alias']||_0xf27fe0);}if(_0x45a35c[_0xeeb5('0x7d')]){_0x45a35c[_0xeeb5('0x7d')]=JSON['parse'](_0x45a35c[_0xeeb5('0x7d')]);for(var _0x394710=0x0;_0x394710<_0x45a35c[_0xeeb5('0x7d')][_0xeeb5('0x48')];_0x394710+=0x1){if(_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x3e')]&&_[_0xeeb5('0x65')](_0x159ef3,_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x3e')])&&_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x7f')]&&_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x83')]&&_0x45a35c[_0xeeb5('0x7d')][_0x394710]['foreignKey']){_0x1e1e19[_0x45a35c['joins'][_0x394710][_0xeeb5('0x3e')]](_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x83')],null,util[_0xeeb5('0x78')](_0xeeb5('0x81'),_0x45a35c[_0xeeb5('0x82')],_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x7f')],_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x83')],_0x45a35c[_0xeeb5('0x7d')][_0x394710]['foreignKey']));}}}if(_0x45a35c[_0xeeb5('0x84')]){_0x45a35c['conditions']=JSON['parse'](_0x45a35c[_0xeeb5('0x84')]);_0x1e1e19[_0xeeb5('0x3a')](_0x3c43a3(_0x45a35c['conditions'][_0xeeb5('0x6b')]));}_0x5db4aa=_0x1e1e19[_0xeeb5('0x85')]();_0x1e1e19[_0xeeb5('0x1c')](_0x1df7ca);_0x1e1e19[_0xeeb5('0x1a')](0x0);return;}})[_0xeeb5('0x23')](function(){if(_0x1ad28a[_0xeeb5('0x8f')]===_0xeeb5('0x90')){return null;}var _0x43ad2d=_[_0xeeb5('0x40')](_0x1ad28a,{'name':_0x1ad28a[_0xeeb5('0x91')]||_0x1ad28a[_0xeeb5('0x2a')]||_0x45a35c[_0xeeb5('0x2a')],'basename':_0x17ba20,'savename':util[_0xeeb5('0x78')]('%s-%s.%s',_0x1ad28a['name']||_0x45a35c[_0xeeb5('0x2a')],require(_0xeeb5('0x92'))['generate'](0x4),_0x1ad28a[_0xeeb5('0x8f')]||_0xeeb5('0x93')),'reportId':_0x45a35c['id'],'reportType':'custom'});return db[_0xeeb5('0x94')][_0xeeb5('0x4b')](_0x43ad2d,{'raw':!![]});})[_0xeeb5('0x23')](function(_0x466c54){if(_0x45a35c[_0xeeb5('0x82')]==='cdr'){_0x5db4aa[_0xeeb5('0x3a')](_0x45a35c[_0xeeb5('0x82')]+_0xeeb5('0x95'),_0x1ad28a[_0xeeb5('0x96')],_0x1ad28a[_0xeeb5('0x97')]);}else{_0x5db4aa[_0xeeb5('0x3a')](_0x45a35c['table']+_0xeeb5('0x98'),_0x1ad28a[_0xeeb5('0x96')],_0x1ad28a[_0xeeb5('0x97')]);}if(_0x466c54){logger[_0xeeb5('0x99')](_0xeeb5('0x9a'),_0x5db4aa[_0xeeb5('0x86')]());require('child_process')['fork'](path[_0xeeb5('0x56')](__dirname,_0xeeb5('0x9b'),_0x466c54[_0xeeb5('0x8f')]),[_0x466c54['id'],_0x5db4aa[_0xeeb5('0x86')](),path[_0xeeb5('0x56')](__dirname,_0xeeb5('0x9c'),_0x466c54[_0xeeb5('0x9d')]),_0x17ba20]);return _0x466c54;}else{var _0x1d5286=squel['select']();_0x1d5286[_0xeeb5('0x73')]('('+_0x5db4aa[_0xeeb5('0x86')]()+')','countTable');_0x1d5286[_0xeeb5('0x6c')](_0xeeb5('0x9e'),'count');_0x5db4aa['limit'](_0x1ad28a[_0xeeb5('0x1c')]||_0x1df7ca);_0x5db4aa[_0xeeb5('0x1a')](_0x1ad28a[_0xeeb5('0x1a')]||0x0);return dbH['sequelize'][_0xeeb5('0x2f')](_0x1d5286['toString'](),{'type':dbH['sequelize'][_0xeeb5('0x9f')][_0xeeb5('0x88')]})['then'](function(_0x2c7984){if(!_0x2c7984['length']){_0x1830d0=0x0;}else{_0x1830d0=_0x2c7984[0x0][_0xeeb5('0x41')]||0x0;}return dbH[_0xeeb5('0x87')][_0xeeb5('0x2f')](_0x5db4aa['toString'](),{'type':dbH[_0xeeb5('0x87')][_0xeeb5('0x9f')][_0xeeb5('0x88')]});})[_0xeeb5('0x23')](function(_0x3ee131){return{'rows':_0x3ee131||[],'count':_0x1830d0};});}});}exports[_0xeeb5('0xa0')]=function(_0x104bd6,_0x2c78a5){return runReport(_0x104bd6[_0xeeb5('0x47')],_0x104bd6['query'],_0x104bd6[_0xeeb5('0x4a')])['then'](respondWithResult(_0x2c78a5,null))[_0xeeb5('0x45')](handleError(_0x2c78a5,null));};exports['runReport']=runReport;exports[_0xeeb5('0x2f')]=function(_0x1c75e1,_0x324aeb){var _0x1dad46=0xa;var _0x2351d6=[_0xeeb5('0x56'),_0xeeb5('0x89'),'right_join',_0xeeb5('0x57')];var _0x1e93c7={'SUM':_0xeeb5('0x58'),'COUNT':_0xeeb5('0x59'),'COUNT DISTINCT':_0xeeb5('0x5a'),'MAX':_0xeeb5('0x5b'),'MIN':_0xeeb5('0x5c'),'AVG':_0xeeb5('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xeeb5('0x5f'),'GROUP_CONCAT DESC':_0xeeb5('0x60')};var _0x19eea7={'SEC_TO_TIME':_0xeeb5('0x61'),'DATE':_0xeeb5('0x8b'),'HOUR':_0xeeb5('0x62'),'ROUND':_0xeeb5('0x63'),'UNIX_TIMESTAMP':_0xeeb5('0x64')};var _0x21d96b=function(_0x21840d){return!_[_0xeeb5('0x65')](['IS\x20NULL',_0xeeb5('0x66'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x21840d);};var _0x279fc8=function(_0x310bf0){if(!_0x310bf0||!_0x310bf0[_0xeeb5('0x69')][_0xeeb5('0x48')]){return'';}for(var _0x5c8ada='(',_0xad747f=0x0;_0xad747f<_0x310bf0[_0xeeb5('0x69')]['length'];_0xad747f+=0x1){_0xad747f>0x0&&(_0x5c8ada+='\x20'+_0x310bf0[_0xeeb5('0x6a')]+'\x20');_0x5c8ada+=_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x6b')]?_0x279fc8(_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x6b')]):_0x310bf0[_0xeeb5('0x69')][_0xad747f]['field']+'\x20'+_0x310bf0[_0xeeb5('0x69')][_0xad747f]['condition']+(_0x21d96b(_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x6d')])?'\x20'+_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x8d')]:'');}return _0x5c8ada+')';};var _0x3bce78={'where':{'id':_0x1c75e1[_0xeeb5('0x47')]['id']}},_0x65d25e,_0x108fb2,_0x114d96,_0x2d7a31,_0x2e6f5a;_0x3bce78=_[_0xeeb5('0x40')]({},_0x3bce78,_0x1c75e1['options']);return db[_0xeeb5('0x43')][_0xeeb5('0x51')](_0x3bce78)['then'](function(_0x1836c8){if(_0x1836c8){_0x65d25e=_0x1836c8;return _0x1836c8[_0xeeb5('0x6e')]();}return null;})[_0xeeb5('0x23')](function(_0x5450fd){if(_0x5450fd){if(!_0x5450fd[_0xeeb5('0x48')]){throw new db[(_0xeeb5('0x6f'))][(_0xeeb5('0x70'))](_0xeeb5('0xa1'),0x193);}_0x108fb2=_0x5450fd;return db['AnalyticMetric'][_0xeeb5('0x44')]({'raw':!![]});}return null;})[_0xeeb5('0x23')](function(_0x46da19){if(_0x46da19){_0x114d96=_['keyBy'](_0x46da19,'id');var _0x4c0333;var _0x715be7=squel[_0xeeb5('0x72')]();_0x715be7[_0xeeb5('0x73')](_0x65d25e[_0xeeb5('0x82')]);for(var _0x3783ed=0x0;_0x3783ed<_0x108fb2[_0xeeb5('0x48')];_0x3783ed+=0x1){_0x4c0333=_0x108fb2[_0x3783ed]['MetricId']?_0x114d96[_0x108fb2[_0x3783ed][_0xeeb5('0x74')]][_0xeeb5('0x75')]:_0x108fb2[_0x3783ed][_0xeeb5('0x6c')];_0x4c0333=_0x108fb2[_0x3783ed][_0xeeb5('0x76')]?_[_0xeeb5('0x77')](_0x1e93c7[_0x108fb2[_0x3783ed][_0xeeb5('0x76')]],'%s',_0x4c0333):_0x4c0333;_0x4c0333=_0x108fb2[_0x3783ed]['format']?_[_0xeeb5('0x77')](_0x19eea7[_0x108fb2[_0x3783ed][_0xeeb5('0x78')]],'%s',_0x4c0333):_0x4c0333;if(_0x108fb2[_0x3783ed][_0xeeb5('0x79')]){_0x715be7[_0xeeb5('0x6b')](_0x4c0333);}_0x108fb2[_0x3783ed][_0xeeb5('0x7a')]&&_0x715be7[_0xeeb5('0x38')](_0x4c0333,_0x108fb2[_0x3783ed][_0xeeb5('0x7a')]===_0xeeb5('0x7b')?![]:!![]);_0x715be7[_0xeeb5('0x6c')](_0x4c0333,_0x108fb2[_0x3783ed][_0xeeb5('0x7c')]||_0x4c0333);}if(_0x65d25e[_0xeeb5('0x7d')]){_0x65d25e['joins']=JSON[_0xeeb5('0x7e')](_0x65d25e[_0xeeb5('0x7d')]);for(var _0x1dee23=0x0;_0x1dee23<_0x65d25e[_0xeeb5('0x7d')][_0xeeb5('0x48')];_0x1dee23+=0x1){if(_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['type']&&_[_0xeeb5('0x65')](_0x2351d6,_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x3e')])&&_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['parentKey']&&_0x65d25e['joins'][_0x1dee23][_0xeeb5('0x83')]&&_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x80')]){_0x715be7[_0x65d25e['joins'][_0x1dee23][_0xeeb5('0x3e')]](_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['foreignTable'],null,util[_0xeeb5('0x78')]('%s.%s\x20=\x20%s.%s',_0x65d25e[_0xeeb5('0x82')],_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['parentKey'],_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x83')],_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x80')]));}}}if(_0x65d25e[_0xeeb5('0x84')]){_0x65d25e[_0xeeb5('0x84')]=JSON[_0xeeb5('0x7e')](_0x65d25e[_0xeeb5('0x84')]);_0x715be7['where'](_0x279fc8(_0x65d25e[_0xeeb5('0x84')][_0xeeb5('0x6b')]));}_0x2e6f5a=_0x715be7[_0xeeb5('0x85')]();_0x715be7[_0xeeb5('0x1c')](_0x1dad46);_0x715be7[_0xeeb5('0x1a')](0x0);logger[_0xeeb5('0xa2')]('Limited\x20Query:',_0x715be7[_0xeeb5('0x86')]());return dbH[_0xeeb5('0x87')]['query'](_0x715be7['toString'](),{'type':dbH[_0xeeb5('0x87')][_0xeeb5('0x9f')][_0xeeb5('0x88')]});}})[_0xeeb5('0x23')](function(){return{'sql':_0x2e6f5a[_0xeeb5('0x86')]()};})[_0xeeb5('0x23')](respondWithResult(_0x324aeb,null))[_0xeeb5('0x45')](handleError(_0x324aeb,null));};
\ No newline at end of file
+var _0x832e=['groupBy','orderBy','order','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','condition','getFields','ValidationErrorItem','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','get','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','AnalyticCustomReport','findAll','show','options','find','catch','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','right_join','cross_join','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','rules','operator','group','field','value','params','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format'];(function(_0x47271b,_0x2fd7d7){var _0x24aa67=function(_0x5a7376){while(--_0x5a7376){_0x47271b['push'](_0x47271b['shift']());}};_0x24aa67(++_0x2fd7d7);}(_0x832e,0x17b));var _0xe832=function(_0x1c5572,_0x2b93aa){_0x1c5572=_0x1c5572-0x0;var _0x341a36=_0x832e[_0x1c5572];return _0x341a36;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe832('0x0'));var jsonpatch=require(_0xe832('0x1'));var rp=require(_0xe832('0x2'));var moment=require(_0xe832('0x3'));var BPromise=require(_0xe832('0x4'));var Mustache=require(_0xe832('0x5'));var util=require(_0xe832('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe832('0x7'));var ejs=require(_0xe832('0x8'));var fs=require('fs');var fs_extra=require(_0xe832('0x9'));var _=require(_0xe832('0xa'));var squel=require(_0xe832('0xb'));var crypto=require(_0xe832('0xc'));var jsforce=require(_0xe832('0xd'));var deskjs=require(_0xe832('0xe'));var toCsv=require(_0xe832('0x7'));var querystring=require('querystring');var Papa=require(_0xe832('0xf'));var Redis=require('ioredis');var authService=require(_0xe832('0x10'));var qs=require(_0xe832('0x11'));var as=require(_0xe832('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe832('0x13'))(_0xe832('0x14'));var utils=require(_0xe832('0x15'));var config=require(_0xe832('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe832('0x17'))['db'];var dbH=require(_0xe832('0x17'))['dbH'];function respondWithStatusCode(_0x4669b4,_0x3c46d3){_0x3c46d3=_0x3c46d3||0xcc;return function(_0x4c857b){if(_0x4c857b){return _0x4669b4[_0xe832('0x18')](_0x3c46d3);}return _0x4669b4[_0xe832('0x19')](_0x3c46d3)[_0xe832('0x1a')]();};}function respondWithResult(_0x124d4c,_0x312999){_0x312999=_0x312999||0xc8;return function(_0x3d8782){if(_0x3d8782){return _0x124d4c[_0xe832('0x19')](_0x312999)[_0xe832('0x1b')](_0x3d8782);}};}function respondWithFilteredResult(_0x4e3995,_0x3d8382){return function(_0xd70f2e){if(_0xd70f2e){var _0x918070=typeof _0x3d8382['offset']===_0xe832('0x1c')&&typeof _0x3d8382[_0xe832('0x1d')]===_0xe832('0x1c');var _0x382e95=_0xd70f2e['count'];var _0x346cbb=_0x918070?0x0:_0x3d8382[_0xe832('0x1e')];var _0x4d1603=_0x918070?_0xd70f2e[_0xe832('0x1f')]:_0x3d8382['offset']+_0x3d8382[_0xe832('0x1d')];var _0x45e24a;if(_0x4d1603>=_0x382e95){_0x4d1603=_0x382e95;_0x45e24a=0xc8;}else{_0x45e24a=0xce;}_0x4e3995[_0xe832('0x19')](_0x45e24a);return _0x4e3995[_0xe832('0x20')](_0xe832('0x21'),_0x346cbb+'-'+_0x4d1603+'/'+_0x382e95)['json'](_0xd70f2e);}return null;};}function patchUpdates(_0x3646b2){return function(_0x4753e3){try{jsonpatch[_0xe832('0x22')](_0x4753e3,_0x3646b2,!![]);}catch(_0x2e668c){return BPromise['reject'](_0x2e668c);}return _0x4753e3['save']();};}function saveUpdates(_0x57446a,_0xc4c62f){return function(_0x349553){if(_0x349553){return _0x349553[_0xe832('0x23')](_0x57446a)[_0xe832('0x24')](function(_0x596d30){return _0x596d30;});}return null;};}function removeEntity(_0x55c81f,_0x281a96){return function(_0x53984c){if(_0x53984c){return _0x53984c[_0xe832('0x25')]()[_0xe832('0x24')](function(){var _0x329ffd=_0x53984c[_0xe832('0x26')]({'plain':!![]});var _0x13420a='CustomReports';return db['UserProfileResource'][_0xe832('0x25')]({'where':{'type':_0x13420a,'resourceId':_0x329ffd['id']}})[_0xe832('0x24')](function(){return _0x53984c;});})[_0xe832('0x24')](function(){_0x55c81f[_0xe832('0x19')](0xcc)[_0xe832('0x1a')]();});}};}function handleEntityNotFound(_0x53d622,_0x5b3cab){return function(_0x55c508){if(!_0x55c508){_0x53d622[_0xe832('0x18')](0x194);}return _0x55c508;};}function handleError(_0x2c2737,_0x54497e){_0x54497e=_0x54497e||0x1f4;return function(_0x54a243){logger['error'](_0x54a243[_0xe832('0x27')]);if(_0x54a243['name']){delete _0x54a243[_0xe832('0x28')];}_0x2c2737['status'](_0x54497e)[_0xe832('0x29')](_0x54a243);};}exports[_0xe832('0x2a')]=function(_0x5391fc,_0x35d0d3){var _0x334433={},_0x583158={},_0x335d44={'count':0x0,'rows':[]};var _0x1c4c5e=_['map'](db['AnalyticCustomReport'][_0xe832('0x2b')],function(_0x4c162c){return{'name':_0x4c162c[_0xe832('0x2c')],'type':_0x4c162c[_0xe832('0x2d')][_0xe832('0x2e')]};});_0x583158['model']=_[_0xe832('0x2f')](_0x1c4c5e,_0xe832('0x28'));_0x583158[_0xe832('0x30')]=_[_0xe832('0x31')](_0x5391fc[_0xe832('0x30')]);_0x583158[_0xe832('0x32')]=_[_0xe832('0x33')](_0x583158[_0xe832('0x34')],_0x583158[_0xe832('0x30')]);_0x334433['attributes']=_[_0xe832('0x33')](_0x583158['model'],qs['fields'](_0x5391fc[_0xe832('0x30')][_0xe832('0x35')]));_0x334433[_0xe832('0x36')]=_0x334433[_0xe832('0x36')][_0xe832('0x37')]?_0x334433[_0xe832('0x36')]:_0x583158[_0xe832('0x34')];if(!_0x5391fc[_0xe832('0x30')]['hasOwnProperty'](_0xe832('0x38'))){_0x334433['limit']=qs['limit'](_0x5391fc['query'][_0xe832('0x1d')]);_0x334433[_0xe832('0x1e')]=qs['offset'](_0x5391fc[_0xe832('0x30')][_0xe832('0x1e')]);}_0x334433['order']=qs[_0xe832('0x39')](_0x5391fc[_0xe832('0x30')]['sort']);_0x334433[_0xe832('0x3a')]=qs['filters'](_[_0xe832('0x3b')](_0x5391fc[_0xe832('0x30')],_0x583158[_0xe832('0x32')]),_0x1c4c5e);if(_0x5391fc[_0xe832('0x30')]['filter']){_0x334433[_0xe832('0x3a')]=_[_0xe832('0x3c')](_0x334433[_0xe832('0x3a')],{'$or':_[_0xe832('0x2f')](_0x1c4c5e,function(_0x1dbaf8){if(_0x1dbaf8[_0xe832('0x2d')]!==_0xe832('0x3d')){var _0x4d8d03={};_0x4d8d03[_0x1dbaf8['name']]={'$like':'%'+_0x5391fc[_0xe832('0x30')][_0xe832('0x3e')]+'%'};return _0x4d8d03;}})});}_0x334433=_[_0xe832('0x3c')]({},_0x334433,_0x5391fc['options']);var _0x24f385={'where':_0x334433[_0xe832('0x3a')]};return db['AnalyticCustomReport'][_0xe832('0x1f')](_0x24f385)[_0xe832('0x24')](function(_0x233258){_0x335d44[_0xe832('0x1f')]=_0x233258;if(_0x5391fc[_0xe832('0x30')][_0xe832('0x3f')]){_0x334433[_0xe832('0x40')]=[{'all':!![]}];}return db[_0xe832('0x41')][_0xe832('0x42')](_0x334433);})[_0xe832('0x24')](function(_0x3a3671){_0x335d44['rows']=_0x3a3671;return _0x335d44;})['then'](respondWithFilteredResult(_0x35d0d3,_0x334433))['catch'](handleError(_0x35d0d3,null));};exports[_0xe832('0x43')]=function(_0x198afa,_0x580895){var _0x2f60da={'raw':![],'where':{'id':_0x198afa['params']['id']}},_0x33f68f={};_0x33f68f['model']=_['keys'](db[_0xe832('0x41')][_0xe832('0x2b')]);_0x33f68f[_0xe832('0x30')]=_[_0xe832('0x31')](_0x198afa[_0xe832('0x30')]);_0x33f68f[_0xe832('0x32')]=_[_0xe832('0x33')](_0x33f68f[_0xe832('0x34')],_0x33f68f[_0xe832('0x30')]);_0x2f60da[_0xe832('0x36')]=_[_0xe832('0x33')](_0x33f68f[_0xe832('0x34')],qs[_0xe832('0x35')](_0x198afa[_0xe832('0x30')]['fields']));_0x2f60da[_0xe832('0x36')]=_0x2f60da[_0xe832('0x36')][_0xe832('0x37')]?_0x2f60da['attributes']:_0x33f68f[_0xe832('0x34')];if(_0x198afa['query'][_0xe832('0x3f')]){_0x2f60da[_0xe832('0x40')]=[{'all':!![]}];}_0x2f60da=_[_0xe832('0x3c')]({},_0x2f60da,_0x198afa[_0xe832('0x44')]);return db[_0xe832('0x41')][_0xe832('0x45')](_0x2f60da)[_0xe832('0x24')](handleEntityNotFound(_0x580895,null))[_0xe832('0x24')](respondWithResult(_0x580895,null))[_0xe832('0x46')](handleError(_0x580895,null));};exports['create']=function(_0xfdcdbe,_0x18a560){return db[_0xe832('0x41')][_0xe832('0x47')](_0xfdcdbe['body'],{})[_0xe832('0x24')](function(_0x4110c4){var _0x2a62b4=_0xfdcdbe['user']['get']({'plain':!![]});if(!_0x2a62b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a62b4['role']===_0xe832('0x48')){var _0x518de1=_0x4110c4[_0xe832('0x26')]({'plain':!![]});var _0xd67ff9='Reports';return db[_0xe832('0x49')][_0xe832('0x45')]({'where':{'name':_0xd67ff9,'userProfileId':_0x2a62b4[_0xe832('0x4a')]},'raw':!![]})['then'](function(_0x208622){if(_0x208622&&_0x208622[_0xe832('0x4b')]===0x0){return db[_0xe832('0x4c')][_0xe832('0x47')]({'name':_0x518de1[_0xe832('0x28')],'resourceId':_0x518de1['id'],'type':_0xe832('0x4d'),'sectionId':_0x208622['id']},{})['then'](function(){return _0x4110c4;});}else{return _0x4110c4;}})['catch'](function(_0x5ad382){logger[_0xe832('0x4e')](_0xe832('0x4f'),_0x5ad382);throw _0x5ad382;});}return _0x4110c4;})[_0xe832('0x24')](respondWithResult(_0x18a560,0xc9))[_0xe832('0x46')](handleError(_0x18a560,null));};exports[_0xe832('0x23')]=function(_0x37ae6e,_0x4b35b9){if(_0x37ae6e[_0xe832('0x50')]['id']){delete _0x37ae6e[_0xe832('0x50')]['id'];}return db[_0xe832('0x41')][_0xe832('0x45')]({'where':{'id':_0x37ae6e['params']['id']}})[_0xe832('0x24')](handleEntityNotFound(_0x4b35b9,null))[_0xe832('0x24')](saveUpdates(_0x37ae6e[_0xe832('0x50')],null))[_0xe832('0x24')](respondWithResult(_0x4b35b9,null))['catch'](handleError(_0x4b35b9,null));};exports[_0xe832('0x25')]=function(_0x394efe,_0xfd9c8e){return db[_0xe832('0x41')][_0xe832('0x45')]({'where':{'id':_0x394efe['params']['id']}})[_0xe832('0x24')](handleEntityNotFound(_0xfd9c8e,null))[_0xe832('0x24')](removeEntity(_0xfd9c8e,null))['catch'](handleError(_0xfd9c8e,null));};exports['preview']=function(_0x4b9aa8,_0x312ba1){var _0x3bbef8=0xa;var _0x42ce59=[_0xe832('0x51'),'left_join',_0xe832('0x52'),_0xe832('0x53')];var _0x107413={'SUM':_0xe832('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe832('0x55'),'GROUP_CONCAT':_0xe832('0x56'),'GROUP_CONCAT ASC':_0xe832('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x419508={'SEC_TO_TIME':_0xe832('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe832('0x59')};var _0x50731c=function(_0x41e1c1){return!_[_0xe832('0x5a')]([_0xe832('0x5b'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x41e1c1);};var _0x161e32=function(_0x162073){if(!_0x162073||!_0x162073[_0xe832('0x5c')]['length']){return'';}for(var _0x280c84='(',_0x544384=0x0;_0x544384<_0x162073[_0xe832('0x5c')][_0xe832('0x37')];_0x544384+=0x1){_0x544384>0x0&&(_0x280c84+='\x20'+_0x162073[_0xe832('0x5d')]+'\x20');_0x280c84+=_0x162073['rules'][_0x544384]['group']?_0x161e32(_0x162073[_0xe832('0x5c')][_0x544384][_0xe832('0x5e')]):_0x162073[_0xe832('0x5c')][_0x544384][_0xe832('0x5f')]+'\x20'+_0x162073[_0xe832('0x5c')][_0x544384]['condition']+(_0x50731c(_0x162073[_0xe832('0x5c')][_0x544384]['condition'])?'\x20'+_0x162073['rules'][_0x544384][_0xe832('0x60')]:'');}return _0x280c84+')';};var _0x4a01b5={'where':{'id':_0x4b9aa8[_0xe832('0x61')]['id']}},_0x38286e,_0x1be49d,_0x3c583e,_0x3cef74,_0x2d575e;_0x4a01b5=_['merge']({},_0x4a01b5,_0x4b9aa8[_0xe832('0x44')]);return db[_0xe832('0x41')][_0xe832('0x45')](_0x4a01b5)[_0xe832('0x24')](function(_0x59910e){if(_0x59910e){_0x38286e=_0x59910e;return _0x59910e['getFields']();}return null;})[_0xe832('0x24')](function(_0xa8c198){if(_0xa8c198){if(!_0xa8c198[_0xe832('0x37')]){throw new db[(_0xe832('0x62'))]['ValidationErrorItem'](_0xe832('0x63'),0x193);}_0x1be49d=_0xa8c198;return db[_0xe832('0x64')][_0xe832('0x42')]({'raw':!![]});}return null;})[_0xe832('0x24')](function(_0x304884){if(_0x304884){_0x3c583e=_[_0xe832('0x65')](_0x304884,'id');var _0x4f58b9;var _0x2778d7=squel[_0xe832('0x66')]();_0x2778d7[_0xe832('0x67')](_0x38286e[_0xe832('0x68')]);for(var _0x2ba799=0x0;_0x2ba799<_0x1be49d[_0xe832('0x37')];_0x2ba799+=0x1){_0x4f58b9=_0x1be49d[_0x2ba799][_0xe832('0x69')]?_0x3c583e[_0x1be49d[_0x2ba799][_0xe832('0x69')]][_0xe832('0x6a')]:_0x1be49d[_0x2ba799][_0xe832('0x5f')];_0x4f58b9=_0x1be49d[_0x2ba799][_0xe832('0x6b')]?_[_0xe832('0x6c')](_0x107413[_0x1be49d[_0x2ba799][_0xe832('0x6b')]],'%s',_0x4f58b9):_0x4f58b9;_0x4f58b9=_0x1be49d[_0x2ba799][_0xe832('0x6d')]?_[_0xe832('0x6c')](_0x419508[_0x1be49d[_0x2ba799][_0xe832('0x6d')]],'%s',_0x4f58b9):_0x4f58b9;if(_0x1be49d[_0x2ba799][_0xe832('0x6e')]){_0x2778d7[_0xe832('0x5e')](_0x4f58b9);}_0x1be49d[_0x2ba799][_0xe832('0x6f')]&&_0x2778d7[_0xe832('0x70')](_0x4f58b9,_0x1be49d[_0x2ba799][_0xe832('0x6f')]===_0xe832('0x71')?![]:!![]);_0x2778d7[_0xe832('0x5f')](_0x4f58b9,_0x1be49d[_0x2ba799][_0xe832('0x72')]||_0x4f58b9);}if(_0x38286e[_0xe832('0x73')]){_0x38286e['joins']=JSON[_0xe832('0x74')](_0x38286e['joins']);for(var _0x41e5f8=0x0;_0x41e5f8<_0x38286e[_0xe832('0x73')][_0xe832('0x37')];_0x41e5f8+=0x1){if(_0x38286e[_0xe832('0x73')][_0x41e5f8]['type']&&_[_0xe832('0x5a')](_0x42ce59,_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x2d')])&&_0x38286e[_0xe832('0x73')][_0x41e5f8]['parentKey']&&_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x75')]&&_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x76')]){_0x2778d7[_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x2d')]](_0x38286e[_0xe832('0x73')][_0x41e5f8]['foreignTable'],null,util['format'](_0xe832('0x77'),_0x38286e[_0xe832('0x68')],_0x38286e['joins'][_0x41e5f8][_0xe832('0x78')],_0x38286e[_0xe832('0x73')][_0x41e5f8]['foreignTable'],_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x76')]));}}}if(_0x38286e[_0xe832('0x79')]){_0x38286e[_0xe832('0x79')]=JSON[_0xe832('0x74')](_0x38286e['conditions']);_0x2778d7[_0xe832('0x3a')](_0x161e32(_0x38286e[_0xe832('0x79')][_0xe832('0x5e')]));}_0x2d575e=_0x2778d7[_0xe832('0x7a')]();_0x2778d7[_0xe832('0x1d')](_0x3bbef8);_0x2778d7['offset'](0x0);logger[_0xe832('0x7b')](_0xe832('0x7c'),_0x2778d7[_0xe832('0x7d')]());return dbH['sequelize'][_0xe832('0x30')](_0x2778d7['toString'](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]});}})[_0xe832('0x24')](respondWithResult(_0x312ba1,null))[_0xe832('0x46')](handleError(_0x312ba1,null));};function runReport(_0x29c6f8,_0x23d367,_0x455fe){var _0x5ca54f=_0x23d367[_0xe832('0x28')];var _0x2cd87f=0xa;var _0x199db9=['join',_0xe832('0x81'),_0xe832('0x52'),'cross_join'];var _0x329303={'SUM':_0xe832('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe832('0x82'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe832('0x55'),'GROUP_CONCAT':_0xe832('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4273d2={'SEC_TO_TIME':_0xe832('0x58'),'DATE':'DATE(%s)','HOUR':_0xe832('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe832('0x59')};var _0x1a0807=function(_0xb4168c){return!_['includes']([_0xe832('0x5b'),_0xe832('0x84'),_0xe832('0x85'),_0xe832('0x86')],_0xb4168c);};var _0x496cd3=function(_0x8775ca){if(!_0x8775ca||!_0x8775ca[_0xe832('0x5c')][_0xe832('0x37')]){return'';}for(var _0x10f9a1='(',_0x5bff87=0x0;_0x5bff87<_0x8775ca[_0xe832('0x5c')][_0xe832('0x37')];_0x5bff87+=0x1){_0x5bff87>0x0&&(_0x10f9a1+='\x20'+_0x8775ca[_0xe832('0x5d')]+'\x20');_0x10f9a1+=_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x5e')]?_0x496cd3(_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x5e')]):_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x5f')]+'\x20'+_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x87')]+(_0x1a0807(_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x87')])?'\x20'+_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x60')]:'');}return _0x10f9a1+')';};var _0x39e271={'where':{'id':_0x29c6f8['id']}},_0x1b46a2,_0xe23634,_0xa802a1,_0x4659be,_0x514c83;_0x39e271=_[_0xe832('0x3c')]({},_0x39e271,_0x455fe);return db[_0xe832('0x41')][_0xe832('0x45')](_0x39e271)[_0xe832('0x24')](function(_0x1b92e8){if(_0x1b92e8){_0x1b46a2=_0x1b92e8;return _0x1b92e8[_0xe832('0x88')]();}return null;})['then'](function(_0x2e1914){if(_0x2e1914){if(!_0x2e1914['length']){throw new db[(_0xe832('0x62'))][(_0xe832('0x89'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe23634=_0x2e1914;return db[_0xe832('0x64')][_0xe832('0x42')]({'raw':!![]});}return null;})[_0xe832('0x24')](function(_0x2c8723){if(_0x2c8723){_0xa802a1=_[_0xe832('0x65')](_0x2c8723,'id');var _0x5a421d;var _0x5918d9=squel['select']();_0x5918d9[_0xe832('0x67')](_0x1b46a2[_0xe832('0x68')]);for(var _0x5dd1fd=0x0;_0x5dd1fd<_0xe23634['length'];_0x5dd1fd+=0x1){_0x5a421d=_0xe23634[_0x5dd1fd][_0xe832('0x69')]?_0xa802a1[_0xe23634[_0x5dd1fd][_0xe832('0x69')]][_0xe832('0x6a')]:_0xe23634[_0x5dd1fd][_0xe832('0x5f')];_0x5a421d=_0xe23634[_0x5dd1fd][_0xe832('0x6b')]?_[_0xe832('0x6c')](_0x329303[_0xe23634[_0x5dd1fd]['function']],'%s',_0x5a421d):_0x5a421d;_0x5a421d=_0xe23634[_0x5dd1fd][_0xe832('0x6d')]?_['replace'](_0x4273d2[_0xe23634[_0x5dd1fd][_0xe832('0x6d')]],'%s',_0x5a421d):_0x5a421d;if(_0xe23634[_0x5dd1fd][_0xe832('0x6e')]){_0x5918d9[_0xe832('0x5e')](_0x5a421d);}_0xe23634[_0x5dd1fd][_0xe832('0x6f')]&&_0x5918d9[_0xe832('0x70')](_0x5a421d,_0xe23634[_0x5dd1fd][_0xe832('0x6f')]==='DESC'?![]:!![]);_0x5918d9[_0xe832('0x5f')](_0x5a421d,_0xe23634[_0x5dd1fd]['alias']||_0x5a421d);}if(_0x1b46a2[_0xe832('0x73')]){_0x1b46a2['joins']=JSON[_0xe832('0x74')](_0x1b46a2[_0xe832('0x73')]);for(var _0x174e9c=0x0;_0x174e9c<_0x1b46a2['joins'][_0xe832('0x37')];_0x174e9c+=0x1){if(_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x2d')]&&_[_0xe832('0x5a')](_0x199db9,_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x2d')])&&_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x78')]&&_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x75')]&&_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x76')]){_0x5918d9[_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x2d')]](_0x1b46a2['joins'][_0x174e9c][_0xe832('0x75')],null,util[_0xe832('0x6d')](_0xe832('0x77'),_0x1b46a2['table'],_0x1b46a2['joins'][_0x174e9c][_0xe832('0x78')],_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x75')],_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x76')]));}}}if(_0x1b46a2[_0xe832('0x79')]){_0x1b46a2[_0xe832('0x79')]=JSON['parse'](_0x1b46a2[_0xe832('0x79')]);_0x5918d9[_0xe832('0x3a')](_0x496cd3(_0x1b46a2['conditions'][_0xe832('0x5e')]));}_0x514c83=_0x5918d9[_0xe832('0x7a')]();_0x5918d9[_0xe832('0x1d')](_0x2cd87f);_0x5918d9[_0xe832('0x1e')](0x0);return;}})[_0xe832('0x24')](function(){if(_0x23d367[_0xe832('0x8a')]===_0xe832('0x8b')){return null;}var _0x1fa98a=_[_0xe832('0x3c')](_0x23d367,{'name':_0x23d367['fullPath']||_0x23d367[_0xe832('0x28')]||_0x1b46a2['name'],'basename':_0x5ca54f,'savename':util[_0xe832('0x6d')](_0xe832('0x8c'),_0x23d367[_0xe832('0x28')]||_0x1b46a2[_0xe832('0x28')],require(_0xe832('0x8d'))[_0xe832('0x8e')](0x4),_0x23d367[_0xe832('0x8a')]||_0xe832('0x8f')),'reportId':_0x1b46a2['id'],'reportType':_0xe832('0x90')});return db[_0xe832('0x91')][_0xe832('0x47')](_0x1fa98a,{'raw':!![]});})[_0xe832('0x24')](function(_0x2c0e43){if(_0x1b46a2['table']==='cdr'){_0x514c83[_0xe832('0x3a')](_0x1b46a2[_0xe832('0x68')]+_0xe832('0x92'),_0x23d367[_0xe832('0x93')],_0x23d367[_0xe832('0x94')]);}else{_0x514c83[_0xe832('0x3a')](_0x1b46a2['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x23d367[_0xe832('0x93')],_0x23d367['endDate']);}if(_0x2c0e43){logger[_0xe832('0x95')]('Run\x20Query:',_0x514c83[_0xe832('0x7d')]());require(_0xe832('0x96'))['fork'](path[_0xe832('0x51')](__dirname,_0xe832('0x97'),_0x2c0e43[_0xe832('0x8a')]),[_0x2c0e43['id'],_0x514c83[_0xe832('0x7d')](),path['join'](__dirname,_0xe832('0x98'),_0x2c0e43[_0xe832('0x99')]),_0x5ca54f]);return _0x2c0e43;}else{var _0x1632e5=squel[_0xe832('0x66')]();_0x1632e5[_0xe832('0x67')]('('+_0x514c83[_0xe832('0x7d')]()+')',_0xe832('0x9a'));_0x1632e5[_0xe832('0x5f')](_0xe832('0x9b'),_0xe832('0x1f'));_0x514c83[_0xe832('0x1d')](_0x23d367[_0xe832('0x1d')]||_0x2cd87f);_0x514c83[_0xe832('0x1e')](_0x23d367[_0xe832('0x1e')]||0x0);return dbH[_0xe832('0x7e')][_0xe832('0x30')](_0x1632e5[_0xe832('0x7d')](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]})[_0xe832('0x24')](function(_0x161cce){if(!_0x161cce[_0xe832('0x37')]){_0x4659be=0x0;}else{_0x4659be=_0x161cce[0x0][_0xe832('0x1f')]||0x0;}return dbH[_0xe832('0x7e')]['query'](_0x514c83[_0xe832('0x7d')](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]});})[_0xe832('0x24')](function(_0x47dbc4){return{'rows':_0x47dbc4||[],'count':_0x4659be};});}});}exports['run']=function(_0xdab5b1,_0x2338b2){return runReport(_0xdab5b1[_0xe832('0x61')],_0xdab5b1[_0xe832('0x30')],_0xdab5b1['options'])[_0xe832('0x24')](respondWithResult(_0x2338b2,null))['catch'](handleError(_0x2338b2,null));};exports[_0xe832('0x9c')]=runReport;exports[_0xe832('0x30')]=function(_0x4e0433,_0xc6271e){var _0x22269c=0xa;var _0x4e2a31=[_0xe832('0x51'),'left_join',_0xe832('0x52'),_0xe832('0x53')];var _0x401bcb={'SUM':_0xe832('0x54'),'COUNT':_0xe832('0x9d'),'COUNT DISTINCT':_0xe832('0x82'),'MAX':_0xe832('0x9e'),'MIN':_0xe832('0x9f'),'AVG':_0xe832('0x55'),'GROUP_CONCAT':_0xe832('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe832('0xa0')};var _0x400f07={'SEC_TO_TIME':_0xe832('0x58'),'DATE':_0xe832('0xa1'),'HOUR':_0xe832('0x83'),'ROUND':_0xe832('0xa2'),'UNIX_TIMESTAMP':_0xe832('0x59')};var _0x1e915e=function(_0x340de8){return!_[_0xe832('0x5a')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe832('0x85'),_0xe832('0x86')],_0x340de8);};var _0x5644fd=function(_0x4c4504){if(!_0x4c4504||!_0x4c4504[_0xe832('0x5c')]['length']){return'';}for(var _0x2cf794='(',_0x59e67b=0x0;_0x59e67b<_0x4c4504[_0xe832('0x5c')][_0xe832('0x37')];_0x59e67b+=0x1){_0x59e67b>0x0&&(_0x2cf794+='\x20'+_0x4c4504[_0xe832('0x5d')]+'\x20');_0x2cf794+=_0x4c4504[_0xe832('0x5c')][_0x59e67b]['group']?_0x5644fd(_0x4c4504[_0xe832('0x5c')][_0x59e67b][_0xe832('0x5e')]):_0x4c4504['rules'][_0x59e67b][_0xe832('0x5f')]+'\x20'+_0x4c4504[_0xe832('0x5c')][_0x59e67b][_0xe832('0x87')]+(_0x1e915e(_0x4c4504[_0xe832('0x5c')][_0x59e67b]['condition'])?'\x20'+_0x4c4504[_0xe832('0x5c')][_0x59e67b][_0xe832('0x60')]:'');}return _0x2cf794+')';};var _0x438dd8={'where':{'id':_0x4e0433['params']['id']}},_0x5b6347,_0x41875e,_0x14df33,_0x51287a,_0x56b39b;_0x438dd8=_[_0xe832('0x3c')]({},_0x438dd8,_0x4e0433['options']);return db[_0xe832('0x41')]['find'](_0x438dd8)['then'](function(_0xa73ac1){if(_0xa73ac1){_0x5b6347=_0xa73ac1;return _0xa73ac1['getFields']();}return null;})['then'](function(_0x1cfcd5){if(_0x1cfcd5){if(!_0x1cfcd5[_0xe832('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe832('0x63'),0x193);}_0x41875e=_0x1cfcd5;return db['AnalyticMetric'][_0xe832('0x42')]({'raw':!![]});}return null;})[_0xe832('0x24')](function(_0x213ba7){if(_0x213ba7){_0x14df33=_[_0xe832('0x65')](_0x213ba7,'id');var _0x1384c4;var _0xed10e6=squel[_0xe832('0x66')]();_0xed10e6['from'](_0x5b6347[_0xe832('0x68')]);for(var _0xe2b2df=0x0;_0xe2b2df<_0x41875e[_0xe832('0x37')];_0xe2b2df+=0x1){_0x1384c4=_0x41875e[_0xe2b2df][_0xe832('0x69')]?_0x14df33[_0x41875e[_0xe2b2df][_0xe832('0x69')]][_0xe832('0x6a')]:_0x41875e[_0xe2b2df][_0xe832('0x5f')];_0x1384c4=_0x41875e[_0xe2b2df][_0xe832('0x6b')]?_['replace'](_0x401bcb[_0x41875e[_0xe2b2df][_0xe832('0x6b')]],'%s',_0x1384c4):_0x1384c4;_0x1384c4=_0x41875e[_0xe2b2df][_0xe832('0x6d')]?_[_0xe832('0x6c')](_0x400f07[_0x41875e[_0xe2b2df]['format']],'%s',_0x1384c4):_0x1384c4;if(_0x41875e[_0xe2b2df][_0xe832('0x6e')]){_0xed10e6['group'](_0x1384c4);}_0x41875e[_0xe2b2df][_0xe832('0x6f')]&&_0xed10e6[_0xe832('0x70')](_0x1384c4,_0x41875e[_0xe2b2df][_0xe832('0x6f')]===_0xe832('0x71')?![]:!![]);_0xed10e6['field'](_0x1384c4,_0x41875e[_0xe2b2df]['alias']||_0x1384c4);}if(_0x5b6347[_0xe832('0x73')]){_0x5b6347['joins']=JSON[_0xe832('0x74')](_0x5b6347['joins']);for(var _0x34190a=0x0;_0x34190a<_0x5b6347[_0xe832('0x73')]['length'];_0x34190a+=0x1){if(_0x5b6347[_0xe832('0x73')][_0x34190a][_0xe832('0x2d')]&&_['includes'](_0x4e2a31,_0x5b6347[_0xe832('0x73')][_0x34190a]['type'])&&_0x5b6347[_0xe832('0x73')][_0x34190a][_0xe832('0x78')]&&_0x5b6347[_0xe832('0x73')][_0x34190a]['foreignTable']&&_0x5b6347['joins'][_0x34190a][_0xe832('0x76')]){_0xed10e6[_0x5b6347[_0xe832('0x73')][_0x34190a]['type']](_0x5b6347['joins'][_0x34190a][_0xe832('0x75')],null,util[_0xe832('0x6d')]('%s.%s\x20=\x20%s.%s',_0x5b6347[_0xe832('0x68')],_0x5b6347[_0xe832('0x73')][_0x34190a]['parentKey'],_0x5b6347['joins'][_0x34190a][_0xe832('0x75')],_0x5b6347[_0xe832('0x73')][_0x34190a]['foreignKey']));}}}if(_0x5b6347['conditions']){_0x5b6347[_0xe832('0x79')]=JSON[_0xe832('0x74')](_0x5b6347['conditions']);_0xed10e6['where'](_0x5644fd(_0x5b6347[_0xe832('0x79')][_0xe832('0x5e')]));}_0x56b39b=_0xed10e6[_0xe832('0x7a')]();_0xed10e6[_0xe832('0x1d')](_0x22269c);_0xed10e6[_0xe832('0x1e')](0x0);logger[_0xe832('0x7b')](_0xe832('0x7c'),_0xed10e6[_0xe832('0x7d')]());return dbH['sequelize'][_0xe832('0x30')](_0xed10e6[_0xe832('0x7d')](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]});}})[_0xe832('0x24')](function(){return{'sql':_0x56b39b[_0xe832('0x7d')]()};})['then'](respondWithResult(_0xc6271e,null))[_0xe832('0x46')](handleError(_0xc6271e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 01f838d..46a94fd 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.model.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2089=['api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x2089,0x107));var _0x9208=function(_0x231ef3,_0x75aa1c){_0x231ef3=_0x231ef3-0x0;var _0x3a9965=_0x2089[_0x231ef3];return _0x3a9965;};'use strict';var _=require(_0x9208('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9208('0x1'));var moment=require(_0x9208('0x2'));var BPromise=require(_0x9208('0x3'));var rp=require(_0x9208('0x4'));var fs=require('fs');var path=require(_0x9208('0x5'));var rimraf=require('rimraf');var config=require(_0x9208('0x6'));var attributes=require(_0x9208('0x7'));module[_0x9208('0x8')]=function(_0x4cd1fc,_0x45bc6b){return _0x4cd1fc[_0x9208('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x9208('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0821=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x170a52,_0x2e27d6){var _0x2c03ed=function(_0x32e213){while(--_0x32e213){_0x170a52['push'](_0x170a52['shift']());}};_0x2c03ed(++_0x2e27d6);}(_0x0821,0xa5));var _0x1082=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x0821[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x1082('0x0'));var util=require(_0x1082('0x1'));var logger=require(_0x1082('0x2'))('api');var moment=require(_0x1082('0x3'));var BPromise=require(_0x1082('0x4'));var rp=require(_0x1082('0x5'));var fs=require('fs');var path=require(_0x1082('0x6'));var rimraf=require(_0x1082('0x7'));var config=require(_0x1082('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x1082('0x9')]=function(_0x1c0d4b,_0xf0839a){return _0x1c0d4b['define'](_0x1082('0xa'),attributes,{'tableName':_0x1082('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 81c0fa2..87b9312 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x48ee=['AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info'];(function(_0xea0cf2,_0x1502d9){var _0x3652df=function(_0x39db2a){while(--_0x39db2a){_0xea0cf2['push'](_0xea0cf2['shift']());}};_0x3652df(++_0x1502d9);}(_0x48ee,0x138));var _0xe48e=function(_0x1ba229,_0x46fef5){_0x1ba229=_0x1ba229-0x0;var _0x44692f=_0x48ee[_0x1ba229];return _0x44692f;};'use strict';var _=require('lodash');var util=require(_0xe48e('0x0'));var moment=require(_0xe48e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe48e('0x2'));var db=require(_0xe48e('0x3'))['db'];var utils=require(_0xe48e('0x4'));var logger=require('../../config/logger')(_0xe48e('0x5'));var config=require('../../config/environment');var jayson=require(_0xe48e('0x6'));var client=jayson[_0xe48e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1ac2,_0x34f626,_0xdd9c26){return new BPromise(function(_0x54cde1,_0x5b7e13){return client[_0xe48e('0x8')](_0x3a1ac2,_0xdd9c26)[_0xe48e('0x9')](function(_0x4bde1f){logger[_0xe48e('0xa')](_0xe48e('0xb'),_0x34f626,'request\x20sent');logger['debug'](_0xe48e('0xc'),_0x34f626,_0xe48e('0xd'),JSON[_0xe48e('0xe')](_0x4bde1f));if(_0x4bde1f['error']){if(_0x4bde1f[_0xe48e('0xf')]['code']===0x1f4){logger[_0xe48e('0xf')](_0xe48e('0xb'),_0x34f626,_0x4bde1f['error'][_0xe48e('0x10')]);return _0x5b7e13(_0x4bde1f[_0xe48e('0xf')][_0xe48e('0x10')]);}logger[_0xe48e('0xf')](_0xe48e('0xb'),_0x34f626,_0x4bde1f[_0xe48e('0xf')][_0xe48e('0x10')]);return _0x54cde1(_0x4bde1f[_0xe48e('0xf')][_0xe48e('0x10')]);}else{logger[_0xe48e('0xa')](_0xe48e('0xb'),_0x34f626,_0xe48e('0xd'));_0x54cde1(_0x4bde1f[_0xe48e('0x11')]['message']);}})[_0xe48e('0x12')](function(_0x2ae9a3){logger['error'](_0xe48e('0xb'),_0x34f626,_0x2ae9a3);_0x5b7e13(_0x2ae9a3);});});}
\ No newline at end of file
+var _0xdc2a=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x940ce4,_0x1b0503){var _0x4b9212=function(_0x561348){while(--_0x561348){_0x940ce4['push'](_0x940ce4['shift']());}};_0x4b9212(++_0x1b0503);}(_0xdc2a,0x9d));var _0xadc2=function(_0x4fd163,_0x154781){_0x4fd163=_0x4fd163-0x0;var _0x178f7b=_0xdc2a[_0x4fd163];return _0x178f7b;};'use strict';var _=require(_0xadc2('0x0'));var util=require('util');var moment=require(_0xadc2('0x1'));var BPromise=require(_0xadc2('0x2'));var rs=require(_0xadc2('0x3'));var fs=require('fs');var Redis=require(_0xadc2('0x4'));var db=require(_0xadc2('0x5'))['db'];var utils=require(_0xadc2('0x6'));var logger=require(_0xadc2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xadc2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39f9ac,_0x20d73f,_0x5d1030){return new BPromise(function(_0x42f7ce,_0x45a615){return client['request'](_0x39f9ac,_0x5d1030)['then'](function(_0x25f8f2){logger[_0xadc2('0x9')](_0xadc2('0xa'),_0x20d73f,_0xadc2('0xb'));logger['debug'](_0xadc2('0xc'),_0x20d73f,_0xadc2('0xb'),JSON['stringify'](_0x25f8f2));if(_0x25f8f2[_0xadc2('0xd')]){if(_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xe')]===0x1f4){logger[_0xadc2('0xd')](_0xadc2('0xa'),_0x20d73f,_0x25f8f2['error']['message']);return _0x45a615(_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xf')]);}logger[_0xadc2('0xd')](_0xadc2('0xa'),_0x20d73f,_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xf')]);return _0x42f7ce(_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xf')]);}else{logger[_0xadc2('0x9')](_0xadc2('0xa'),_0x20d73f,_0xadc2('0xb'));_0x42f7ce(_0x25f8f2[_0xadc2('0x10')][_0xadc2('0xf')]);}})[_0xadc2('0x11')](function(_0x450f94){logger[_0xadc2('0xd')](_0xadc2('0xa'),_0x20d73f,_0x450f94);_0x45a615(_0x450f94);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 8598295..78505c6 100644
--- a/server/api/analyticCustomReport/index.js
+++ b/server/api/analyticCustomReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29c7=['index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','create','put','update','destroy','exports','multer','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x29c7,0x84));var _0x729c=function(_0x179f38,_0x4a5eca){_0x179f38=_0x179f38-0x0;var _0x385a77=_0x29c7[_0x179f38];return _0x385a77;};'use strict';var multer=require(_0x729c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x729c('0x1'));var auth=require(_0x729c('0x2'));var interaction=require(_0x729c('0x3'));var config=require(_0x729c('0x4'));var controller=require(_0x729c('0x5'));router[_0x729c('0x6')]('/',auth[_0x729c('0x7')](),controller[_0x729c('0x8')]);router[_0x729c('0x6')](_0x729c('0x9'),auth[_0x729c('0x7')](),controller['show']);router[_0x729c('0x6')](_0x729c('0xa'),auth['isAuthenticated'](),controller[_0x729c('0xb')]);router[_0x729c('0x6')](_0x729c('0xc'),auth[_0x729c('0x7')](),controller[_0x729c('0xd')]);router[_0x729c('0x6')](_0x729c('0xe'),auth[_0x729c('0x7')](),controller['query']);router['post']('/',auth[_0x729c('0x7')](),controller[_0x729c('0xf')]);router[_0x729c('0x10')](_0x729c('0x9'),auth[_0x729c('0x7')](),controller[_0x729c('0x11')]);router['delete']('/:id',auth[_0x729c('0x7')](),controller[_0x729c('0x12')]);module[_0x729c('0x13')]=router;
\ No newline at end of file
+var _0x4af1=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post'];(function(_0x4a563b,_0x36f42d){var _0x2935ef=function(_0x32593f){while(--_0x32593f){_0x4a563b['push'](_0x4a563b['shift']());}};_0x2935ef(++_0x36f42d);}(_0x4af1,0x94));var _0x14af=function(_0x1c00e3,_0x3c24a0){_0x1c00e3=_0x1c00e3-0x0;var _0x27181b=_0x4af1[_0x1c00e3];return _0x27181b;};'use strict';var multer=require(_0x14af('0x0'));var util=require(_0x14af('0x1'));var path=require(_0x14af('0x2'));var timeout=require(_0x14af('0x3'));var express=require(_0x14af('0x4'));var router=express['Router']();var fs_extra=require(_0x14af('0x5'));var auth=require(_0x14af('0x6'));var interaction=require(_0x14af('0x7'));var config=require('../../config/environment');var controller=require(_0x14af('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x14af('0x9')]);router[_0x14af('0xa')](_0x14af('0xb'),auth[_0x14af('0xc')](),controller[_0x14af('0xd')]);router['get'](_0x14af('0xe'),auth[_0x14af('0xc')](),controller[_0x14af('0xf')]);router[_0x14af('0xa')](_0x14af('0x10'),auth[_0x14af('0xc')](),controller['run']);router[_0x14af('0xa')](_0x14af('0x11'),auth[_0x14af('0xc')](),controller[_0x14af('0x12')]);router[_0x14af('0x13')]('/',auth[_0x14af('0xc')](),controller[_0x14af('0x14')]);router['put'](_0x14af('0xb'),auth[_0x14af('0xc')](),controller['update']);router[_0x14af('0x15')](_0x14af('0xb'),auth[_0x14af('0xc')](),controller[_0x14af('0x16')]);module[_0x14af('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index e35c33f..79feb99 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x4650bf,_0x44b2bd){var _0x29ec71=function(_0xb8caad){while(--_0xb8caad){_0x4650bf['push'](_0x4650bf['shift']());}};_0x29ec71(++_0x44b2bd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5fc3[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
+var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x194d2f,_0x58d4af){var _0x3e5eca=function(_0x4bd8df){while(--_0x4bd8df){_0x194d2f['push'](_0x194d2f['shift']());}};_0x3e5eca(++_0x58d4af);}(_0xeda8,0x104));var _0x8eda=function(_0x2e5d8a,_0x2f97c0){_0x2e5d8a=_0x2e5d8a-0x0;var _0x4969ae=_0xeda8[_0x2e5d8a];return _0x4969ae;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 62d599d..1bae3f7 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x58f1b0,_0x3a2be3){var _0x551656=function(_0x5152c1){while(--_0x5152c1){_0x58f1b0['push'](_0x58f1b0['shift']());}};_0x551656(++_0x3a2be3);}(_0x814b,0x1a2));var _0xb814=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x814b[_0x349148];return _0x2f2b0f;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
+var _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x3f80e8,_0xd88ecf){var _0x17cf31=function(_0x5c849e){while(--_0x5c849e){_0x3f80e8['push'](_0x3f80e8['shift']());}};_0x17cf31(++_0xd88ecf);}(_0xda19,0xd5));var _0x9da1=function(_0x55c498,_0x14021c){_0x55c498=_0x55c498-0x0;var _0x3323f2=_0xda19[_0x55c498];return _0x3323f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index e45c9cd..6832c46 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b8e=['../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x3e9e78,_0x1e92c9){var _0x4fc5ac=function(_0x44cbd1){while(--_0x44cbd1){_0x3e9e78['push'](_0x3e9e78['shift']());}};_0x4fc5ac(++_0x1e92c9);}(_0x2b8e,0x14f));var _0xe2b8=function(_0x1e73ab,_0x3a9040){_0x1e73ab=_0x1e73ab-0x0;var _0x40d8c0=_0x2b8e[_0x1e73ab];return _0x40d8c0;};'use strict';var _=require(_0xe2b8('0x0'));var util=require(_0xe2b8('0x1'));var logger=require(_0xe2b8('0x2'))('api');var moment=require(_0xe2b8('0x3'));var BPromise=require(_0xe2b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2b8('0x5'));var rimraf=require('rimraf');var config=require(_0xe2b8('0x6'));var attributes=require(_0xe2b8('0x7'));module['exports']=function(_0x156628,_0x5536dc){return _0x156628[_0xe2b8('0x8')](_0xe2b8('0x9'),attributes,{'tableName':_0xe2b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb5a=['path','rimraf','./analyticDefaultReport.attributes','exports','define','util','api','bluebird','request-promise'];(function(_0x3f00ee,_0x1d1673){var _0x18a07e=function(_0x4dad57){while(--_0x4dad57){_0x3f00ee['push'](_0x3f00ee['shift']());}};_0x18a07e(++_0x1d1673);}(_0xdb5a,0x1d0));var _0xadb5=function(_0x1ca804,_0x2a0925){_0x1ca804=_0x1ca804-0x0;var _0x2fc5bf=_0xdb5a[_0x1ca804];return _0x2fc5bf;};'use strict';var _=require('lodash');var util=require(_0xadb5('0x0'));var logger=require('../../config/logger')(_0xadb5('0x1'));var moment=require('moment');var BPromise=require(_0xadb5('0x2'));var rp=require(_0xadb5('0x3'));var fs=require('fs');var path=require(_0xadb5('0x4'));var rimraf=require(_0xadb5('0x5'));var config=require('../../config/environment');var attributes=require(_0xadb5('0x6'));module[_0xadb5('0x7')]=function(_0x3f0728,_0x594c43){return _0x3f0728[_0xadb5('0x8')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 57eebb9..14c2aae 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6c71=['jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2c4e42,_0x7104de){var _0x380da6=function(_0x56f273){while(--_0x56f273){_0x2c4e42['push'](_0x2c4e42['shift']());}};_0x380da6(++_0x7104de);}(_0x6c71,0x1ad));var _0x16c7=function(_0x456fc1,_0x191e3d){_0x456fc1=_0x456fc1-0x0;var _0x84fab3=_0x6c71[_0x456fc1];return _0x84fab3;};'use strict';var _=require(_0x16c7('0x0'));var util=require(_0x16c7('0x1'));var moment=require(_0x16c7('0x2'));var BPromise=require(_0x16c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x16c7('0x5'));var logger=require(_0x16c7('0x6'))('rpc');var config=require(_0x16c7('0x7'));var jayson=require(_0x16c7('0x8'));var client=jayson[_0x16c7('0x9')][_0x16c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448d24,_0x359aea,_0x1f95e8){return new BPromise(function(_0x2eac9f,_0x116cda){return client['request'](_0x448d24,_0x1f95e8)[_0x16c7('0xb')](function(_0x21c7b2){logger[_0x16c7('0xc')](_0x16c7('0xd'),_0x359aea,_0x16c7('0xe'));logger[_0x16c7('0xf')](_0x16c7('0x10'),_0x359aea,_0x16c7('0xe'),JSON[_0x16c7('0x11')](_0x21c7b2));if(_0x21c7b2['error']){if(_0x21c7b2[_0x16c7('0x12')][_0x16c7('0x13')]===0x1f4){logger[_0x16c7('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x359aea,_0x21c7b2[_0x16c7('0x12')][_0x16c7('0x14')]);return _0x116cda(_0x21c7b2[_0x16c7('0x12')][_0x16c7('0x14')]);}logger[_0x16c7('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x359aea,_0x21c7b2['error']['message']);return _0x2eac9f(_0x21c7b2['error'][_0x16c7('0x14')]);}else{logger[_0x16c7('0xc')](_0x16c7('0xd'),_0x359aea,_0x16c7('0xe'));_0x2eac9f(_0x21c7b2[_0x16c7('0x15')]['message']);}})[_0x16c7('0x16')](function(_0x4c8c42){logger['error'](_0x16c7('0xd'),_0x359aea,_0x4c8c42);_0x116cda(_0x4c8c42);});});}
\ No newline at end of file
+var _0x92a0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x5506cd,_0x1f1fc1){var _0x3be516=function(_0x492c42){while(--_0x492c42){_0x5506cd['push'](_0x5506cd['shift']());}};_0x3be516(++_0x1f1fc1);}(_0x92a0,0x1c6));var _0x092a=function(_0xa0be1c,_0x152d5d){_0xa0be1c=_0xa0be1c-0x0;var _0x546eec=_0x92a0[_0xa0be1c];return _0x546eec;};'use strict';var _=require(_0x092a('0x0'));var util=require(_0x092a('0x1'));var moment=require(_0x092a('0x2'));var BPromise=require('bluebird');var rs=require(_0x092a('0x3'));var fs=require('fs');var Redis=require(_0x092a('0x4'));var db=require(_0x092a('0x5'))['db'];var utils=require(_0x092a('0x6'));var logger=require('../../config/logger')(_0x092a('0x7'));var config=require(_0x092a('0x8'));var jayson=require(_0x092a('0x9'));var client=jayson[_0x092a('0xa')][_0x092a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272931,_0x57dbef,_0x330d04){return new BPromise(function(_0x50a109,_0x4f149f){return client[_0x092a('0xc')](_0x272931,_0x330d04)['then'](function(_0x5607d6){logger['info'](_0x092a('0xd'),_0x57dbef,_0x092a('0xe'));logger[_0x092a('0xf')](_0x092a('0x10'),_0x57dbef,_0x092a('0xe'),JSON[_0x092a('0x11')](_0x5607d6));if(_0x5607d6[_0x092a('0x12')]){if(_0x5607d6[_0x092a('0x12')][_0x092a('0x13')]===0x1f4){logger[_0x092a('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x57dbef,_0x5607d6[_0x092a('0x12')][_0x092a('0x14')]);return _0x4f149f(_0x5607d6['error'][_0x092a('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x57dbef,_0x5607d6[_0x092a('0x12')][_0x092a('0x14')]);return _0x50a109(_0x5607d6[_0x092a('0x12')][_0x092a('0x14')]);}else{logger[_0x092a('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x57dbef,'request\x20sent');_0x50a109(_0x5607d6[_0x092a('0x16')][_0x092a('0x14')]);}})['catch'](function(_0xd921f9){logger[_0x092a('0x12')](_0x092a('0xd'),_0x57dbef,_0xd921f9);_0x4f149f(_0xd921f9);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 7885f1d..71756d5 100644
--- a/server/api/analyticDefaultReport/index.js
+++ b/server/api/analyticDefaultReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2c40=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','put','update','delete','destroy','exports'];(function(_0x59c683,_0x209444){var _0x47251b=function(_0x4db046){while(--_0x4db046){_0x59c683['push'](_0x59c683['shift']());}};_0x47251b(++_0x209444);}(_0x2c40,0xfd));var _0x02c4=function(_0x575d6b,_0x3f86c1){_0x575d6b=_0x575d6b-0x0;var _0x2c9819=_0x2c40[_0x575d6b];return _0x2c9819;};'use strict';var multer=require('multer');var util=require(_0x02c4('0x0'));var path=require(_0x02c4('0x1'));var timeout=require(_0x02c4('0x2'));var express=require(_0x02c4('0x3'));var router=express[_0x02c4('0x4')]();var fs_extra=require(_0x02c4('0x5'));var auth=require(_0x02c4('0x6'));var interaction=require(_0x02c4('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x02c4('0x8')]('/',auth[_0x02c4('0x9')](),controller['index']);router[_0x02c4('0x8')](_0x02c4('0xa'),auth[_0x02c4('0x9')](),controller[_0x02c4('0xb')]);router['get'](_0x02c4('0xc'),auth['isAuthenticated'](),controller[_0x02c4('0xd')]);router['get'](_0x02c4('0xe'),auth[_0x02c4('0x9')](),controller[_0x02c4('0xf')]);router[_0x02c4('0x8')](_0x02c4('0x10'),auth['isAuthenticated'](),controller[_0x02c4('0x11')]);router['post']('/',auth[_0x02c4('0x9')](),controller['create']);router[_0x02c4('0x12')](_0x02c4('0xa'),auth[_0x02c4('0x9')](),controller[_0x02c4('0x13')]);router[_0x02c4('0x14')](_0x02c4('0xa'),auth['isAuthenticated'](),controller[_0x02c4('0x15')]);module[_0x02c4('0x16')]=router;
\ No newline at end of file
+var _0x19f4=['../../components/auth/service','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x18032f,_0x4f4e45){var _0xb0b2b8=function(_0x563262){while(--_0x563262){_0x18032f['push'](_0x18032f['shift']());}};_0xb0b2b8(++_0x4f4e45);}(_0x19f4,0x10c));var _0x419f=function(_0x2d3154,_0xf911c9){_0x2d3154=_0x2d3154-0x0;var _0x30196e=_0x19f4[_0x2d3154];return _0x30196e;};'use strict';var multer=require(_0x419f('0x0'));var util=require(_0x419f('0x1'));var path=require(_0x419f('0x2'));var timeout=require(_0x419f('0x3'));var express=require('express');var router=express[_0x419f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x419f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x419f('0x6'));router['get']('/',auth[_0x419f('0x7')](),controller['index']);router[_0x419f('0x8')](_0x419f('0x9'),auth[_0x419f('0x7')](),controller[_0x419f('0xa')]);router['get'](_0x419f('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0x419f('0x8')](_0x419f('0xc'),auth[_0x419f('0x7')](),controller[_0x419f('0xd')]);router[_0x419f('0x8')](_0x419f('0xe'),auth['isAuthenticated'](),controller[_0x419f('0xf')]);router[_0x419f('0x10')]('/',auth[_0x419f('0x7')](),controller[_0x419f('0x11')]);router[_0x419f('0x12')](_0x419f('0x9'),auth[_0x419f('0x7')](),controller[_0x419f('0x13')]);router['delete'](_0x419f('0x9'),auth[_0x419f('0x7')](),controller[_0x419f('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index d93dbc5..eaa54cc 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x409a=['xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','csv','pdf'];(function(_0xd46227,_0x18477f){var _0x2a980d=function(_0x34e452){while(--_0x34e452){_0xd46227['push'](_0xd46227['shift']());}};_0x2a980d(++_0x18477f);}(_0x409a,0x181));var _0xa409=function(_0x931503,_0x296d97){_0x931503=_0x931503-0x0;var _0x2c838f=_0x409a[_0x931503];return _0x2c838f;};'use strict';var Sequelize=require(_0xa409('0x0'));var moment=require(_0xa409('0x1'));module['exports']={'name':{'type':Sequelize[_0xa409('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xa409('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xa409('0x3'),_0xa409('0x4'),_0xa409('0x5')),'allowNull':![],'defaultValue':_0xa409('0x3')},'savename':{'type':Sequelize[_0xa409('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa409('0x6')]},'endDate':{'type':Sequelize[_0xa409('0x6')]},'status':{'type':Sequelize[_0xa409('0x2')],'defaultValue':_0xa409('0x7')},'type':{'type':Sequelize[_0xa409('0x8')](_0xa409('0x9'),_0xa409('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xa409('0xb')](0xb)[_0xa409('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4722=['manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','Loading'];(function(_0x322e53,_0x12446f){var _0x3e19ab=function(_0x2bb848){while(--_0x2bb848){_0x322e53['push'](_0x322e53['shift']());}};_0x3e19ab(++_0x12446f);}(_0x4722,0x18a));var _0x2472=function(_0x4cdb9b,_0x9800cf){_0x4cdb9b=_0x4cdb9b-0x0;var _0x46cfa4=_0x4722[_0x4cdb9b];return _0x46cfa4;};'use strict';var Sequelize=require(_0x2472('0x0'));var moment=require(_0x2472('0x1'));module[_0x2472('0x2')]={'name':{'type':Sequelize[_0x2472('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2472('0x4')](_0x2472('0x5'),_0x2472('0x6'),_0x2472('0x7')),'allowNull':![],'defaultValue':_0x2472('0x5')},'savename':{'type':Sequelize[_0x2472('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x2472('0x3')],'defaultValue':_0x2472('0x8')},'type':{'type':Sequelize[_0x2472('0x4')](_0x2472('0x9'),_0x2472('0xa')),'allowNull':![],'defaultValue':_0x2472('0x9')},'reportId':{'type':Sequelize[_0x2472('0xb')](0xb)[_0x2472('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index e44b41c..f33b071 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x388a=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','root','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x706e7e,_0x31bb07){var _0x1dfb2e=function(_0x47cbb8){while(--_0x47cbb8){_0x706e7e['push'](_0x706e7e['shift']());}};_0x1dfb2e(++_0x31bb07);}(_0x388a,0x17e));var _0xa388=function(_0x80c112,_0xae37fc){_0x80c112=_0x80c112-0x0;var _0x23232c=_0x388a[_0x80c112];return _0x23232c;};'use strict';var emlformat=require(_0xa388('0x0'));var rimraf=require(_0xa388('0x1'));var zipdir=require(_0xa388('0x2'));var jsonpatch=require(_0xa388('0x3'));var rp=require(_0xa388('0x4'));var moment=require(_0xa388('0x5'));var BPromise=require(_0xa388('0x6'));var Mustache=require(_0xa388('0x7'));var util=require('util');var path=require(_0xa388('0x8'));var sox=require(_0xa388('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa388('0xa'));var squel=require(_0xa388('0xb'));var crypto=require(_0xa388('0xc'));var jsforce=require(_0xa388('0xd'));var deskjs=require(_0xa388('0xe'));var toCsv=require(_0xa388('0xf'));var querystring=require(_0xa388('0x10'));var Papa=require('papaparse');var Redis=require(_0xa388('0x11'));var authService=require(_0xa388('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa388('0x13'));var hardwareService=require(_0xa388('0x14'));var logger=require(_0xa388('0x15'))('api');var utils=require(_0xa388('0x16'));var config=require(_0xa388('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa388('0x18'))['db'];function respondWithStatusCode(_0x17d47e,_0x2087da){_0x2087da=_0x2087da||0xcc;return function(_0x5f4637){if(_0x5f4637){return _0x17d47e['sendStatus'](_0x2087da);}return _0x17d47e['status'](_0x2087da)[_0xa388('0x19')]();};}function respondWithResult(_0x4c816b,_0x289744){_0x289744=_0x289744||0xc8;return function(_0x388e29){if(_0x388e29){return _0x4c816b[_0xa388('0x1a')](_0x289744)[_0xa388('0x1b')](_0x388e29);}};}function respondWithFilteredResult(_0x1d01ef,_0x3b8699){return function(_0x2ae86f){if(_0x2ae86f){var _0x581364=typeof _0x3b8699['offset']===_0xa388('0x1c')&&typeof _0x3b8699[_0xa388('0x1d')]===_0xa388('0x1c');var _0x2378f0=_0x2ae86f[_0xa388('0x1e')];var _0x215e27=_0x581364?0x0:_0x3b8699[_0xa388('0x1f')];var _0x537a6d=_0x581364?_0x2ae86f[_0xa388('0x1e')]:_0x3b8699[_0xa388('0x1f')]+_0x3b8699[_0xa388('0x1d')];var _0x9be630;if(_0x537a6d>=_0x2378f0){_0x537a6d=_0x2378f0;_0x9be630=0xc8;}else{_0x9be630=0xce;}_0x1d01ef[_0xa388('0x1a')](_0x9be630);return _0x1d01ef['set'](_0xa388('0x20'),_0x215e27+'-'+_0x537a6d+'/'+_0x2378f0)[_0xa388('0x1b')](_0x2ae86f);}return null;};}function patchUpdates(_0x3d4656){return function(_0x3392ec){try{jsonpatch[_0xa388('0x21')](_0x3392ec,_0x3d4656,!![]);}catch(_0x138dc2){return BPromise[_0xa388('0x22')](_0x138dc2);}return _0x3392ec[_0xa388('0x23')]();};}function saveUpdates(_0x2b479f,_0x2c8efb){return function(_0x19552c){if(_0x19552c){return _0x19552c[_0xa388('0x24')](_0x2b479f)[_0xa388('0x25')](function(_0x15ed3e){return _0x15ed3e;});}return null;};}function removeEntity(_0x3ecff2,_0x2ffc35){return function(_0x1e56d4){if(_0x1e56d4){return _0x1e56d4['destroy']()[_0xa388('0x25')](function(){var _0x37d0e6=_0x1e56d4['get']({'plain':!![]});var _0x243ce9=_0xa388('0x26');return db[_0xa388('0x27')][_0xa388('0x28')]({'where':{'type':_0x243ce9,'resourceId':_0x37d0e6['id']}})[_0xa388('0x25')](function(){return _0x1e56d4;});})['then'](function(){_0x3ecff2[_0xa388('0x1a')](0xcc)[_0xa388('0x19')]();});}};}function handleEntityNotFound(_0x220246,_0x1e44da){return function(_0xe9e5e2){if(!_0xe9e5e2){_0x220246['sendStatus'](0x194);}return _0xe9e5e2;};}function handleError(_0xa719d6,_0x5eeccd){_0x5eeccd=_0x5eeccd||0x1f4;return function(_0xe8b4b2){logger[_0xa388('0x29')](_0xe8b4b2[_0xa388('0x2a')]);if(_0xe8b4b2[_0xa388('0x2b')]){delete _0xe8b4b2['name'];}_0xa719d6['status'](_0x5eeccd)[_0xa388('0x2c')](_0xe8b4b2);};}exports[_0xa388('0x2d')]=function(_0x17ff06,_0x129879){var _0x431a59={},_0x168508={},_0x5dc0c6={'count':0x0,'rows':[]};var _0x383b11=_[_0xa388('0x2e')](db[_0xa388('0x2f')][_0xa388('0x30')],function(_0x2f4a9e){return{'name':_0x2f4a9e[_0xa388('0x31')],'type':_0x2f4a9e[_0xa388('0x32')]['key']};});_0x168508[_0xa388('0x33')]=_['map'](_0x383b11,'name');_0x168508[_0xa388('0x34')]=_[_0xa388('0x35')](_0x17ff06[_0xa388('0x34')]);_0x168508[_0xa388('0x36')]=_['intersection'](_0x168508[_0xa388('0x33')],_0x168508['query']);_0x431a59[_0xa388('0x37')]=_[_0xa388('0x38')](_0x168508[_0xa388('0x33')],qs[_0xa388('0x39')](_0x17ff06[_0xa388('0x34')][_0xa388('0x39')]));_0x431a59[_0xa388('0x37')]=_0x431a59[_0xa388('0x37')]['length']?_0x431a59['attributes']:_0x168508[_0xa388('0x33')];if(!_0x17ff06[_0xa388('0x34')][_0xa388('0x3a')](_0xa388('0x3b'))){_0x431a59[_0xa388('0x1d')]=qs[_0xa388('0x1d')](_0x17ff06[_0xa388('0x34')][_0xa388('0x1d')]);_0x431a59[_0xa388('0x1f')]=qs[_0xa388('0x1f')](_0x17ff06[_0xa388('0x34')][_0xa388('0x1f')]);}_0x431a59['order']=qs[_0xa388('0x3c')](_0x17ff06[_0xa388('0x34')][_0xa388('0x3c')]);_0x431a59['where']=qs['filters'](_['pick'](_0x17ff06[_0xa388('0x34')],_0x168508[_0xa388('0x36')]),_0x383b11);if(_0x17ff06[_0xa388('0x34')][_0xa388('0x3d')]){_0x431a59['where']=_[_0xa388('0x3e')](_0x431a59[_0xa388('0x3f')],{'$or':_['map'](_0x383b11,function(_0x19b46d){if(_0x19b46d[_0xa388('0x32')]!==_0xa388('0x40')){var _0x529b7d={};_0x529b7d[_0x19b46d[_0xa388('0x2b')]]={'$like':'%'+_0x17ff06[_0xa388('0x34')][_0xa388('0x3d')]+'%'};return _0x529b7d;}})});}_0x431a59=_[_0xa388('0x3e')]({},_0x431a59,_0x17ff06[_0xa388('0x41')]);var _0x446095={'where':_0x431a59[_0xa388('0x3f')]};return db[_0xa388('0x2f')]['count'](_0x446095)[_0xa388('0x25')](function(_0x1f7b25){_0x5dc0c6['count']=_0x1f7b25;if(_0x17ff06['query'][_0xa388('0x42')]){_0x431a59[_0xa388('0x43')]=[{'all':!![]}];}return db[_0xa388('0x2f')][_0xa388('0x44')](_0x431a59);})['then'](function(_0x34e7df){_0x5dc0c6[_0xa388('0x45')]=_0x34e7df;return _0x5dc0c6;})[_0xa388('0x25')](respondWithFilteredResult(_0x129879,_0x431a59))['catch'](handleError(_0x129879,null));};exports[_0xa388('0x46')]=function(_0x58da0d,_0x2458db){var _0x31484b={'raw':!![],'where':{'id':_0x58da0d[_0xa388('0x47')]['id']}},_0x420442={};_0x420442[_0xa388('0x33')]=_['keys'](db[_0xa388('0x2f')][_0xa388('0x30')]);_0x420442['query']=_[_0xa388('0x35')](_0x58da0d[_0xa388('0x34')]);_0x420442[_0xa388('0x36')]=_[_0xa388('0x38')](_0x420442[_0xa388('0x33')],_0x420442[_0xa388('0x34')]);_0x31484b['attributes']=_['intersection'](_0x420442[_0xa388('0x33')],qs[_0xa388('0x39')](_0x58da0d[_0xa388('0x34')][_0xa388('0x39')]));_0x31484b[_0xa388('0x37')]=_0x31484b[_0xa388('0x37')][_0xa388('0x48')]?_0x31484b[_0xa388('0x37')]:_0x420442[_0xa388('0x33')];if(_0x58da0d[_0xa388('0x34')][_0xa388('0x42')]){_0x31484b['include']=[{'all':!![]}];}_0x31484b=_[_0xa388('0x3e')]({},_0x31484b,_0x58da0d['options']);return db[_0xa388('0x2f')]['find'](_0x31484b)[_0xa388('0x25')](handleEntityNotFound(_0x2458db,null))[_0xa388('0x25')](respondWithResult(_0x2458db,null))[_0xa388('0x49')](handleError(_0x2458db,null));};exports[_0xa388('0x4a')]=function(_0x20e99c,_0x4e7896){return db[_0xa388('0x2f')][_0xa388('0x4a')](_0x20e99c[_0xa388('0x4b')],{})[_0xa388('0x25')](function(_0x51ab75){var _0x5dcaa8=_0x20e99c[_0xa388('0x4c')]['get']({'plain':!![]});if(!_0x5dcaa8)throw new Error(_0xa388('0x4d'));if(_0x5dcaa8[_0xa388('0x4e')]===_0xa388('0x4c')){var _0x3b8abc=_0x51ab75[_0xa388('0x4f')]({'plain':!![]});var _0x1ce8c3=_0xa388('0x26');return db[_0xa388('0x50')][_0xa388('0x51')]({'where':{'name':_0x1ce8c3,'userProfileId':_0x5dcaa8[_0xa388('0x52')]},'raw':!![]})[_0xa388('0x25')](function(_0x1a28fd){if(_0x1a28fd&&_0x1a28fd[_0xa388('0x53')]===0x0){return db[_0xa388('0x27')][_0xa388('0x4a')]({'name':_0x3b8abc[_0xa388('0x2b')],'resourceId':_0x3b8abc['id'],'type':_0x1a28fd['name'],'sectionId':_0x1a28fd['id']},{})[_0xa388('0x25')](function(){return _0x51ab75;});}else{return _0x51ab75;}})['catch'](function(_0x2b0709){logger[_0xa388('0x29')](_0xa388('0x54'),_0x2b0709);throw _0x2b0709;});}return _0x51ab75;})[_0xa388('0x25')](respondWithResult(_0x4e7896,0xc9))[_0xa388('0x49')](handleError(_0x4e7896,null));};exports[_0xa388('0x24')]=function(_0x5491ca,_0xde0faf){if(_0x5491ca[_0xa388('0x4b')]['id']){delete _0x5491ca[_0xa388('0x4b')]['id'];}return db[_0xa388('0x2f')][_0xa388('0x51')]({'where':{'id':_0x5491ca['params']['id']}})[_0xa388('0x25')](handleEntityNotFound(_0xde0faf,null))['then'](saveUpdates(_0x5491ca[_0xa388('0x4b')],null))['then'](respondWithResult(_0xde0faf,null))[_0xa388('0x49')](handleError(_0xde0faf,null));};exports[_0xa388('0x28')]=function(_0x4eb570,_0x3cfcb7){return db[_0xa388('0x2f')][_0xa388('0x51')]({'where':{'id':_0x4eb570[_0xa388('0x47')]['id']}})[_0xa388('0x25')](handleEntityNotFound(_0x3cfcb7,null))['then'](removeEntity(_0x3cfcb7,null))[_0xa388('0x49')](handleError(_0x3cfcb7,null));};exports[_0xa388('0x55')]=function(_0x4f81e9,_0x1e7068,_0x35c437){return db[_0xa388('0x2f')]['find']({'where':{'id':_0x4f81e9[_0xa388('0x47')]['id']},'attributes':['name',_0xa388('0x56'),'savename',_0xa388('0x57')],'raw':!![]})[_0xa388('0x25')](handleEntityNotFound(_0x1e7068,null))[_0xa388('0x25')](function(_0x399790){if(_0x399790){if(!fs[_0xa388('0x58')](path['join'](config[_0xa388('0x59')],'server/files/reports',_0x399790[_0xa388('0x5a')]))){throw new db[(_0xa388('0x5b'))][(_0xa388('0x5c'))](_0xa388('0x5d'));}if(_0x4f81e9[_0xa388('0x34')][_0xa388('0x5e')]){return _0x1e7068['sendStatus'](0xc8);}return _0x1e7068[_0xa388('0x55')](path['join'](config[_0xa388('0x59')],_0xa388('0x5f'),_0x399790[_0xa388('0x5a')]),util[_0xa388('0x60')](_0xa388('0x61'),_0x399790[_0xa388('0x56')]||_0x399790[_0xa388('0x2b')],_0x399790[_0xa388('0x57')]['toLowerCase']()));}})[_0xa388('0x49')](handleError(_0x1e7068,null));};
\ No newline at end of file
+var _0x5d89=['path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','end','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','eml-format','rimraf','request-promise','moment','mustache','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5d89,0x1e9));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x95d8('0x0'));var rimraf=require(_0x95d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x95d8('0x2'));var moment=require(_0x95d8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x95d8('0x4'));var util=require(_0x95d8('0x5'));var path=require(_0x95d8('0x6'));var sox=require(_0x95d8('0x7'));var csv=require(_0x95d8('0x8'));var ejs=require(_0x95d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95d8('0xa'));var squel=require(_0x95d8('0xb'));var crypto=require(_0x95d8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x95d8('0x8'));var querystring=require(_0x95d8('0xd'));var Papa=require(_0x95d8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x95d8('0xf'));var as=require(_0x95d8('0x10'));var hardwareService=require(_0x95d8('0x11'));var logger=require(_0x95d8('0x12'))('api');var utils=require(_0x95d8('0x13'));var config=require(_0x95d8('0x14'));var licenseUtil=require(_0x95d8('0x15'));var db=require(_0x95d8('0x16'))['db'];function respondWithStatusCode(_0x4e9972,_0x5cf2fe){_0x5cf2fe=_0x5cf2fe||0xcc;return function(_0x255382){if(_0x255382){return _0x4e9972['sendStatus'](_0x5cf2fe);}return _0x4e9972['status'](_0x5cf2fe)['end']();};}function respondWithResult(_0x23ede8,_0x4adc31){_0x4adc31=_0x4adc31||0xc8;return function(_0x2326bb){if(_0x2326bb){return _0x23ede8[_0x95d8('0x17')](_0x4adc31)[_0x95d8('0x18')](_0x2326bb);}};}function respondWithFilteredResult(_0x52a119,_0x1b3f26){return function(_0x275a83){if(_0x275a83){var _0x4850c2=typeof _0x1b3f26[_0x95d8('0x19')]===_0x95d8('0x1a')&&typeof _0x1b3f26['limit']===_0x95d8('0x1a');var _0x17f69d=_0x275a83['count'];var _0x14f9ff=_0x4850c2?0x0:_0x1b3f26[_0x95d8('0x19')];var _0x4ab61e=_0x4850c2?_0x275a83[_0x95d8('0x1b')]:_0x1b3f26[_0x95d8('0x19')]+_0x1b3f26[_0x95d8('0x1c')];var _0x286e57;if(_0x4ab61e>=_0x17f69d){_0x4ab61e=_0x17f69d;_0x286e57=0xc8;}else{_0x286e57=0xce;}_0x52a119[_0x95d8('0x17')](_0x286e57);return _0x52a119[_0x95d8('0x1d')](_0x95d8('0x1e'),_0x14f9ff+'-'+_0x4ab61e+'/'+_0x17f69d)[_0x95d8('0x18')](_0x275a83);}return null;};}function patchUpdates(_0x45a763){return function(_0x49d9da){try{jsonpatch[_0x95d8('0x1f')](_0x49d9da,_0x45a763,!![]);}catch(_0x10b11f){return BPromise[_0x95d8('0x20')](_0x10b11f);}return _0x49d9da[_0x95d8('0x21')]();};}function saveUpdates(_0x1b9735,_0x7e0444){return function(_0x502c58){if(_0x502c58){return _0x502c58[_0x95d8('0x22')](_0x1b9735)[_0x95d8('0x23')](function(_0x276e18){return _0x276e18;});}return null;};}function removeEntity(_0x3ed960,_0x6ea91b){return function(_0x900539){if(_0x900539){return _0x900539[_0x95d8('0x24')]()['then'](function(){var _0x78ad19=_0x900539[_0x95d8('0x25')]({'plain':!![]});var _0x1996ca='ExtractedReports';return db['UserProfileResource'][_0x95d8('0x24')]({'where':{'type':_0x1996ca,'resourceId':_0x78ad19['id']}})[_0x95d8('0x23')](function(){return _0x900539;});})[_0x95d8('0x23')](function(){_0x3ed960['status'](0xcc)[_0x95d8('0x26')]();});}};}function handleEntityNotFound(_0x54fa64,_0x2ba6d9){return function(_0x1a1dbc){if(!_0x1a1dbc){_0x54fa64[_0x95d8('0x27')](0x194);}return _0x1a1dbc;};}function handleError(_0x5b28da,_0x194e54){_0x194e54=_0x194e54||0x1f4;return function(_0x7cfc74){logger[_0x95d8('0x28')](_0x7cfc74[_0x95d8('0x29')]);if(_0x7cfc74[_0x95d8('0x2a')]){delete _0x7cfc74[_0x95d8('0x2a')];}_0x5b28da[_0x95d8('0x17')](_0x194e54)[_0x95d8('0x2b')](_0x7cfc74);};}exports[_0x95d8('0x2c')]=function(_0xe9b10e,_0x4c981e){var _0x20fe0b={},_0x228d65={},_0x36977e={'count':0x0,'rows':[]};var _0xfcfd00=_[_0x95d8('0x2d')](db[_0x95d8('0x2e')][_0x95d8('0x2f')],function(_0x1fe92f){return{'name':_0x1fe92f[_0x95d8('0x30')],'type':_0x1fe92f[_0x95d8('0x31')][_0x95d8('0x32')]};});_0x228d65[_0x95d8('0x33')]=_[_0x95d8('0x2d')](_0xfcfd00,'name');_0x228d65[_0x95d8('0x34')]=_[_0x95d8('0x35')](_0xe9b10e[_0x95d8('0x34')]);_0x228d65['filters']=_[_0x95d8('0x36')](_0x228d65[_0x95d8('0x33')],_0x228d65[_0x95d8('0x34')]);_0x20fe0b['attributes']=_[_0x95d8('0x36')](_0x228d65[_0x95d8('0x33')],qs[_0x95d8('0x37')](_0xe9b10e[_0x95d8('0x34')]['fields']));_0x20fe0b[_0x95d8('0x38')]=_0x20fe0b[_0x95d8('0x38')][_0x95d8('0x39')]?_0x20fe0b[_0x95d8('0x38')]:_0x228d65[_0x95d8('0x33')];if(!_0xe9b10e['query']['hasOwnProperty'](_0x95d8('0x3a'))){_0x20fe0b[_0x95d8('0x1c')]=qs[_0x95d8('0x1c')](_0xe9b10e[_0x95d8('0x34')]['limit']);_0x20fe0b[_0x95d8('0x19')]=qs[_0x95d8('0x19')](_0xe9b10e['query']['offset']);}_0x20fe0b[_0x95d8('0x3b')]=qs[_0x95d8('0x3c')](_0xe9b10e[_0x95d8('0x34')][_0x95d8('0x3c')]);_0x20fe0b[_0x95d8('0x3d')]=qs[_0x95d8('0x3e')](_['pick'](_0xe9b10e[_0x95d8('0x34')],_0x228d65['filters']),_0xfcfd00);if(_0xe9b10e[_0x95d8('0x34')][_0x95d8('0x3f')]){_0x20fe0b[_0x95d8('0x3d')]=_[_0x95d8('0x40')](_0x20fe0b[_0x95d8('0x3d')],{'$or':_['map'](_0xfcfd00,function(_0x6653d0){if(_0x6653d0[_0x95d8('0x31')]!==_0x95d8('0x41')){var _0x1c38e9={};_0x1c38e9[_0x6653d0['name']]={'$like':'%'+_0xe9b10e[_0x95d8('0x34')][_0x95d8('0x3f')]+'%'};return _0x1c38e9;}})});}_0x20fe0b=_[_0x95d8('0x40')]({},_0x20fe0b,_0xe9b10e[_0x95d8('0x42')]);var _0x501fde={'where':_0x20fe0b['where']};return db[_0x95d8('0x2e')][_0x95d8('0x1b')](_0x501fde)[_0x95d8('0x23')](function(_0x3effbf){_0x36977e[_0x95d8('0x1b')]=_0x3effbf;if(_0xe9b10e[_0x95d8('0x34')]['includeAll']){_0x20fe0b[_0x95d8('0x43')]=[{'all':!![]}];}return db[_0x95d8('0x2e')][_0x95d8('0x44')](_0x20fe0b);})[_0x95d8('0x23')](function(_0x4fc463){_0x36977e[_0x95d8('0x45')]=_0x4fc463;return _0x36977e;})[_0x95d8('0x23')](respondWithFilteredResult(_0x4c981e,_0x20fe0b))[_0x95d8('0x46')](handleError(_0x4c981e,null));};exports[_0x95d8('0x47')]=function(_0x2612be,_0x1d5f1a){var _0x5dcc49={'raw':!![],'where':{'id':_0x2612be[_0x95d8('0x48')]['id']}},_0x222d11={};_0x222d11[_0x95d8('0x33')]=_['keys'](db[_0x95d8('0x2e')]['rawAttributes']);_0x222d11[_0x95d8('0x34')]=_[_0x95d8('0x35')](_0x2612be[_0x95d8('0x34')]);_0x222d11['filters']=_[_0x95d8('0x36')](_0x222d11[_0x95d8('0x33')],_0x222d11[_0x95d8('0x34')]);_0x5dcc49['attributes']=_[_0x95d8('0x36')](_0x222d11[_0x95d8('0x33')],qs['fields'](_0x2612be['query']['fields']));_0x5dcc49['attributes']=_0x5dcc49[_0x95d8('0x38')]['length']?_0x5dcc49[_0x95d8('0x38')]:_0x222d11[_0x95d8('0x33')];if(_0x2612be[_0x95d8('0x34')][_0x95d8('0x49')]){_0x5dcc49['include']=[{'all':!![]}];}_0x5dcc49=_[_0x95d8('0x40')]({},_0x5dcc49,_0x2612be[_0x95d8('0x42')]);return db[_0x95d8('0x2e')][_0x95d8('0x4a')](_0x5dcc49)[_0x95d8('0x23')](handleEntityNotFound(_0x1d5f1a,null))[_0x95d8('0x23')](respondWithResult(_0x1d5f1a,null))[_0x95d8('0x46')](handleError(_0x1d5f1a,null));};exports[_0x95d8('0x4b')]=function(_0x51b159,_0x29f6a5){return db['AnalyticExtractedReport'][_0x95d8('0x4b')](_0x51b159[_0x95d8('0x4c')],{})[_0x95d8('0x23')](function(_0x3e340e){var _0x47e252=_0x51b159[_0x95d8('0x4d')][_0x95d8('0x25')]({'plain':!![]});if(!_0x47e252)throw new Error(_0x95d8('0x4e'));if(_0x47e252[_0x95d8('0x4f')]===_0x95d8('0x4d')){var _0x4b4de7=_0x3e340e['get']({'plain':!![]});var _0x1a2a20=_0x95d8('0x50');return db['UserProfileSection'][_0x95d8('0x4a')]({'where':{'name':_0x1a2a20,'userProfileId':_0x47e252[_0x95d8('0x51')]},'raw':!![]})['then'](function(_0x17b185){if(_0x17b185&&_0x17b185[_0x95d8('0x52')]===0x0){return db[_0x95d8('0x53')][_0x95d8('0x4b')]({'name':_0x4b4de7[_0x95d8('0x2a')],'resourceId':_0x4b4de7['id'],'type':_0x17b185[_0x95d8('0x2a')],'sectionId':_0x17b185['id']},{})[_0x95d8('0x23')](function(){return _0x3e340e;});}else{return _0x3e340e;}})[_0x95d8('0x46')](function(_0x5ba290){logger[_0x95d8('0x28')](_0x95d8('0x54'),_0x5ba290);throw _0x5ba290;});}return _0x3e340e;})['then'](respondWithResult(_0x29f6a5,0xc9))[_0x95d8('0x46')](handleError(_0x29f6a5,null));};exports[_0x95d8('0x22')]=function(_0x43309c,_0x397f07){if(_0x43309c[_0x95d8('0x4c')]['id']){delete _0x43309c[_0x95d8('0x4c')]['id'];}return db[_0x95d8('0x2e')][_0x95d8('0x4a')]({'where':{'id':_0x43309c[_0x95d8('0x48')]['id']}})[_0x95d8('0x23')](handleEntityNotFound(_0x397f07,null))[_0x95d8('0x23')](saveUpdates(_0x43309c[_0x95d8('0x4c')],null))['then'](respondWithResult(_0x397f07,null))[_0x95d8('0x46')](handleError(_0x397f07,null));};exports[_0x95d8('0x24')]=function(_0x4caf8b,_0x433ba6){return db[_0x95d8('0x2e')][_0x95d8('0x4a')]({'where':{'id':_0x4caf8b['params']['id']}})[_0x95d8('0x23')](handleEntityNotFound(_0x433ba6,null))['then'](removeEntity(_0x433ba6,null))[_0x95d8('0x46')](handleError(_0x433ba6,null));};exports[_0x95d8('0x55')]=function(_0x155073,_0x67f929,_0xbfeeb5){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x155073[_0x95d8('0x48')]['id']},'attributes':[_0x95d8('0x2a'),_0x95d8('0x56'),_0x95d8('0x57'),_0x95d8('0x58')],'raw':!![]})[_0x95d8('0x23')](handleEntityNotFound(_0x67f929,null))[_0x95d8('0x23')](function(_0x101e74){if(_0x101e74){if(!fs[_0x95d8('0x59')](path['join'](config[_0x95d8('0x5a')],_0x95d8('0x5b'),_0x101e74[_0x95d8('0x57')]))){throw new db[(_0x95d8('0x5c'))][(_0x95d8('0x5d'))](_0x95d8('0x5e'));}if(_0x155073[_0x95d8('0x34')][_0x95d8('0x5f')]){return _0x67f929[_0x95d8('0x27')](0xc8);}return _0x67f929['download'](path[_0x95d8('0x60')](config[_0x95d8('0x5a')],'server/files/reports',_0x101e74[_0x95d8('0x57')]),util[_0x95d8('0x61')](_0x95d8('0x62'),_0x101e74['basename']||_0x101e74[_0x95d8('0x2a')],_0x101e74[_0x95d8('0x58')]['toLowerCase']()));}})[_0x95d8('0x46')](handleError(_0x67f929,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index ff01000..ecabe0b 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xacde=['../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x34eccb,_0x3a9083){var _0x15f1f6=function(_0x454bf0){while(--_0x454bf0){_0x34eccb['push'](_0x34eccb['shift']());}};_0x15f1f6(++_0x3a9083);}(_0xacde,0xc5));var _0xeacd=function(_0x4be687,_0xe630cc){_0x4be687=_0x4be687-0x0;var _0x42156f=_0xacde[_0x4be687];return _0x42156f;};'use strict';var _=require(_0xeacd('0x0'));var util=require(_0xeacd('0x1'));var logger=require(_0xeacd('0x2'))(_0xeacd('0x3'));var moment=require(_0xeacd('0x4'));var BPromise=require(_0xeacd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeacd('0x6'));var rimraf=require('rimraf');var config=require(_0xeacd('0x7'));var attributes=require(_0xeacd('0x8'));module['exports']=function(_0x42cc59,_0x1727ba){return _0x42cc59[_0xeacd('0x9')](_0xeacd('0xa'),attributes,{'tableName':_0xeacd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1790=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x4bd9bd,_0x2fd047){var _0x1ebbd5=function(_0x1b8304){while(--_0x1b8304){_0x4bd9bd['push'](_0x4bd9bd['shift']());}};_0x1ebbd5(++_0x2fd047);}(_0x1790,0xd0));var _0x0179=function(_0x544d9a,_0x1dd46e){_0x544d9a=_0x544d9a-0x0;var _0x31cb96=_0x1790[_0x544d9a];return _0x31cb96;};'use strict';var _=require(_0x0179('0x0'));var util=require('util');var logger=require(_0x0179('0x1'))(_0x0179('0x2'));var moment=require('moment');var BPromise=require(_0x0179('0x3'));var rp=require(_0x0179('0x4'));var fs=require('fs');var path=require(_0x0179('0x5'));var rimraf=require(_0x0179('0x6'));var config=require(_0x0179('0x7'));var attributes=require(_0x0179('0x8'));module[_0x0179('0x9')]=function(_0x48b7c7,_0x4c4e36){return _0x48b7c7[_0x0179('0xa')](_0x0179('0xb'),attributes,{'tableName':_0x0179('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 04a97c1..f25a6e6 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6fa8=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x364048,_0x34dea3){var _0x591678=function(_0x239c0a){while(--_0x239c0a){_0x364048['push'](_0x364048['shift']());}};_0x591678(++_0x34dea3);}(_0x6fa8,0x79));var _0x86fa=function(_0x1ef48d,_0x203c73){_0x1ef48d=_0x1ef48d-0x0;var _0x450096=_0x6fa8[_0x1ef48d];return _0x450096;};'use strict';var _=require('lodash');var util=require(_0x86fa('0x0'));var moment=require(_0x86fa('0x1'));var BPromise=require(_0x86fa('0x2'));var rs=require(_0x86fa('0x3'));var fs=require('fs');var Redis=require(_0x86fa('0x4'));var db=require(_0x86fa('0x5'))['db'];var utils=require(_0x86fa('0x6'));var logger=require(_0x86fa('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x86fa('0x8'));var client=jayson[_0x86fa('0x9')][_0x86fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x509e45,_0x1f0e92,_0x34b993){return new BPromise(function(_0x20eec3,_0x2de438){return client[_0x86fa('0xb')](_0x509e45,_0x34b993)['then'](function(_0x2bd4bc){logger[_0x86fa('0xc')](_0x86fa('0xd'),_0x1f0e92,_0x86fa('0xe'));logger['debug'](_0x86fa('0xf'),_0x1f0e92,_0x86fa('0xe'),JSON['stringify'](_0x2bd4bc));if(_0x2bd4bc[_0x86fa('0x10')]){if(_0x2bd4bc[_0x86fa('0x10')][_0x86fa('0x11')]===0x1f4){logger[_0x86fa('0x10')](_0x86fa('0xd'),_0x1f0e92,_0x2bd4bc[_0x86fa('0x10')][_0x86fa('0x12')]);return _0x2de438(_0x2bd4bc['error'][_0x86fa('0x12')]);}logger[_0x86fa('0x10')](_0x86fa('0xd'),_0x1f0e92,_0x2bd4bc['error'][_0x86fa('0x12')]);return _0x20eec3(_0x2bd4bc[_0x86fa('0x10')][_0x86fa('0x12')]);}else{logger[_0x86fa('0xc')](_0x86fa('0xd'),_0x1f0e92,_0x86fa('0xe'));_0x20eec3(_0x2bd4bc[_0x86fa('0x13')]['message']);}})[_0x86fa('0x14')](function(_0x4ae13c){logger[_0x86fa('0x10')](_0x86fa('0xd'),_0x1f0e92,_0x4ae13c);_0x2de438(_0x4ae13c);});});}
\ No newline at end of file
+var _0x9280=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x2e180b,_0x1b08c7){var _0x59e9bb=function(_0x341602){while(--_0x341602){_0x2e180b['push'](_0x2e180b['shift']());}};_0x59e9bb(++_0x1b08c7);}(_0x9280,0x113));var _0x0928=function(_0x178e27,_0x2dcbde){_0x178e27=_0x178e27-0x0;var _0x582375=_0x9280[_0x178e27];return _0x582375;};'use strict';var _=require(_0x0928('0x0'));var util=require(_0x0928('0x1'));var moment=require(_0x0928('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0928('0x3'));var db=require(_0x0928('0x4'))['db'];var utils=require(_0x0928('0x5'));var logger=require(_0x0928('0x6'))(_0x0928('0x7'));var config=require(_0x0928('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0928('0x9')][_0x0928('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51404f,_0x1c26c4,_0x47a28c){return new BPromise(function(_0x1f60a5,_0x47597d){return client['request'](_0x51404f,_0x47a28c)[_0x0928('0xb')](function(_0x15861b){logger['info'](_0x0928('0xc'),_0x1c26c4,'request\x20sent');logger[_0x0928('0xd')](_0x0928('0xe'),_0x1c26c4,_0x0928('0xf'),JSON[_0x0928('0x10')](_0x15861b));if(_0x15861b[_0x0928('0x11')]){if(_0x15861b[_0x0928('0x11')][_0x0928('0x12')]===0x1f4){logger[_0x0928('0x11')](_0x0928('0xc'),_0x1c26c4,_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);return _0x47597d(_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);}logger['error'](_0x0928('0xc'),_0x1c26c4,_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);return _0x1f60a5(_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);}else{logger['info'](_0x0928('0xc'),_0x1c26c4,_0x0928('0xf'));_0x1f60a5(_0x15861b['result'][_0x0928('0x13')]);}})['catch'](function(_0x3700d6){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1c26c4,_0x3700d6);_0x47597d(_0x3700d6);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 9153d6c..2c69491 100644
--- a/server/api/analyticExtractedReport/index.js
+++ b/server/api/analyticExtractedReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe641=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x56d1ed,_0x237e84){var _0x1b282b=function(_0x56648c){while(--_0x56648c){_0x56d1ed['push'](_0x56d1ed['shift']());}};_0x1b282b(++_0x237e84);}(_0xe641,0xea));var _0x1e64=function(_0x30f583,_0x42b6a8){_0x30f583=_0x30f583-0x0;var _0xf24311=_0xe641[_0x30f583];return _0xf24311;};'use strict';var multer=require(_0x1e64('0x0'));var util=require(_0x1e64('0x1'));var path=require(_0x1e64('0x2'));var timeout=require(_0x1e64('0x3'));var express=require(_0x1e64('0x4'));var router=express[_0x1e64('0x5')]();var fs_extra=require(_0x1e64('0x6'));var auth=require(_0x1e64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1e64('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x1e64('0x9')]('/',auth[_0x1e64('0xa')](),controller[_0x1e64('0xb')]);router[_0x1e64('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1e64('0xc')]);router[_0x1e64('0x9')](_0x1e64('0xd'),auth[_0x1e64('0xa')](),controller[_0x1e64('0xe')]);router[_0x1e64('0xf')]('/',auth[_0x1e64('0xa')](),controller['create']);router[_0x1e64('0x10')](_0x1e64('0x11'),auth[_0x1e64('0xa')](),controller[_0x1e64('0x12')]);router[_0x1e64('0x13')](_0x1e64('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf4e7=['Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5b7b22,_0x5bc479){var _0x53dc9d=function(_0x5108c0){while(--_0x5108c0){_0x5b7b22['push'](_0x5b7b22['shift']());}};_0x53dc9d(++_0x5bc479);}(_0xf4e7,0x154));var _0x7f4e=function(_0x5f30b9,_0x196dad){_0x5f30b9=_0x5f30b9-0x0;var _0x3e8ee9=_0xf4e7[_0x5f30b9];return _0x3e8ee9;};'use strict';var multer=require(_0x7f4e('0x0'));var util=require(_0x7f4e('0x1'));var path=require(_0x7f4e('0x2'));var timeout=require(_0x7f4e('0x3'));var express=require(_0x7f4e('0x4'));var router=express[_0x7f4e('0x5')]();var fs_extra=require(_0x7f4e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f4e('0x7'));var controller=require(_0x7f4e('0x8'));router[_0x7f4e('0x9')]('/',auth[_0x7f4e('0xa')](),controller[_0x7f4e('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7f4e('0xc')]);router[_0x7f4e('0x9')](_0x7f4e('0xd'),auth[_0x7f4e('0xa')](),controller[_0x7f4e('0xe')]);router[_0x7f4e('0xf')]('/',auth[_0x7f4e('0xa')](),controller[_0x7f4e('0x10')]);router[_0x7f4e('0x11')](_0x7f4e('0x12'),auth[_0x7f4e('0xa')](),controller[_0x7f4e('0x13')]);router[_0x7f4e('0x14')](_0x7f4e('0x12'),auth[_0x7f4e('0xa')](),controller[_0x7f4e('0x15')]);module[_0x7f4e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c7ed436..21f9e6f 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd03f=['STRING','BOOLEAN','sequelize','exports'];(function(_0x334599,_0x4b1cfa){var _0x4cdff2=function(_0x297be7){while(--_0x297be7){_0x334599['push'](_0x334599['shift']());}};_0x4cdff2(++_0x4b1cfa);}(_0xd03f,0x16e));var _0xfd03=function(_0xe391aa,_0x255528){_0xe391aa=_0xe391aa-0x0;var _0x793c4d=_0xd03f[_0xe391aa];return _0x793c4d;};'use strict';var Sequelize=require(_0xfd03('0x0'));module[_0xfd03('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xfd03('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xfd03('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfd03('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x59ad=['BOOLEAN','exports','TEXT','STRING'];(function(_0xe650fa,_0x28e061){var _0x21f96b=function(_0x167c65){while(--_0x167c65){_0xe650fa['push'](_0xe650fa['shift']());}};_0x21f96b(++_0x28e061);}(_0x59ad,0x1bd));var _0xd59a=function(_0x6830be,_0x5817ec){_0x6830be=_0x6830be-0x0;var _0x2127af=_0x59ad[_0x6830be];return _0x2127af;};'use strict';var Sequelize=require('sequelize');module[_0xd59a('0x0')]={'field':{'type':Sequelize[_0xd59a('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd59a('0x2')]},'groupBy':{'type':Sequelize[_0xd59a('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xd59a('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index bd2664d..990e9a6 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.controller.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a49=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','AnalyticFieldReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x5a49,0x1e7));var _0x95a4=function(_0x329a91,_0x2b1d8f){_0x329a91=_0x329a91-0x0;var _0x3294a8=_0x5a49[_0x329a91];return _0x3294a8;};'use strict';var emlformat=require(_0x95a4('0x0'));var rimraf=require(_0x95a4('0x1'));var zipdir=require(_0x95a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x95a4('0x4'));var util=require(_0x95a4('0x5'));var path=require(_0x95a4('0x6'));var sox=require(_0x95a4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95a4('0x8'));var _=require(_0x95a4('0x9'));var squel=require('squel');var crypto=require(_0x95a4('0xa'));var jsforce=require(_0x95a4('0xb'));var deskjs=require(_0x95a4('0xc'));var toCsv=require(_0x95a4('0xd'));var querystring=require(_0x95a4('0xe'));var Papa=require(_0x95a4('0xf'));var Redis=require(_0x95a4('0x10'));var authService=require(_0x95a4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x95a4('0x12'));var hardwareService=require(_0x95a4('0x13'));var logger=require('../../config/logger')(_0x95a4('0x14'));var utils=require(_0x95a4('0x15'));var config=require(_0x95a4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x95a4('0x17'))['db'];function respondWithStatusCode(_0x44073d,_0x2ee8b1){_0x2ee8b1=_0x2ee8b1||0xcc;return function(_0x2095d9){if(_0x2095d9){return _0x44073d[_0x95a4('0x18')](_0x2ee8b1);}return _0x44073d[_0x95a4('0x19')](_0x2ee8b1)['end']();};}function respondWithResult(_0x25b9a1,_0x496c7b){_0x496c7b=_0x496c7b||0xc8;return function(_0x4656cf){if(_0x4656cf){return _0x25b9a1[_0x95a4('0x19')](_0x496c7b)[_0x95a4('0x1a')](_0x4656cf);}};}function respondWithFilteredResult(_0x34f7ce,_0x11ca6c){return function(_0x31749e){if(_0x31749e){var _0x4fae15=typeof _0x11ca6c[_0x95a4('0x1b')]===_0x95a4('0x1c')&&typeof _0x11ca6c[_0x95a4('0x1d')]===_0x95a4('0x1c');var _0x2a38d0=_0x31749e[_0x95a4('0x1e')];var _0x2dad27=_0x4fae15?0x0:_0x11ca6c[_0x95a4('0x1b')];var _0x2ae7d6=_0x4fae15?_0x31749e['count']:_0x11ca6c[_0x95a4('0x1b')]+_0x11ca6c[_0x95a4('0x1d')];var _0x425807;if(_0x2ae7d6>=_0x2a38d0){_0x2ae7d6=_0x2a38d0;_0x425807=0xc8;}else{_0x425807=0xce;}_0x34f7ce[_0x95a4('0x19')](_0x425807);return _0x34f7ce[_0x95a4('0x1f')](_0x95a4('0x20'),_0x2dad27+'-'+_0x2ae7d6+'/'+_0x2a38d0)['json'](_0x31749e);}return null;};}function patchUpdates(_0x46a4dc){return function(_0x20b932){try{jsonpatch[_0x95a4('0x21')](_0x20b932,_0x46a4dc,!![]);}catch(_0x2c4127){return BPromise[_0x95a4('0x22')](_0x2c4127);}return _0x20b932[_0x95a4('0x23')]();};}function saveUpdates(_0x586db8,_0x3ab2ad){return function(_0x68f88){if(_0x68f88){return _0x68f88[_0x95a4('0x24')](_0x586db8)[_0x95a4('0x25')](function(_0x441d72){return _0x441d72;});}return null;};}function removeEntity(_0x589d73,_0x504478){return function(_0x16575b){if(_0x16575b){return _0x16575b[_0x95a4('0x26')]()[_0x95a4('0x25')](function(){_0x589d73[_0x95a4('0x19')](0xcc)[_0x95a4('0x27')]();});}};}function handleEntityNotFound(_0x57ad12,_0x48ba44){return function(_0x1dc2b9){if(!_0x1dc2b9){_0x57ad12[_0x95a4('0x18')](0x194);}return _0x1dc2b9;};}function handleError(_0x3a5ed3,_0x31524b){_0x31524b=_0x31524b||0x1f4;return function(_0x2cd049){logger[_0x95a4('0x28')](_0x2cd049['stack']);if(_0x2cd049[_0x95a4('0x29')]){delete _0x2cd049['name'];}_0x3a5ed3[_0x95a4('0x19')](_0x31524b)[_0x95a4('0x2a')](_0x2cd049);};}exports[_0x95a4('0x2b')]=function(_0x42fbab,_0xbd0056){var _0x5a591d={},_0x16123b={},_0x57526a={'count':0x0,'rows':[]};var _0x34f0ef=_[_0x95a4('0x2c')](db[_0x95a4('0x2d')]['rawAttributes'],function(_0x3e5f8b){return{'name':_0x3e5f8b[_0x95a4('0x2e')],'type':_0x3e5f8b[_0x95a4('0x2f')][_0x95a4('0x30')]};});_0x16123b['model']=_[_0x95a4('0x2c')](_0x34f0ef,_0x95a4('0x29'));_0x16123b[_0x95a4('0x31')]=_[_0x95a4('0x32')](_0x42fbab[_0x95a4('0x31')]);_0x16123b[_0x95a4('0x33')]=_[_0x95a4('0x34')](_0x16123b[_0x95a4('0x35')],_0x16123b[_0x95a4('0x31')]);_0x5a591d[_0x95a4('0x36')]=_['intersection'](_0x16123b[_0x95a4('0x35')],qs[_0x95a4('0x37')](_0x42fbab[_0x95a4('0x31')][_0x95a4('0x37')]));_0x5a591d[_0x95a4('0x36')]=_0x5a591d[_0x95a4('0x36')][_0x95a4('0x38')]?_0x5a591d[_0x95a4('0x36')]:_0x16123b['model'];if(!_0x42fbab[_0x95a4('0x31')][_0x95a4('0x39')](_0x95a4('0x3a'))){_0x5a591d[_0x95a4('0x1d')]=qs['limit'](_0x42fbab[_0x95a4('0x31')]['limit']);_0x5a591d[_0x95a4('0x1b')]=qs[_0x95a4('0x1b')](_0x42fbab['query'][_0x95a4('0x1b')]);}_0x5a591d[_0x95a4('0x3b')]=qs['sort'](_0x42fbab[_0x95a4('0x31')][_0x95a4('0x3c')]);_0x5a591d['where']=qs[_0x95a4('0x33')](_[_0x95a4('0x3d')](_0x42fbab[_0x95a4('0x31')],_0x16123b[_0x95a4('0x33')]),_0x34f0ef);if(_0x42fbab['query']['filter']){_0x5a591d['where']=_[_0x95a4('0x3e')](_0x5a591d[_0x95a4('0x3f')],{'$or':_['map'](_0x34f0ef,function(_0x4d1108){if(_0x4d1108[_0x95a4('0x2f')]!==_0x95a4('0x40')){var _0x36404a={};_0x36404a[_0x4d1108['name']]={'$like':'%'+_0x42fbab[_0x95a4('0x31')][_0x95a4('0x41')]+'%'};return _0x36404a;}})});}_0x5a591d=_['merge']({},_0x5a591d,_0x42fbab[_0x95a4('0x42')]);var _0x96cbbc={'where':_0x5a591d[_0x95a4('0x3f')]};return db[_0x95a4('0x2d')][_0x95a4('0x1e')](_0x96cbbc)[_0x95a4('0x25')](function(_0x45f8e2){_0x57526a['count']=_0x45f8e2;if(_0x42fbab[_0x95a4('0x31')][_0x95a4('0x43')]){_0x5a591d[_0x95a4('0x44')]=[{'all':!![]}];}return db[_0x95a4('0x2d')][_0x95a4('0x45')](_0x5a591d);})[_0x95a4('0x25')](function(_0x3a1970){_0x57526a['rows']=_0x3a1970;return _0x57526a;})[_0x95a4('0x25')](respondWithFilteredResult(_0xbd0056,_0x5a591d))['catch'](handleError(_0xbd0056,null));};exports[_0x95a4('0x46')]=function(_0x544db5,_0x18d98f){var _0x40b7cb={'raw':![],'where':{'id':_0x544db5[_0x95a4('0x47')]['id']}},_0xd40964={};_0xd40964[_0x95a4('0x35')]=_['keys'](db[_0x95a4('0x2d')][_0x95a4('0x48')]);_0xd40964[_0x95a4('0x31')]=_[_0x95a4('0x32')](_0x544db5['query']);_0xd40964[_0x95a4('0x33')]=_[_0x95a4('0x34')](_0xd40964[_0x95a4('0x35')],_0xd40964[_0x95a4('0x31')]);_0x40b7cb[_0x95a4('0x36')]=_['intersection'](_0xd40964[_0x95a4('0x35')],qs[_0x95a4('0x37')](_0x544db5[_0x95a4('0x31')][_0x95a4('0x37')]));_0x40b7cb[_0x95a4('0x36')]=_0x40b7cb['attributes'][_0x95a4('0x38')]?_0x40b7cb[_0x95a4('0x36')]:_0xd40964[_0x95a4('0x35')];if(_0x544db5[_0x95a4('0x31')][_0x95a4('0x43')]){_0x40b7cb['include']=[{'all':!![]}];}_0x40b7cb=_[_0x95a4('0x3e')]({},_0x40b7cb,_0x544db5[_0x95a4('0x42')]);return db[_0x95a4('0x2d')][_0x95a4('0x49')](_0x40b7cb)['then'](handleEntityNotFound(_0x18d98f,null))[_0x95a4('0x25')](respondWithResult(_0x18d98f,null))[_0x95a4('0x4a')](handleError(_0x18d98f,null));};exports[_0x95a4('0x4b')]=function(_0x113693,_0x5b64fd){return db[_0x95a4('0x2d')]['create'](_0x113693[_0x95a4('0x4c')],{})[_0x95a4('0x25')](respondWithResult(_0x5b64fd,0xc9))[_0x95a4('0x4a')](handleError(_0x5b64fd,null));};exports['bulkCreate']=function(_0x1cf314,_0x229ca2){return db[_0x95a4('0x2d')][_0x95a4('0x4d')](_0x1cf314['body'],{'raw':![],'individualHooks':!![]})[_0x95a4('0x25')](respondWithResult(_0x229ca2,0xc9))[_0x95a4('0x4a')](handleError(_0x229ca2,null));};exports['update']=function(_0x561515,_0x511e00){if(_0x561515['body']['id']){delete _0x561515[_0x95a4('0x4c')]['id'];}return db['AnalyticFieldReport'][_0x95a4('0x49')]({'where':{'id':_0x561515[_0x95a4('0x47')]['id']}})[_0x95a4('0x25')](handleEntityNotFound(_0x511e00,null))['then'](saveUpdates(_0x561515[_0x95a4('0x4c')],null))['then'](respondWithResult(_0x511e00,null))[_0x95a4('0x4a')](handleError(_0x511e00,null));};exports[_0x95a4('0x26')]=function(_0x46ce47,_0xdd0b2e){return db[_0x95a4('0x2d')][_0x95a4('0x49')]({'where':{'id':_0x46ce47[_0x95a4('0x47')]['id']}})[_0x95a4('0x25')](handleEntityNotFound(_0xdd0b2e,null))[_0x95a4('0x25')](removeEntity(_0xdd0b2e,null))['catch'](handleError(_0xdd0b2e,null));};exports[_0x95a4('0x4e')]=function(_0x3049fb,_0xf8f4fb){return db['AnalyticFieldReport'][_0x95a4('0x26')]({'where':{'id':_0x3049fb[_0x95a4('0x31')][_0x95a4('0x4f')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xf8f4fb,0xcc))[_0x95a4('0x4a')](handleError(_0xf8f4fb,null));};exports[_0x95a4('0x50')]=function(_0x54b07f,_0x5a04eb,_0x2ed4e4){return db[_0x95a4('0x51')]['findOne']({'where':{'id':_0x54b07f['params']['id']}})[_0x95a4('0x25')](handleEntityNotFound(_0x5a04eb,null))['then'](function(_0x24cd65){if(_0x24cd65){return db[_0x95a4('0x52')][_0x95a4('0x53')](function(_0x179930){return db[_0x95a4('0x2d')][_0x95a4('0x26')]({'where':{'CustomReportId':_0x54b07f[_0x95a4('0x47')]['id']},'transaction':_0x179930})[_0x95a4('0x25')](function(_0x5b9d27){var _0x8029d6=_[_0x95a4('0x2c')](_0x54b07f[_0x95a4('0x4c')],function(_0x104b08){delete _0x104b08['id'];_0x104b08['CustomReportId']=_0x54b07f[_0x95a4('0x47')]['id'];return _0x104b08;});return db[_0x95a4('0x2d')]['bulkCreate'](_0x8029d6,{'transaction':_0x179930});});})[_0x95a4('0x25')](function(){return db[_0x95a4('0x2d')][_0x95a4('0x45')]({'where':{'CustomReportId':_0x54b07f['params']['id']}});});}})[_0x95a4('0x25')](respondWithResult(_0x5a04eb,null))[_0x95a4('0x4a')](handleError(_0x5a04eb,null));};
\ No newline at end of file
+var _0x1d3c=['error','name','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','length','find','create','body','catch','bulkCreate','destroy','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','update','then','sendStatus'];(function(_0x1140c3,_0x562621){var _0x2d0b43=function(_0x20bc1e){while(--_0x20bc1e){_0x1140c3['push'](_0x1140c3['shift']());}};_0x2d0b43(++_0x562621);}(_0x1d3c,0x1c7));var _0xc1d3=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x1d3c[_0x4667b2];return _0x1070f2;};'use strict';var emlformat=require(_0xc1d3('0x0'));var rimraf=require(_0xc1d3('0x1'));var zipdir=require(_0xc1d3('0x2'));var jsonpatch=require(_0xc1d3('0x3'));var rp=require(_0xc1d3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc1d3('0x5'));var path=require(_0xc1d3('0x6'));var sox=require(_0xc1d3('0x7'));var csv=require(_0xc1d3('0x8'));var ejs=require(_0xc1d3('0x9'));var fs=require('fs');var fs_extra=require(_0xc1d3('0xa'));var _=require('lodash');var squel=require(_0xc1d3('0xb'));var crypto=require(_0xc1d3('0xc'));var jsforce=require(_0xc1d3('0xd'));var deskjs=require(_0xc1d3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc1d3('0xf'));var authService=require(_0xc1d3('0x10'));var qs=require(_0xc1d3('0x11'));var as=require(_0xc1d3('0x12'));var hardwareService=require(_0xc1d3('0x13'));var logger=require(_0xc1d3('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc1d3('0x15'));var licenseUtil=require(_0xc1d3('0x16'));var db=require(_0xc1d3('0x17'))['db'];function respondWithStatusCode(_0xa6ef78,_0x58c5a8){_0x58c5a8=_0x58c5a8||0xcc;return function(_0x319e86){if(_0x319e86){return _0xa6ef78['sendStatus'](_0x58c5a8);}return _0xa6ef78[_0xc1d3('0x18')](_0x58c5a8)[_0xc1d3('0x19')]();};}function respondWithResult(_0x2866fa,_0x5a206e){_0x5a206e=_0x5a206e||0xc8;return function(_0x3a2408){if(_0x3a2408){return _0x2866fa[_0xc1d3('0x18')](_0x5a206e)[_0xc1d3('0x1a')](_0x3a2408);}};}function respondWithFilteredResult(_0x405d43,_0x393bc0){return function(_0x24ffdd){if(_0x24ffdd){var _0x795219=typeof _0x393bc0['offset']===_0xc1d3('0x1b')&&typeof _0x393bc0['limit']===_0xc1d3('0x1b');var _0x4b36be=_0x24ffdd['count'];var _0x4b14f5=_0x795219?0x0:_0x393bc0[_0xc1d3('0x1c')];var _0x431f0e=_0x795219?_0x24ffdd['count']:_0x393bc0[_0xc1d3('0x1c')]+_0x393bc0[_0xc1d3('0x1d')];var _0x4a708f;if(_0x431f0e>=_0x4b36be){_0x431f0e=_0x4b36be;_0x4a708f=0xc8;}else{_0x4a708f=0xce;}_0x405d43['status'](_0x4a708f);return _0x405d43[_0xc1d3('0x1e')](_0xc1d3('0x1f'),_0x4b14f5+'-'+_0x431f0e+'/'+_0x4b36be)[_0xc1d3('0x1a')](_0x24ffdd);}return null;};}function patchUpdates(_0x20c688){return function(_0x255145){try{jsonpatch[_0xc1d3('0x20')](_0x255145,_0x20c688,!![]);}catch(_0x3ad214){return BPromise[_0xc1d3('0x21')](_0x3ad214);}return _0x255145['save']();};}function saveUpdates(_0x1ae1f9,_0xad94f7){return function(_0x2b3e27){if(_0x2b3e27){return _0x2b3e27[_0xc1d3('0x22')](_0x1ae1f9)[_0xc1d3('0x23')](function(_0x2b9d3d){return _0x2b9d3d;});}return null;};}function removeEntity(_0xea51aa,_0x4917f2){return function(_0x1d6d1b){if(_0x1d6d1b){return _0x1d6d1b['destroy']()[_0xc1d3('0x23')](function(){_0xea51aa['status'](0xcc)[_0xc1d3('0x19')]();});}};}function handleEntityNotFound(_0x4ecf49,_0x6e7559){return function(_0x1eaadd){if(!_0x1eaadd){_0x4ecf49[_0xc1d3('0x24')](0x194);}return _0x1eaadd;};}function handleError(_0x1fb545,_0x466949){_0x466949=_0x466949||0x1f4;return function(_0x4a1422){logger[_0xc1d3('0x25')](_0x4a1422['stack']);if(_0x4a1422[_0xc1d3('0x26')]){delete _0x4a1422['name'];}_0x1fb545[_0xc1d3('0x18')](_0x466949)['send'](_0x4a1422);};}exports[_0xc1d3('0x27')]=function(_0x849553,_0x5da72e){var _0x3f288b={},_0x363358={},_0x29706a={'count':0x0,'rows':[]};var _0x3f4b92=_['map'](db[_0xc1d3('0x28')][_0xc1d3('0x29')],function(_0x406cd4){return{'name':_0x406cd4[_0xc1d3('0x2a')],'type':_0x406cd4[_0xc1d3('0x2b')][_0xc1d3('0x2c')]};});_0x363358[_0xc1d3('0x2d')]=_[_0xc1d3('0x2e')](_0x3f4b92,_0xc1d3('0x26'));_0x363358[_0xc1d3('0x2f')]=_['keys'](_0x849553[_0xc1d3('0x2f')]);_0x363358['filters']=_[_0xc1d3('0x30')](_0x363358[_0xc1d3('0x2d')],_0x363358[_0xc1d3('0x2f')]);_0x3f288b[_0xc1d3('0x31')]=_[_0xc1d3('0x30')](_0x363358[_0xc1d3('0x2d')],qs[_0xc1d3('0x32')](_0x849553['query'][_0xc1d3('0x32')]));_0x3f288b[_0xc1d3('0x31')]=_0x3f288b[_0xc1d3('0x31')]['length']?_0x3f288b[_0xc1d3('0x31')]:_0x363358[_0xc1d3('0x2d')];if(!_0x849553['query'][_0xc1d3('0x33')]('nolimit')){_0x3f288b['limit']=qs[_0xc1d3('0x1d')](_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x1d')]);_0x3f288b[_0xc1d3('0x1c')]=qs[_0xc1d3('0x1c')](_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x1c')]);}_0x3f288b['order']=qs[_0xc1d3('0x34')](_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x34')]);_0x3f288b[_0xc1d3('0x35')]=qs[_0xc1d3('0x36')](_[_0xc1d3('0x37')](_0x849553['query'],_0x363358[_0xc1d3('0x36')]),_0x3f4b92);if(_0x849553['query'][_0xc1d3('0x38')]){_0x3f288b['where']=_[_0xc1d3('0x39')](_0x3f288b['where'],{'$or':_['map'](_0x3f4b92,function(_0x26bc91){if(_0x26bc91[_0xc1d3('0x2b')]!==_0xc1d3('0x3a')){var _0x41da28={};_0x41da28[_0x26bc91[_0xc1d3('0x26')]]={'$like':'%'+_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x38')]+'%'};return _0x41da28;}})});}_0x3f288b=_[_0xc1d3('0x39')]({},_0x3f288b,_0x849553[_0xc1d3('0x3b')]);var _0x4748e3={'where':_0x3f288b['where']};return db['AnalyticFieldReport'][_0xc1d3('0x3c')](_0x4748e3)[_0xc1d3('0x23')](function(_0x6043f4){_0x29706a[_0xc1d3('0x3c')]=_0x6043f4;if(_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x3d')]){_0x3f288b[_0xc1d3('0x3e')]=[{'all':!![]}];}return db[_0xc1d3('0x28')]['findAll'](_0x3f288b);})[_0xc1d3('0x23')](function(_0x212cf6){_0x29706a[_0xc1d3('0x3f')]=_0x212cf6;return _0x29706a;})['then'](respondWithFilteredResult(_0x5da72e,_0x3f288b))['catch'](handleError(_0x5da72e,null));};exports[_0xc1d3('0x40')]=function(_0x39f322,_0x221bed){var _0x468f5a={'raw':![],'where':{'id':_0x39f322[_0xc1d3('0x41')]['id']}},_0x5997f1={};_0x5997f1[_0xc1d3('0x2d')]=_[_0xc1d3('0x42')](db[_0xc1d3('0x28')][_0xc1d3('0x29')]);_0x5997f1['query']=_['keys'](_0x39f322[_0xc1d3('0x2f')]);_0x5997f1[_0xc1d3('0x36')]=_[_0xc1d3('0x30')](_0x5997f1[_0xc1d3('0x2d')],_0x5997f1[_0xc1d3('0x2f')]);_0x468f5a[_0xc1d3('0x31')]=_[_0xc1d3('0x30')](_0x5997f1[_0xc1d3('0x2d')],qs[_0xc1d3('0x32')](_0x39f322[_0xc1d3('0x2f')][_0xc1d3('0x32')]));_0x468f5a['attributes']=_0x468f5a['attributes'][_0xc1d3('0x43')]?_0x468f5a['attributes']:_0x5997f1[_0xc1d3('0x2d')];if(_0x39f322[_0xc1d3('0x2f')][_0xc1d3('0x3d')]){_0x468f5a['include']=[{'all':!![]}];}_0x468f5a=_[_0xc1d3('0x39')]({},_0x468f5a,_0x39f322[_0xc1d3('0x3b')]);return db[_0xc1d3('0x28')][_0xc1d3('0x44')](_0x468f5a)[_0xc1d3('0x23')](handleEntityNotFound(_0x221bed,null))[_0xc1d3('0x23')](respondWithResult(_0x221bed,null))['catch'](handleError(_0x221bed,null));};exports[_0xc1d3('0x45')]=function(_0x447e9d,_0x172cd6){return db['AnalyticFieldReport'][_0xc1d3('0x45')](_0x447e9d[_0xc1d3('0x46')],{})[_0xc1d3('0x23')](respondWithResult(_0x172cd6,0xc9))[_0xc1d3('0x47')](handleError(_0x172cd6,null));};exports[_0xc1d3('0x48')]=function(_0x5a2455,_0xcf2c24){return db[_0xc1d3('0x28')][_0xc1d3('0x48')](_0x5a2455['body'],{'raw':![],'individualHooks':!![]})[_0xc1d3('0x23')](respondWithResult(_0xcf2c24,0xc9))[_0xc1d3('0x47')](handleError(_0xcf2c24,null));};exports[_0xc1d3('0x22')]=function(_0x4a21c6,_0x20796d){if(_0x4a21c6[_0xc1d3('0x46')]['id']){delete _0x4a21c6[_0xc1d3('0x46')]['id'];}return db['AnalyticFieldReport'][_0xc1d3('0x44')]({'where':{'id':_0x4a21c6[_0xc1d3('0x41')]['id']}})['then'](handleEntityNotFound(_0x20796d,null))[_0xc1d3('0x23')](saveUpdates(_0x4a21c6[_0xc1d3('0x46')],null))['then'](respondWithResult(_0x20796d,null))[_0xc1d3('0x47')](handleError(_0x20796d,null));};exports[_0xc1d3('0x49')]=function(_0x56d1cb,_0x2d5b91){return db[_0xc1d3('0x28')][_0xc1d3('0x44')]({'where':{'id':_0x56d1cb[_0xc1d3('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d5b91,null))[_0xc1d3('0x23')](removeEntity(_0x2d5b91,null))[_0xc1d3('0x47')](handleError(_0x2d5b91,null));};exports[_0xc1d3('0x4a')]=function(_0x2e416c,_0x195b9b){return db[_0xc1d3('0x28')][_0xc1d3('0x49')]({'where':{'id':_0x2e416c[_0xc1d3('0x2f')][_0xc1d3('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x195b9b,0xcc))[_0xc1d3('0x47')](handleError(_0x195b9b,null));};exports['addFields']=function(_0x366b1c,_0x286544,_0x173f1e){return db[_0xc1d3('0x4c')][_0xc1d3('0x4d')]({'where':{'id':_0x366b1c['params']['id']}})['then'](handleEntityNotFound(_0x286544,null))[_0xc1d3('0x23')](function(_0xbfbf4f){if(_0xbfbf4f){return db[_0xc1d3('0x4e')][_0xc1d3('0x4f')](function(_0x2a782a){return db[_0xc1d3('0x28')][_0xc1d3('0x49')]({'where':{'CustomReportId':_0x366b1c[_0xc1d3('0x41')]['id']},'transaction':_0x2a782a})[_0xc1d3('0x23')](function(_0x45b268){var _0x349ba4=_[_0xc1d3('0x2e')](_0x366b1c[_0xc1d3('0x46')],function(_0xd81085){delete _0xd81085['id'];_0xd81085[_0xc1d3('0x50')]=_0x366b1c[_0xc1d3('0x41')]['id'];return _0xd81085;});return db['AnalyticFieldReport']['bulkCreate'](_0x349ba4,{'transaction':_0x2a782a});});})[_0xc1d3('0x23')](function(){return db['AnalyticFieldReport'][_0xc1d3('0x51')]({'where':{'CustomReportId':_0x366b1c[_0xc1d3('0x41')]['id']}});});}})[_0xc1d3('0x23')](respondWithResult(_0x286544,null))['catch'](handleError(_0x286544,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 5d7d6d1..9335f1a 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.model.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88da=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','moment'];(function(_0xcf4690,_0x1888f6){var _0x1a5ebe=function(_0x1c428c){while(--_0x1c428c){_0xcf4690['push'](_0xcf4690['shift']());}};_0x1a5ebe(++_0x1888f6);}(_0x88da,0xa5));var _0xa88d=function(_0x5cb25e,_0x120a7f){_0x5cb25e=_0x5cb25e-0x0;var _0xe7d756=_0x88da[_0x5cb25e];return _0xe7d756;};'use strict';var _=require(_0xa88d('0x0'));var util=require(_0xa88d('0x1'));var logger=require(_0xa88d('0x2'))('api');var moment=require(_0xa88d('0x3'));var BPromise=require(_0xa88d('0x4'));var rp=require(_0xa88d('0x5'));var fs=require('fs');var path=require(_0xa88d('0x6'));var rimraf=require(_0xa88d('0x7'));var config=require(_0xa88d('0x8'));var attributes=require(_0xa88d('0x9'));module[_0xa88d('0xa')]=function(_0xa8a29e,_0x37a735){return _0xa8a29e[_0xa88d('0xb')](_0xa88d('0xc'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x44a0=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','../../config/logger','moment','request-promise'];(function(_0x1cc32e,_0x1f278f){var _0x1dac9a=function(_0x1fb7a0){while(--_0x1fb7a0){_0x1cc32e['push'](_0x1cc32e['shift']());}};_0x1dac9a(++_0x1f278f);}(_0x44a0,0x193));var _0x044a=function(_0x4891a7,_0x566170){_0x4891a7=_0x4891a7-0x0;var _0x20a6aa=_0x44a0[_0x4891a7];return _0x20a6aa;};'use strict';var _=require(_0x044a('0x0'));var util=require('util');var logger=require(_0x044a('0x1'))('api');var moment=require(_0x044a('0x2'));var BPromise=require('bluebird');var rp=require(_0x044a('0x3'));var fs=require('fs');var path=require(_0x044a('0x4'));var rimraf=require(_0x044a('0x5'));var config=require(_0x044a('0x6'));var attributes=require(_0x044a('0x7'));module[_0x044a('0x8')]=function(_0x35e5ce,_0x476d49){return _0x35e5ce[_0x044a('0x9')](_0x044a('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index eb6904b..e0fb259 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbefc=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4a7b7e,_0x1d1bf4){var _0xffd584=function(_0x6cb30c){while(--_0x6cb30c){_0x4a7b7e['push'](_0x4a7b7e['shift']());}};_0xffd584(++_0x1d1bf4);}(_0xbefc,0x80));var _0xcbef=function(_0x42af56,_0x4eaefe){_0x42af56=_0x42af56-0x0;var _0x2e5696=_0xbefc[_0x42af56];return _0x2e5696;};'use strict';var _=require(_0xcbef('0x0'));var util=require(_0xcbef('0x1'));var moment=require(_0xcbef('0x2'));var BPromise=require(_0xcbef('0x3'));var rs=require(_0xcbef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbef('0x5'))['db'];var utils=require(_0xcbef('0x6'));var logger=require(_0xcbef('0x7'))('rpc');var config=require(_0xcbef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcbef('0x9')][_0xcbef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528bdc,_0x235ad4,_0x2d4702){return new BPromise(function(_0x51c81d,_0x5c7eb6){return client['request'](_0x528bdc,_0x2d4702)['then'](function(_0x212734){logger[_0xcbef('0xb')](_0xcbef('0xc'),_0x235ad4,_0xcbef('0xd'));logger[_0xcbef('0xe')](_0xcbef('0xf'),_0x235ad4,'request\x20sent',JSON[_0xcbef('0x10')](_0x212734));if(_0x212734[_0xcbef('0x11')]){if(_0x212734[_0xcbef('0x11')][_0xcbef('0x12')]===0x1f4){logger[_0xcbef('0x11')](_0xcbef('0xc'),_0x235ad4,_0x212734[_0xcbef('0x11')][_0xcbef('0x13')]);return _0x5c7eb6(_0x212734[_0xcbef('0x11')][_0xcbef('0x13')]);}logger[_0xcbef('0x11')](_0xcbef('0xc'),_0x235ad4,_0x212734[_0xcbef('0x11')][_0xcbef('0x13')]);return _0x51c81d(_0x212734['error']['message']);}else{logger['info'](_0xcbef('0xc'),_0x235ad4,_0xcbef('0xd'));_0x51c81d(_0x212734[_0xcbef('0x14')][_0xcbef('0x13')]);}})[_0xcbef('0x15')](function(_0x109163){logger[_0xcbef('0x11')](_0xcbef('0xc'),_0x235ad4,_0x109163);_0x5c7eb6(_0x109163);});});}
\ No newline at end of file
+var _0x0826=['request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x42f6ca,_0x268900){var _0x509ea9=function(_0x45b0a2){while(--_0x45b0a2){_0x42f6ca['push'](_0x42f6ca['shift']());}};_0x509ea9(++_0x268900);}(_0x0826,0x104));var _0x6082=function(_0x15b065,_0x3b77a7){_0x15b065=_0x15b065-0x0;var _0x4cb0ae=_0x0826[_0x15b065];return _0x4cb0ae;};'use strict';var _=require(_0x6082('0x0'));var util=require(_0x6082('0x1'));var moment=require(_0x6082('0x2'));var BPromise=require(_0x6082('0x3'));var rs=require(_0x6082('0x4'));var fs=require('fs');var Redis=require(_0x6082('0x5'));var db=require(_0x6082('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6082('0x7'))(_0x6082('0x8'));var config=require(_0x6082('0x9'));var jayson=require(_0x6082('0xa'));var client=jayson[_0x6082('0xb')][_0x6082('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x85e0c1,_0x3210d1,_0x4387de){return new BPromise(function(_0x355aec,_0x23f9af){return client['request'](_0x85e0c1,_0x4387de)[_0x6082('0xd')](function(_0x4c0212){logger[_0x6082('0xe')](_0x6082('0xf'),_0x3210d1,_0x6082('0x10'));logger[_0x6082('0x11')](_0x6082('0x12'),_0x3210d1,_0x6082('0x10'),JSON['stringify'](_0x4c0212));if(_0x4c0212[_0x6082('0x13')]){if(_0x4c0212[_0x6082('0x13')][_0x6082('0x14')]===0x1f4){logger[_0x6082('0x13')](_0x6082('0xf'),_0x3210d1,_0x4c0212[_0x6082('0x13')][_0x6082('0x15')]);return _0x23f9af(_0x4c0212[_0x6082('0x13')][_0x6082('0x15')]);}logger[_0x6082('0x13')](_0x6082('0xf'),_0x3210d1,_0x4c0212[_0x6082('0x13')][_0x6082('0x15')]);return _0x355aec(_0x4c0212[_0x6082('0x13')]['message']);}else{logger[_0x6082('0xe')](_0x6082('0xf'),_0x3210d1,'request\x20sent');_0x355aec(_0x4c0212['result'][_0x6082('0x15')]);}})[_0x6082('0x16')](function(_0x276ed5){logger[_0x6082('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3210d1,_0x276ed5);_0x23f9af(_0x276ed5);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index c5f0115..aa0b4fc 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x2e195d,_0x229650){var _0x15cf2a=function(_0x1603eb){while(--_0x1603eb){_0x2e195d['push'](_0x2e195d['shift']());}};_0x15cf2a(++_0x229650);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x58ef58,_0x2ea5b7){var _0x10117a=function(_0x4d282){while(--_0x4d282){_0x58ef58['push'](_0x58ef58['shift']());}};_0x10117a(++_0x2ea5b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 05b952e..88b7811 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e5e=['STRING','TEXT','sequelize','exports','name'];(function(_0x2ab276,_0x2fc401){var _0x46dfb1=function(_0x44f9fc){while(--_0x44f9fc){_0x2ab276['push'](_0x2ab276['shift']());}};_0x46dfb1(++_0x2fc401);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x9e5e[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe9e5('0x2')},'table':{'type':Sequelize[_0xe9e5('0x3')]},'metric':{'type':Sequelize[_0xe9e5('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x38a5=['sequelize','exports','STRING','name','TEXT'];(function(_0x589172,_0x2839fa){var _0x105c51=function(_0x5eb9a5){while(--_0x5eb9a5){_0x589172['push'](_0x589172['shift']());}};_0x105c51(++_0x2839fa);}(_0x38a5,0x69));var _0x538a=function(_0x32c272,_0x1b6d58){_0x32c272=_0x32c272-0x0;var _0x534033=_0x38a5[_0x32c272];return _0x534033;};'use strict';var Sequelize=require(_0x538a('0x0'));module[_0x538a('0x1')]={'name':{'type':Sequelize[_0x538a('0x2')],'allowNull':![],'unique':_0x538a('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x538a('0x4')]},'description':{'type':Sequelize[_0x538a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 9e6fbd7..64f3bc5 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x1e514e,_0x4c2113){var _0x54f8ae=function(_0xa83626){while(--_0xa83626){_0x1e514e['push'](_0x1e514e['shift']());}};_0x54f8ae(++_0x4c2113);}(_0x9a19,0x114));var _0x99a1=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x9a19[_0x3430aa];return _0x2ac5c;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
+var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x1a929b,_0x5dee96){var _0x39b6f9=function(_0x42afe8){while(--_0x42afe8){_0x1a929b['push'](_0x1a929b['shift']());}};_0x39b6f9(++_0x5dee96);}(_0x98a8,0x12c));var _0x898a=function(_0x338255,_0x457edc){_0x338255=_0x338255-0x0;var _0x3dc9c7=_0x98a8[_0x338255];return _0x3dc9c7;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 38d414a..5156e2d 100644
--- a/server/api/analyticMetric/analyticMetric.model.js
+++ b/server/api/analyticMetric/analyticMetric.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe2a=['rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bb321,_0x16ce37){var _0x4b2937=function(_0x36a9b6){while(--_0x36a9b6){_0x1bb321['push'](_0x1bb321['shift']());}};_0x4b2937(++_0x16ce37);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x47dd4a,_0x8ecd84){_0x47dd4a=_0x47dd4a-0x0;var _0xf70f7c=_0xbe2a[_0x47dd4a];return _0xf70f7c;};'use strict';var _=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var logger=require(_0xabe2('0x2'))(_0xabe2('0x3'));var moment=require(_0xabe2('0x4'));var BPromise=require(_0xabe2('0x5'));var rp=require(_0xabe2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabe2('0x7'));var config=require('../../config/environment');var attributes=require(_0xabe2('0x8'));module[_0xabe2('0x9')]=function(_0x2ddf42,_0x475007){return _0x2ddf42[_0xabe2('0xa')](_0xabe2('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0689=['define','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x0689,0x161));var _0x9068=function(_0x1abfc4,_0x1e1298){_0x1abfc4=_0x1abfc4-0x0;var _0x1e6a3e=_0x0689[_0x1abfc4];return _0x1e6a3e;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 96152e2..ebc3a40 100644
--- a/server/api/analyticMetric/analyticMetric.rpc.js
+++ b/server/api/analyticMetric/analyticMetric.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3bfc=['then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0xe41a46,_0x144159){var _0x3d970c=function(_0x97c741){while(--_0x97c741){_0xe41a46['push'](_0xe41a46['shift']());}};_0x3d970c(++_0x144159);}(_0x3bfc,0x154));var _0xc3bf=function(_0x2cea58,_0x153c15){_0x2cea58=_0x2cea58-0x0;var _0x192933=_0x3bfc[_0x2cea58];return _0x192933;};'use strict';var _=require(_0xc3bf('0x0'));var util=require(_0xc3bf('0x1'));var moment=require(_0xc3bf('0x2'));var BPromise=require(_0xc3bf('0x3'));var rs=require(_0xc3bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3bf('0x5'))['db'];var utils=require(_0xc3bf('0x6'));var logger=require(_0xc3bf('0x7'))('rpc');var config=require(_0xc3bf('0x8'));var jayson=require(_0xc3bf('0x9'));var client=jayson['client'][_0xc3bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22877f,_0x425b45,_0x24601c){return new BPromise(function(_0x1cebaf,_0x42813e){return client[_0xc3bf('0xb')](_0x22877f,_0x24601c)[_0xc3bf('0xc')](function(_0x38c2ef){logger[_0xc3bf('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x425b45,_0xc3bf('0xe'));logger[_0xc3bf('0xf')](_0xc3bf('0x10'),_0x425b45,_0xc3bf('0xe'),JSON[_0xc3bf('0x11')](_0x38c2ef));if(_0x38c2ef[_0xc3bf('0x12')]){if(_0x38c2ef['error']['code']===0x1f4){logger['error'](_0xc3bf('0x13'),_0x425b45,_0x38c2ef[_0xc3bf('0x12')]['message']);return _0x42813e(_0x38c2ef['error'][_0xc3bf('0x14')]);}logger[_0xc3bf('0x12')](_0xc3bf('0x13'),_0x425b45,_0x38c2ef[_0xc3bf('0x12')][_0xc3bf('0x14')]);return _0x1cebaf(_0x38c2ef['error'][_0xc3bf('0x14')]);}else{logger[_0xc3bf('0xd')](_0xc3bf('0x13'),_0x425b45,_0xc3bf('0xe'));_0x1cebaf(_0x38c2ef['result'][_0xc3bf('0x14')]);}})[_0xc3bf('0x15')](function(_0xb14e0c){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x425b45,_0xb14e0c);_0x42813e(_0xb14e0c);});});}
\ No newline at end of file
+var _0x9f66=['info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x547030,_0x5ac365){var _0x20dd29=function(_0x138efd){while(--_0x138efd){_0x547030['push'](_0x547030['shift']());}};_0x20dd29(++_0x5ac365);}(_0x9f66,0x1be));var _0x69f6=function(_0x28150d,_0x276ffa){_0x28150d=_0x28150d-0x0;var _0x52fd33=_0x9f66[_0x28150d];return _0x52fd33;};'use strict';var _=require(_0x69f6('0x0'));var util=require(_0x69f6('0x1'));var moment=require(_0x69f6('0x2'));var BPromise=require(_0x69f6('0x3'));var rs=require(_0x69f6('0x4'));var fs=require('fs');var Redis=require(_0x69f6('0x5'));var db=require(_0x69f6('0x6'))['db'];var utils=require(_0x69f6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x69f6('0x8'));var jayson=require(_0x69f6('0x9'));var client=jayson[_0x69f6('0xa')][_0x69f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9bc56e,_0x3b8a76,_0x43fb93){return new BPromise(function(_0x39757e,_0x2b62e5){return client[_0x69f6('0xc')](_0x9bc56e,_0x43fb93)[_0x69f6('0xd')](function(_0x38b147){logger[_0x69f6('0xe')](_0x69f6('0xf'),_0x3b8a76,_0x69f6('0x10'));logger['debug'](_0x69f6('0x11'),_0x3b8a76,_0x69f6('0x10'),JSON[_0x69f6('0x12')](_0x38b147));if(_0x38b147[_0x69f6('0x13')]){if(_0x38b147[_0x69f6('0x13')]['code']===0x1f4){logger[_0x69f6('0x13')](_0x69f6('0xf'),_0x3b8a76,_0x38b147['error']['message']);return _0x2b62e5(_0x38b147['error'][_0x69f6('0x14')]);}logger[_0x69f6('0x13')](_0x69f6('0xf'),_0x3b8a76,_0x38b147[_0x69f6('0x13')][_0x69f6('0x14')]);return _0x39757e(_0x38b147['error'][_0x69f6('0x14')]);}else{logger[_0x69f6('0xe')](_0x69f6('0xf'),_0x3b8a76,'request\x20sent');_0x39757e(_0x38b147[_0x69f6('0x15')]['message']);}})[_0x69f6('0x16')](function(_0x54a435){logger['error'](_0x69f6('0xf'),_0x3b8a76,_0x54a435);_0x2b62e5(_0x54a435);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 7e40cf9..84aee45 100644
--- a/server/api/analyticMetric/index.js
+++ b/server/api/analyticMetric/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x27a8=['/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x5e3212,_0x2b36de){var _0x62f793=function(_0x371267){while(--_0x371267){_0x5e3212['push'](_0x5e3212['shift']());}};_0x62f793(++_0x2b36de);}(_0x27a8,0x170));var _0x827a=function(_0x2f3fe7,_0x4048ba){_0x2f3fe7=_0x2f3fe7-0x0;var _0xbc9d29=_0x27a8[_0x2f3fe7];return _0xbc9d29;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x827a('0x0'));var timeout=require(_0x827a('0x1'));var express=require(_0x827a('0x2'));var router=express[_0x827a('0x3')]();var fs_extra=require(_0x827a('0x4'));var auth=require(_0x827a('0x5'));var interaction=require(_0x827a('0x6'));var config=require(_0x827a('0x7'));var controller=require(_0x827a('0x8'));router[_0x827a('0x9')]('/',auth[_0x827a('0xa')](),controller[_0x827a('0xb')]);router[_0x827a('0x9')](_0x827a('0xc'),auth[_0x827a('0xa')](),controller[_0x827a('0xd')]);router[_0x827a('0xe')]('/',auth[_0x827a('0xa')](),controller[_0x827a('0xf')]);router[_0x827a('0x10')](_0x827a('0xc'),auth[_0x827a('0xa')](),controller[_0x827a('0x11')]);router['delete']('/:id',auth[_0x827a('0xa')](),controller[_0x827a('0x12')]);module[_0x827a('0x13')]=router;
\ No newline at end of file
+var _0xa23f=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','delete','exports','multer','util','express','Router'];(function(_0x150d4a,_0x2ee3d8){var _0x1d31ec=function(_0x4a794a){while(--_0x4a794a){_0x150d4a['push'](_0x150d4a['shift']());}};_0x1d31ec(++_0x2ee3d8);}(_0xa23f,0x7c));var _0xfa23=function(_0x59e068,_0x8ce760){_0x59e068=_0x59e068-0x0;var _0x1a7f9e=_0xa23f[_0x59e068];return _0x1a7f9e;};'use strict';var multer=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa23('0x2'));var router=express[_0xfa23('0x3')]();var fs_extra=require(_0xfa23('0x4'));var auth=require(_0xfa23('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa23('0x6'));var controller=require('./analyticMetric.controller');router[_0xfa23('0x7')]('/',auth[_0xfa23('0x8')](),controller[_0xfa23('0x9')]);router[_0xfa23('0x7')]('/:id',auth[_0xfa23('0x8')](),controller['show']);router[_0xfa23('0xa')]('/',auth[_0xfa23('0x8')](),controller[_0xfa23('0xb')]);router[_0xfa23('0xc')](_0xfa23('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xfa23('0xe')]('/:id',auth[_0xfa23('0x8')](),controller['destroy']);module[_0xfa23('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index ca4c962..f61c294 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2664=['TEXT','sequelize','exports'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0x2664,0x127));var _0x4266=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2664[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x4266('0x0'));module[_0x4266('0x1')]={'tree':{'type':Sequelize[_0x4266('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x3bca=['sequelize','exports','TEXT'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x3bca,0x132));var _0xa3bc=function(_0x58927c,_0x47c5f0){_0x58927c=_0x58927c-0x0;var _0x1100c2=_0x3bca[_0x58927c];return _0x1100c2;};'use strict';var Sequelize=require(_0xa3bc('0x0'));module[_0xa3bc('0x1')]={'tree':{'type':Sequelize[_0xa3bc('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index cd9072d..ddd9165 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.controller.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9788=['catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','AnalyticTreeReport','findAll','rows','show','params','rawAttributes','intersection','find','create','body'];(function(_0x3f3b97,_0x395d93){var _0xb6ab0c=function(_0x330c5a){while(--_0x330c5a){_0x3f3b97['push'](_0x3f3b97['shift']());}};_0xb6ab0c(++_0x395d93);}(_0x9788,0x1db));var _0x8978=function(_0x30a616,_0x16f281){_0x30a616=_0x30a616-0x0;var _0x29d79d=_0x9788[_0x30a616];return _0x29d79d;};'use strict';var emlformat=require(_0x8978('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8978('0x1'));var jsonpatch=require(_0x8978('0x2'));var rp=require(_0x8978('0x3'));var moment=require(_0x8978('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8978('0x5'));var util=require(_0x8978('0x6'));var path=require(_0x8978('0x7'));var sox=require(_0x8978('0x8'));var csv=require('to-csv');var ejs=require(_0x8978('0x9'));var fs=require('fs');var fs_extra=require(_0x8978('0xa'));var _=require(_0x8978('0xb'));var squel=require('squel');var crypto=require(_0x8978('0xc'));var jsforce=require(_0x8978('0xd'));var deskjs=require(_0x8978('0xe'));var toCsv=require(_0x8978('0xf'));var querystring=require('querystring');var Papa=require(_0x8978('0x10'));var Redis=require(_0x8978('0x11'));var authService=require(_0x8978('0x12'));var qs=require(_0x8978('0x13'));var as=require(_0x8978('0x14'));var hardwareService=require(_0x8978('0x15'));var logger=require(_0x8978('0x16'))(_0x8978('0x17'));var utils=require(_0x8978('0x18'));var config=require(_0x8978('0x19'));var licenseUtil=require(_0x8978('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x106aa2,_0x39e1d2){_0x39e1d2=_0x39e1d2||0xcc;return function(_0x9d3140){if(_0x9d3140){return _0x106aa2['sendStatus'](_0x39e1d2);}return _0x106aa2[_0x8978('0x1b')](_0x39e1d2)[_0x8978('0x1c')]();};}function respondWithResult(_0x43deef,_0x4e7d48){_0x4e7d48=_0x4e7d48||0xc8;return function(_0x8ce215){if(_0x8ce215){return _0x43deef[_0x8978('0x1b')](_0x4e7d48)['json'](_0x8ce215);}};}function respondWithFilteredResult(_0x2eff35,_0x2fb17d){return function(_0x3e1e9c){if(_0x3e1e9c){var _0x244f57=typeof _0x2fb17d[_0x8978('0x1d')]===_0x8978('0x1e')&&typeof _0x2fb17d[_0x8978('0x1f')]===_0x8978('0x1e');var _0x479a60=_0x3e1e9c[_0x8978('0x20')];var _0x5b65c7=_0x244f57?0x0:_0x2fb17d[_0x8978('0x1d')];var _0x52cd18=_0x244f57?_0x3e1e9c[_0x8978('0x20')]:_0x2fb17d[_0x8978('0x1d')]+_0x2fb17d[_0x8978('0x1f')];var _0x5ec7ec;if(_0x52cd18>=_0x479a60){_0x52cd18=_0x479a60;_0x5ec7ec=0xc8;}else{_0x5ec7ec=0xce;}_0x2eff35['status'](_0x5ec7ec);return _0x2eff35[_0x8978('0x21')](_0x8978('0x22'),_0x5b65c7+'-'+_0x52cd18+'/'+_0x479a60)['json'](_0x3e1e9c);}return null;};}function patchUpdates(_0x2a7666){return function(_0x165f58){try{jsonpatch[_0x8978('0x23')](_0x165f58,_0x2a7666,!![]);}catch(_0x2c13b3){return BPromise['reject'](_0x2c13b3);}return _0x165f58[_0x8978('0x24')]();};}function saveUpdates(_0x5c9998,_0x33a5d7){return function(_0xa98e86){if(_0xa98e86){return _0xa98e86[_0x8978('0x25')](_0x5c9998)[_0x8978('0x26')](function(_0x2569e2){return _0x2569e2;});}return null;};}function removeEntity(_0x2a430c,_0x145bb7){return function(_0x1b7758){if(_0x1b7758){return _0x1b7758[_0x8978('0x27')]()[_0x8978('0x26')](function(){_0x2a430c[_0x8978('0x1b')](0xcc)[_0x8978('0x1c')]();});}};}function handleEntityNotFound(_0x4c49fe,_0x46785b){return function(_0xda73b4){if(!_0xda73b4){_0x4c49fe[_0x8978('0x28')](0x194);}return _0xda73b4;};}function handleError(_0x226715,_0x1fb755){_0x1fb755=_0x1fb755||0x1f4;return function(_0x71a77b){logger[_0x8978('0x29')](_0x71a77b[_0x8978('0x2a')]);if(_0x71a77b['name']){delete _0x71a77b[_0x8978('0x2b')];}_0x226715[_0x8978('0x1b')](_0x1fb755)[_0x8978('0x2c')](_0x71a77b);};}exports[_0x8978('0x2d')]=function(_0x1f212c,_0x4e4250){var _0x350b15={},_0x231501={},_0x4c74c7={'count':0x0,'rows':[]};var _0x57b8a4=_[_0x8978('0x2e')](db['AnalyticTreeReport']['rawAttributes'],function(_0x2dc634){return{'name':_0x2dc634[_0x8978('0x2f')],'type':_0x2dc634['type'][_0x8978('0x30')]};});_0x231501[_0x8978('0x31')]=_[_0x8978('0x2e')](_0x57b8a4,_0x8978('0x2b'));_0x231501[_0x8978('0x32')]=_[_0x8978('0x33')](_0x1f212c[_0x8978('0x32')]);_0x231501[_0x8978('0x34')]=_['intersection'](_0x231501[_0x8978('0x31')],_0x231501[_0x8978('0x32')]);_0x350b15[_0x8978('0x35')]=_['intersection'](_0x231501['model'],qs[_0x8978('0x36')](_0x1f212c['query'][_0x8978('0x36')]));_0x350b15[_0x8978('0x35')]=_0x350b15['attributes'][_0x8978('0x37')]?_0x350b15[_0x8978('0x35')]:_0x231501[_0x8978('0x31')];if(!_0x1f212c['query'][_0x8978('0x38')](_0x8978('0x39'))){_0x350b15[_0x8978('0x1f')]=qs[_0x8978('0x1f')](_0x1f212c[_0x8978('0x32')][_0x8978('0x1f')]);_0x350b15[_0x8978('0x1d')]=qs[_0x8978('0x1d')](_0x1f212c[_0x8978('0x32')][_0x8978('0x1d')]);}_0x350b15['order']=qs[_0x8978('0x3a')](_0x1f212c[_0x8978('0x32')]['sort']);_0x350b15['where']=qs[_0x8978('0x34')](_[_0x8978('0x3b')](_0x1f212c[_0x8978('0x32')],_0x231501[_0x8978('0x34')]),_0x57b8a4);if(_0x1f212c['query']['filter']){_0x350b15[_0x8978('0x3c')]=_['merge'](_0x350b15['where'],{'$or':_['map'](_0x57b8a4,function(_0xd4d885){if(_0xd4d885[_0x8978('0x3d')]!==_0x8978('0x3e')){var _0xf03683={};_0xf03683[_0xd4d885[_0x8978('0x2b')]]={'$like':'%'+_0x1f212c[_0x8978('0x32')][_0x8978('0x3f')]+'%'};return _0xf03683;}})});}_0x350b15=_[_0x8978('0x40')]({},_0x350b15,_0x1f212c[_0x8978('0x41')]);var _0x22ef6c={'where':_0x350b15['where']};return db['AnalyticTreeReport'][_0x8978('0x20')](_0x22ef6c)[_0x8978('0x26')](function(_0x131b0e){_0x4c74c7['count']=_0x131b0e;if(_0x1f212c[_0x8978('0x32')][_0x8978('0x42')]){_0x350b15[_0x8978('0x43')]=[{'all':!![]}];}return db[_0x8978('0x44')][_0x8978('0x45')](_0x350b15);})[_0x8978('0x26')](function(_0x3301f7){_0x4c74c7[_0x8978('0x46')]=_0x3301f7;return _0x4c74c7;})['then'](respondWithFilteredResult(_0x4e4250,_0x350b15))['catch'](handleError(_0x4e4250,null));};exports[_0x8978('0x47')]=function(_0x4d4d3e,_0x4d7ccf){var _0x53fcfe={'raw':!![],'where':{'id':_0x4d4d3e[_0x8978('0x48')]['id']}},_0x4972c1={};_0x4972c1[_0x8978('0x31')]=_[_0x8978('0x33')](db[_0x8978('0x44')][_0x8978('0x49')]);_0x4972c1[_0x8978('0x32')]=_[_0x8978('0x33')](_0x4d4d3e[_0x8978('0x32')]);_0x4972c1[_0x8978('0x34')]=_['intersection'](_0x4972c1[_0x8978('0x31')],_0x4972c1['query']);_0x53fcfe[_0x8978('0x35')]=_[_0x8978('0x4a')](_0x4972c1[_0x8978('0x31')],qs[_0x8978('0x36')](_0x4d4d3e[_0x8978('0x32')]['fields']));_0x53fcfe[_0x8978('0x35')]=_0x53fcfe[_0x8978('0x35')][_0x8978('0x37')]?_0x53fcfe[_0x8978('0x35')]:_0x4972c1[_0x8978('0x31')];if(_0x4d4d3e[_0x8978('0x32')][_0x8978('0x42')]){_0x53fcfe[_0x8978('0x43')]=[{'all':!![]}];}_0x53fcfe=_['merge']({},_0x53fcfe,_0x4d4d3e[_0x8978('0x41')]);return db[_0x8978('0x44')][_0x8978('0x4b')](_0x53fcfe)['then'](handleEntityNotFound(_0x4d7ccf,null))['then'](respondWithResult(_0x4d7ccf,null))['catch'](handleError(_0x4d7ccf,null));};exports[_0x8978('0x4c')]=function(_0x193827,_0x236eca){return db['AnalyticTreeReport'][_0x8978('0x4c')](_0x193827[_0x8978('0x4d')],{})[_0x8978('0x26')](respondWithResult(_0x236eca,0xc9))['catch'](handleError(_0x236eca,null));};exports[_0x8978('0x25')]=function(_0x3933be,_0x7a070b){if(_0x3933be['body']['id']){delete _0x3933be[_0x8978('0x4d')]['id'];}return db['AnalyticTreeReport'][_0x8978('0x4b')]({'where':{'id':_0x3933be['params']['id']}})[_0x8978('0x26')](handleEntityNotFound(_0x7a070b,null))[_0x8978('0x26')](saveUpdates(_0x3933be['body'],null))['then'](respondWithResult(_0x7a070b,null))[_0x8978('0x4e')](handleError(_0x7a070b,null));};exports[_0x8978('0x27')]=function(_0x587579,_0x3fda7e){return db[_0x8978('0x44')][_0x8978('0x4b')]({'where':{'id':_0x587579[_0x8978('0x48')]['id']}})[_0x8978('0x26')](handleEntityNotFound(_0x3fda7e,null))[_0x8978('0x26')](removeEntity(_0x3fda7e,null))['catch'](handleError(_0x3fda7e,null));};
\ No newline at end of file
+var _0xb96b=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','keys','filters','intersection','query','fields','attributes','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x1b515f,_0x52aa6b){var _0x66ff73=function(_0x2cc081){while(--_0x2cc081){_0x1b515f['push'](_0x1b515f['shift']());}};_0x66ff73(++_0x52aa6b);}(_0xb96b,0xfd));var _0xbb96=function(_0x2d991c,_0x1583d4){_0x2d991c=_0x2d991c-0x0;var _0x3d5af5=_0xb96b[_0x2d991c];return _0x3d5af5;};'use strict';var emlformat=require(_0xbb96('0x0'));var rimraf=require(_0xbb96('0x1'));var zipdir=require(_0xbb96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbb96('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbb96('0x4'));var sox=require(_0xbb96('0x5'));var csv=require('to-csv');var ejs=require(_0xbb96('0x6'));var fs=require('fs');var fs_extra=require(_0xbb96('0x7'));var _=require(_0xbb96('0x8'));var squel=require(_0xbb96('0x9'));var crypto=require(_0xbb96('0xa'));var jsforce=require(_0xbb96('0xb'));var deskjs=require(_0xbb96('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbb96('0xd'));var Papa=require(_0xbb96('0xe'));var Redis=require(_0xbb96('0xf'));var authService=require(_0xbb96('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbb96('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbb96('0x12'));var utils=require('../../config/utils');var config=require(_0xbb96('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb96('0x14'))['db'];function respondWithStatusCode(_0x50f376,_0x1369a1){_0x1369a1=_0x1369a1||0xcc;return function(_0x10462a){if(_0x10462a){return _0x50f376[_0xbb96('0x15')](_0x1369a1);}return _0x50f376[_0xbb96('0x16')](_0x1369a1)[_0xbb96('0x17')]();};}function respondWithResult(_0x154b6f,_0x7e0bf9){_0x7e0bf9=_0x7e0bf9||0xc8;return function(_0x238b7c){if(_0x238b7c){return _0x154b6f[_0xbb96('0x16')](_0x7e0bf9)[_0xbb96('0x18')](_0x238b7c);}};}function respondWithFilteredResult(_0x410ca0,_0x43b182){return function(_0x19855e){if(_0x19855e){var _0x8079c0=typeof _0x43b182[_0xbb96('0x19')]===_0xbb96('0x1a')&&typeof _0x43b182[_0xbb96('0x1b')]===_0xbb96('0x1a');var _0xf17f90=_0x19855e[_0xbb96('0x1c')];var _0x1703bb=_0x8079c0?0x0:_0x43b182[_0xbb96('0x19')];var _0x77d361=_0x8079c0?_0x19855e[_0xbb96('0x1c')]:_0x43b182[_0xbb96('0x19')]+_0x43b182[_0xbb96('0x1b')];var _0x273013;if(_0x77d361>=_0xf17f90){_0x77d361=_0xf17f90;_0x273013=0xc8;}else{_0x273013=0xce;}_0x410ca0[_0xbb96('0x16')](_0x273013);return _0x410ca0['set'](_0xbb96('0x1d'),_0x1703bb+'-'+_0x77d361+'/'+_0xf17f90)[_0xbb96('0x18')](_0x19855e);}return null;};}function patchUpdates(_0x2a5e9b){return function(_0x1ea65c){try{jsonpatch[_0xbb96('0x1e')](_0x1ea65c,_0x2a5e9b,!![]);}catch(_0x8da8d5){return BPromise[_0xbb96('0x1f')](_0x8da8d5);}return _0x1ea65c[_0xbb96('0x20')]();};}function saveUpdates(_0x574a7e,_0x49b16e){return function(_0x1adc62){if(_0x1adc62){return _0x1adc62[_0xbb96('0x21')](_0x574a7e)['then'](function(_0xeed2fa){return _0xeed2fa;});}return null;};}function removeEntity(_0x3748ec,_0x28ec20){return function(_0x4bd3f6){if(_0x4bd3f6){return _0x4bd3f6['destroy']()[_0xbb96('0x22')](function(){_0x3748ec[_0xbb96('0x16')](0xcc)[_0xbb96('0x17')]();});}};}function handleEntityNotFound(_0x32c5c7,_0xd78b3c){return function(_0x5a82e5){if(!_0x5a82e5){_0x32c5c7[_0xbb96('0x15')](0x194);}return _0x5a82e5;};}function handleError(_0x52280b,_0x31b124){_0x31b124=_0x31b124||0x1f4;return function(_0x4a9ca6){logger['error'](_0x4a9ca6[_0xbb96('0x23')]);if(_0x4a9ca6[_0xbb96('0x24')]){delete _0x4a9ca6['name'];}_0x52280b[_0xbb96('0x16')](_0x31b124)['send'](_0x4a9ca6);};}exports[_0xbb96('0x25')]=function(_0x4b8162,_0x4bb140){var _0xe18b22={},_0x55d7c9={},_0x102119={'count':0x0,'rows':[]};var _0x5d9e8f=_[_0xbb96('0x26')](db[_0xbb96('0x27')][_0xbb96('0x28')],function(_0x49fdae){return{'name':_0x49fdae[_0xbb96('0x29')],'type':_0x49fdae[_0xbb96('0x2a')][_0xbb96('0x2b')]};});_0x55d7c9['model']=_[_0xbb96('0x26')](_0x5d9e8f,_0xbb96('0x24'));_0x55d7c9['query']=_[_0xbb96('0x2c')](_0x4b8162['query']);_0x55d7c9[_0xbb96('0x2d')]=_[_0xbb96('0x2e')](_0x55d7c9['model'],_0x55d7c9[_0xbb96('0x2f')]);_0xe18b22['attributes']=_[_0xbb96('0x2e')](_0x55d7c9['model'],qs[_0xbb96('0x30')](_0x4b8162['query'][_0xbb96('0x30')]));_0xe18b22[_0xbb96('0x31')]=_0xe18b22[_0xbb96('0x31')][_0xbb96('0x32')]?_0xe18b22['attributes']:_0x55d7c9[_0xbb96('0x33')];if(!_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x34')]('nolimit')){_0xe18b22['limit']=qs['limit'](_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x1b')]);_0xe18b22[_0xbb96('0x19')]=qs[_0xbb96('0x19')](_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x19')]);}_0xe18b22[_0xbb96('0x35')]=qs[_0xbb96('0x36')](_0x4b8162[_0xbb96('0x2f')]['sort']);_0xe18b22[_0xbb96('0x37')]=qs['filters'](_[_0xbb96('0x38')](_0x4b8162['query'],_0x55d7c9[_0xbb96('0x2d')]),_0x5d9e8f);if(_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x39')]){_0xe18b22[_0xbb96('0x37')]=_[_0xbb96('0x3a')](_0xe18b22[_0xbb96('0x37')],{'$or':_[_0xbb96('0x26')](_0x5d9e8f,function(_0xb8d1d){if(_0xb8d1d['type']!=='VIRTUAL'){var _0x148f8c={};_0x148f8c[_0xb8d1d[_0xbb96('0x24')]]={'$like':'%'+_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x39')]+'%'};return _0x148f8c;}})});}_0xe18b22=_['merge']({},_0xe18b22,_0x4b8162['options']);var _0x16aa03={'where':_0xe18b22[_0xbb96('0x37')]};return db[_0xbb96('0x27')][_0xbb96('0x1c')](_0x16aa03)[_0xbb96('0x22')](function(_0x49cea0){_0x102119[_0xbb96('0x1c')]=_0x49cea0;if(_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x3b')]){_0xe18b22[_0xbb96('0x3c')]=[{'all':!![]}];}return db[_0xbb96('0x27')][_0xbb96('0x3d')](_0xe18b22);})[_0xbb96('0x22')](function(_0x5bcaf6){_0x102119[_0xbb96('0x3e')]=_0x5bcaf6;return _0x102119;})[_0xbb96('0x22')](respondWithFilteredResult(_0x4bb140,_0xe18b22))['catch'](handleError(_0x4bb140,null));};exports['show']=function(_0xdaa1e1,_0x1a6dc1){var _0x147414={'raw':!![],'where':{'id':_0xdaa1e1[_0xbb96('0x3f')]['id']}},_0x3fe0d5={};_0x3fe0d5['model']=_[_0xbb96('0x2c')](db[_0xbb96('0x27')][_0xbb96('0x28')]);_0x3fe0d5['query']=_[_0xbb96('0x2c')](_0xdaa1e1[_0xbb96('0x2f')]);_0x3fe0d5['filters']=_['intersection'](_0x3fe0d5[_0xbb96('0x33')],_0x3fe0d5[_0xbb96('0x2f')]);_0x147414[_0xbb96('0x31')]=_[_0xbb96('0x2e')](_0x3fe0d5[_0xbb96('0x33')],qs[_0xbb96('0x30')](_0xdaa1e1[_0xbb96('0x2f')]['fields']));_0x147414[_0xbb96('0x31')]=_0x147414[_0xbb96('0x31')][_0xbb96('0x32')]?_0x147414[_0xbb96('0x31')]:_0x3fe0d5[_0xbb96('0x33')];if(_0xdaa1e1[_0xbb96('0x2f')]['includeAll']){_0x147414[_0xbb96('0x3c')]=[{'all':!![]}];}_0x147414=_['merge']({},_0x147414,_0xdaa1e1[_0xbb96('0x40')]);return db['AnalyticTreeReport'][_0xbb96('0x41')](_0x147414)[_0xbb96('0x22')](handleEntityNotFound(_0x1a6dc1,null))[_0xbb96('0x22')](respondWithResult(_0x1a6dc1,null))[_0xbb96('0x42')](handleError(_0x1a6dc1,null));};exports['create']=function(_0x1d7c35,_0x4dd29f){return db['AnalyticTreeReport'][_0xbb96('0x43')](_0x1d7c35[_0xbb96('0x44')],{})[_0xbb96('0x22')](respondWithResult(_0x4dd29f,0xc9))[_0xbb96('0x42')](handleError(_0x4dd29f,null));};exports[_0xbb96('0x21')]=function(_0x2f52a4,_0x2fb24e){if(_0x2f52a4['body']['id']){delete _0x2f52a4[_0xbb96('0x44')]['id'];}return db[_0xbb96('0x27')][_0xbb96('0x41')]({'where':{'id':_0x2f52a4['params']['id']}})[_0xbb96('0x22')](handleEntityNotFound(_0x2fb24e,null))['then'](saveUpdates(_0x2f52a4[_0xbb96('0x44')],null))[_0xbb96('0x22')](respondWithResult(_0x2fb24e,null))[_0xbb96('0x42')](handleError(_0x2fb24e,null));};exports['destroy']=function(_0x298a54,_0x2afb01){return db[_0xbb96('0x27')][_0xbb96('0x41')]({'where':{'id':_0x298a54['params']['id']}})['then'](handleEntityNotFound(_0x2afb01,null))['then'](removeEntity(_0x2afb01,null))[_0xbb96('0x42')](handleError(_0x2afb01,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 8391aef..3b60112 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.model.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad91=['analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x10acb2,_0x3ca870){var _0x186379=function(_0x294bbd){while(--_0x294bbd){_0x10acb2['push'](_0x10acb2['shift']());}};_0x186379(++_0x3ca870);}(_0xad91,0x105));var _0x1ad9=function(_0x1c46c5,_0x41bc70){_0x1c46c5=_0x1c46c5-0x0;var _0x4e403c=_0xad91[_0x1c46c5];return _0x4e403c;};'use strict';var _=require(_0x1ad9('0x0'));var util=require(_0x1ad9('0x1'));var logger=require(_0x1ad9('0x2'))(_0x1ad9('0x3'));var moment=require('moment');var BPromise=require(_0x1ad9('0x4'));var rp=require(_0x1ad9('0x5'));var fs=require('fs');var path=require(_0x1ad9('0x6'));var rimraf=require(_0x1ad9('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ad9('0x8'));module[_0x1ad9('0x9')]=function(_0x22f6a6,_0x96d8fb){return _0x22f6a6[_0x1ad9('0xa')](_0x1ad9('0xb'),attributes,{'tableName':_0x1ad9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3bd=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','moment'];(function(_0x360cf1,_0x3c9321){var _0x1d1c80=function(_0x295473){while(--_0x295473){_0x360cf1['push'](_0x360cf1['shift']());}};_0x1d1c80(++_0x3c9321);}(_0xe3bd,0x19f));var _0xde3b=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xe3bd[_0x4551f6];return _0x581dc2;};'use strict';var _=require('lodash');var util=require(_0xde3b('0x0'));var logger=require(_0xde3b('0x1'))('api');var moment=require(_0xde3b('0x2'));var BPromise=require('bluebird');var rp=require(_0xde3b('0x3'));var fs=require('fs');var path=require(_0xde3b('0x4'));var rimraf=require(_0xde3b('0x5'));var config=require(_0xde3b('0x6'));var attributes=require(_0xde3b('0x7'));module[_0xde3b('0x8')]=function(_0x5569ff,_0x29a1dc){return _0x5569ff['define'](_0xde3b('0x9'),attributes,{'tableName':_0xde3b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index f5c38c4..ee66dcd 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5096e5,_0x4d0c54){var _0x23dd95=function(_0x26b0cf){while(--_0x26b0cf){_0x5096e5['push'](_0x5096e5['shift']());}};_0x23dd95(++_0x4d0c54);}(_0xdb28,0x106));var _0x8db2=function(_0x19abee,_0x54372e){_0x19abee=_0x19abee-0x0;var _0x23c7bd=_0xdb28[_0x19abee];return _0x23c7bd;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x272282,_0x2e94a0){var _0xedf511=function(_0x5d1ab6){while(--_0x5d1ab6){_0x272282['push'](_0x272282['shift']());}};_0xedf511(++_0x2e94a0);}(_0xadb5,0xad));var _0x5adb=function(_0x420868,_0x3719af){_0x420868=_0x420868-0x0;var _0x3a06a3=_0xadb5[_0x420868];return _0x3a06a3;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 88fb65b..fc17b5b 100644
--- a/server/api/analyticTreeReport/index.js
+++ b/server/api/analyticTreeReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2dc7=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2dc7,0x96));var _0x72dc=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x2dc7[_0x43a37c];return _0x5d1d40;};'use strict';var multer=require(_0x72dc('0x0'));var util=require(_0x72dc('0x1'));var path=require(_0x72dc('0x2'));var timeout=require(_0x72dc('0x3'));var express=require(_0x72dc('0x4'));var router=express[_0x72dc('0x5')]();var fs_extra=require(_0x72dc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x72dc('0x7'));var config=require(_0x72dc('0x8'));var controller=require(_0x72dc('0x9'));router['get']('/',auth[_0x72dc('0xa')](),controller[_0x72dc('0xb')]);router['get'](_0x72dc('0xc'),auth[_0x72dc('0xa')](),controller['show']);router[_0x72dc('0xd')]('/',auth[_0x72dc('0xa')](),controller['create']);router[_0x72dc('0xe')](_0x72dc('0xc'),auth[_0x72dc('0xa')](),controller[_0x72dc('0xf')]);router[_0x72dc('0x10')](_0x72dc('0xc'),auth[_0x72dc('0xa')](),controller[_0x72dc('0x11')]);module[_0x72dc('0x12')]=router;
\ No newline at end of file
+var _0xe308=['./analyticTreeReport.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x13ae4a,_0x4b8c49){var _0x514426=function(_0x2a3a3b){while(--_0x2a3a3b){_0x13ae4a['push'](_0x13ae4a['shift']());}};_0x514426(++_0x4b8c49);}(_0xe308,0x175));var _0x8e30=function(_0x2d5fb2,_0x1706f1){_0x2d5fb2=_0x2d5fb2-0x0;var _0x58439d=_0xe308[_0x2d5fb2];return _0x58439d;};'use strict';var multer=require(_0x8e30('0x0'));var util=require(_0x8e30('0x1'));var path=require(_0x8e30('0x2'));var timeout=require(_0x8e30('0x3'));var express=require('express');var router=express[_0x8e30('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8e30('0x5'));var config=require(_0x8e30('0x6'));var controller=require(_0x8e30('0x7'));router[_0x8e30('0x8')]('/',auth['isAuthenticated'](),controller[_0x8e30('0x9')]);router[_0x8e30('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8e30('0xa')]);router[_0x8e30('0xb')]('/',auth[_0x8e30('0xc')](),controller[_0x8e30('0xd')]);router[_0x8e30('0xe')](_0x8e30('0xf'),auth[_0x8e30('0xc')](),controller['update']);router[_0x8e30('0x10')](_0x8e30('0xf'),auth[_0x8e30('0xc')](),controller[_0x8e30('0x11')]);module[_0x8e30('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 841a945..f1bbd0b 100644
--- a/server/api/attachment/attachment.attributes.js
+++ b/server/api/attachment/attachment.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea70=['STRING','sequelize','exports'];(function(_0x5d6806,_0x54f344){var _0x21adb5=function(_0x4448f5){while(--_0x4448f5){_0x5d6806['push'](_0x5d6806['shift']());}};_0x21adb5(++_0x54f344);}(_0xea70,0x175));var _0x0ea7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xea70[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x0ea7('0x0'));module[_0x0ea7('0x1')]={'name':{'type':Sequelize[_0x0ea7('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0ea7('0x2')]}};
\ No newline at end of file
+var _0xe13e=['STRING'];(function(_0x403b7c,_0x4ff6bc){var _0x4a4272=function(_0x1ce280){while(--_0x1ce280){_0x403b7c['push'](_0x403b7c['shift']());}};_0x4a4272(++_0x4ff6bc);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xee13('0x0')]},'basename':{'type':Sequelize[_0xee13('0x0')]},'type':{'type':Sequelize[_0xee13('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 69edd05..778a887 100644
--- a/server/api/attachment/attachment.controller.js
+++ b/server/api/attachment/attachment.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x72e9=['show','params','find','clone','merge','get','updatedAt','body','createdAt','create','file','basename','filename','mimetype','ChatOfflineMessageId','join','root','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','apply','reject','update','then','destroy','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','where','pick','filters','filter','includeAll','include','findAll','rows','catch'];(function(_0x3d50a7,_0x1f6705){var _0x4017ef=function(_0x20b7d6){while(--_0x20b7d6){_0x3d50a7['push'](_0x3d50a7['shift']());}};_0x4017ef(++_0x1f6705);}(_0x72e9,0xbb));var _0x972e=function(_0x3e197b,_0x36ba95){_0x3e197b=_0x3e197b-0x0;var _0x3ba301=_0x72e9[_0x3e197b];return _0x3ba301;};'use strict';var emlformat=require(_0x972e('0x0'));var rimraf=require(_0x972e('0x1'));var zipdir=require(_0x972e('0x2'));var jsonpatch=require(_0x972e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x972e('0x4'));var Mustache=require(_0x972e('0x5'));var util=require(_0x972e('0x6'));var path=require(_0x972e('0x7'));var sox=require(_0x972e('0x8'));var csv=require(_0x972e('0x9'));var ejs=require(_0x972e('0xa'));var fs=require('fs');var fs_extra=require(_0x972e('0xb'));var _=require(_0x972e('0xc'));var squel=require(_0x972e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x972e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x972e('0xf'));var Papa=require(_0x972e('0x10'));var Redis=require('ioredis');var authService=require(_0x972e('0x11'));var qs=require(_0x972e('0x12'));var as=require(_0x972e('0x13'));var hardwareService=require(_0x972e('0x14'));var logger=require(_0x972e('0x15'))(_0x972e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x972e('0x17'))['db'];function respondWithStatusCode(_0x30f33e,_0x3d87c9){_0x3d87c9=_0x3d87c9||0xcc;return function(_0x5c5f11){if(_0x5c5f11){return _0x30f33e[_0x972e('0x18')](_0x3d87c9);}return _0x30f33e['status'](_0x3d87c9)[_0x972e('0x19')]();};}function respondWithResult(_0x3c1378,_0x403fb2){_0x403fb2=_0x403fb2||0xc8;return function(_0x479353){if(_0x479353){return _0x3c1378[_0x972e('0x1a')](_0x403fb2)[_0x972e('0x1b')](_0x479353);}};}function respondWithFilteredResult(_0x3557f8,_0x238908){return function(_0x1f595d){if(_0x1f595d){var _0x2e7440=typeof _0x238908['offset']===_0x972e('0x1c')&&typeof _0x238908[_0x972e('0x1d')]===_0x972e('0x1c');var _0x5e0d9e=_0x1f595d['count'];var _0x4f7575=_0x2e7440?0x0:_0x238908[_0x972e('0x1e')];var _0xa91f61=_0x2e7440?_0x1f595d[_0x972e('0x1f')]:_0x238908[_0x972e('0x1e')]+_0x238908[_0x972e('0x1d')];var _0x3fcc75;if(_0xa91f61>=_0x5e0d9e){_0xa91f61=_0x5e0d9e;_0x3fcc75=0xc8;}else{_0x3fcc75=0xce;}_0x3557f8[_0x972e('0x1a')](_0x3fcc75);return _0x3557f8['set']('Content-Range',_0x4f7575+'-'+_0xa91f61+'/'+_0x5e0d9e)[_0x972e('0x1b')](_0x1f595d);}return null;};}function patchUpdates(_0x231254){return function(_0x54cd66){try{jsonpatch[_0x972e('0x20')](_0x54cd66,_0x231254,!![]);}catch(_0x46388c){return BPromise[_0x972e('0x21')](_0x46388c);}return _0x54cd66['save']();};}function saveUpdates(_0x2753b2,_0xcd8afa){return function(_0x52876c){if(_0x52876c){return _0x52876c[_0x972e('0x22')](_0x2753b2)[_0x972e('0x23')](function(_0x23e4e6){return _0x23e4e6;});}return null;};}function removeEntity(_0x178c2c,_0x1b2194){return function(_0x8f32cd){if(_0x8f32cd){return _0x8f32cd[_0x972e('0x24')]()[_0x972e('0x23')](function(){_0x178c2c[_0x972e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fbed0,_0x46ca0b){return function(_0x456a6c){if(!_0x456a6c){_0x1fbed0[_0x972e('0x18')](0x194);}return _0x456a6c;};}function handleError(_0x190fc4,_0x258961){_0x258961=_0x258961||0x1f4;return function(_0x4a4164){logger[_0x972e('0x25')](_0x4a4164[_0x972e('0x26')]);if(_0x4a4164[_0x972e('0x27')]){delete _0x4a4164[_0x972e('0x27')];}_0x190fc4['status'](_0x258961)[_0x972e('0x28')](_0x4a4164);};}exports[_0x972e('0x29')]=function(_0x229894,_0x3d62df){var _0x203466={},_0x41bc44={},_0x319917={'count':0x0,'rows':[]};var _0x519d25=_['map'](db[_0x972e('0x2a')][_0x972e('0x2b')],function(_0x2098a3){return{'name':_0x2098a3[_0x972e('0x2c')],'type':_0x2098a3[_0x972e('0x2d')]['key']};});_0x41bc44[_0x972e('0x2e')]=_[_0x972e('0x2f')](_0x519d25,_0x972e('0x27'));_0x41bc44[_0x972e('0x30')]=_[_0x972e('0x31')](_0x229894['query']);_0x41bc44['filters']=_[_0x972e('0x32')](_0x41bc44[_0x972e('0x2e')],_0x41bc44['query']);_0x203466[_0x972e('0x33')]=_[_0x972e('0x32')](_0x41bc44['model'],qs[_0x972e('0x34')](_0x229894[_0x972e('0x30')]['fields']));_0x203466[_0x972e('0x33')]=_0x203466[_0x972e('0x33')][_0x972e('0x35')]?_0x203466['attributes']:_0x41bc44['model'];if(!_0x229894['query']['hasOwnProperty'](_0x972e('0x36'))){_0x203466[_0x972e('0x1d')]=qs[_0x972e('0x1d')](_0x229894[_0x972e('0x30')][_0x972e('0x1d')]);_0x203466[_0x972e('0x1e')]=qs[_0x972e('0x1e')](_0x229894[_0x972e('0x30')][_0x972e('0x1e')]);}_0x203466[_0x972e('0x37')]=qs['sort'](_0x229894['query']['sort']);_0x203466[_0x972e('0x38')]=qs['filters'](_[_0x972e('0x39')](_0x229894[_0x972e('0x30')],_0x41bc44[_0x972e('0x3a')]),_0x519d25);if(_0x229894[_0x972e('0x30')][_0x972e('0x3b')]){_0x203466[_0x972e('0x38')]=_['merge'](_0x203466[_0x972e('0x38')],{'$or':_[_0x972e('0x2f')](_0x519d25,function(_0x1051d7){if(_0x1051d7[_0x972e('0x2d')]!=='VIRTUAL'){var _0x123783={};_0x123783[_0x1051d7[_0x972e('0x27')]]={'$like':'%'+_0x229894[_0x972e('0x30')][_0x972e('0x3b')]+'%'};return _0x123783;}})});}_0x203466=_['merge']({},_0x203466,_0x229894['options']);var _0x256509={'where':_0x203466['where']};return db['Attachment'][_0x972e('0x1f')](_0x256509)[_0x972e('0x23')](function(_0x2ee097){_0x319917[_0x972e('0x1f')]=_0x2ee097;if(_0x229894['query'][_0x972e('0x3c')]){_0x203466[_0x972e('0x3d')]=[{'all':!![]}];}return db[_0x972e('0x2a')][_0x972e('0x3e')](_0x203466);})[_0x972e('0x23')](function(_0xdf5eb7){_0x319917[_0x972e('0x3f')]=_0xdf5eb7;return _0x319917;})[_0x972e('0x23')](respondWithFilteredResult(_0x3d62df,_0x203466))[_0x972e('0x40')](handleError(_0x3d62df,null));};exports[_0x972e('0x41')]=function(_0x445fa1,_0x1c6b89){var _0x2a6160={'raw':!![],'where':{'id':_0x445fa1[_0x972e('0x42')]['id']}},_0x2ed4ef={};_0x2ed4ef['model']=_[_0x972e('0x31')](db[_0x972e('0x2a')][_0x972e('0x2b')]);_0x2ed4ef[_0x972e('0x30')]=_[_0x972e('0x31')](_0x445fa1['query']);_0x2ed4ef['filters']=_['intersection'](_0x2ed4ef['model'],_0x2ed4ef[_0x972e('0x30')]);_0x2a6160[_0x972e('0x33')]=_[_0x972e('0x32')](_0x2ed4ef['model'],qs[_0x972e('0x34')](_0x445fa1[_0x972e('0x30')][_0x972e('0x34')]));_0x2a6160['attributes']=_0x2a6160['attributes'][_0x972e('0x35')]?_0x2a6160[_0x972e('0x33')]:_0x2ed4ef['model'];if(_0x445fa1[_0x972e('0x30')][_0x972e('0x3c')]){_0x2a6160[_0x972e('0x3d')]=[{'all':!![]}];}_0x2a6160=_['merge']({},_0x2a6160,_0x445fa1['options']);return db[_0x972e('0x2a')][_0x972e('0x43')](_0x2a6160)[_0x972e('0x23')](handleEntityNotFound(_0x1c6b89,null))['then'](respondWithResult(_0x1c6b89,null))[_0x972e('0x40')](handleError(_0x1c6b89,null));};exports[_0x972e('0x44')]=function(_0x3445ec,_0x475f25){var _0xa6b13f={'where':{'id':_0x3445ec[_0x972e('0x42')]['id']}},_0x21bdf9={};_0x21bdf9[_0x972e('0x2e')]=_[_0x972e('0x31')](db[_0x972e('0x2a')]['rawAttributes']);_0xa6b13f[_0x972e('0x33')]=_[_0x972e('0x32')](_0x21bdf9[_0x972e('0x2e')],qs[_0x972e('0x34')](_0x3445ec[_0x972e('0x30')]['fields']));_0xa6b13f[_0x972e('0x33')]=_0xa6b13f['attributes'][_0x972e('0x35')]?_0xa6b13f[_0x972e('0x33')]:_0x21bdf9['model'];if(_0x3445ec[_0x972e('0x30')][_0x972e('0x3c')]){_0xa6b13f['include']=[{'all':!![]}];}_0xa6b13f=_[_0x972e('0x45')]({},_0xa6b13f,_0x3445ec['options']);return db['Attachment'][_0x972e('0x43')](_0xa6b13f)[_0x972e('0x23')](handleEntityNotFound(_0x475f25,null))[_0x972e('0x23')](function(_0x5e3e3c){if(_0x5e3e3c){var _0x4a860d=_0x5e3e3c[_0x972e('0x46')]({'plain':!![]});_0x4a860d=qs['omit'](_0x4a860d,['id','createdAt',_0x972e('0x47')]);_0x3445ec['body']=_['omit'](_0x3445ec[_0x972e('0x48')],['id',_0x972e('0x49'),'updatedAt']);return db['Attachment'][_0x972e('0x4a')](_[_0x972e('0x45')](_0x4a860d,_0x3445ec[_0x972e('0x48')]),{'include':_0x3445ec[_0x972e('0x30')][_0x972e('0x3c')]?[{'all':!![]}]:undefined});}})[_0x972e('0x23')](respondWithResult(_0x475f25,0xc9))['catch'](handleError(_0x475f25,null));};exports[_0x972e('0x22')]=function(_0x3bd1ad,_0x144ec8){if(_0x3bd1ad[_0x972e('0x48')]['id']){delete _0x3bd1ad[_0x972e('0x48')]['id'];}return db[_0x972e('0x2a')][_0x972e('0x43')]({'where':{'id':_0x3bd1ad[_0x972e('0x42')]['id']}})[_0x972e('0x23')](handleEntityNotFound(_0x144ec8,null))[_0x972e('0x23')](saveUpdates(_0x3bd1ad[_0x972e('0x48')],null))['then'](respondWithResult(_0x144ec8,null))[_0x972e('0x40')](handleError(_0x144ec8,null));};exports[_0x972e('0x24')]=function(_0xd6084,_0x3bedc8){return db['Attachment'][_0x972e('0x43')]({'where':{'id':_0xd6084[_0x972e('0x42')]['id']}})[_0x972e('0x23')](handleEntityNotFound(_0x3bedc8,null))[_0x972e('0x23')](removeEntity(_0x3bedc8,null))[_0x972e('0x40')](handleError(_0x3bedc8,null));};exports[_0x972e('0x4a')]=function(_0x270339,_0x250dc4,_0x1b22fb){_0x270339['body'][_0x972e('0x27')]=_0x270339[_0x972e('0x4b')]['originalname'];_0x270339['body'][_0x972e('0x4c')]=_0x270339[_0x972e('0x4b')][_0x972e('0x4d')];_0x270339['body'][_0x972e('0x2d')]=_0x270339[_0x972e('0x4b')][_0x972e('0x4e')];return db['Attachment'][_0x972e('0x4a')](_0x270339[_0x972e('0x48')])[_0x972e('0x23')](respondWithResult(_0x250dc4,0xc9))['catch'](handleError(_0x250dc4,null));};exports['download']=function(_0x3919d8,_0x2fb3f7,_0x4e8e75){return db[_0x972e('0x2a')]['findOne']({'where':{'id':_0x3919d8[_0x972e('0x42')]['id']},'raw':!![]})[_0x972e('0x23')](handleEntityNotFound(_0x2fb3f7,null))['then'](function(_0x375323){if(_0x375323){var _0x4e6843=_0x375323[_0x972e('0x4f')]!==null;var _0x5a5ac0=path[_0x972e('0x50')](config[_0x972e('0x51')],'server/files/attachments/');if(_0x4e6843){_0x5a5ac0=path[_0x972e('0x50')](_0x5a5ac0,_0x972e('0x52'));}var _0x284c6d=path['join'](_0x5a5ac0,_0x375323[_0x972e('0x4c')]);return _0x2fb3f7[_0x972e('0x53')](_0x284c6d);}})[_0x972e('0x40')](handleError(_0x2fb3f7,null));};
\ No newline at end of file
+var _0x38ff=['filters','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','clone','get','omit','body','createdAt','updatedAt','create','update','find','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x409ea0,_0x24d255){var _0x983244=function(_0x17a19){while(--_0x17a19){_0x409ea0['push'](_0x409ea0['shift']());}};_0x983244(++_0x24d255);}(_0x38ff,0x7e));var _0xf38f=function(_0xadc7d9,_0x203608){_0xadc7d9=_0xadc7d9-0x0;var _0x915ca1=_0x38ff[_0xadc7d9];return _0x915ca1;};'use strict';var emlformat=require(_0xf38f('0x0'));var rimraf=require(_0xf38f('0x1'));var zipdir=require(_0xf38f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf38f('0x3'));var moment=require(_0xf38f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf38f('0x5'));var util=require(_0xf38f('0x6'));var path=require('path');var sox=require(_0xf38f('0x7'));var csv=require(_0xf38f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf38f('0x9'));var _=require(_0xf38f('0xa'));var squel=require(_0xf38f('0xb'));var crypto=require(_0xf38f('0xc'));var jsforce=require(_0xf38f('0xd'));var deskjs=require(_0xf38f('0xe'));var toCsv=require(_0xf38f('0x8'));var querystring=require(_0xf38f('0xf'));var Papa=require(_0xf38f('0x10'));var Redis=require('ioredis');var authService=require(_0xf38f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf38f('0x12'));var hardwareService=require(_0xf38f('0x13'));var logger=require(_0xf38f('0x14'))(_0xf38f('0x15'));var utils=require(_0xf38f('0x16'));var config=require(_0xf38f('0x17'));var licenseUtil=require(_0xf38f('0x18'));var db=require(_0xf38f('0x19'))['db'];function respondWithStatusCode(_0x45748b,_0x258385){_0x258385=_0x258385||0xcc;return function(_0x2fe1f8){if(_0x2fe1f8){return _0x45748b[_0xf38f('0x1a')](_0x258385);}return _0x45748b['status'](_0x258385)[_0xf38f('0x1b')]();};}function respondWithResult(_0x3d4e22,_0x3b2af0){_0x3b2af0=_0x3b2af0||0xc8;return function(_0x46093a){if(_0x46093a){return _0x3d4e22[_0xf38f('0x1c')](_0x3b2af0)[_0xf38f('0x1d')](_0x46093a);}};}function respondWithFilteredResult(_0x358a99,_0x50cdfa){return function(_0x59465d){if(_0x59465d){var _0x1d40c2=typeof _0x50cdfa[_0xf38f('0x1e')]==='undefined'&&typeof _0x50cdfa[_0xf38f('0x1f')]===_0xf38f('0x20');var _0x3d686a=_0x59465d[_0xf38f('0x21')];var _0x454845=_0x1d40c2?0x0:_0x50cdfa['offset'];var _0xf6ff42=_0x1d40c2?_0x59465d['count']:_0x50cdfa[_0xf38f('0x1e')]+_0x50cdfa[_0xf38f('0x1f')];var _0x46a66f;if(_0xf6ff42>=_0x3d686a){_0xf6ff42=_0x3d686a;_0x46a66f=0xc8;}else{_0x46a66f=0xce;}_0x358a99[_0xf38f('0x1c')](_0x46a66f);return _0x358a99['set']('Content-Range',_0x454845+'-'+_0xf6ff42+'/'+_0x3d686a)[_0xf38f('0x1d')](_0x59465d);}return null;};}function patchUpdates(_0x2f4ac9){return function(_0x283f01){try{jsonpatch[_0xf38f('0x22')](_0x283f01,_0x2f4ac9,!![]);}catch(_0x41f84c){return BPromise[_0xf38f('0x23')](_0x41f84c);}return _0x283f01['save']();};}function saveUpdates(_0x326ee5,_0x4e3e03){return function(_0x146992){if(_0x146992){return _0x146992['update'](_0x326ee5)['then'](function(_0x4098a7){return _0x4098a7;});}return null;};}function removeEntity(_0x30c4f0,_0x1b00f3){return function(_0x293dc2){if(_0x293dc2){return _0x293dc2[_0xf38f('0x24')]()[_0xf38f('0x25')](function(){_0x30c4f0[_0xf38f('0x1c')](0xcc)[_0xf38f('0x1b')]();});}};}function handleEntityNotFound(_0x3a6020,_0x51621e){return function(_0x3f7bbc){if(!_0x3f7bbc){_0x3a6020[_0xf38f('0x1a')](0x194);}return _0x3f7bbc;};}function handleError(_0x5956ca,_0x48f86e){_0x48f86e=_0x48f86e||0x1f4;return function(_0x5dcbd6){logger[_0xf38f('0x26')](_0x5dcbd6[_0xf38f('0x27')]);if(_0x5dcbd6[_0xf38f('0x28')]){delete _0x5dcbd6[_0xf38f('0x28')];}_0x5956ca[_0xf38f('0x1c')](_0x48f86e)[_0xf38f('0x29')](_0x5dcbd6);};}exports[_0xf38f('0x2a')]=function(_0x28f247,_0x52696f){var _0x5b81ce={},_0x1d895b={},_0xf41424={'count':0x0,'rows':[]};var _0x4aecdd=_[_0xf38f('0x2b')](db[_0xf38f('0x2c')][_0xf38f('0x2d')],function(_0x57e937){return{'name':_0x57e937[_0xf38f('0x2e')],'type':_0x57e937[_0xf38f('0x2f')][_0xf38f('0x30')]};});_0x1d895b['model']=_[_0xf38f('0x2b')](_0x4aecdd,_0xf38f('0x28'));_0x1d895b[_0xf38f('0x31')]=_[_0xf38f('0x32')](_0x28f247['query']);_0x1d895b['filters']=_[_0xf38f('0x33')](_0x1d895b['model'],_0x1d895b[_0xf38f('0x31')]);_0x5b81ce['attributes']=_[_0xf38f('0x33')](_0x1d895b[_0xf38f('0x34')],qs['fields'](_0x28f247[_0xf38f('0x31')][_0xf38f('0x35')]));_0x5b81ce[_0xf38f('0x36')]=_0x5b81ce[_0xf38f('0x36')][_0xf38f('0x37')]?_0x5b81ce[_0xf38f('0x36')]:_0x1d895b['model'];if(!_0x28f247[_0xf38f('0x31')][_0xf38f('0x38')](_0xf38f('0x39'))){_0x5b81ce[_0xf38f('0x1f')]=qs[_0xf38f('0x1f')](_0x28f247[_0xf38f('0x31')][_0xf38f('0x1f')]);_0x5b81ce['offset']=qs[_0xf38f('0x1e')](_0x28f247['query'][_0xf38f('0x1e')]);}_0x5b81ce[_0xf38f('0x3a')]=qs[_0xf38f('0x3b')](_0x28f247[_0xf38f('0x31')][_0xf38f('0x3b')]);_0x5b81ce['where']=qs[_0xf38f('0x3c')](_[_0xf38f('0x3d')](_0x28f247[_0xf38f('0x31')],_0x1d895b[_0xf38f('0x3c')]),_0x4aecdd);if(_0x28f247[_0xf38f('0x31')][_0xf38f('0x3e')]){_0x5b81ce[_0xf38f('0x3f')]=_[_0xf38f('0x40')](_0x5b81ce[_0xf38f('0x3f')],{'$or':_[_0xf38f('0x2b')](_0x4aecdd,function(_0x28419d){if(_0x28419d[_0xf38f('0x2f')]!=='VIRTUAL'){var _0x4be876={};_0x4be876[_0x28419d[_0xf38f('0x28')]]={'$like':'%'+_0x28f247[_0xf38f('0x31')]['filter']+'%'};return _0x4be876;}})});}_0x5b81ce=_[_0xf38f('0x40')]({},_0x5b81ce,_0x28f247[_0xf38f('0x41')]);var _0x12f0d6={'where':_0x5b81ce[_0xf38f('0x3f')]};return db[_0xf38f('0x2c')][_0xf38f('0x21')](_0x12f0d6)['then'](function(_0x11d8b5){_0xf41424[_0xf38f('0x21')]=_0x11d8b5;if(_0x28f247['query'][_0xf38f('0x42')]){_0x5b81ce[_0xf38f('0x43')]=[{'all':!![]}];}return db[_0xf38f('0x2c')]['findAll'](_0x5b81ce);})[_0xf38f('0x25')](function(_0x3a1509){_0xf41424[_0xf38f('0x44')]=_0x3a1509;return _0xf41424;})['then'](respondWithFilteredResult(_0x52696f,_0x5b81ce))[_0xf38f('0x45')](handleError(_0x52696f,null));};exports[_0xf38f('0x46')]=function(_0x2c0309,_0x2a4e14){var _0x2ca5b4={'raw':!![],'where':{'id':_0x2c0309[_0xf38f('0x47')]['id']}},_0x5980ad={};_0x5980ad[_0xf38f('0x34')]=_['keys'](db[_0xf38f('0x2c')]['rawAttributes']);_0x5980ad[_0xf38f('0x31')]=_['keys'](_0x2c0309['query']);_0x5980ad[_0xf38f('0x3c')]=_['intersection'](_0x5980ad[_0xf38f('0x34')],_0x5980ad[_0xf38f('0x31')]);_0x2ca5b4[_0xf38f('0x36')]=_[_0xf38f('0x33')](_0x5980ad[_0xf38f('0x34')],qs[_0xf38f('0x35')](_0x2c0309[_0xf38f('0x31')][_0xf38f('0x35')]));_0x2ca5b4['attributes']=_0x2ca5b4['attributes'][_0xf38f('0x37')]?_0x2ca5b4['attributes']:_0x5980ad[_0xf38f('0x34')];if(_0x2c0309[_0xf38f('0x31')][_0xf38f('0x42')]){_0x2ca5b4[_0xf38f('0x43')]=[{'all':!![]}];}_0x2ca5b4=_[_0xf38f('0x40')]({},_0x2ca5b4,_0x2c0309[_0xf38f('0x41')]);return db[_0xf38f('0x2c')]['find'](_0x2ca5b4)[_0xf38f('0x25')](handleEntityNotFound(_0x2a4e14,null))[_0xf38f('0x25')](respondWithResult(_0x2a4e14,null))[_0xf38f('0x45')](handleError(_0x2a4e14,null));};exports[_0xf38f('0x48')]=function(_0xb1af4f,_0x26f3a0){var _0xe616c6={'where':{'id':_0xb1af4f[_0xf38f('0x47')]['id']}},_0x373f66={};_0x373f66[_0xf38f('0x34')]=_[_0xf38f('0x32')](db[_0xf38f('0x2c')][_0xf38f('0x2d')]);_0xe616c6[_0xf38f('0x36')]=_[_0xf38f('0x33')](_0x373f66[_0xf38f('0x34')],qs['fields'](_0xb1af4f[_0xf38f('0x31')][_0xf38f('0x35')]));_0xe616c6[_0xf38f('0x36')]=_0xe616c6[_0xf38f('0x36')][_0xf38f('0x37')]?_0xe616c6[_0xf38f('0x36')]:_0x373f66[_0xf38f('0x34')];if(_0xb1af4f[_0xf38f('0x31')][_0xf38f('0x42')]){_0xe616c6[_0xf38f('0x43')]=[{'all':!![]}];}_0xe616c6=_['merge']({},_0xe616c6,_0xb1af4f[_0xf38f('0x41')]);return db[_0xf38f('0x2c')]['find'](_0xe616c6)['then'](handleEntityNotFound(_0x26f3a0,null))[_0xf38f('0x25')](function(_0x140f19){if(_0x140f19){var _0x457679=_0x140f19[_0xf38f('0x49')]({'plain':!![]});_0x457679=qs[_0xf38f('0x4a')](_0x457679,['id','createdAt','updatedAt']);_0xb1af4f[_0xf38f('0x4b')]=_[_0xf38f('0x4a')](_0xb1af4f[_0xf38f('0x4b')],['id',_0xf38f('0x4c'),_0xf38f('0x4d')]);return db[_0xf38f('0x2c')][_0xf38f('0x4e')](_['merge'](_0x457679,_0xb1af4f[_0xf38f('0x4b')]),{'include':_0xb1af4f[_0xf38f('0x31')][_0xf38f('0x42')]?[{'all':!![]}]:undefined});}})[_0xf38f('0x25')](respondWithResult(_0x26f3a0,0xc9))[_0xf38f('0x45')](handleError(_0x26f3a0,null));};exports[_0xf38f('0x4f')]=function(_0x41ce38,_0x1c888d){if(_0x41ce38[_0xf38f('0x4b')]['id']){delete _0x41ce38[_0xf38f('0x4b')]['id'];}return db['Attachment'][_0xf38f('0x50')]({'where':{'id':_0x41ce38['params']['id']}})[_0xf38f('0x25')](handleEntityNotFound(_0x1c888d,null))['then'](saveUpdates(_0x41ce38['body'],null))['then'](respondWithResult(_0x1c888d,null))['catch'](handleError(_0x1c888d,null));};exports[_0xf38f('0x24')]=function(_0x140c05,_0x3cbfa7){return db[_0xf38f('0x2c')][_0xf38f('0x50')]({'where':{'id':_0x140c05['params']['id']}})[_0xf38f('0x25')](handleEntityNotFound(_0x3cbfa7,null))[_0xf38f('0x25')](removeEntity(_0x3cbfa7,null))[_0xf38f('0x45')](handleError(_0x3cbfa7,null));};exports[_0xf38f('0x4e')]=function(_0x5e2a82,_0x13d57c,_0x17cc62){_0x5e2a82[_0xf38f('0x4b')][_0xf38f('0x28')]=_0x5e2a82[_0xf38f('0x51')][_0xf38f('0x52')];_0x5e2a82[_0xf38f('0x4b')][_0xf38f('0x53')]=_0x5e2a82['file'][_0xf38f('0x54')];_0x5e2a82[_0xf38f('0x4b')][_0xf38f('0x2f')]=_0x5e2a82['file'][_0xf38f('0x55')];return db[_0xf38f('0x2c')][_0xf38f('0x4e')](_0x5e2a82[_0xf38f('0x4b')])[_0xf38f('0x25')](respondWithResult(_0x13d57c,0xc9))['catch'](handleError(_0x13d57c,null));};exports[_0xf38f('0x56')]=function(_0x3e0d03,_0x1a6578,_0x386cc9){return db['Attachment'][_0xf38f('0x57')]({'where':{'id':_0x3e0d03[_0xf38f('0x47')]['id']},'raw':!![]})[_0xf38f('0x25')](handleEntityNotFound(_0x1a6578,null))[_0xf38f('0x25')](function(_0x3d18cd){if(_0x3d18cd){var _0x4d9232=_0x3d18cd[_0xf38f('0x58')]!==null;var _0x58ae99=path['join'](config[_0xf38f('0x59')],_0xf38f('0x5a'));if(_0x4d9232){_0x58ae99=path[_0xf38f('0x5b')](_0x58ae99,_0xf38f('0x5c'));}var _0x5b0b1b=path[_0xf38f('0x5b')](_0x58ae99,_0x3d18cd[_0xf38f('0x53')]);return _0x1a6578[_0xf38f('0x56')](_0x5b0b1b);}})[_0xf38f('0x45')](handleError(_0x1a6578,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 1281382..a0d415a 100644
--- a/server/api/attachment/attachment.model.js
+++ b/server/api/attachment/attachment.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1a11=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x1a11,0x99));var _0x11a1=function(_0x5d9ab8,_0x18d257){_0x5d9ab8=_0x5d9ab8-0x0;var _0x533d5c=_0x1a11[_0x5d9ab8];return _0x533d5c;};'use strict';var _=require(_0x11a1('0x0'));var util=require(_0x11a1('0x1'));var logger=require(_0x11a1('0x2'))(_0x11a1('0x3'));var moment=require(_0x11a1('0x4'));var BPromise=require(_0x11a1('0x5'));var rp=require(_0x11a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x11a1('0x7'));var config=require(_0x11a1('0x8'));var attributes=require(_0x11a1('0x9'));module[_0x11a1('0xa')]=function(_0x5e4906,_0x224847){return _0x5e4906[_0x11a1('0xb')](_0x11a1('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd0ee=['exports','define','util','moment','bluebird','request-promise','../../config/environment','./attachment.attributes'];(function(_0x485df0,_0x55eb9f){var _0xfd4f3b=function(_0x1d43e9){while(--_0x1d43e9){_0x485df0['push'](_0x485df0['shift']());}};_0xfd4f3b(++_0x55eb9f);}(_0xd0ee,0x152));var _0xed0e=function(_0x14dbda,_0x2767ff){_0x14dbda=_0x14dbda-0x0;var _0x32cbc9=_0xd0ee[_0x14dbda];return _0x32cbc9;};'use strict';var _=require('lodash');var util=require(_0xed0e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xed0e('0x1'));var BPromise=require(_0xed0e('0x2'));var rp=require(_0xed0e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed0e('0x4'));var attributes=require(_0xed0e('0x5'));module[_0xed0e('0x6')]=function(_0xf70193,_0x49c33b){return _0xf70193[_0xed0e('0x7')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 514c35a..38069b7 100644
--- a/server/api/attachment/attachment.rpc.js
+++ b/server/api/attachment/attachment.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb43b=['raw','then','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','catch','CreateAttachment','Attachment','create','options'];(function(_0xac8c71,_0x26de55){var _0x2fbac1=function(_0x59e466){while(--_0x59e466){_0xac8c71['push'](_0xac8c71['shift']());}};_0x2fbac1(++_0x26de55);}(_0xb43b,0x1b2));var _0xbb43=function(_0x49b487,_0x27137c){_0x49b487=_0x49b487-0x0;var _0x1e04f1=_0xb43b[_0x49b487];return _0x1e04f1;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('Attachment,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('Attachment,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('Attachment,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}exports[_0xbb43('0x15')]=function(_0x2e3b43){var _0x55dd73=this;return new Promise(function(_0x1c16d7,_0x4f28b8){return db[_0xbb43('0x16')][_0xbb43('0x17')](_0x2e3b43['body'],{'raw':_0x2e3b43['options']?_0x2e3b43[_0xbb43('0x18')][_0xbb43('0x19')]===undefined?!![]:![]:!![]})[_0xbb43('0x1a')](function(_0x2bf2d4){logger['info'](_0xbb43('0x15'),_0x2e3b43);logger['debug'](_0xbb43('0x15'),_0x2e3b43,JSON['stringify'](_0x2bf2d4));_0x1c16d7(_0x2bf2d4);})[_0xbb43('0x14')](function(_0x565256){logger[_0xbb43('0x10')](_0xbb43('0x15'),_0x565256['message'],_0x2e3b43);_0x4f28b8(_0x55dd73[_0xbb43('0x10')](0x1f4,_0x565256['message']));});});};
\ No newline at end of file
+var _0xd4b6=['jayson/promise','client','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/environment'];(function(_0x4e7667,_0x47c33b){var _0x2dcbad=function(_0x4ec54b){while(--_0x4ec54b){_0x4e7667['push'](_0x4e7667['shift']());}};_0x2dcbad(++_0x47c33b);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x3b6148,_0x2e26e5){_0x3b6148=_0x3b6148-0x0;var _0x2d750a=_0xd4b6[_0x3b6148];return _0x2d750a;};'use strict';var _=require(_0x6d4b('0x0'));var util=require(_0x6d4b('0x1'));var moment=require('moment');var BPromise=require(_0x6d4b('0x2'));var rs=require(_0x6d4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d4b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6d4b('0x5'));var jayson=require(_0x6d4b('0x6'));var client=jayson[_0x6d4b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20f52a,_0x42a52a,_0x424690){return new BPromise(function(_0x262eed,_0x4dcf3d){return client[_0x6d4b('0x8')](_0x20f52a,_0x424690)[_0x6d4b('0x9')](function(_0xb2567b){logger[_0x6d4b('0xa')]('Attachment,\x20%s,\x20%s',_0x42a52a,_0x6d4b('0xb'));logger[_0x6d4b('0xc')](_0x6d4b('0xd'),_0x42a52a,_0x6d4b('0xb'),JSON[_0x6d4b('0xe')](_0xb2567b));if(_0xb2567b[_0x6d4b('0xf')]){if(_0xb2567b[_0x6d4b('0xf')]['code']===0x1f4){logger[_0x6d4b('0xf')](_0x6d4b('0x10'),_0x42a52a,_0xb2567b[_0x6d4b('0xf')]['message']);return _0x4dcf3d(_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);}logger[_0x6d4b('0xf')](_0x6d4b('0x10'),_0x42a52a,_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);return _0x262eed(_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);}else{logger[_0x6d4b('0xa')](_0x6d4b('0x10'),_0x42a52a,'request\x20sent');_0x262eed(_0xb2567b[_0x6d4b('0x12')]['message']);}})[_0x6d4b('0x13')](function(_0x428b75){logger['error']('Attachment,\x20%s,\x20%s',_0x42a52a,_0x428b75);_0x4dcf3d(_0x428b75);});});}exports[_0x6d4b('0x14')]=function(_0x3a30b2){var _0x318b0f=this;return new Promise(function(_0x2694ba,_0xa2f130){return db[_0x6d4b('0x15')][_0x6d4b('0x16')](_0x3a30b2[_0x6d4b('0x17')],{'raw':_0x3a30b2[_0x6d4b('0x18')]?_0x3a30b2[_0x6d4b('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x25a1fa){logger[_0x6d4b('0xa')](_0x6d4b('0x14'),_0x3a30b2);logger['debug'](_0x6d4b('0x14'),_0x3a30b2,JSON[_0x6d4b('0xe')](_0x25a1fa));_0x2694ba(_0x25a1fa);})[_0x6d4b('0x13')](function(_0x26b72d){logger['error'](_0x6d4b('0x14'),_0x26b72d[_0x6d4b('0x11')],_0x3a30b2);_0xa2f130(_0x318b0f[_0x6d4b('0xf')](0x1f4,_0x26b72d[_0x6d4b('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index fb30a56..20b037a 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x14ca6e,_0x3cc76a){var _0x3fa76a=function(_0x3bde0b){while(--_0x3bde0b){_0x14ca6e['push'](_0x14ca6e['shift']());}};_0x3fa76a(++_0x3cc76a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b1082,_0x223695){_0x3b1082=_0x3b1082-0x0;var _0x296714=_0x5f2f[_0x3b1082];return _0x296714;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x0b0e[_0x44b3bd];return _0x1efc4a;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index ffe3dd2..2827568 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f52=['online','admin','user','agent','add','minutes','clearBlockUser','then','getLicense','catch','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','User','passport','passport-local','Strategy','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','blockedAt'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x7f52,0x1cc));var _0x27f5=function(_0x51486a,_0x250856){_0x51486a=_0x51486a-0x0;var _0x7756d9=_0x7f52[_0x51486a];return _0x7756d9;};'use strict';var passport=require(_0x27f5('0x0'));var LocalStrategy=require(_0x27f5('0x1'))[_0x27f5('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x27f5('0x3'));var util=require(_0x27f5('0x4'));var db=require(_0x27f5('0x5'))['db'];var authService=require(_0x27f5('0x6'));var utils=require(_0x27f5('0x7'));var config=require(_0x27f5('0x8'));var logger=require('../../config/logger')(_0x27f5('0x9'));function isActiveDirectoryConfigured(_0xe0e8c3){var _0x57aca7=![];if(typeof _0xe0e8c3[_0x27f5('0xa')]!==_0x27f5('0xb')){_0x57aca7=_0xe0e8c3['activedirectory'][_0x27f5('0xc')]&&_0xe0e8c3[_0x27f5('0xa')][_0x27f5('0xd')]&&_0xe0e8c3[_0x27f5('0xa')][_0x27f5('0xe')];}return _0x57aca7;}function adAuthenticate(_0x19d7b5,_0x681fbc,_0xf7fe12){return new BPromise(function(_0x105ae5,_0x3f2d23){try{var _0x103fdb=new ActiveDirectory(_0x19d7b5);_0x103fdb[_0x27f5('0xf')](_0x681fbc,_0xf7fe12,function(_0x5cdbf2,_0x5cd642){if(_0x5cdbf2){logger[_0x27f5('0x10')](_0x27f5('0x11'),_0x681fbc,util[_0x27f5('0x12')](_0x5cdbf2,{'showHidden':![],'depth':null}));_0x3f2d23(_0x27f5('0x13'));}else if(!_0x5cd642){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x681fbc);_0x3f2d23(_0x27f5('0x13'));}else{_0x105ae5(_0x5cd642);}});}catch(_0x4b3a95){_0x3f2d23(_0x4b3a95);}});}function ActiveDirectoryAuthenticate(_0x338020,_0x52027a,_0x4dabd2,_0xf7830e){var _0xcc2e59,_0x486ffa;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x52027a);return _0xf7830e(null,![],{'message':_0x27f5('0x13')});}return db['Setting'][_0x27f5('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x27f5('0x15')],'raw':!![]})['then'](function(_0x492a34){_0xcc2e59=_0x492a34;if(!_0xcc2e59[_0x27f5('0x16')]){logger[_0x27f5('0x10')](_0x27f5('0x17'),_0x52027a);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x338020[_0x27f5('0x14')]({'attributes':['id',_0x27f5('0x18'),_0x27f5('0x19'),_0x27f5('0x1a'),'role',_0x27f5('0x1b'),_0x27f5('0x1c'),_0x27f5('0x1d'),_0x27f5('0x1e')],'where':{'name':_0x52027a,'role':{'$or':[_0x27f5('0x1f'),_0x27f5('0x20'),_0x27f5('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x307fcc){if(!_0x307fcc||_0x307fcc&&_0x307fcc[_0x27f5('0x18')]!==_0x52027a){throw new Error(_0x27f5('0x13'));}_0x486ffa=_0x307fcc;var _0x284433=_0x486ffa[_0x27f5('0x18')]+'@'+config['activedirectory'][_0x27f5('0xe')];return adAuthenticate(config['activedirectory'],_0x284433,_0x4dabd2);})['then'](function(_0x2c9960){if(_0x486ffa['disabled']){throw new Error(_0x27f5('0x13'));}if(_0xcc2e59[_0x27f5('0x15')]>0x0){if(_0x486ffa[_0x27f5('0x1c')]){if(moment(_0x486ffa[_0x27f5('0x1d')])[_0x27f5('0x22')](_0xcc2e59[_0x27f5('0x15')],_0x27f5('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x27f5('0x24')](_0x486ffa,0x0,![],null)[_0x27f5('0x25')](function(){return utils[_0x27f5('0x26')](_0x486ffa);})[_0x27f5('0x25')](function(){return _0xf7830e(null,_0x486ffa);});}else{return utils[_0x27f5('0x26')](_0x486ffa)['then'](function(){return _0xf7830e(null,_0x486ffa);});}}else{return utils[_0x27f5('0x26')](_0x486ffa)[_0x27f5('0x25')](function(){return _0xf7830e(null,_0x486ffa);});}})[_0x27f5('0x27')](function(_0x5c9eb7){return _0xf7830e(null,![],_0x5c9eb7);});}function handleError(_0x54c352,_0x1c5781,_0x8b041c){return _0x54c352['status'](_0x1c5781||0x1f4)[_0x27f5('0x28')]({'message':_0x8b041c?_0x8b041c[_0x27f5('0x29')]||_0x8b041c:''});}exports[_0x27f5('0x2a')]=function(_0x572edf,_0x400fb5,_0x27ef78){passport['authenticate']('ad-login',function(_0x7bd30a,_0x443f15,_0x265067){var _0x264374=_0x7bd30a||_0x265067;if(_0x264374){return handleError(_0x400fb5,0x191,_0x264374);}if(!_0x443f15){return handleError(_0x400fb5,0x194,{'message':_0x27f5('0x2b')});}else{var _0x16dd14={'payload':{'id':_0x443f15['id'],'role':_0x443f15[_0x27f5('0x2c')]},'options':{'expiresIn':0x15180}};return authService[_0x27f5('0x2d')](_0x16dd14)['then'](function(_0x394048){_0x400fb5[_0x27f5('0x2e')]({'id':_0x443f15['id'],'token':_0x394048,'statusCall':'','isAlreadyLogged':_0x443f15[_0x27f5('0x1e')]});});}})(_0x572edf,_0x400fb5,_0x27ef78);};passport[_0x27f5('0x2f')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x27f5('0x19')},function(_0x509400,_0xcb9087,_0x748660){return ActiveDirectoryAuthenticate(db[_0x27f5('0x30')],_0x509400,_0xcb9087,_0x748660);}));
\ No newline at end of file
+var _0x6889=['activedirectory2','util','../../config/utils','../../config/environment','../../config/logger','activedirectory','url','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','blockedAt','online','user','domain','blocked','minutes','clearBlockUser','getLicense','status','send','message','authenticate','json','use','User','passport','passport-local','Strategy','moment'];(function(_0x5d5f7e,_0x17b602){var _0x4df13f=function(_0x5cf293){while(--_0x5cf293){_0x5d5f7e['push'](_0x5d5f7e['shift']());}};_0x4df13f(++_0x17b602);}(_0x6889,0x114));var _0x9688=function(_0x13f5ac,_0x303066){_0x13f5ac=_0x13f5ac-0x0;var _0x163d97=_0x6889[_0x13f5ac];return _0x163d97;};'use strict';var passport=require(_0x9688('0x0'));var LocalStrategy=require(_0x9688('0x1'))[_0x9688('0x2')];var moment=require(_0x9688('0x3'));var ActiveDirectory=require(_0x9688('0x4'));var BPromise=require('bluebird');var util=require(_0x9688('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x9688('0x6'));var config=require(_0x9688('0x7'));var logger=require(_0x9688('0x8'))('api');function isActiveDirectoryConfigured(_0x795938){var _0x2b8881=![];if(typeof _0x795938[_0x9688('0x9')]!=='undefined'){_0x2b8881=_0x795938[_0x9688('0x9')]['baseDN']&&_0x795938['activedirectory'][_0x9688('0xa')]&&_0x795938['activedirectory']['domain'];}return _0x2b8881;}function adAuthenticate(_0x5322b0,_0x3171ed,_0x396ab2){return new BPromise(function(_0x284c71,_0x4d1ef0){try{var _0x123c50=new ActiveDirectory(_0x5322b0);_0x123c50['authenticate'](_0x3171ed,_0x396ab2,function(_0x53ba22,_0x59dec3){if(_0x53ba22){logger[_0x9688('0xb')](_0x9688('0xc'),_0x3171ed,util['inspect'](_0x53ba22,{'showHidden':![],'depth':null}));_0x4d1ef0('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x59dec3){logger[_0x9688('0xb')](_0x9688('0xd'),_0x3171ed);_0x4d1ef0(_0x9688('0xe'));}else{_0x284c71(_0x59dec3);}});}catch(_0x17a9ae){_0x4d1ef0(_0x17a9ae);}});}function ActiveDirectoryAuthenticate(_0x466211,_0x5f3055,_0x17b5f6,_0xd9dfc){var _0x2daabc,_0x1b3646;if(!isActiveDirectoryConfigured(config)){logger[_0x9688('0xb')](_0x9688('0xf'),_0x5f3055);return _0xd9dfc(null,![],{'message':_0x9688('0xe')});}return db[_0x9688('0x10')][_0x9688('0x11')]({'where':{'id':0x1},'attributes':[_0x9688('0x12'),_0x9688('0x13')],'raw':!![]})[_0x9688('0x14')](function(_0x51fe0e){_0x2daabc=_0x51fe0e;if(!_0x2daabc[_0x9688('0x12')]){logger[_0x9688('0xb')](_0x9688('0x15'),_0x5f3055);throw new Error(_0x9688('0xe'));}return _0x466211['findOne']({'attributes':['id',_0x9688('0x16'),_0x9688('0x17'),'salt',_0x9688('0x18'),'disabled','blocked',_0x9688('0x19'),_0x9688('0x1a')],'where':{'name':_0x5f3055,'role':{'$or':['admin',_0x9688('0x1b'),'agent']},'adSsoEnabled':!![]}});})[_0x9688('0x14')](function(_0x477a58){if(!_0x477a58||_0x477a58&&_0x477a58['name']!==_0x5f3055){throw new Error(_0x9688('0xe'));}_0x1b3646=_0x477a58;var _0x1faf51=_0x1b3646[_0x9688('0x16')]+'@'+config[_0x9688('0x9')][_0x9688('0x1c')];return adAuthenticate(config[_0x9688('0x9')],_0x1faf51,_0x17b5f6);})[_0x9688('0x14')](function(_0x2d196a){if(_0x1b3646['disabled']){throw new Error(_0x9688('0xe'));}if(_0x2daabc[_0x9688('0x13')]>0x0){if(_0x1b3646[_0x9688('0x1d')]){if(moment(_0x1b3646[_0x9688('0x19')])['add'](_0x2daabc['blockDuration'],_0x9688('0x1e'))>moment()){throw new Error(_0x9688('0xe'));}return utils[_0x9688('0x1f')](_0x1b3646,0x0,![],null)[_0x9688('0x14')](function(){return utils[_0x9688('0x20')](_0x1b3646);})[_0x9688('0x14')](function(){return _0xd9dfc(null,_0x1b3646);});}else{return utils[_0x9688('0x20')](_0x1b3646)[_0x9688('0x14')](function(){return _0xd9dfc(null,_0x1b3646);});}}else{return utils[_0x9688('0x20')](_0x1b3646)[_0x9688('0x14')](function(){return _0xd9dfc(null,_0x1b3646);});}})['catch'](function(_0x338caa){return _0xd9dfc(null,![],_0x338caa);});}function handleError(_0x204d7c,_0x698e50,_0xc2906){return _0x204d7c[_0x9688('0x21')](_0x698e50||0x1f4)[_0x9688('0x22')]({'message':_0xc2906?_0xc2906[_0x9688('0x23')]||_0xc2906:''});}exports['login']=function(_0x4a8168,_0x567312,_0x1d6e33){passport[_0x9688('0x24')]('ad-login',function(_0x299c31,_0x142071,_0x2d9408){var _0x1af471=_0x299c31||_0x2d9408;if(_0x1af471){return handleError(_0x567312,0x191,_0x1af471);}if(!_0x142071){return handleError(_0x567312,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3bcb44={'payload':{'id':_0x142071['id'],'role':_0x142071[_0x9688('0x18')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3bcb44)[_0x9688('0x14')](function(_0x22adaa){_0x567312[_0x9688('0x25')]({'id':_0x142071['id'],'token':_0x22adaa,'statusCall':'','isAlreadyLogged':_0x142071[_0x9688('0x1a')]});});}})(_0x4a8168,_0x567312,_0x1d6e33);};passport[_0x9688('0x26')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x9688('0x17')},function(_0x5ba757,_0x4f8f07,_0x25f53e){return ActiveDirectoryAuthenticate(db[_0x9688('0x27')],_0x5ba757,_0x4f8f07,_0x25f53e);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index cb9720e..50372c0 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x84c2=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x4e1ba7,_0x5311f2){var _0x145c84=function(_0x1b4788){while(--_0x1b4788){_0x4e1ba7['push'](_0x4e1ba7['shift']());}};_0x145c84(++_0x5311f2);}(_0x84c2,0x1a7));var _0x284c=function(_0x396552,_0x532a80){_0x396552=_0x396552-0x0;var _0xb63575=_0x84c2[_0x396552];return _0xb63575;};'use strict';var express=require(_0x284c('0x0'));var router=express[_0x284c('0x1')]();var controller=require(_0x284c('0x2'));router[_0x284c('0x3')]('/',controller[_0x284c('0x4')]);module[_0x284c('0x5')]=router;
\ No newline at end of file
+var _0x2e55=['Router','./authActiveDirectory.controller','exports','express'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x2e55,0xeb));var _0x52e5=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x2e55[_0xf26d40];return _0x50b68c;};'use strict';var express=require(_0x52e5('0x0'));var router=express[_0x52e5('0x1')]();var controller=require(_0x52e5('0x2'));router['post']('/',controller['login']);module[_0x52e5('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index ce73e5b..b895166 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x213f91,_0x8f3782){var _0x5cf677=function(_0x469754){while(--_0x469754){_0x213f91['push'](_0x213f91['shift']());}};_0x5cf677(++_0x8f3782);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7a54,0x106));var _0x47a5=function(_0x28dc65,_0x47963e){_0x28dc65=_0x28dc65-0x0;var _0x74222b=_0x7a54[_0x28dc65];return _0x74222b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 8a15539..204d0ff 100644
--- a/server/api/authGoogle/index.js
+++ b/server/api/authGoogle/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x596c=['get','login','isMiddleware','setTokenCookie','exports','../user/user.controller.js'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0x596c,0x1cd));var _0xc596=function(_0x55a177,_0x3fed1b){_0x55a177=_0x55a177-0x0;var _0x4196eb=_0x596c[_0x55a177];return _0x4196eb;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xc596('0x0'));var authService=require('../../components/auth/service');router[_0xc596('0x1')]('/',controller[_0xc596('0x2')]);router['get']('/callback',controller['callback'],authService[_0xc596('0x3')],userController['login'],authService[_0xc596('0x4')]);module[_0xc596('0x5')]=router;
\ No newline at end of file
+var _0x5e58=['callback','isMiddleware','login','express','get','/callback'];(function(_0x364a17,_0x1c3288){var _0x1a78ce=function(_0x5940a3){while(--_0x5940a3){_0x364a17['push'](_0x364a17['shift']());}};_0x1a78ce(++_0x1c3288);}(_0x5e58,0x14d));var _0x85e5=function(_0x201b94,_0x5cada6){_0x201b94=_0x201b94-0x0;var _0x49da82=_0x5e58[_0x201b94];return _0x49da82;};'use strict';var express=require(_0x85e5('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x85e5('0x1')]('/',controller['login']);router['get'](_0x85e5('0x2'),controller[_0x85e5('0x3')],authService[_0x85e5('0x4')],userController[_0x85e5('0x5')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 37c0c8d..683724b 100644
--- a/server/api/authLocal/authLocal.controller.js
+++ b/server/api/authLocal/authLocal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d46=['format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','message','stringify','status','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','blockedAt','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','loginAttempts','admin','user','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge'];(function(_0x34e29e,_0x3d6df5){var _0x4d0088=function(_0x317af6){while(--_0x317af6){_0x34e29e['push'](_0x34e29e['shift']());}};_0x4d0088(++_0x3d6df5);}(_0x9d46,0xe1));var _0x69d4=function(_0x17c92d,_0x571d35){_0x17c92d=_0x17c92d-0x0;var _0x2f26ba=_0x9d46[_0x17c92d];return _0x2f26ba;};'use strict';var util=require(_0x69d4('0x0'));var passport=require(_0x69d4('0x1'));var LocalStrategy=require(_0x69d4('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x69d4('0x3'));var rs=require(_0x69d4('0x4'));var moment=require('moment');var db=require(_0x69d4('0x5'))['db'];var authService=require(_0x69d4('0x6'));var utils=require(_0x69d4('0x7'));var client=jayson[_0x69d4('0x8')][_0x69d4('0x9')]({'port':0x232b});function localAuthenticate(_0x19db4c,_0x4bf4ab,_0x521088,_0x2205f8){var _0x2626ef,_0x47edc5;return db['Setting'][_0x69d4('0xa')]({'where':{'id':0x1},'attributes':[_0x69d4('0xb'),_0x69d4('0xc')],'raw':!![]})['then'](function(_0x13ec19){_0x2626ef=_0x13ec19;return _0x19db4c[_0x69d4('0xa')]({'attributes':['id','name',_0x69d4('0xd'),_0x69d4('0xe'),_0x69d4('0xf'),_0x69d4('0x10'),'blocked','blockedAt',_0x69d4('0x11')],'where':{'name':_0x4bf4ab,'role':{'$or':[_0x69d4('0x12'),_0x69d4('0x13'),_0x69d4('0x14')]}}});})[_0x69d4('0x15')](function(_0x206021){if(!_0x206021||_0x206021&&_0x206021[_0x69d4('0x16')]!==_0x4bf4ab){throw new Error(_0x69d4('0x17'));}else{_0x47edc5=_0x206021;return _0x47edc5;}})[_0x69d4('0x15')](function(){_0x47edc5['authenticate'](_0x521088,function(_0x325da1,_0x512639){var _0x3c1243=_0x47edc5['loginAttempts']+0x1;if(_0x325da1){return _0x2205f8(_0x325da1);}else if(!_0x512639){if(_0x47edc5[_0x69d4('0x10')]){return _0x2205f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2626ef[_0x69d4('0xb')]>0x0){if(_0x47edc5[_0x69d4('0x18')]){if(_0x2626ef['blockDuration']>0x0){if(moment(_0x47edc5['blockedAt'])['add'](_0x2626ef[_0x69d4('0xc')],_0x69d4('0x19'))>moment()){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else{return utils[_0x69d4('0x1a')](_0x47edc5,_0x3c1243,![],null)[_0x69d4('0x15')](function(){return _0x2205f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}}else{if(_0x3c1243>=_0x2626ef[_0x69d4('0xb')]){return utils[_0x69d4('0x1a')](_0x47edc5,0x0,!![],moment())[_0x69d4('0x15')](function(){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});});}else{return utils[_0x69d4('0x1a')](_0x47edc5,_0x3c1243,![],null)[_0x69d4('0x15')](function(){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});});}}}else{return _0x2205f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x47edc5[_0x69d4('0x10')]){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else if(_0x2626ef[_0x69d4('0xb')]>0x0){if(_0x47edc5[_0x69d4('0x18')]){if(_0x2626ef[_0x69d4('0xc')]>0x0){if(moment(_0x47edc5['blockedAt'])['add'](_0x2626ef[_0x69d4('0xc')],_0x69d4('0x19'))>moment()){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else{return utils['clearBlockUser'](_0x47edc5,0x0,![],null)[_0x69d4('0x15')](function(){return utils[_0x69d4('0x1b')](_0x47edc5);})['then'](function(){return _0x2205f8(null,_0x47edc5);});}}else{return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}}else{return utils['clearBlockUser'](_0x47edc5,0x0,![],null)['then'](function(){return utils[_0x69d4('0x1b')](_0x47edc5);})[_0x69d4('0x15')](function(){return _0x2205f8(null,_0x47edc5);})[_0x69d4('0x1c')](function(_0x2fb2e2){return _0x2205f8(null,![],_0x2fb2e2);});}}else{if(_0x47edc5[_0x69d4('0x18')]){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else{return utils[_0x69d4('0x1b')](_0x47edc5)['then'](function(){return _0x2205f8(null,_0x47edc5);});}}}});})[_0x69d4('0x1c')](function(_0x108c49){return _0x2205f8(null,![],_0x108c49);});}function sendServiceMail(_0x3040bd){return db['MailAccount'][_0x69d4('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x69d4('0x1e')],'include':[{'model':db[_0x69d4('0x1f')],'as':'Smtp','include':[{'model':db[_0x69d4('0x20')],'as':_0x69d4('0x20')}]}]})[_0x69d4('0x15')](function(_0x3d4e4a){if(!_0x3d4e4a){throw new Error(_0x69d4('0x21'));}var _0x4ebb7c=_0x3d4e4a[_0x69d4('0x22')]();var _0xe118d0={'account':_0x4ebb7c,'message':_[_0x69d4('0x23')]({'from':util[_0x69d4('0x24')](_0x69d4('0x25'),_0x3d4e4a[_0x69d4('0x16')],_0x3d4e4a[_0x69d4('0x1e')]||_0x3d4e4a[_0x69d4('0x26')]['user'])},_0x3040bd)};return client[_0x69d4('0x27')](_0x69d4('0x28'),_0xe118d0);})['then'](function(_0x192bd8){if(_0x192bd8[_0x69d4('0x29')]){throw new Error(util[_0x69d4('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x192bd8['error'][_0x69d4('0x2a')]||JSON[_0x69d4('0x2b')](_0x192bd8[_0x69d4('0x29')])));}return!![];});}function handleError(_0x4145f8,_0x508c63,_0x4e34b7){return _0x4145f8[_0x69d4('0x2c')](_0x508c63||0x1f4)['send']({'message':_0x4e34b7?_0x4e34b7[_0x69d4('0x2a')]||_0x4e34b7:''});}exports[_0x69d4('0x2d')]=function(_0x19dd84,_0x13adbb,_0x54b74e){passport[_0x69d4('0x2e')](_0x69d4('0x2f'),function(_0x323a9c,_0x1604f6,_0x411495){var _0x3f0f7d=_0x323a9c||_0x411495;if(_0x3f0f7d){return handleError(_0x13adbb,0x191,_0x3f0f7d);}if(!_0x1604f6){return handleError(_0x13adbb,0x194,{'message':_0x69d4('0x30')});}else{var _0x23859a={'payload':{'id':_0x1604f6['id'],'role':_0x1604f6[_0x69d4('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x69d4('0x31')](_0x23859a)[_0x69d4('0x15')](function(_0x4ef0a1){_0x13adbb[_0x69d4('0x32')]({'id':_0x1604f6['id'],'token':_0x4ef0a1,'statusCall':'','isAlreadyLogged':_0x1604f6[_0x69d4('0x33')]});});}})(_0x19dd84,_0x13adbb,_0x54b74e);};exports[_0x69d4('0x34')]=function(_0x18077e,_0x809a53){if(!_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')]){return handleError(_0x809a53,0x1f4,{'message':_0x69d4('0x36')});}var _0x5117b3=rs[_0x69d4('0x37')]();_0x18077e['body'][_0x69d4('0x1e')]=_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')][_0x69d4('0x38')]()[_0x69d4('0x39')]();var _0x2773b0;return db[_0x69d4('0x3a')][_0x69d4('0xa')]({'where':{'id':0x1},'attributes':[_0x69d4('0xb'),'blockDuration'],'raw':!![]})[_0x69d4('0x15')](function(_0x1e8b6f){_0x2773b0=_0x1e8b6f;return db[_0x69d4('0x3b')][_0x69d4('0x1d')]({'where':{'email':_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')]}});})[_0x69d4('0x15')](function(_0x1bba89){if(!_0x1bba89){throw new Error(_0x69d4('0x3c'));}if(_0x1bba89[_0x69d4('0x10')]){throw new Error(_0x69d4('0x3d'));}if(_0x1bba89['blocked']){if(moment(_0x1bba89[_0x69d4('0x3e')])[_0x69d4('0x3f')](_0x2773b0[_0x69d4('0xc')],_0x69d4('0x19'))>moment()){throw new Error(_0x69d4('0x40'));}else{_0x1bba89[_0x69d4('0x18')]=![];_0x1bba89[_0x69d4('0x3e')]=null;}}_0x1bba89[_0x69d4('0x41')]=_0x5117b3;_0x1bba89[_0x69d4('0x42')]=Date[_0x69d4('0x43')]()+0x36ee80;return _0x1bba89[_0x69d4('0x44')]();})[_0x69d4('0x15')](function(){return sendServiceMail({'to':_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')],'subject':_0x69d4('0x45'),'text':_0x69d4('0x46')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x18077e[_0x69d4('0x47')]['host']+_0x69d4('0x48')+_0x5117b3+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x69d4('0x15')](function(){_0x809a53[_0x69d4('0x2c')](0xc8)[_0x69d4('0x49')]({'message':_0x69d4('0x4a')});})['catch'](function(_0x3bd64b){return handleError(_0x809a53,0x1f4,_0x3bd64b);});};exports[_0x69d4('0x4b')]=function(_0x585e0d,_0x170f32){return db[_0x69d4('0x3b')][_0x69d4('0x1d')]({'where':{'resetPasswordToken':_0x585e0d[_0x69d4('0x4c')][_0x69d4('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x69d4('0x43')]()}}})[_0x69d4('0x15')](function(_0x3fa2d7){if(!_0x3fa2d7){throw new Error(_0x69d4('0x4e'));}return db['Setting'][_0x69d4('0xa')]({'attributes':['id',_0x69d4('0x4f'),'enforcePasswordHistory',_0x69d4('0x50')]})[_0x69d4('0x15')](function(_0x4237e0){if(_0x4237e0[_0x69d4('0x4f')])authService[_0x69d4('0x51')](_0x585e0d[_0x69d4('0x35')]['password']);if(!_0x4237e0[_0x69d4('0x52')]||!_0x3fa2d7['previousPasswords'])return _0x3fa2d7;authService[_0x69d4('0x53')](_0x585e0d[_0x69d4('0x35')][_0x69d4('0xd')],_0x3fa2d7[_0x69d4('0x54')],_0x4237e0[_0x69d4('0x50')]);return _0x3fa2d7;})['then'](function(){_0x3fa2d7[_0x69d4('0xd')]=_0x585e0d[_0x69d4('0x35')][_0x69d4('0xd')];_0x3fa2d7[_0x69d4('0x41')]=null;_0x3fa2d7[_0x69d4('0x42')]=null;return _0x3fa2d7['save']();});})[_0x69d4('0x15')](function(){_0x170f32[_0x69d4('0x2c')](0xc8)[_0x69d4('0x49')]({'message':_0x69d4('0x55')});})[_0x69d4('0x1c')](function(_0x4eebb9){return handleError(_0x170f32,0x1f4,_0x4eebb9);});};passport[_0x69d4('0x56')](_0x69d4('0x2f'),new LocalStrategy({'usernameField':_0x69d4('0x16'),'passwordField':_0x69d4('0xd')},function(_0x433b19,_0x2a007a,_0x883f2f){return localAuthenticate(db[_0x69d4('0x3b')],_0x433b19,_0x2a007a,_0x883f2f);}));
\ No newline at end of file
+var _0x40ff=['findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','admin','user','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','minutes','clearBlockUser','blockedAt','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','\x22%s\x22\x20<%s>','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting'];(function(_0x175cd1,_0x5dd9f8){var _0x3ff513=function(_0x2835c4){while(--_0x2835c4){_0x175cd1['push'](_0x175cd1['shift']());}};_0x3ff513(++_0x5dd9f8);}(_0x40ff,0xe8));var _0xf40f=function(_0x5e41f0,_0x1799cc){_0x5e41f0=_0x5e41f0-0x0;var _0x5c85c4=_0x40ff[_0x5e41f0];return _0x5c85c4;};'use strict';var util=require(_0xf40f('0x0'));var passport=require(_0xf40f('0x1'));var LocalStrategy=require(_0xf40f('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xf40f('0x3'));var rs=require('randomstring');var moment=require(_0xf40f('0x4'));var db=require(_0xf40f('0x5'))['db'];var authService=require(_0xf40f('0x6'));var utils=require(_0xf40f('0x7'));var client=jayson[_0xf40f('0x8')][_0xf40f('0x9')]({'port':0x232b});function localAuthenticate(_0x4323cf,_0x55d113,_0x4318c6,_0x2f9923){var _0xc6cdaf,_0x134784;return db[_0xf40f('0xa')][_0xf40f('0xb')]({'where':{'id':0x1},'attributes':[_0xf40f('0xc'),'blockDuration'],'raw':!![]})[_0xf40f('0xd')](function(_0x5bf174){_0xc6cdaf=_0x5bf174;return _0x4323cf['findOne']({'attributes':['id',_0xf40f('0xe'),_0xf40f('0xf'),_0xf40f('0x10'),_0xf40f('0x11'),_0xf40f('0x12'),_0xf40f('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x55d113,'role':{'$or':[_0xf40f('0x14'),_0xf40f('0x15'),'agent']}}});})['then'](function(_0x53948f){if(!_0x53948f||_0x53948f&&_0x53948f['name']!==_0x55d113){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x134784=_0x53948f;return _0x134784;}})[_0xf40f('0xd')](function(){_0x134784['authenticate'](_0x4318c6,function(_0x407c19,_0x14699d){var _0x54e684=_0x134784[_0xf40f('0x16')]+0x1;if(_0x407c19){return _0x2f9923(_0x407c19);}else if(!_0x14699d){if(_0x134784['disabled']){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else if(_0xc6cdaf[_0xf40f('0xc')]>0x0){if(_0x134784['blocked']){if(_0xc6cdaf[_0xf40f('0x18')]>0x0){if(moment(_0x134784['blockedAt'])['add'](_0xc6cdaf[_0xf40f('0x18')],_0xf40f('0x19'))>moment()){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else{return utils[_0xf40f('0x1a')](_0x134784,_0x54e684,![],null)[_0xf40f('0xd')](function(){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});});}}else{return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}}else{if(_0x54e684>=_0xc6cdaf[_0xf40f('0xc')]){return utils[_0xf40f('0x1a')](_0x134784,0x0,!![],moment())[_0xf40f('0xd')](function(){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});});}else{return utils['clearBlockUser'](_0x134784,_0x54e684,![],null)[_0xf40f('0xd')](function(){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});});}}}else{return _0x2f9923(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x134784[_0xf40f('0x12')]){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else if(_0xc6cdaf[_0xf40f('0xc')]>0x0){if(_0x134784['blocked']){if(_0xc6cdaf['blockDuration']>0x0){if(moment(_0x134784[_0xf40f('0x1b')])[_0xf40f('0x1c')](_0xc6cdaf[_0xf40f('0x18')],_0xf40f('0x19'))>moment()){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else{return utils['clearBlockUser'](_0x134784,0x0,![],null)[_0xf40f('0xd')](function(){return utils['getLicense'](_0x134784);})[_0xf40f('0xd')](function(){return _0x2f9923(null,_0x134784);});}}else{return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}}else{return utils[_0xf40f('0x1a')](_0x134784,0x0,![],null)['then'](function(){return utils[_0xf40f('0x1d')](_0x134784);})[_0xf40f('0xd')](function(){return _0x2f9923(null,_0x134784);})[_0xf40f('0x1e')](function(_0x4d8e15){return _0x2f9923(null,![],_0x4d8e15);});}}else{if(_0x134784[_0xf40f('0x13')]){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else{return utils['getLicense'](_0x134784)[_0xf40f('0xd')](function(){return _0x2f9923(null,_0x134784);});}}}});})[_0xf40f('0x1e')](function(_0x3b987d){return _0x2f9923(null,![],_0x3b987d);});}function sendServiceMail(_0x1e57a9){return db['MailAccount'][_0xf40f('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xf40f('0xe'),_0xf40f('0x20')],'include':[{'model':db[_0xf40f('0x21')],'as':_0xf40f('0x22'),'include':[{'model':db[_0xf40f('0x23')],'as':_0xf40f('0x23')}]}]})['then'](function(_0x1333b7){if(!_0x1333b7){throw new Error(_0xf40f('0x24'));}var _0x1b642e=_0x1333b7[_0xf40f('0x25')]();var _0x371dc9={'account':_0x1b642e,'message':_['merge']({'from':util['format'](_0xf40f('0x26'),_0x1333b7[_0xf40f('0xe')],_0x1333b7['email']||_0x1333b7['Smtp'][_0xf40f('0x15')])},_0x1e57a9)};return client[_0xf40f('0x27')](_0xf40f('0x28'),_0x371dc9);})[_0xf40f('0xd')](function(_0x532240){if(_0x532240['error']){throw new Error(util[_0xf40f('0x29')](_0xf40f('0x2a'),_0x532240[_0xf40f('0x2b')][_0xf40f('0x2c')]||JSON[_0xf40f('0x2d')](_0x532240[_0xf40f('0x2b')])));}return!![];});}function handleError(_0x4aa496,_0x1ee844,_0x441bc1){return _0x4aa496[_0xf40f('0x2e')](_0x1ee844||0x1f4)[_0xf40f('0x2f')]({'message':_0x441bc1?_0x441bc1[_0xf40f('0x2c')]||_0x441bc1:''});}exports[_0xf40f('0x30')]=function(_0x2f9170,_0x3ddddc,_0x50d96d){passport[_0xf40f('0x31')](_0xf40f('0x32'),function(_0x2f95b8,_0x556c8e,_0x5dd8f6){var _0x2eafb4=_0x2f95b8||_0x5dd8f6;if(_0x2eafb4){return handleError(_0x3ddddc,0x191,_0x2eafb4);}if(!_0x556c8e){return handleError(_0x3ddddc,0x194,{'message':_0xf40f('0x33')});}else{var _0x45d57c={'payload':{'id':_0x556c8e['id'],'role':_0x556c8e[_0xf40f('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xf40f('0x34')](_0x45d57c)['then'](function(_0x3bc02d){_0x3ddddc[_0xf40f('0x35')]({'id':_0x556c8e['id'],'token':_0x3bc02d,'statusCall':'','isAlreadyLogged':_0x556c8e['online']});});}})(_0x2f9170,_0x3ddddc,_0x50d96d);};exports[_0xf40f('0x36')]=function(_0x115e58,_0x4c22d6){if(!_0x115e58[_0xf40f('0x37')][_0xf40f('0x20')]){return handleError(_0x4c22d6,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xcc2eb3=rs['generate']();_0x115e58[_0xf40f('0x37')][_0xf40f('0x20')]=_0x115e58[_0xf40f('0x37')]['email'][_0xf40f('0x38')]()[_0xf40f('0x39')]();var _0x4b4879;return db[_0xf40f('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xf40f('0xc'),_0xf40f('0x18')],'raw':!![]})[_0xf40f('0xd')](function(_0x4609f0){_0x4b4879=_0x4609f0;return db[_0xf40f('0x3a')][_0xf40f('0x1f')]({'where':{'email':_0x115e58[_0xf40f('0x37')]['email']}});})[_0xf40f('0xd')](function(_0x19ddc3){if(!_0x19ddc3){throw new Error(_0xf40f('0x3b'));}if(_0x19ddc3['disabled']){throw new Error(_0xf40f('0x3c'));}if(_0x19ddc3[_0xf40f('0x13')]){if(moment(_0x19ddc3['blockedAt'])[_0xf40f('0x1c')](_0x4b4879[_0xf40f('0x18')],_0xf40f('0x19'))>moment()){throw new Error(_0xf40f('0x3d'));}else{_0x19ddc3[_0xf40f('0x13')]=![];_0x19ddc3['blockedAt']=null;}}_0x19ddc3['resetPasswordToken']=_0xcc2eb3;_0x19ddc3['resetPasswordExpires']=Date[_0xf40f('0x3e')]()+0x36ee80;return _0x19ddc3[_0xf40f('0x3f')]();})['then'](function(){return sendServiceMail({'to':_0x115e58['body'][_0xf40f('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf40f('0x40')+_0xf40f('0x41')+_0xf40f('0x42')+_0x115e58[_0xf40f('0x43')]['host']+'/reset/'+_0xcc2eb3+'\x0a\x0a'+_0xf40f('0x44')});})['then'](function(){_0x4c22d6[_0xf40f('0x2e')](0xc8)[_0xf40f('0x2f')]({'message':_0xf40f('0x45')});})[_0xf40f('0x1e')](function(_0x360340){return handleError(_0x4c22d6,0x1f4,_0x360340);});};exports[_0xf40f('0x46')]=function(_0x47ce81,_0x3d3087){return db[_0xf40f('0x3a')][_0xf40f('0x1f')]({'where':{'resetPasswordToken':_0x47ce81['params'][_0xf40f('0x47')],'resetPasswordExpires':{'$gt':Date[_0xf40f('0x3e')]()}}})[_0xf40f('0xd')](function(_0x577374){if(!_0x577374){throw new Error(_0xf40f('0x48'));}return db['Setting'][_0xf40f('0xb')]({'attributes':['id',_0xf40f('0x49'),'enforcePasswordHistory',_0xf40f('0x4a')]})[_0xf40f('0xd')](function(_0x17e0d4){if(_0x17e0d4[_0xf40f('0x49')])authService[_0xf40f('0x4b')](_0x47ce81[_0xf40f('0x37')][_0xf40f('0xf')]);if(!_0x17e0d4['enforcePasswordHistory']||!_0x577374[_0xf40f('0x4c')])return _0x577374;authService[_0xf40f('0x4d')](_0x47ce81['body'][_0xf40f('0xf')],_0x577374[_0xf40f('0x4c')],_0x17e0d4['passwordHistoryLimit']);return _0x577374;})[_0xf40f('0xd')](function(){_0x577374['password']=_0x47ce81[_0xf40f('0x37')]['password'];_0x577374['resetPasswordToken']=null;_0x577374[_0xf40f('0x4e')]=null;return _0x577374['save']();});})['then'](function(){_0x3d3087[_0xf40f('0x2e')](0xc8)[_0xf40f('0x2f')]({'message':_0xf40f('0x4f')});})[_0xf40f('0x1e')](function(_0xd15605){return handleError(_0x3d3087,0x1f4,_0xd15605);});};passport[_0xf40f('0x50')](_0xf40f('0x32'),new LocalStrategy({'usernameField':_0xf40f('0xe'),'passwordField':_0xf40f('0xf')},function(_0x4e5bc8,_0x38e62d,_0x41ebbc){return localAuthenticate(db[_0xf40f('0x3a')],_0x4e5bc8,_0x38e62d,_0x41ebbc);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 66d9d6c..cce9aed 100644
--- a/server/api/authLocal/index.js
+++ b/server/api/authLocal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x593a=['login','/forgot','forgot','reset','./authLocal.controller','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x593a,0x6a));var _0xa593=function(_0xf6842c,_0x5aaeb8){_0xf6842c=_0xf6842c-0x0;var _0x446268=_0x593a[_0xf6842c];return _0x446268;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa593('0x0'));router[_0xa593('0x1')]('/',controller[_0xa593('0x2')]);router[_0xa593('0x1')](_0xa593('0x3'),controller[_0xa593('0x4')]);router[_0xa593('0x1')]('/reset/:token',controller[_0xa593('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x3ef3=['post','login','forgot','/reset/:token','express','Router'];(function(_0x587bdb,_0xffed85){var _0x3e292c=function(_0xc1bb6b){while(--_0xc1bb6b){_0x587bdb['push'](_0x587bdb['shift']());}};_0x3e292c(++_0xffed85);}(_0x3ef3,0xdc));var _0x33ef=function(_0x3ffa4a,_0xbfbae4){_0x3ffa4a=_0x3ffa4a-0x0;var _0x4e9062=_0x3ef3[_0x3ffa4a];return _0x4e9062;};'use strict';var express=require(_0x33ef('0x0'));var router=express[_0x33ef('0x1')]();var controller=require('./authLocal.controller');router[_0x33ef('0x2')]('/',controller[_0x33ef('0x3')]);router[_0x33ef('0x2')]('/forgot',controller[_0x33ef('0x4')]);router['post'](_0x33ef('0x5'),controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 556335f..a775fcb 100644
--- a/server/api/automation/automation.attributes.js
+++ b/server/api/automation/automation.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc02d=['sequelize','exports','STRING','INTEGER'];(function(_0x3c49b5,_0x2fce8e){var _0x146bc9=function(_0x5e4010){while(--_0x5e4010){_0x3c49b5['push'](_0x3c49b5['shift']());}};_0x146bc9(++_0x2fce8e);}(_0xc02d,0x1b0));var _0xdc02=function(_0x552516,_0x33e040){_0x552516=_0x552516-0x0;var _0x533b0a=_0xc02d[_0x552516];return _0x533b0a;};'use strict';var Sequelize=require(_0xdc02('0x0'));module[_0xdc02('0x1')]={'name':{'type':Sequelize[_0xdc02('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xdc02('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xdc02('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x8a04=['sequelize','STRING','INTEGER'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x8a04,0x1d7));var _0x48a0=function(_0x3cba10,_0x365836){_0x3cba10=_0x3cba10-0x0;var _0x27fc93=_0x8a04[_0x3cba10];return _0x27fc93;};'use strict';var Sequelize=require(_0x48a0('0x0'));module['exports']={'name':{'type':Sequelize[_0x48a0('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x48a0('0x1')]},'description':{'type':Sequelize[_0x48a0('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x48a0('0x2')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index e5d7c6c..cbef0c3 100644
--- a/server/api/automation/automation.controller.js
+++ b/server/api/automation/automation.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x336c=['nolimit','order','sort','where','filter','type','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','intersection','includeAll','find','create','body','addConditions','Condition','getConditions','findOne','pick','options','addActions','Action','ids','getActions','hasOwnProperty','eml-format','rimraf','request-promise','moment','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','Automation','rawAttributes','fieldName','model','query','filters','attributes','fields','length'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x336c,0x15f));var _0xc336=function(_0x49ae59,_0x52bdd0){_0x49ae59=_0x49ae59-0x0;var _0x3888b8=_0x336c[_0x49ae59];return _0x3888b8;};'use strict';var emlformat=require(_0xc336('0x0'));var rimraf=require(_0xc336('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc336('0x2'));var moment=require(_0xc336('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc336('0x4'));var path=require(_0xc336('0x5'));var sox=require('sox');var csv=require(_0xc336('0x6'));var ejs=require(_0xc336('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc336('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc336('0x9'));var toCsv=require('to-csv');var querystring=require(_0xc336('0xa'));var Papa=require(_0xc336('0xb'));var Redis=require(_0xc336('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc336('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc336('0xe'));var utils=require(_0xc336('0xf'));var config=require(_0xc336('0x10'));var licenseUtil=require(_0xc336('0x11'));var db=require(_0xc336('0x12'))['db'];function respondWithStatusCode(_0x5c891e,_0x351229){_0x351229=_0x351229||0xcc;return function(_0x45302b){if(_0x45302b){return _0x5c891e['sendStatus'](_0x351229);}return _0x5c891e[_0xc336('0x13')](_0x351229)['end']();};}function respondWithResult(_0x97bba0,_0x1b74d5){_0x1b74d5=_0x1b74d5||0xc8;return function(_0x10b59b){if(_0x10b59b){return _0x97bba0[_0xc336('0x13')](_0x1b74d5)[_0xc336('0x14')](_0x10b59b);}};}function respondWithFilteredResult(_0x7b4b08,_0x90b322){return function(_0x552a60){if(_0x552a60){var _0x51c035=typeof _0x90b322[_0xc336('0x15')]===_0xc336('0x16')&&typeof _0x90b322[_0xc336('0x17')]==='undefined';var _0x125592=_0x552a60[_0xc336('0x18')];var _0x330b4c=_0x51c035?0x0:_0x90b322[_0xc336('0x15')];var _0xfff80d=_0x51c035?_0x552a60['count']:_0x90b322['offset']+_0x90b322[_0xc336('0x17')];var _0x1e121f;if(_0xfff80d>=_0x125592){_0xfff80d=_0x125592;_0x1e121f=0xc8;}else{_0x1e121f=0xce;}_0x7b4b08['status'](_0x1e121f);return _0x7b4b08[_0xc336('0x19')](_0xc336('0x1a'),_0x330b4c+'-'+_0xfff80d+'/'+_0x125592)[_0xc336('0x14')](_0x552a60);}return null;};}function patchUpdates(_0x3fcb11){return function(_0x374561){try{jsonpatch[_0xc336('0x1b')](_0x374561,_0x3fcb11,!![]);}catch(_0x1c598e){return BPromise[_0xc336('0x1c')](_0x1c598e);}return _0x374561[_0xc336('0x1d')]();};}function saveUpdates(_0x23129c,_0x5aa78b){return function(_0x43dfc2){if(_0x43dfc2){return _0x43dfc2[_0xc336('0x1e')](_0x23129c)[_0xc336('0x1f')](function(_0x70757c){return _0x70757c;});}return null;};}function removeEntity(_0x21ed12,_0x1b984a){return function(_0x308dd3){if(_0x308dd3){return _0x308dd3[_0xc336('0x20')]()['then'](function(){_0x21ed12[_0xc336('0x13')](0xcc)[_0xc336('0x21')]();});}};}function handleEntityNotFound(_0xad8b07,_0x192ec8){return function(_0x2220ac){if(!_0x2220ac){_0xad8b07[_0xc336('0x22')](0x194);}return _0x2220ac;};}function handleError(_0x50fb52,_0x4e3f96){_0x4e3f96=_0x4e3f96||0x1f4;return function(_0x133baa){logger[_0xc336('0x23')](_0x133baa['stack']);if(_0x133baa[_0xc336('0x24')]){delete _0x133baa['name'];}_0x50fb52['status'](_0x4e3f96)[_0xc336('0x25')](_0x133baa);};}exports[_0xc336('0x26')]=function(_0x3bf1d6,_0x510b09){var _0x296381={},_0x32f0eb={},_0x21b221={'count':0x0,'rows':[]};var _0x1519c6=_[_0xc336('0x27')](db[_0xc336('0x28')][_0xc336('0x29')],function(_0x11dc31){return{'name':_0x11dc31[_0xc336('0x2a')],'type':_0x11dc31['type']['key']};});_0x32f0eb[_0xc336('0x2b')]=_[_0xc336('0x27')](_0x1519c6,_0xc336('0x24'));_0x32f0eb[_0xc336('0x2c')]=_['keys'](_0x3bf1d6['query']);_0x32f0eb[_0xc336('0x2d')]=_['intersection'](_0x32f0eb['model'],_0x32f0eb[_0xc336('0x2c')]);_0x296381[_0xc336('0x2e')]=_['intersection'](_0x32f0eb[_0xc336('0x2b')],qs[_0xc336('0x2f')](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x2f')]));_0x296381[_0xc336('0x2e')]=_0x296381[_0xc336('0x2e')][_0xc336('0x30')]?_0x296381[_0xc336('0x2e')]:_0x32f0eb[_0xc336('0x2b')];if(!_0x3bf1d6[_0xc336('0x2c')]['hasOwnProperty'](_0xc336('0x31'))){_0x296381['limit']=qs[_0xc336('0x17')](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x17')]);_0x296381[_0xc336('0x15')]=qs['offset'](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x15')]);}_0x296381[_0xc336('0x32')]=qs[_0xc336('0x33')](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x33')]);_0x296381[_0xc336('0x34')]=qs[_0xc336('0x2d')](_['pick'](_0x3bf1d6[_0xc336('0x2c')],_0x32f0eb[_0xc336('0x2d')]),_0x1519c6);if(_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x35')]){_0x296381[_0xc336('0x34')]=_['merge'](_0x296381['where'],{'$or':_['map'](_0x1519c6,function(_0x5126b8){if(_0x5126b8[_0xc336('0x36')]!==_0xc336('0x37')){var _0x22f8f8={};_0x22f8f8[_0x5126b8['name']]={'$like':'%'+_0x3bf1d6[_0xc336('0x2c')]['filter']+'%'};return _0x22f8f8;}})});}_0x296381=_[_0xc336('0x38')]({},_0x296381,_0x3bf1d6['options']);var _0x50e964={'where':_0x296381[_0xc336('0x34')]};return db[_0xc336('0x28')][_0xc336('0x18')](_0x50e964)[_0xc336('0x1f')](function(_0x22df8c){_0x21b221[_0xc336('0x18')]=_0x22df8c;if(_0x3bf1d6[_0xc336('0x2c')]['includeAll']){_0x296381[_0xc336('0x39')]=[{'all':!![]}];}return db['Automation'][_0xc336('0x3a')](_0x296381);})[_0xc336('0x1f')](function(_0x21438f){_0x21b221[_0xc336('0x3b')]=_0x21438f;return _0x21b221;})[_0xc336('0x1f')](respondWithFilteredResult(_0x510b09,_0x296381))[_0xc336('0x3c')](handleError(_0x510b09,null));};exports[_0xc336('0x3d')]=function(_0x1fcb3d,_0xca1ff3){var _0x1fef80={'raw':![],'where':{'id':_0x1fcb3d[_0xc336('0x3e')]['id']}},_0xc6903e={};_0xc6903e['model']=_['keys'](db[_0xc336('0x28')][_0xc336('0x29')]);_0xc6903e[_0xc336('0x2c')]=_[_0xc336('0x3f')](_0x1fcb3d['query']);_0xc6903e[_0xc336('0x2d')]=_[_0xc336('0x40')](_0xc6903e[_0xc336('0x2b')],_0xc6903e['query']);_0x1fef80[_0xc336('0x2e')]=_[_0xc336('0x40')](_0xc6903e[_0xc336('0x2b')],qs[_0xc336('0x2f')](_0x1fcb3d[_0xc336('0x2c')][_0xc336('0x2f')]));_0x1fef80[_0xc336('0x2e')]=_0x1fef80['attributes']['length']?_0x1fef80['attributes']:_0xc6903e[_0xc336('0x2b')];if(_0x1fcb3d[_0xc336('0x2c')][_0xc336('0x41')]){_0x1fef80[_0xc336('0x39')]=[{'all':!![]}];}_0x1fef80=_[_0xc336('0x38')]({},_0x1fef80,_0x1fcb3d['options']);return db['Automation'][_0xc336('0x42')](_0x1fef80)[_0xc336('0x1f')](handleEntityNotFound(_0xca1ff3,null))[_0xc336('0x1f')](respondWithResult(_0xca1ff3,null))[_0xc336('0x3c')](handleError(_0xca1ff3,null));};exports[_0xc336('0x43')]=function(_0x516433,_0x1a41b4){return db[_0xc336('0x28')][_0xc336('0x43')](_0x516433[_0xc336('0x44')],{})[_0xc336('0x1f')](respondWithResult(_0x1a41b4,0xc9))[_0xc336('0x3c')](handleError(_0x1a41b4,null));};exports[_0xc336('0x1e')]=function(_0x4a5ee2,_0x5f3123){if(_0x4a5ee2[_0xc336('0x44')]['id']){delete _0x4a5ee2[_0xc336('0x44')]['id'];}return db['Automation'][_0xc336('0x42')]({'where':{'id':_0x4a5ee2['params']['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x5f3123,null))[_0xc336('0x1f')](saveUpdates(_0x4a5ee2[_0xc336('0x44')],null))['then'](respondWithResult(_0x5f3123,null))[_0xc336('0x3c')](handleError(_0x5f3123,null));};exports['destroy']=function(_0x1cc79d,_0x27630d){return db['Automation'][_0xc336('0x42')]({'where':{'id':_0x1cc79d[_0xc336('0x3e')]['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x27630d,null))['then'](removeEntity(_0x27630d,null))[_0xc336('0x3c')](handleError(_0x27630d,null));};exports[_0xc336('0x45')]=function(_0xf3b2fa,_0x4c67dd,_0x116b24){return db[_0xc336('0x46')]['find']({'where':{'id':_0xf3b2fa[_0xc336('0x3e')]['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x4c67dd,null))[_0xc336('0x1f')](function(_0x4b5b95){if(_0x4b5b95){return _0x4b5b95[_0xc336('0x45')](_0xf3b2fa[_0xc336('0x44')]['ids'],_['omit'](_0xf3b2fa['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4c67dd,null))[_0xc336('0x3c')](handleError(_0x4c67dd,null));};exports[_0xc336('0x47')]=function(_0x438285,_0x1cd7b8,_0x5df97a){var _0x2286a1={};var _0x2c1362={};var _0x258dda;var _0x179799;return db['Automation'][_0xc336('0x48')]({'where':{'id':_0x438285[_0xc336('0x3e')]['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x1cd7b8,null))['then'](function(_0x237b52){if(_0x237b52){_0x258dda=_0x237b52;_0x2c1362[_0xc336('0x2b')]=_[_0xc336('0x3f')](db[_0xc336('0x46')]['rawAttributes']);_0x2c1362[_0xc336('0x2c')]=_[_0xc336('0x3f')](_0x438285['query']);_0x2c1362['filters']=_['intersection'](_0x2c1362[_0xc336('0x2b')],_0x2c1362[_0xc336('0x2c')]);_0x2286a1[_0xc336('0x2e')]=_['intersection'](_0x2c1362[_0xc336('0x2b')],qs[_0xc336('0x2f')](_0x438285[_0xc336('0x2c')][_0xc336('0x2f')]));_0x2286a1['attributes']=_0x2286a1['attributes'][_0xc336('0x30')]?_0x2286a1['attributes']:_0x2c1362['model'];_0x2286a1['order']=qs[_0xc336('0x33')](_0x438285['query'][_0xc336('0x33')]);_0x2286a1['where']=qs[_0xc336('0x2d')](_[_0xc336('0x49')](_0x438285[_0xc336('0x2c')],_0x2c1362[_0xc336('0x2d')]));if(_0x438285[_0xc336('0x2c')][_0xc336('0x35')]){_0x2286a1[_0xc336('0x34')]=_[_0xc336('0x38')](_0x2286a1[_0xc336('0x34')],{'$or':_[_0xc336('0x27')](_0x2286a1[_0xc336('0x2e')],function(_0x3f95ae){var _0x5cc4f3={};_0x5cc4f3[_0x3f95ae]={'$like':'%'+_0x438285[_0xc336('0x2c')][_0xc336('0x35')]+'%'};return _0x5cc4f3;})});}_0x2286a1=_[_0xc336('0x38')]({},_0x2286a1,_0x438285[_0xc336('0x4a')]);return _0x258dda['getConditions'](_0x2286a1);}})[_0xc336('0x1f')](function(_0x2edcd2){if(_0x2edcd2){_0x179799=_0x2edcd2[_0xc336('0x30')];if(!_0x438285[_0xc336('0x2c')]['hasOwnProperty']('nolimit')){_0x2286a1[_0xc336('0x17')]=qs[_0xc336('0x17')](_0x438285[_0xc336('0x2c')]['limit']);_0x2286a1['offset']=qs['offset'](_0x438285['query'][_0xc336('0x15')]);}return _0x258dda['getConditions'](_0x2286a1);}})[_0xc336('0x1f')](function(_0x53667b){if(_0x53667b){return _0x53667b?{'count':_0x179799,'rows':_0x53667b}:null;}})['then'](respondWithResult(_0x1cd7b8,null))[_0xc336('0x3c')](handleError(_0x1cd7b8,null));};exports[_0xc336('0x4b')]=function(_0x55e666,_0x86974c,_0x13f3d4){return db[_0xc336('0x4c')][_0xc336('0x42')]({'where':{'id':_0x55e666[_0xc336('0x3e')]['id']}})['then'](handleEntityNotFound(_0x86974c,null))[_0xc336('0x1f')](function(_0x4ca3f4){if(_0x4ca3f4){return _0x4ca3f4[_0xc336('0x4b')](_0x55e666[_0xc336('0x44')][_0xc336('0x4d')],_['omit'](_0x55e666['body'],[_0xc336('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x86974c,null))['catch'](handleError(_0x86974c,null));};exports[_0xc336('0x4e')]=function(_0x4df59b,_0x3ed4b1,_0xf3b328){var _0x52a238={};var _0x38455d={};var _0x521591;var _0x38b473;return db[_0xc336('0x28')][_0xc336('0x48')]({'where':{'id':_0x4df59b[_0xc336('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3ed4b1,null))['then'](function(_0x217596){if(_0x217596){_0x521591=_0x217596;_0x38455d['model']=_[_0xc336('0x3f')](db['Action'][_0xc336('0x29')]);_0x38455d[_0xc336('0x2c')]=_['keys'](_0x4df59b[_0xc336('0x2c')]);_0x38455d[_0xc336('0x2d')]=_[_0xc336('0x40')](_0x38455d[_0xc336('0x2b')],_0x38455d[_0xc336('0x2c')]);_0x52a238[_0xc336('0x2e')]=_[_0xc336('0x40')](_0x38455d[_0xc336('0x2b')],qs['fields'](_0x4df59b[_0xc336('0x2c')][_0xc336('0x2f')]));_0x52a238[_0xc336('0x2e')]=_0x52a238[_0xc336('0x2e')][_0xc336('0x30')]?_0x52a238[_0xc336('0x2e')]:_0x38455d['model'];_0x52a238[_0xc336('0x32')]=qs[_0xc336('0x33')](_0x4df59b['query'][_0xc336('0x33')]);_0x52a238['where']=qs[_0xc336('0x2d')](_[_0xc336('0x49')](_0x4df59b[_0xc336('0x2c')],_0x38455d[_0xc336('0x2d')]));if(_0x4df59b[_0xc336('0x2c')][_0xc336('0x35')]){_0x52a238['where']=_[_0xc336('0x38')](_0x52a238[_0xc336('0x34')],{'$or':_[_0xc336('0x27')](_0x52a238[_0xc336('0x2e')],function(_0x40d323){var _0x5b8f5f={};_0x5b8f5f[_0x40d323]={'$like':'%'+_0x4df59b[_0xc336('0x2c')][_0xc336('0x35')]+'%'};return _0x5b8f5f;})});}_0x52a238=_[_0xc336('0x38')]({},_0x52a238,_0x4df59b[_0xc336('0x4a')]);return _0x521591[_0xc336('0x4e')](_0x52a238);}})[_0xc336('0x1f')](function(_0x390358){if(_0x390358){_0x38b473=_0x390358[_0xc336('0x30')];if(!_0x4df59b['query'][_0xc336('0x4f')](_0xc336('0x31'))){_0x52a238[_0xc336('0x17')]=qs[_0xc336('0x17')](_0x4df59b['query'][_0xc336('0x17')]);_0x52a238['offset']=qs[_0xc336('0x15')](_0x4df59b[_0xc336('0x2c')][_0xc336('0x15')]);}return _0x521591['getActions'](_0x52a238);}})[_0xc336('0x1f')](function(_0x36a225){if(_0x36a225){return _0x36a225?{'count':_0x38b473,'rows':_0x36a225}:null;}})['then'](respondWithResult(_0x3ed4b1,null))['catch'](handleError(_0x3ed4b1,null));};
\ No newline at end of file
+var _0xcee9=['Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Automation','includeAll','include','findAll','rows','show','params','find','catch','create','body','addConditions','Condition','ids','omit','order','getConditions','addActions','Action','getActions','findOne','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set'];(function(_0x48f848,_0x887c01){var _0x783f00=function(_0x58902a){while(--_0x58902a){_0x48f848['push'](_0x48f848['shift']());}};_0x783f00(++_0x887c01);}(_0xcee9,0xe8));var _0x9cee=function(_0x3017f3,_0x138709){_0x3017f3=_0x3017f3-0x0;var _0x1a7b94=_0xcee9[_0x3017f3];return _0x1a7b94;};'use strict';var emlformat=require(_0x9cee('0x0'));var rimraf=require(_0x9cee('0x1'));var zipdir=require(_0x9cee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9cee('0x3'));var moment=require(_0x9cee('0x4'));var BPromise=require(_0x9cee('0x5'));var Mustache=require(_0x9cee('0x6'));var util=require(_0x9cee('0x7'));var path=require(_0x9cee('0x8'));var sox=require(_0x9cee('0x9'));var csv=require(_0x9cee('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cee('0xb'));var _=require(_0x9cee('0xc'));var squel=require('squel');var crypto=require(_0x9cee('0xd'));var jsforce=require(_0x9cee('0xe'));var deskjs=require(_0x9cee('0xf'));var toCsv=require(_0x9cee('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9cee('0x10'));var authService=require(_0x9cee('0x11'));var qs=require(_0x9cee('0x12'));var as=require(_0x9cee('0x13'));var hardwareService=require(_0x9cee('0x14'));var logger=require('../../config/logger')(_0x9cee('0x15'));var utils=require('../../config/utils');var config=require(_0x9cee('0x16'));var licenseUtil=require(_0x9cee('0x17'));var db=require(_0x9cee('0x18'))['db'];function respondWithStatusCode(_0x1b2854,_0x5e6b9b){_0x5e6b9b=_0x5e6b9b||0xcc;return function(_0x149a7f){if(_0x149a7f){return _0x1b2854['sendStatus'](_0x5e6b9b);}return _0x1b2854['status'](_0x5e6b9b)['end']();};}function respondWithResult(_0x110be6,_0x5a0064){_0x5a0064=_0x5a0064||0xc8;return function(_0x429ed7){if(_0x429ed7){return _0x110be6[_0x9cee('0x19')](_0x5a0064)[_0x9cee('0x1a')](_0x429ed7);}};}function respondWithFilteredResult(_0x340065,_0x4569f4){return function(_0x384ee1){if(_0x384ee1){var _0x2a075=typeof _0x4569f4[_0x9cee('0x1b')]===_0x9cee('0x1c')&&typeof _0x4569f4[_0x9cee('0x1d')]===_0x9cee('0x1c');var _0x1d0a5c=_0x384ee1['count'];var _0xed57bc=_0x2a075?0x0:_0x4569f4[_0x9cee('0x1b')];var _0x17c180=_0x2a075?_0x384ee1[_0x9cee('0x1e')]:_0x4569f4[_0x9cee('0x1b')]+_0x4569f4[_0x9cee('0x1d')];var _0x7f4bed;if(_0x17c180>=_0x1d0a5c){_0x17c180=_0x1d0a5c;_0x7f4bed=0xc8;}else{_0x7f4bed=0xce;}_0x340065[_0x9cee('0x19')](_0x7f4bed);return _0x340065[_0x9cee('0x1f')](_0x9cee('0x20'),_0xed57bc+'-'+_0x17c180+'/'+_0x1d0a5c)['json'](_0x384ee1);}return null;};}function patchUpdates(_0x475c8b){return function(_0x259984){try{jsonpatch[_0x9cee('0x21')](_0x259984,_0x475c8b,!![]);}catch(_0x4fb879){return BPromise[_0x9cee('0x22')](_0x4fb879);}return _0x259984['save']();};}function saveUpdates(_0x5a713a,_0x184da2){return function(_0x17aee2){if(_0x17aee2){return _0x17aee2[_0x9cee('0x23')](_0x5a713a)[_0x9cee('0x24')](function(_0x5754a9){return _0x5754a9;});}return null;};}function removeEntity(_0x2a6fdc,_0x11e205){return function(_0x483c96){if(_0x483c96){return _0x483c96[_0x9cee('0x25')]()[_0x9cee('0x24')](function(){_0x2a6fdc[_0x9cee('0x19')](0xcc)[_0x9cee('0x26')]();});}};}function handleEntityNotFound(_0x5e445b,_0x19f746){return function(_0x276a78){if(!_0x276a78){_0x5e445b[_0x9cee('0x27')](0x194);}return _0x276a78;};}function handleError(_0x39d310,_0x5de48a){_0x5de48a=_0x5de48a||0x1f4;return function(_0x51bcc9){logger[_0x9cee('0x28')](_0x51bcc9[_0x9cee('0x29')]);if(_0x51bcc9[_0x9cee('0x2a')]){delete _0x51bcc9['name'];}_0x39d310[_0x9cee('0x19')](_0x5de48a)[_0x9cee('0x2b')](_0x51bcc9);};}exports[_0x9cee('0x2c')]=function(_0x2c6252,_0x5ee160){var _0x2f891a={},_0x4c90c1={},_0x598e70={'count':0x0,'rows':[]};var _0x3af562=_['map'](db['Automation'][_0x9cee('0x2d')],function(_0xdeab53){return{'name':_0xdeab53[_0x9cee('0x2e')],'type':_0xdeab53[_0x9cee('0x2f')][_0x9cee('0x30')]};});_0x4c90c1['model']=_[_0x9cee('0x31')](_0x3af562,_0x9cee('0x2a'));_0x4c90c1[_0x9cee('0x32')]=_[_0x9cee('0x33')](_0x2c6252[_0x9cee('0x32')]);_0x4c90c1[_0x9cee('0x34')]=_[_0x9cee('0x35')](_0x4c90c1[_0x9cee('0x36')],_0x4c90c1[_0x9cee('0x32')]);_0x2f891a[_0x9cee('0x37')]=_['intersection'](_0x4c90c1[_0x9cee('0x36')],qs['fields'](_0x2c6252['query'][_0x9cee('0x38')]));_0x2f891a['attributes']=_0x2f891a[_0x9cee('0x37')][_0x9cee('0x39')]?_0x2f891a[_0x9cee('0x37')]:_0x4c90c1[_0x9cee('0x36')];if(!_0x2c6252['query'][_0x9cee('0x3a')]('nolimit')){_0x2f891a['limit']=qs[_0x9cee('0x1d')](_0x2c6252[_0x9cee('0x32')]['limit']);_0x2f891a[_0x9cee('0x1b')]=qs[_0x9cee('0x1b')](_0x2c6252[_0x9cee('0x32')][_0x9cee('0x1b')]);}_0x2f891a['order']=qs[_0x9cee('0x3b')](_0x2c6252[_0x9cee('0x32')][_0x9cee('0x3b')]);_0x2f891a[_0x9cee('0x3c')]=qs[_0x9cee('0x34')](_[_0x9cee('0x3d')](_0x2c6252['query'],_0x4c90c1[_0x9cee('0x34')]),_0x3af562);if(_0x2c6252[_0x9cee('0x32')][_0x9cee('0x3e')]){_0x2f891a['where']=_[_0x9cee('0x3f')](_0x2f891a['where'],{'$or':_[_0x9cee('0x31')](_0x3af562,function(_0x5eb118){if(_0x5eb118[_0x9cee('0x2f')]!==_0x9cee('0x40')){var _0x345614={};_0x345614[_0x5eb118['name']]={'$like':'%'+_0x2c6252['query'][_0x9cee('0x3e')]+'%'};return _0x345614;}})});}_0x2f891a=_[_0x9cee('0x3f')]({},_0x2f891a,_0x2c6252[_0x9cee('0x41')]);var _0x415b8b={'where':_0x2f891a[_0x9cee('0x3c')]};return db[_0x9cee('0x42')]['count'](_0x415b8b)[_0x9cee('0x24')](function(_0x2d87fc){_0x598e70[_0x9cee('0x1e')]=_0x2d87fc;if(_0x2c6252[_0x9cee('0x32')][_0x9cee('0x43')]){_0x2f891a[_0x9cee('0x44')]=[{'all':!![]}];}return db[_0x9cee('0x42')][_0x9cee('0x45')](_0x2f891a);})['then'](function(_0x390a6a){_0x598e70[_0x9cee('0x46')]=_0x390a6a;return _0x598e70;})['then'](respondWithFilteredResult(_0x5ee160,_0x2f891a))['catch'](handleError(_0x5ee160,null));};exports[_0x9cee('0x47')]=function(_0x33cacc,_0x43ed0c){var _0x4823b2={'raw':![],'where':{'id':_0x33cacc[_0x9cee('0x48')]['id']}},_0x404fa6={};_0x404fa6[_0x9cee('0x36')]=_[_0x9cee('0x33')](db[_0x9cee('0x42')]['rawAttributes']);_0x404fa6[_0x9cee('0x32')]=_[_0x9cee('0x33')](_0x33cacc[_0x9cee('0x32')]);_0x404fa6[_0x9cee('0x34')]=_[_0x9cee('0x35')](_0x404fa6[_0x9cee('0x36')],_0x404fa6[_0x9cee('0x32')]);_0x4823b2[_0x9cee('0x37')]=_[_0x9cee('0x35')](_0x404fa6['model'],qs[_0x9cee('0x38')](_0x33cacc['query'][_0x9cee('0x38')]));_0x4823b2['attributes']=_0x4823b2[_0x9cee('0x37')][_0x9cee('0x39')]?_0x4823b2['attributes']:_0x404fa6[_0x9cee('0x36')];if(_0x33cacc[_0x9cee('0x32')][_0x9cee('0x43')]){_0x4823b2['include']=[{'all':!![]}];}_0x4823b2=_[_0x9cee('0x3f')]({},_0x4823b2,_0x33cacc[_0x9cee('0x41')]);return db[_0x9cee('0x42')][_0x9cee('0x49')](_0x4823b2)[_0x9cee('0x24')](handleEntityNotFound(_0x43ed0c,null))[_0x9cee('0x24')](respondWithResult(_0x43ed0c,null))[_0x9cee('0x4a')](handleError(_0x43ed0c,null));};exports[_0x9cee('0x4b')]=function(_0x2de9ed,_0xbcef18){return db[_0x9cee('0x42')][_0x9cee('0x4b')](_0x2de9ed[_0x9cee('0x4c')],{})[_0x9cee('0x24')](respondWithResult(_0xbcef18,0xc9))[_0x9cee('0x4a')](handleError(_0xbcef18,null));};exports['update']=function(_0x51d0ee,_0x5827bd){if(_0x51d0ee[_0x9cee('0x4c')]['id']){delete _0x51d0ee['body']['id'];}return db[_0x9cee('0x42')][_0x9cee('0x49')]({'where':{'id':_0x51d0ee[_0x9cee('0x48')]['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x5827bd,null))[_0x9cee('0x24')](saveUpdates(_0x51d0ee['body'],null))['then'](respondWithResult(_0x5827bd,null))[_0x9cee('0x4a')](handleError(_0x5827bd,null));};exports['destroy']=function(_0x446bcd,_0x4c675b){return db[_0x9cee('0x42')][_0x9cee('0x49')]({'where':{'id':_0x446bcd['params']['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x4c675b,null))[_0x9cee('0x24')](removeEntity(_0x4c675b,null))[_0x9cee('0x4a')](handleError(_0x4c675b,null));};exports[_0x9cee('0x4d')]=function(_0x4b02e7,_0x5d342a,_0x41b5be){return db[_0x9cee('0x4e')]['find']({'where':{'id':_0x4b02e7[_0x9cee('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d342a,null))[_0x9cee('0x24')](function(_0x34fd79){if(_0x34fd79){return _0x34fd79[_0x9cee('0x4d')](_0x4b02e7[_0x9cee('0x4c')][_0x9cee('0x4f')],_[_0x9cee('0x50')](_0x4b02e7[_0x9cee('0x4c')],['ids','id'])||{});}})[_0x9cee('0x24')](respondWithResult(_0x5d342a,null))[_0x9cee('0x4a')](handleError(_0x5d342a,null));};exports['getConditions']=function(_0x3768ed,_0x2b7fac,_0x176bda){var _0x402aa9={};var _0x5a0da5={};var _0x4d82c6;var _0x308dd6;return db['Automation']['findOne']({'where':{'id':_0x3768ed[_0x9cee('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b7fac,null))[_0x9cee('0x24')](function(_0x53d137){if(_0x53d137){_0x4d82c6=_0x53d137;_0x5a0da5['model']=_[_0x9cee('0x33')](db[_0x9cee('0x4e')][_0x9cee('0x2d')]);_0x5a0da5['query']=_[_0x9cee('0x33')](_0x3768ed[_0x9cee('0x32')]);_0x5a0da5['filters']=_[_0x9cee('0x35')](_0x5a0da5['model'],_0x5a0da5[_0x9cee('0x32')]);_0x402aa9['attributes']=_[_0x9cee('0x35')](_0x5a0da5['model'],qs[_0x9cee('0x38')](_0x3768ed[_0x9cee('0x32')][_0x9cee('0x38')]));_0x402aa9['attributes']=_0x402aa9[_0x9cee('0x37')][_0x9cee('0x39')]?_0x402aa9['attributes']:_0x5a0da5['model'];_0x402aa9[_0x9cee('0x51')]=qs[_0x9cee('0x3b')](_0x3768ed['query']['sort']);_0x402aa9[_0x9cee('0x3c')]=qs['filters'](_[_0x9cee('0x3d')](_0x3768ed[_0x9cee('0x32')],_0x5a0da5[_0x9cee('0x34')]));if(_0x3768ed[_0x9cee('0x32')][_0x9cee('0x3e')]){_0x402aa9['where']=_[_0x9cee('0x3f')](_0x402aa9[_0x9cee('0x3c')],{'$or':_[_0x9cee('0x31')](_0x402aa9['attributes'],function(_0x3c95c8){var _0xcdff11={};_0xcdff11[_0x3c95c8]={'$like':'%'+_0x3768ed[_0x9cee('0x32')][_0x9cee('0x3e')]+'%'};return _0xcdff11;})});}_0x402aa9=_[_0x9cee('0x3f')]({},_0x402aa9,_0x3768ed[_0x9cee('0x41')]);return _0x4d82c6[_0x9cee('0x52')](_0x402aa9);}})['then'](function(_0x5551b3){if(_0x5551b3){_0x308dd6=_0x5551b3[_0x9cee('0x39')];if(!_0x3768ed['query'][_0x9cee('0x3a')]('nolimit')){_0x402aa9[_0x9cee('0x1d')]=qs[_0x9cee('0x1d')](_0x3768ed[_0x9cee('0x32')][_0x9cee('0x1d')]);_0x402aa9[_0x9cee('0x1b')]=qs[_0x9cee('0x1b')](_0x3768ed['query'][_0x9cee('0x1b')]);}return _0x4d82c6[_0x9cee('0x52')](_0x402aa9);}})[_0x9cee('0x24')](function(_0x53cb3c){if(_0x53cb3c){return _0x53cb3c?{'count':_0x308dd6,'rows':_0x53cb3c}:null;}})['then'](respondWithResult(_0x2b7fac,null))[_0x9cee('0x4a')](handleError(_0x2b7fac,null));};exports[_0x9cee('0x53')]=function(_0x940e34,_0x3d887c,_0x8fb6f4){return db[_0x9cee('0x54')][_0x9cee('0x49')]({'where':{'id':_0x940e34[_0x9cee('0x48')]['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x3d887c,null))['then'](function(_0x415c06){if(_0x415c06){return _0x415c06[_0x9cee('0x53')](_0x940e34[_0x9cee('0x4c')][_0x9cee('0x4f')],_[_0x9cee('0x50')](_0x940e34[_0x9cee('0x4c')],[_0x9cee('0x4f'),'id'])||{});}})[_0x9cee('0x24')](respondWithResult(_0x3d887c,null))[_0x9cee('0x4a')](handleError(_0x3d887c,null));};exports[_0x9cee('0x55')]=function(_0x23016c,_0x2ffe51,_0x388daf){var _0x971a={};var _0x1aaec4={};var _0x7a0f01;var _0x2481f8;return db['Automation'][_0x9cee('0x56')]({'where':{'id':_0x23016c['params']['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x2ffe51,null))[_0x9cee('0x24')](function(_0x4a04d0){if(_0x4a04d0){_0x7a0f01=_0x4a04d0;_0x1aaec4[_0x9cee('0x36')]=_[_0x9cee('0x33')](db[_0x9cee('0x54')]['rawAttributes']);_0x1aaec4[_0x9cee('0x32')]=_[_0x9cee('0x33')](_0x23016c[_0x9cee('0x32')]);_0x1aaec4[_0x9cee('0x34')]=_[_0x9cee('0x35')](_0x1aaec4[_0x9cee('0x36')],_0x1aaec4[_0x9cee('0x32')]);_0x971a[_0x9cee('0x37')]=_['intersection'](_0x1aaec4[_0x9cee('0x36')],qs[_0x9cee('0x38')](_0x23016c[_0x9cee('0x32')][_0x9cee('0x38')]));_0x971a[_0x9cee('0x37')]=_0x971a[_0x9cee('0x37')][_0x9cee('0x39')]?_0x971a[_0x9cee('0x37')]:_0x1aaec4[_0x9cee('0x36')];_0x971a['order']=qs[_0x9cee('0x3b')](_0x23016c[_0x9cee('0x32')]['sort']);_0x971a[_0x9cee('0x3c')]=qs['filters'](_[_0x9cee('0x3d')](_0x23016c[_0x9cee('0x32')],_0x1aaec4[_0x9cee('0x34')]));if(_0x23016c[_0x9cee('0x32')][_0x9cee('0x3e')]){_0x971a['where']=_[_0x9cee('0x3f')](_0x971a['where'],{'$or':_[_0x9cee('0x31')](_0x971a[_0x9cee('0x37')],function(_0xc9f4c2){var _0x9f2237={};_0x9f2237[_0xc9f4c2]={'$like':'%'+_0x23016c[_0x9cee('0x32')][_0x9cee('0x3e')]+'%'};return _0x9f2237;})});}_0x971a=_['merge']({},_0x971a,_0x23016c[_0x9cee('0x41')]);return _0x7a0f01[_0x9cee('0x55')](_0x971a);}})[_0x9cee('0x24')](function(_0x37dd91){if(_0x37dd91){_0x2481f8=_0x37dd91[_0x9cee('0x39')];if(!_0x23016c['query'][_0x9cee('0x3a')](_0x9cee('0x57'))){_0x971a['limit']=qs[_0x9cee('0x1d')](_0x23016c[_0x9cee('0x32')]['limit']);_0x971a[_0x9cee('0x1b')]=qs[_0x9cee('0x1b')](_0x23016c[_0x9cee('0x32')][_0x9cee('0x1b')]);}return _0x7a0f01[_0x9cee('0x55')](_0x971a);}})[_0x9cee('0x24')](function(_0x9c7f92){if(_0x9c7f92){return _0x9c7f92?{'count':_0x2481f8,'rows':_0x9c7f92}:null;}})[_0x9cee('0x24')](respondWithResult(_0x2ffe51,null))[_0x9cee('0x4a')](handleError(_0x2ffe51,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 5e4cc75..94c97ba 100644
--- a/server/api/automation/automation.model.js
+++ b/server/api/automation/automation.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2e2=['define','Automation','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes'];(function(_0x5ad18c,_0x4ee0d3){var _0x470c74=function(_0x3b5850){while(--_0x3b5850){_0x5ad18c['push'](_0x5ad18c['shift']());}};_0x470c74(++_0x4ee0d3);}(_0xf2e2,0x1db));var _0x2f2e=function(_0x3d3904,_0x5dfdb){_0x3d3904=_0x3d3904-0x0;var _0x20cdfc=_0xf2e2[_0x3d3904];return _0x20cdfc;};'use strict';var _=require(_0x2f2e('0x0'));var util=require(_0x2f2e('0x1'));var logger=require(_0x2f2e('0x2'))('api');var moment=require(_0x2f2e('0x3'));var BPromise=require(_0x2f2e('0x4'));var rp=require(_0x2f2e('0x5'));var fs=require('fs');var path=require(_0x2f2e('0x6'));var rimraf=require('rimraf');var config=require(_0x2f2e('0x7'));var attributes=require(_0x2f2e('0x8'));module['exports']=function(_0x33420c,_0x109a3f){return _0x33420c[_0x2f2e('0x9')](_0x2f2e('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc3d=['rimraf','./automation.attributes','exports','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x22e6f0,_0x9d6f84){var _0x31aeaf=function(_0x203316){while(--_0x203316){_0x22e6f0['push'](_0x22e6f0['shift']());}};_0x31aeaf(++_0x9d6f84);}(_0xfc3d,0x19d));var _0xdfc3=function(_0x208cda,_0x46fb61){_0x208cda=_0x208cda-0x0;var _0x3cc9a8=_0xfc3d[_0x208cda];return _0x3cc9a8;};'use strict';var _=require(_0xdfc3('0x0'));var util=require(_0xdfc3('0x1'));var logger=require('../../config/logger')(_0xdfc3('0x2'));var moment=require(_0xdfc3('0x3'));var BPromise=require(_0xdfc3('0x4'));var rp=require(_0xdfc3('0x5'));var fs=require('fs');var path=require(_0xdfc3('0x6'));var rimraf=require(_0xdfc3('0x7'));var config=require('../../config/environment');var attributes=require(_0xdfc3('0x8'));module[_0xdfc3('0x9')]=function(_0x401d1a,_0xf38aa4){return _0x401d1a['define'](_0xdfc3('0xa'),attributes,{'tableName':_0xdfc3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 746a4ec..265151a 100644
--- a/server/api/automation/automation.rpc.js
+++ b/server/api/automation/automation.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3014=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s'];(function(_0x487af7,_0x3afa30){var _0x15be2e=function(_0xd48c1b){while(--_0xd48c1b){_0x487af7['push'](_0x487af7['shift']());}};_0x15be2e(++_0x3afa30);}(_0x3014,0x1d7));var _0x4301=function(_0x4f7fa8,_0x268486){_0x4f7fa8=_0x4f7fa8-0x0;var _0x50c25a=_0x3014[_0x4f7fa8];return _0x50c25a;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var moment=require('moment');var BPromise=require(_0x4301('0x2'));var rs=require(_0x4301('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4301('0x4'));var logger=require(_0x4301('0x5'))(_0x4301('0x6'));var config=require(_0x4301('0x7'));var jayson=require(_0x4301('0x8'));var client=jayson[_0x4301('0x9')][_0x4301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e61,_0x5013c,_0x1dc855){return new BPromise(function(_0x337800,_0x4d5020){return client['request'](_0x3a6e61,_0x1dc855)[_0x4301('0xb')](function(_0x2d6581){logger['info'](_0x4301('0xc'),_0x5013c,_0x4301('0xd'));logger[_0x4301('0xe')](_0x4301('0xf'),_0x5013c,'request\x20sent',JSON[_0x4301('0x10')](_0x2d6581));if(_0x2d6581['error']){if(_0x2d6581[_0x4301('0x11')][_0x4301('0x12')]===0x1f4){logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x4d5020(_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);}logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x337800(_0x2d6581[_0x4301('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5013c,_0x4301('0xd'));_0x337800(_0x2d6581[_0x4301('0x14')][_0x4301('0x13')]);}})[_0x4301('0x15')](function(_0x4da25c){logger['error'](_0x4301('0xc'),_0x5013c,_0x4da25c);_0x4d5020(_0x4da25c);});});}
\ No newline at end of file
+var _0xc6d7=['rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3a64dc,_0x1f46be){var _0x58d3a2=function(_0x1031cd){while(--_0x1031cd){_0x3a64dc['push'](_0x3a64dc['shift']());}};_0x58d3a2(++_0x1f46be);}(_0xc6d7,0x71));var _0x7c6d=function(_0x3c9d4b,_0x57223d){_0x3c9d4b=_0x3c9d4b-0x0;var _0x234a8a=_0xc6d7[_0x3c9d4b];return _0x234a8a;};'use strict';var _=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var moment=require(_0x7c6d('0x2'));var BPromise=require(_0x7c6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c6d('0x4'))['db'];var utils=require(_0x7c6d('0x5'));var logger=require(_0x7c6d('0x6'))(_0x7c6d('0x7'));var config=require(_0x7c6d('0x8'));var jayson=require(_0x7c6d('0x9'));var client=jayson[_0x7c6d('0xa')][_0x7c6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x446b68,_0x45713e,_0x338f94){return new BPromise(function(_0x1ad7e2,_0x22755d){return client[_0x7c6d('0xc')](_0x446b68,_0x338f94)['then'](function(_0x477a41){logger['info'](_0x7c6d('0xd'),_0x45713e,_0x7c6d('0xe'));logger[_0x7c6d('0xf')](_0x7c6d('0x10'),_0x45713e,'request\x20sent',JSON[_0x7c6d('0x11')](_0x477a41));if(_0x477a41[_0x7c6d('0x12')]){if(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x13')]===0x1f4){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')]['message']);return _0x22755d(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);return _0x1ad7e2(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}else{logger[_0x7c6d('0x15')]('Automation,\x20%s,\x20%s',_0x45713e,_0x7c6d('0xe'));_0x1ad7e2(_0x477a41[_0x7c6d('0x16')]['message']);}})[_0x7c6d('0x17')](function(_0x220bae){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x220bae);_0x22755d(_0x220bae);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d39165f..fd09122 100644
--- a/server/api/automation/index.js
+++ b/server/api/automation/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e3d=['addActions','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','create','post','addConditions','/:id/actions'];(function(_0x527a6c,_0x15b18d){var _0x4c780d=function(_0xebc03){while(--_0xebc03){_0x527a6c['push'](_0x527a6c['shift']());}};_0x4c780d(++_0x15b18d);}(_0x2e3d,0x8c));var _0xd2e3=function(_0x19c3fd,_0x5a83bf){_0x19c3fd=_0x19c3fd-0x0;var _0x321198=_0x2e3d[_0x19c3fd];return _0x321198;};'use strict';var multer=require(_0xd2e3('0x0'));var util=require(_0xd2e3('0x1'));var path=require(_0xd2e3('0x2'));var timeout=require(_0xd2e3('0x3'));var express=require(_0xd2e3('0x4'));var router=express[_0xd2e3('0x5')]();var fs_extra=require(_0xd2e3('0x6'));var auth=require(_0xd2e3('0x7'));var interaction=require(_0xd2e3('0x8'));var config=require('../../config/environment');var controller=require(_0xd2e3('0x9'));router[_0xd2e3('0xa')]('/',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0xc')]);router['get'](_0xd2e3('0xd'),auth['isAuthenticated'](),controller[_0xd2e3('0xe')]);router['get'](_0xd2e3('0xf'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x10')]);router[_0xd2e3('0xa')]('/:id/actions',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x11')]);router['post']('/',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x12')]);router[_0xd2e3('0x13')]('/:id/conditions',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x14')]);router[_0xd2e3('0x13')](_0xd2e3('0x15'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x16')]);router[_0xd2e3('0x17')](_0xd2e3('0xd'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x18')]);router[_0xd2e3('0x19')](_0xd2e3('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xd2e3('0x1a')]=router;
\ No newline at end of file
+var _0xac52=['/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated'];(function(_0x205496,_0x11ab53){var _0x449187=function(_0xf07d19){while(--_0xf07d19){_0x205496['push'](_0x205496['shift']());}};_0x449187(++_0x11ab53);}(_0xac52,0x122));var _0x2ac5=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xac52[_0x580576];return _0x3f55a0;};'use strict';var multer=require('multer');var util=require(_0x2ac5('0x0'));var path=require(_0x2ac5('0x1'));var timeout=require(_0x2ac5('0x2'));var express=require(_0x2ac5('0x3'));var router=express[_0x2ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ac5('0x5'));var interaction=require(_0x2ac5('0x6'));var config=require('../../config/environment');var controller=require(_0x2ac5('0x7'));router[_0x2ac5('0x8')]('/',auth[_0x2ac5('0x9')](),controller['index']);router['get'](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xb')]);router[_0x2ac5('0x8')](_0x2ac5('0xc'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xd')]);router[_0x2ac5('0x8')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller['getActions']);router[_0x2ac5('0xf')]('/',auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x10')]);router[_0x2ac5('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x2ac5('0xf')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x11')]);router[_0x2ac5('0x12')]('/:id',auth[_0x2ac5('0x9')](),controller['update']);router[_0x2ac5('0x13')](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 286c834..e5e6351 100644
--- a/server/api/campaign/campaign.attributes.js
+++ b/server/api/campaign/campaign.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb954=['#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x38ceff,_0x3c88bd){var _0x44c5f6=function(_0x3288f9){while(--_0x3288f9){_0x38ceff['push'](_0x38ceff['shift']());}};_0x44c5f6(++_0x3c88bd);}(_0xb954,0x115));var _0x4b95=function(_0x1a124d,_0x3e04b0){_0x1a124d=_0x1a124d-0x0;var _0x5f0830=_0xb954[_0x1a124d];return _0x5f0830;};'use strict';var Sequelize=require(_0x4b95('0x0'));module[_0x4b95('0x1')]={'name':{'type':Sequelize[_0x4b95('0x2')],'unique':_0x4b95('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x4b95('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4b95('0x5')],'defaultValue':0x0,'comment':_0x4b95('0x6')},'limitCalls':{'type':Sequelize[_0x4b95('0x7')](0x4)[_0x4b95('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x4b95('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4b95('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'comment':_0x4b95('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4b95('0x2')],'defaultValue':_0x4b95('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x4b95('0x11')](_0x4b95('0x12'),_0x4b95('0x13'),'onlyIfOpen'),'defaultValue':_0x4b95('0x12')},'dialAMDActive':{'type':Sequelize[_0x4b95('0x5')],'defaultValue':0x0,'comment':_0x4b95('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4b95('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x4b95('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4b95('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4b95('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4b95('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4b95('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4b95('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4b95('0x7')](0x5)[_0x4b95('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4b95('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4b95('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4b95('0x11')]('DESC',_0x4b95('0x1d')),'defaultValue':_0x4b95('0x1e')},'dialPrefix':{'type':Sequelize[_0x4b95('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x4b95('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4b95('0x1f')},'dialCutDigit':{'type':Sequelize[_0x4b95('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4b95('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x028a=['ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name'];(function(_0x54854b,_0x5e2ab3){var _0x2ed79b=function(_0x3fc3af){while(--_0x3fc3af){_0x54854b['push'](_0x54854b['shift']());}};_0x2ed79b(++_0x5e2ab3);}(_0x028a,0x1b5));var _0xa028=function(_0x28b709,_0x4d7a52){_0x28b709=_0x28b709-0x0;var _0x1ebf2f=_0x028a[_0x28b709];return _0x1ebf2f;};'use strict';var Sequelize=require('sequelize');module[_0xa028('0x0')]={'name':{'type':Sequelize[_0xa028('0x1')],'unique':_0xa028('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xa028('0x3')),'allowNull':![],'defaultValue':_0xa028('0x3')},'description':{'type':Sequelize[_0xa028('0x1')]},'active':{'type':Sequelize[_0xa028('0x4')],'defaultValue':0x0,'comment':_0xa028('0x5')},'limitCalls':{'type':Sequelize[_0xa028('0x6')](0x4)[_0xa028('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa028('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'comment':_0xa028('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa028('0xf')},'dialTimezone':{'type':Sequelize[_0xa028('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa028('0x1')],'defaultValue':_0xa028('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xa028('0x11'),_0xa028('0x12')),'defaultValue':_0xa028('0x13')},'dialAMDActive':{'type':Sequelize[_0xa028('0x4')],'defaultValue':0x0,'comment':_0xa028('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa028('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa028('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa028('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa028('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xa028('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa028('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa028('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa028('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xa028('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa028('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa028('0x1c')](_0xa028('0x1d'),_0xa028('0x1e')),'defaultValue':_0xa028('0x1d')},'dialPrefix':{'type':Sequelize[_0xa028('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa028('0x1f')},'dialCutDigit':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa028('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4a30029..4e871a0 100644
--- a/server/api/campaign/campaign.controller.js
+++ b/server/api/campaign/campaign.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x97c1=['where','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','find','autoAssociation','getHoppers','findOne','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','omit','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','insert','into','cmHopperId','OrderBy','h.id','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','format','addBlackLists','removeBlackLists','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','Campaign','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x26d034,_0x2c22db){var _0x3015aa=function(_0x282e96){while(--_0x282e96){_0x26d034['push'](_0x26d034['shift']());}};_0x3015aa(++_0x2c22db);}(_0x97c1,0xdf));var _0x197c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x97c1[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];function respondWithStatusCode(_0x668f8,_0x27e46f){_0x27e46f=_0x27e46f||0xcc;return function(_0x1adcfa){if(_0x1adcfa){return _0x668f8['sendStatus'](_0x27e46f);}return _0x668f8[_0x197c('0x17')](_0x27e46f)[_0x197c('0x18')]();};}function respondWithResult(_0x5a7e1c,_0xf735ce){_0xf735ce=_0xf735ce||0xc8;return function(_0x188ff2){if(_0x188ff2){return _0x5a7e1c[_0x197c('0x17')](_0xf735ce)['json'](_0x188ff2);}};}function respondWithFilteredResult(_0x5194c3,_0x422dfa){return function(_0x2bc612){if(_0x2bc612){var _0x2083d4=typeof _0x422dfa[_0x197c('0x19')]===_0x197c('0x1a')&&typeof _0x422dfa[_0x197c('0x1b')]===_0x197c('0x1a');var _0x75beba=_0x2bc612['count'];var _0x372311=_0x2083d4?0x0:_0x422dfa['offset'];var _0x50ac52=_0x2083d4?_0x2bc612[_0x197c('0x1c')]:_0x422dfa[_0x197c('0x19')]+_0x422dfa[_0x197c('0x1b')];var _0x2ce10d;if(_0x50ac52>=_0x75beba){_0x50ac52=_0x75beba;_0x2ce10d=0xc8;}else{_0x2ce10d=0xce;}_0x5194c3['status'](_0x2ce10d);return _0x5194c3[_0x197c('0x1d')](_0x197c('0x1e'),_0x372311+'-'+_0x50ac52+'/'+_0x75beba)[_0x197c('0x1f')](_0x2bc612);}return null;};}function patchUpdates(_0x5c278a){return function(_0x1adb43){try{jsonpatch[_0x197c('0x20')](_0x1adb43,_0x5c278a,!![]);}catch(_0x3b5c4c){return BPromise[_0x197c('0x21')](_0x3b5c4c);}return _0x1adb43[_0x197c('0x22')]();};}function saveUpdates(_0x3c2151,_0x362bbf){return function(_0x2092a0){if(_0x2092a0){return _0x2092a0[_0x197c('0x23')](_0x3c2151)[_0x197c('0x24')](function(_0x29b266){return _0x29b266;});}return null;};}function removeEntity(_0x177bc9,_0x174942){return function(_0x2a1310){if(_0x2a1310){return _0x2a1310[_0x197c('0x25')]()[_0x197c('0x24')](function(){var _0x5f4a02=_0x2a1310[_0x197c('0x26')]({'plain':!![]});var _0x2911dd=_0x197c('0x27');return db['UserProfileResource'][_0x197c('0x25')]({'where':{'type':_0x2911dd,'resourceId':_0x5f4a02['id']}})[_0x197c('0x24')](function(){return _0x2a1310;});})['then'](function(){_0x177bc9['status'](0xcc)[_0x197c('0x18')]();});}};}function handleEntityNotFound(_0x48f759,_0xfbca7a){return function(_0x14b0aa){if(!_0x14b0aa){_0x48f759[_0x197c('0x28')](0x194);}return _0x14b0aa;};}function handleError(_0x16e026,_0x2f031c){_0x2f031c=_0x2f031c||0x1f4;return function(_0x3cdcd8){logger[_0x197c('0x29')](_0x3cdcd8[_0x197c('0x2a')]);if(_0x3cdcd8[_0x197c('0x2b')]){delete _0x3cdcd8['name'];}_0x16e026['status'](_0x2f031c)['send'](_0x3cdcd8);};}exports['index']=function(_0x5f7425,_0x4c9256){var _0x252cde={},_0x35dbf3={},_0x58bc60={'count':0x0,'rows':[]};var _0x422ac6=_['map'](db[_0x197c('0x2c')][_0x197c('0x2d')],function(_0x2ace33){return{'name':_0x2ace33[_0x197c('0x2e')],'type':_0x2ace33[_0x197c('0x2f')][_0x197c('0x30')]};});_0x35dbf3[_0x197c('0x31')]=_[_0x197c('0x32')](_0x422ac6,_0x197c('0x2b'));_0x35dbf3['query']=_['keys'](_0x5f7425[_0x197c('0x33')]);_0x35dbf3[_0x197c('0x34')]=_[_0x197c('0x35')](_0x35dbf3[_0x197c('0x31')],_0x35dbf3[_0x197c('0x33')]);_0x252cde[_0x197c('0x36')]=_[_0x197c('0x35')](_0x35dbf3['model'],qs['fields'](_0x5f7425[_0x197c('0x33')][_0x197c('0x37')]));_0x252cde['attributes']=_0x252cde['attributes'][_0x197c('0x38')]?_0x252cde[_0x197c('0x36')]:_0x35dbf3[_0x197c('0x31')];if(!_0x5f7425[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x252cde[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x5f7425[_0x197c('0x33')]['limit']);_0x252cde[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x5f7425[_0x197c('0x33')][_0x197c('0x19')]);}_0x252cde[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x5f7425['query'][_0x197c('0x3c')]);_0x252cde[_0x197c('0x3d')]=qs[_0x197c('0x34')](_['pick'](_0x5f7425[_0x197c('0x33')],_0x35dbf3[_0x197c('0x34')]),_0x422ac6);if(_0x5f7425[_0x197c('0x33')][_0x197c('0x3e')]){_0x252cde[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x252cde[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x422ac6,function(_0x323a14){if(_0x323a14[_0x197c('0x2f')]!=='VIRTUAL'){var _0x2705f5={};_0x2705f5[_0x323a14[_0x197c('0x2b')]]={'$like':'%'+_0x5f7425['query']['filter']+'%'};return _0x2705f5;}})});}_0x252cde=_[_0x197c('0x3f')]({},_0x252cde,_0x5f7425[_0x197c('0x40')]);var _0x3517a6={'where':_0x252cde[_0x197c('0x3d')]};return db[_0x197c('0x2c')]['count'](_0x3517a6)[_0x197c('0x24')](function(_0x3efae){_0x58bc60[_0x197c('0x1c')]=_0x3efae;if(_0x5f7425[_0x197c('0x33')][_0x197c('0x41')]){_0x252cde['include']=[{'all':!![]}];}return db[_0x197c('0x2c')][_0x197c('0x42')](_0x252cde);})[_0x197c('0x24')](function(_0x197b27){_0x58bc60[_0x197c('0x43')]=_0x197b27;return _0x58bc60;})['then'](respondWithFilteredResult(_0x4c9256,_0x252cde))[_0x197c('0x44')](handleError(_0x4c9256,null));};exports[_0x197c('0x45')]=function(_0x3b7fc1,_0x35f36d){var _0x3e6d6e={'raw':![],'where':{'id':_0x3b7fc1[_0x197c('0x46')]['id']}},_0x41eb51={};_0x41eb51[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x2c')][_0x197c('0x2d')]);_0x41eb51['query']=_['keys'](_0x3b7fc1['query']);_0x41eb51['filters']=_[_0x197c('0x35')](_0x41eb51[_0x197c('0x31')],_0x41eb51['query']);_0x3e6d6e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x41eb51['model'],qs[_0x197c('0x37')](_0x3b7fc1[_0x197c('0x33')]['fields']));_0x3e6d6e[_0x197c('0x36')]=_0x3e6d6e[_0x197c('0x36')]['length']?_0x3e6d6e[_0x197c('0x36')]:_0x41eb51[_0x197c('0x31')];if(_0x3b7fc1[_0x197c('0x33')]['includeAll']){_0x3e6d6e[_0x197c('0x48')]=[{'all':!![]}];}_0x3e6d6e=_[_0x197c('0x3f')]({},_0x3e6d6e,_0x3b7fc1[_0x197c('0x40')]);return db[_0x197c('0x2c')]['find'](_0x3e6d6e)[_0x197c('0x24')](handleEntityNotFound(_0x35f36d,null))[_0x197c('0x24')](respondWithResult(_0x35f36d,null))[_0x197c('0x44')](handleError(_0x35f36d,null));};exports['create']=function(_0x5994bf,_0x3a5089){return db[_0x197c('0x2c')][_0x197c('0x49')](_0x5994bf[_0x197c('0x4a')],{})[_0x197c('0x24')](function(_0x28fac4){var _0x4c82d5=_0x5994bf[_0x197c('0x4b')]['get']({'plain':!![]});if(!_0x4c82d5)throw new Error(_0x197c('0x4c'));if(_0x4c82d5[_0x197c('0x4d')]===_0x197c('0x4b')){var _0x9e8c6a=_0x28fac4[_0x197c('0x26')]({'plain':!![]});var _0x2ab21f=_0x197c('0x27');return db[_0x197c('0x4e')]['find']({'where':{'name':_0x2ab21f,'userProfileId':_0x4c82d5[_0x197c('0x4f')]},'raw':!![]})[_0x197c('0x24')](function(_0x43e9b7){if(_0x43e9b7&&_0x43e9b7['autoAssociation']===0x0){return db[_0x197c('0x50')]['create']({'name':_0x9e8c6a[_0x197c('0x2b')],'resourceId':_0x9e8c6a['id'],'type':_0x43e9b7[_0x197c('0x2b')],'sectionId':_0x43e9b7['id']},{})[_0x197c('0x24')](function(){return _0x28fac4;});}else{return _0x28fac4;}})[_0x197c('0x44')](function(_0x1d7cdd){logger[_0x197c('0x29')](_0x197c('0x51'),_0x1d7cdd);throw _0x1d7cdd;});}return _0x28fac4;})[_0x197c('0x24')](respondWithResult(_0x3a5089,0xc9))['catch'](handleError(_0x3a5089,null));};exports[_0x197c('0x52')]=function(_0x3a9261,_0x275294){var _0x5f3301={'where':{'id':_0x3a9261[_0x197c('0x46')]['id']}},_0x244faa={};_0x244faa[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x2c')]['rawAttributes']);_0x5f3301['attributes']=_[_0x197c('0x35')](_0x244faa[_0x197c('0x31')],qs[_0x197c('0x37')](_0x3a9261[_0x197c('0x33')][_0x197c('0x37')]));_0x5f3301['attributes']=_0x5f3301['attributes'][_0x197c('0x38')]?_0x5f3301[_0x197c('0x36')]:_0x244faa['model'];if(_0x3a9261[_0x197c('0x33')][_0x197c('0x41')]){_0x5f3301[_0x197c('0x48')]=[{'all':!![]}];}_0x5f3301=_[_0x197c('0x3f')]({},_0x5f3301,_0x3a9261[_0x197c('0x40')]);return db[_0x197c('0x2c')]['find'](_0x5f3301)[_0x197c('0x24')](handleEntityNotFound(_0x275294,null))[_0x197c('0x24')](function(_0x57c8c8){if(_0x57c8c8){var _0x480cab=_0x57c8c8[_0x197c('0x26')]({'plain':!![]});_0x480cab=qs['omit'](_0x480cab,['id',_0x197c('0x53'),_0x197c('0x54')]);_0x3a9261[_0x197c('0x4a')]=_['omit'](_0x3a9261[_0x197c('0x4a')],['id',_0x197c('0x53'),'updatedAt']);return db[_0x197c('0x2c')][_0x197c('0x49')](_[_0x197c('0x3f')](_0x480cab,_0x3a9261['body']),{'include':_0x3a9261[_0x197c('0x33')][_0x197c('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x570d76){var _0x381191=_0x3a9261[_0x197c('0x4b')][_0x197c('0x26')]({'plain':!![]});if(!_0x381191)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x381191[_0x197c('0x4d')]===_0x197c('0x4b')){var _0x32e8ba=_0x570d76['get']({'plain':!![]});var _0xe84f3b=_0x197c('0x27');return db[_0x197c('0x4e')][_0x197c('0x55')]({'where':{'name':_0xe84f3b,'userProfileId':_0x381191[_0x197c('0x4f')]},'raw':!![]})[_0x197c('0x24')](function(_0x8d1f3f){if(_0x8d1f3f&&_0x8d1f3f[_0x197c('0x56')]===0x0){return db[_0x197c('0x50')][_0x197c('0x49')]({'name':_0x32e8ba['name'],'resourceId':_0x32e8ba['id'],'type':_0x8d1f3f[_0x197c('0x2b')],'sectionId':_0x8d1f3f['id']},{})['then'](function(){return _0x570d76;});}else{return _0x570d76;}})['catch'](function(_0x4a8e13){logger['error'](_0x197c('0x51'),_0x4a8e13);throw _0x4a8e13;});}return _0x570d76;});}})[_0x197c('0x24')](respondWithResult(_0x275294,0xc9))[_0x197c('0x44')](handleError(_0x275294,null));};exports[_0x197c('0x23')]=function(_0x55b744,_0x32d739){if(_0x55b744['body']['id']){delete _0x55b744[_0x197c('0x4a')]['id'];}return db['Campaign'][_0x197c('0x55')]({'where':{'id':_0x55b744['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x32d739,null))[_0x197c('0x24')](saveUpdates(_0x55b744[_0x197c('0x4a')],null))[_0x197c('0x24')](respondWithResult(_0x32d739,null))['catch'](handleError(_0x32d739,null));};exports[_0x197c('0x25')]=function(_0x304cb7,_0x33ae9c){return db['Campaign'][_0x197c('0x55')]({'where':{'id':_0x304cb7[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x33ae9c,null))[_0x197c('0x24')](removeEntity(_0x33ae9c,null))[_0x197c('0x44')](handleError(_0x33ae9c,null));};exports[_0x197c('0x57')]=function(_0x1e6371,_0x436a53,_0x2c7e66){var _0x1947bd={'raw':!![],'where':{}};var _0x342efa={};var _0x25d3c1={'count':0x0,'rows':[]};return db[_0x197c('0x2c')][_0x197c('0x58')]({'where':{'id':_0x1e6371[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x436a53,null))[_0x197c('0x24')](function(_0x2a03e3){if(_0x2a03e3){_0x342efa['model']=_['keys'](db['CmHopper'][_0x197c('0x2d')]);_0x342efa['query']=_[_0x197c('0x47')](_0x1e6371['query']);_0x342efa['filters']=_[_0x197c('0x35')](_0x342efa[_0x197c('0x31')],_0x342efa[_0x197c('0x33')]);_0x1947bd['attributes']=_[_0x197c('0x35')](_0x342efa[_0x197c('0x31')],qs['fields'](_0x1e6371[_0x197c('0x33')][_0x197c('0x37')]));_0x1947bd[_0x197c('0x36')]=_0x1947bd[_0x197c('0x36')]['length']?_0x1947bd[_0x197c('0x36')]:_0x342efa['model'];if(!_0x1e6371[_0x197c('0x33')]['hasOwnProperty'](_0x197c('0x3a'))){_0x1947bd[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x1e6371['query'][_0x197c('0x1b')]);_0x1947bd[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x1e6371['query'][_0x197c('0x19')]);}_0x1947bd[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x1e6371[_0x197c('0x33')][_0x197c('0x3c')]);_0x1947bd[_0x197c('0x3d')]=qs['filters'](_[_0x197c('0x59')](_0x1e6371['query'],_0x342efa['filters']));_0x1947bd[_0x197c('0x3d')][_0x197c('0x5a')]=_0x2a03e3['id'];if(_0x1e6371['query'][_0x197c('0x3e')]){_0x1947bd[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x1947bd[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x1947bd['attributes'],function(_0x5da64e){var _0x4ca9b9={};_0x4ca9b9[_0x5da64e]={'$like':'%'+_0x1e6371['query'][_0x197c('0x3e')]+'%'};return _0x4ca9b9;})});}_0x1947bd=_[_0x197c('0x3f')]({},_0x1947bd,_0x1e6371['options']);return db['CmHopper'][_0x197c('0x1c')]({'where':_0x1947bd['where']})['then'](function(_0x2d4b26){_0x25d3c1[_0x197c('0x1c')]=_0x2d4b26;if(_0x1e6371[_0x197c('0x33')][_0x197c('0x41')]){_0x1947bd[_0x197c('0x48')]=[{'all':!![]}];}return db[_0x197c('0x5b')]['findAll'](_0x1947bd);})[_0x197c('0x24')](function(_0x2321e1){_0x25d3c1[_0x197c('0x43')]=_0x2321e1;return _0x25d3c1;});}})[_0x197c('0x24')](respondWithFilteredResult(_0x436a53,_0x1947bd))[_0x197c('0x44')](handleError(_0x436a53,null));};exports[_0x197c('0x5c')]=function(_0x4cfcc6,_0x4b332f,_0x15d047){var _0x6c3afd={'raw':!![],'where':{}};var _0x49283d={};var _0x2519a1={'count':0x0,'rows':[]};return db[_0x197c('0x2c')][_0x197c('0x58')]({'where':{'id':_0x4cfcc6['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x4b332f,null))[_0x197c('0x24')](function(_0x530d41){if(_0x530d41){_0x49283d[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x5d')][_0x197c('0x2d')]);_0x49283d[_0x197c('0x33')]=_['keys'](_0x4cfcc6['query']);_0x49283d['filters']=_[_0x197c('0x35')](_0x49283d['model'],_0x49283d['query']);_0x6c3afd[_0x197c('0x36')]=_[_0x197c('0x35')](_0x49283d[_0x197c('0x31')],qs[_0x197c('0x37')](_0x4cfcc6[_0x197c('0x33')]['fields']));_0x6c3afd['attributes']=_0x6c3afd[_0x197c('0x36')][_0x197c('0x38')]?_0x6c3afd['attributes']:_0x49283d[_0x197c('0x31')];if(!_0x4cfcc6[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x6c3afd[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x4cfcc6['query'][_0x197c('0x1b')]);_0x6c3afd[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x4cfcc6[_0x197c('0x33')][_0x197c('0x19')]);}_0x6c3afd['order']=qs['sort'](_0x4cfcc6[_0x197c('0x33')]['sort']);_0x6c3afd[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x4cfcc6[_0x197c('0x33')],_0x49283d[_0x197c('0x34')]));_0x6c3afd['where'][_0x197c('0x5a')]=_0x530d41['id'];if(_0x4cfcc6[_0x197c('0x33')][_0x197c('0x3e')]){_0x6c3afd[_0x197c('0x3d')]=_['merge'](_0x6c3afd['where'],{'$or':_[_0x197c('0x32')](_0x6c3afd['attributes'],function(_0x5505e2){var _0x34b3d6={};_0x34b3d6[_0x5505e2]={'$like':'%'+_0x4cfcc6[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x34b3d6;})});}_0x6c3afd=_['merge']({},_0x6c3afd,_0x4cfcc6['options']);return db[_0x197c('0x5d')][_0x197c('0x1c')]({'where':_0x6c3afd['where']})[_0x197c('0x24')](function(_0x235fce){_0x2519a1['count']=_0x235fce;if(_0x4cfcc6[_0x197c('0x33')][_0x197c('0x41')]){_0x6c3afd['include']=[{'all':!![]}];}return db[_0x197c('0x5d')]['findAll'](_0x6c3afd);})[_0x197c('0x24')](function(_0x18c722){_0x2519a1[_0x197c('0x43')]=_0x18c722;return _0x2519a1;});}})[_0x197c('0x24')](respondWithFilteredResult(_0x4b332f,_0x6c3afd))[_0x197c('0x44')](handleError(_0x4b332f,null));};exports['getHopperFinals']=function(_0x2d1b23,_0x41b34c,_0x35269e){var _0x1a684e={'raw':!![],'where':{}};var _0x2bbe66={};var _0x33c765={'count':0x0,'rows':[]};return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x2d1b23[_0x197c('0x46')]['id']}})['then'](handleEntityNotFound(_0x41b34c,null))[_0x197c('0x24')](function(_0x3c3f7a){if(_0x3c3f7a){_0x2bbe66[_0x197c('0x31')]=_[_0x197c('0x47')](db['CmHopperFinal'][_0x197c('0x2d')]);_0x2bbe66[_0x197c('0x33')]=_[_0x197c('0x47')](_0x2d1b23['query']);_0x2bbe66[_0x197c('0x34')]=_[_0x197c('0x35')](_0x2bbe66[_0x197c('0x31')],_0x2bbe66[_0x197c('0x33')]);_0x1a684e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x2bbe66[_0x197c('0x31')],qs['fields'](_0x2d1b23[_0x197c('0x33')]['fields']));_0x1a684e[_0x197c('0x36')]=_0x1a684e[_0x197c('0x36')][_0x197c('0x38')]?_0x1a684e[_0x197c('0x36')]:_0x2bbe66[_0x197c('0x31')];if(!_0x2d1b23['query'][_0x197c('0x39')](_0x197c('0x3a'))){_0x1a684e[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x2d1b23[_0x197c('0x33')]['limit']);_0x1a684e['offset']=qs[_0x197c('0x19')](_0x2d1b23[_0x197c('0x33')][_0x197c('0x19')]);}_0x1a684e[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x2d1b23[_0x197c('0x33')][_0x197c('0x3c')]);_0x1a684e[_0x197c('0x3d')]=qs['filters'](_[_0x197c('0x59')](_0x2d1b23[_0x197c('0x33')],_0x2bbe66['filters']));_0x1a684e[_0x197c('0x3d')][_0x197c('0x5a')]=_0x3c3f7a['id'];if(_0x2d1b23['query'][_0x197c('0x3e')]){_0x1a684e[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x1a684e[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x1a684e['attributes'],function(_0x5563ff){var _0x31fe6a={};_0x31fe6a[_0x5563ff]={'$like':'%'+_0x2d1b23[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x31fe6a;})});}_0x1a684e=_[_0x197c('0x3f')]({},_0x1a684e,_0x2d1b23[_0x197c('0x40')]);return db[_0x197c('0x5e')][_0x197c('0x1c')]({'where':_0x1a684e[_0x197c('0x3d')]})['then'](function(_0xd324a0){_0x33c765[_0x197c('0x1c')]=_0xd324a0;if(_0x2d1b23[_0x197c('0x33')][_0x197c('0x41')]){_0x1a684e[_0x197c('0x48')]=[{'all':!![]}];}return db[_0x197c('0x5e')]['findAll'](_0x1a684e);})[_0x197c('0x24')](function(_0x16c3be){_0x33c765[_0x197c('0x43')]=_0x16c3be;return _0x33c765;});}})['then'](respondWithFilteredResult(_0x41b34c,_0x1a684e))[_0x197c('0x44')](handleError(_0x41b34c,null));};exports['getHopperBlacks']=function(_0x3207ed,_0x24a61d,_0x165b03){var _0x6174a5={'raw':!![],'where':{}};var _0x14040f={};var _0x2141b1={'count':0x0,'rows':[]};return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x3207ed[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x24a61d,null))[_0x197c('0x24')](function(_0x307edb){if(_0x307edb){_0x14040f['model']=_[_0x197c('0x47')](db['CmHopperBlack'][_0x197c('0x2d')]);_0x14040f[_0x197c('0x33')]=_[_0x197c('0x47')](_0x3207ed[_0x197c('0x33')]);_0x14040f['filters']=_[_0x197c('0x35')](_0x14040f[_0x197c('0x31')],_0x14040f[_0x197c('0x33')]);_0x6174a5[_0x197c('0x36')]=_[_0x197c('0x35')](_0x14040f['model'],qs[_0x197c('0x37')](_0x3207ed[_0x197c('0x33')][_0x197c('0x37')]));_0x6174a5[_0x197c('0x36')]=_0x6174a5[_0x197c('0x36')]['length']?_0x6174a5['attributes']:_0x14040f[_0x197c('0x31')];if(!_0x3207ed[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x6174a5[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x3207ed['query'][_0x197c('0x1b')]);_0x6174a5['offset']=qs['offset'](_0x3207ed[_0x197c('0x33')][_0x197c('0x19')]);}_0x6174a5[_0x197c('0x3b')]=qs['sort'](_0x3207ed[_0x197c('0x33')][_0x197c('0x3c')]);_0x6174a5[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x3207ed[_0x197c('0x33')],_0x14040f['filters']));_0x6174a5[_0x197c('0x3d')]['CampaignId']=_0x307edb['id'];if(_0x3207ed[_0x197c('0x33')]['filter']){_0x6174a5[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x6174a5['where'],{'$or':_[_0x197c('0x32')](_0x6174a5[_0x197c('0x36')],function(_0x25ed2c){var _0x24d25a={};_0x24d25a[_0x25ed2c]={'$like':'%'+_0x3207ed[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x24d25a;})});}_0x6174a5=_[_0x197c('0x3f')]({},_0x6174a5,_0x3207ed[_0x197c('0x40')]);return db[_0x197c('0x5f')][_0x197c('0x1c')]({'where':_0x6174a5[_0x197c('0x3d')]})[_0x197c('0x24')](function(_0x4a27ac){_0x2141b1['count']=_0x4a27ac;if(_0x3207ed[_0x197c('0x33')][_0x197c('0x41')]){_0x6174a5[_0x197c('0x48')]=[{'all':!![]}];}return db[_0x197c('0x5f')][_0x197c('0x42')](_0x6174a5);})['then'](function(_0x31d653){_0x2141b1[_0x197c('0x43')]=_0x31d653;return _0x2141b1;});}})[_0x197c('0x24')](respondWithFilteredResult(_0x24a61d,_0x6174a5))[_0x197c('0x44')](handleError(_0x24a61d,null));};exports[_0x197c('0x60')]=function(_0x32370a,_0x18e177,_0x2ce52a){var _0x211abe={};var _0x1e3364={};var _0xc8ecb4;var _0x2b5d20;return db['Campaign']['findOne']({'where':{'id':_0x32370a[_0x197c('0x46')]['id']}})['then'](handleEntityNotFound(_0x18e177,null))[_0x197c('0x24')](function(_0x74def6){if(_0x74def6){_0xc8ecb4=_0x74def6;_0x1e3364[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x61')][_0x197c('0x2d')]);_0x1e3364[_0x197c('0x33')]=_['keys'](_0x32370a[_0x197c('0x33')]);_0x1e3364['filters']=_[_0x197c('0x35')](_0x1e3364[_0x197c('0x31')],_0x1e3364[_0x197c('0x33')]);_0x211abe[_0x197c('0x36')]=_[_0x197c('0x35')](_0x1e3364[_0x197c('0x31')],qs['fields'](_0x32370a[_0x197c('0x33')][_0x197c('0x37')]));_0x211abe[_0x197c('0x36')]=_0x211abe[_0x197c('0x36')][_0x197c('0x38')]?_0x211abe[_0x197c('0x36')]:_0x1e3364[_0x197c('0x31')];_0x211abe[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x32370a[_0x197c('0x33')]['sort']);_0x211abe[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x32370a[_0x197c('0x33')],_0x1e3364[_0x197c('0x34')]));if(_0x32370a[_0x197c('0x33')][_0x197c('0x3e')]){_0x211abe[_0x197c('0x3d')]=_['merge'](_0x211abe[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x211abe[_0x197c('0x36')],function(_0x4f92e2){var _0x1eee91={};_0x1eee91[_0x4f92e2]={'$like':'%'+_0x32370a[_0x197c('0x33')]['filter']+'%'};return _0x1eee91;})});}_0x211abe=_[_0x197c('0x3f')]({},_0x211abe,_0x32370a[_0x197c('0x40')]);return _0xc8ecb4['getLists'](_0x211abe);}})[_0x197c('0x24')](function(_0x2dcb84){if(_0x2dcb84){_0x2b5d20=_0x2dcb84[_0x197c('0x38')];if(!_0x32370a[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x211abe[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x32370a['query']['limit']);_0x211abe[_0x197c('0x19')]=qs['offset'](_0x32370a[_0x197c('0x33')][_0x197c('0x19')]);}return _0xc8ecb4[_0x197c('0x60')](_0x211abe);}})['then'](function(_0x2fb26b){if(_0x2fb26b){return _0x2fb26b?{'count':_0x2b5d20,'rows':_0x2fb26b}:null;}})[_0x197c('0x24')](respondWithResult(_0x18e177,null))[_0x197c('0x44')](handleError(_0x18e177,null));};exports[_0x197c('0x62')]=function(_0x29e6ee,_0x57d9a4,_0x499624){var _0x29c93c,_0x27285d;var _0x478431=[];var _0x1db087=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x197c('0x55')]({'where':{'id':_0x29e6ee[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x57d9a4,null))[_0x197c('0x24')](function(_0x277247){if(_0x277247){_0x27285d=_0x277247;return _0x277247[_0x197c('0x62')](_0x29e6ee[_0x197c('0x4a')][_0x197c('0x63')],_[_0x197c('0x64')](_0x29e6ee['body'],[_0x197c('0x63'),'id'])||{});}return null;})[_0x197c('0x65')](function(_0x4675d3){var _0x1355e6;var _0x53cd6e;_0x29c93c=_0x4675d3||[];var _0x201ed7=[];if(_0x4675d3){for(var _0x283fa4=0x0;_0x283fa4<_0x4675d3[_0x197c('0x38')];_0x283fa4+=0x1){var _0x48ca1a=_0x4675d3[_0x283fa4][_0x197c('0x26')]({'plain':!![]});_0x27285d['dialCheckDuplicateType']=_0x29e6ee[_0x197c('0x4a')][_0x197c('0x66')]?_0x29e6ee[_0x197c('0x4a')][_0x197c('0x66')]:_0x27285d['dialCheckDuplicateType'];switch(_0x27285d['dialCheckDuplicateType']){case _0x197c('0x67'):_0x1355e6=squel['insert']()['into'](_0x197c('0x68'))[_0x197c('0x69')](['phone',_0x197c('0x6a'),_0x197c('0x6b'),_0x197c('0x6c'),_0x197c('0x5a'),_0x197c('0x53'),_0x197c('0x54')],squel['select']()[_0x197c('0x6d')](_0x197c('0x6e'),_0x197c('0x6e'))[_0x197c('0x6d')](_0x197c('0x6f'),'scheduledAt')[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))[_0x197c('0x6d')](_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')](),_0x197c('0x5a'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x54'))[_0x197c('0x72')](_0x197c('0x73'))[_0x197c('0x3d')](_0x197c('0x74'))[_0x197c('0x3d')](_0x197c('0x75'),_0x48ca1a[_0x197c('0x70')]['toString']())[_0x197c('0x3d')](_0x197c('0x76'))['where'](_0x197c('0x77'),squel['select']()[_0x197c('0x6d')](_0x197c('0x78'))[_0x197c('0x72')](_0x197c('0x79'))[_0x197c('0x3d')](_0x197c('0x7a'),_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x197c('0x7b')]()[_0x197c('0x6d')](_0x197c('0x7c'))[_0x197c('0x72')](_0x197c('0x68'))[_0x197c('0x3d')](_0x197c('0x7a'),_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')]())))[_0x197c('0x71')]();break;case'onlyIfOpen':_0x1355e6=squel[_0x197c('0x7d')]()[_0x197c('0x7e')](_0x197c('0x68'))[_0x197c('0x69')]([_0x197c('0x6e'),_0x197c('0x6a'),'ContactId',_0x197c('0x6c'),_0x197c('0x5a'),_0x197c('0x53'),_0x197c('0x54')],squel[_0x197c('0x7b')]()[_0x197c('0x6d')]('phone',_0x197c('0x6e'))[_0x197c('0x6d')]('NOW()',_0x197c('0x6a'))[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))['field'](_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')](),_0x197c('0x5a'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x54'))[_0x197c('0x72')]('cm_contacts')['where'](_0x197c('0x74'))['where'](_0x197c('0x75'),_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')]())[_0x197c('0x3d')](_0x197c('0x76'))[_0x197c('0x3d')](_0x197c('0x77'),squel['select']()[_0x197c('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0x197c('0x68'))[_0x197c('0x3d')]('CampaignId\x20=\x20?',_0x29e6ee['params']['id'][_0x197c('0x71')]())))[_0x197c('0x71')]();break;default:_0x1355e6=squel['insert']()[_0x197c('0x7e')](_0x197c('0x68'))[_0x197c('0x69')]([_0x197c('0x6e'),'scheduledAt',_0x197c('0x6b'),'ListId','CampaignId',_0x197c('0x53'),_0x197c('0x54')],squel[_0x197c('0x7b')]()[_0x197c('0x6d')](_0x197c('0x6e'),'phone')[_0x197c('0x6d')]('NOW()','scheduledAt')[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))[_0x197c('0x6d')](_0x29e6ee['params']['id'][_0x197c('0x71')](),'CampaignId')[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27','updatedAt')['from'](_0x197c('0x73'))[_0x197c('0x3d')](_0x197c('0x74'))[_0x197c('0x3d')](_0x197c('0x75'),_0x48ca1a['CmListId'][_0x197c('0x71')]())['where'](_0x197c('0x76')))[_0x197c('0x71')]();}_0x53cd6e=squel[_0x197c('0x7d')]()[_0x197c('0x7e')]('cm_hopper_additional_phones')[_0x197c('0x69')]([_0x197c('0x7f'),_0x197c('0x6a'),_0x197c('0x6e'),_0x197c('0x80'),_0x197c('0x53'),'updatedAt'],squel[_0x197c('0x7b')]()[_0x197c('0x6d')](_0x197c('0x81'),'id')[_0x197c('0x6d')](_0x197c('0x6f'),'scheduledAt')[_0x197c('0x6d')]('ci.item','phone')[_0x197c('0x6d')]('ci.OrderBY',_0x197c('0x80'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))['field']('\x27'+_0x1db087+'\x27',_0x197c('0x54'))[_0x197c('0x72')](_0x197c('0x82'),'ci')[_0x197c('0x83')](_0x197c('0x68'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x197c('0x3d')](_0x197c('0x84'),_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')]())['where'](_0x197c('0x85'),_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')]())['where']('h.createdAt\x20=\x20?',_0x1db087))[_0x197c('0x71')]();_0x201ed7[_0x197c('0x86')](db[_0x197c('0x87')]['query'](_0x1355e6));_0x478431[_0x197c('0x86')](db['sequelize'][_0x197c('0x33')](_0x53cd6e));}return BPromise[_0x197c('0x88')](_0x201ed7);}})[_0x197c('0x24')](function(){return BPromise[_0x197c('0x88')](_0x478431);})[_0x197c('0x24')](function(){return _0x29c93c;})[_0x197c('0x24')](respondWithResult(_0x57d9a4,null))[_0x197c('0x44')](handleError(_0x57d9a4,null));};exports[_0x197c('0x89')]=function(_0x5e326f,_0x160a1,_0x62c16c){return db[_0x197c('0x2c')][_0x197c('0x55')]({'where':{'id':_0x5e326f[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x160a1,null))[_0x197c('0x24')](function(_0x55476f){if(_0x55476f){return _0x55476f[_0x197c('0x89')](_0x5e326f[_0x197c('0x33')][_0x197c('0x63')]);}})[_0x197c('0x24')](function(_0x1daa31){if(_0x1daa31){return db[_0x197c('0x5b')]['destroy']({'where':{'ListId':_0x5e326f[_0x197c('0x33')][_0x197c('0x63')],'CampaignId':_0x5e326f[_0x197c('0x46')]['id']}})[_0x197c('0x24')](function(){return _0x1daa31;});}})[_0x197c('0x24')](respondWithStatusCode(_0x160a1,null))[_0x197c('0x44')](handleError(_0x160a1,null));};exports[_0x197c('0x8a')]=function(_0x36ae6c,_0x3d4d3b,_0x522cbb){var _0x4b599e={};var _0x4bc033={};var _0x2bfbb0;var _0x44f647;return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x36ae6c['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x3d4d3b,null))[_0x197c('0x24')](function(_0x1568c2){if(_0x1568c2){_0x2bfbb0=_0x1568c2;_0x4bc033[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x61')]['rawAttributes']);_0x4bc033[_0x197c('0x33')]=_['keys'](_0x36ae6c[_0x197c('0x33')]);_0x4bc033['filters']=_[_0x197c('0x35')](_0x4bc033[_0x197c('0x31')],_0x4bc033[_0x197c('0x33')]);_0x4b599e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x4bc033[_0x197c('0x31')],qs[_0x197c('0x37')](_0x36ae6c[_0x197c('0x33')][_0x197c('0x37')]));_0x4b599e['attributes']=_0x4b599e[_0x197c('0x36')][_0x197c('0x38')]?_0x4b599e[_0x197c('0x36')]:_0x4bc033[_0x197c('0x31')];_0x4b599e[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x36ae6c[_0x197c('0x33')][_0x197c('0x3c')]);_0x4b599e[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x36ae6c[_0x197c('0x33')],_0x4bc033[_0x197c('0x34')]));if(_0x36ae6c[_0x197c('0x33')][_0x197c('0x3e')]){_0x4b599e[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x4b599e[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x4b599e['attributes'],function(_0x2d9880){var _0x12f785={};_0x12f785[_0x2d9880]={'$like':'%'+_0x36ae6c[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x12f785;})});}_0x4b599e=_[_0x197c('0x3f')]({},_0x4b599e,_0x36ae6c[_0x197c('0x40')]);return _0x2bfbb0[_0x197c('0x8a')](_0x4b599e);}})[_0x197c('0x24')](function(_0x5b578b){if(_0x5b578b){_0x44f647=_0x5b578b['length'];if(!_0x36ae6c['query'][_0x197c('0x39')](_0x197c('0x3a'))){_0x4b599e['limit']=qs[_0x197c('0x1b')](_0x36ae6c[_0x197c('0x33')]['limit']);_0x4b599e[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x36ae6c['query'][_0x197c('0x19')]);}return _0x2bfbb0[_0x197c('0x8a')](_0x4b599e);}})['then'](function(_0x366bf0){if(_0x366bf0){return _0x366bf0?{'count':_0x44f647,'rows':_0x366bf0}:null;}})[_0x197c('0x24')](respondWithResult(_0x3d4d3b,null))[_0x197c('0x44')](handleError(_0x3d4d3b,null));};exports['addBlackLists']=function(_0x45bdad,_0x21071b,_0x8f048){var _0x10f469,_0x48e103;var _0xbfdf5a=[];var _0x4f2c75=moment()[_0x197c('0x8b')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x197c('0x2c')][_0x197c('0x55')]({'where':{'id':_0x45bdad['params']['id']}})['then'](handleEntityNotFound(_0x21071b,null))[_0x197c('0x24')](function(_0x1c608c){if(_0x1c608c){_0x48e103=_0x1c608c;return _0x1c608c[_0x197c('0x8c')](_0x45bdad[_0x197c('0x4a')][_0x197c('0x63')],_[_0x197c('0x64')](_0x45bdad[_0x197c('0x4a')],[_0x197c('0x63'),'id'])||{});}return null;})[_0x197c('0x65')](function(_0x43b746){var _0xd42353;var _0x4ccaff;_0x10f469=_0x43b746||[];var _0x109daf=[];if(_0x43b746){for(var _0x3658c9=0x0;_0x3658c9<_0x43b746[_0x197c('0x38')];_0x3658c9+=0x1){var _0x264af2=_0x43b746[_0x3658c9]['get']({'plain':!![]});_0xd42353=squel[_0x197c('0x7d')]()[_0x197c('0x7e')]('cm_hopper_black')[_0x197c('0x69')]([_0x197c('0x6e'),_0x197c('0x6b'),'ListId',_0x197c('0x5a'),_0x197c('0x53'),_0x197c('0x54')],squel[_0x197c('0x7b')]()[_0x197c('0x6d')]('phone',_0x197c('0x6e'))[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x264af2[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))[_0x197c('0x6d')](_0x45bdad[_0x197c('0x46')]['id'][_0x197c('0x71')](),'CampaignId')[_0x197c('0x6d')](_0x197c('0x6f'),_0x197c('0x53'))[_0x197c('0x6d')](_0x197c('0x6f'),'updatedAt')['from'](_0x197c('0x73'))['where'](_0x197c('0x74'))[_0x197c('0x3d')](_0x197c('0x75'),_0x264af2[_0x197c('0x70')][_0x197c('0x71')]())[_0x197c('0x3d')](_0x197c('0x76')))['toString']();_0x109daf[_0x197c('0x86')](db[_0x197c('0x87')]['query'](_0xd42353));}return BPromise[_0x197c('0x88')](_0x109daf);}})[_0x197c('0x24')](function(){return _0x10f469;})[_0x197c('0x24')](respondWithResult(_0x21071b,null))['catch'](handleError(_0x21071b,null));};exports[_0x197c('0x8d')]=function(_0x2eebbb,_0x43ca15,_0x22a786){return db[_0x197c('0x2c')][_0x197c('0x55')]({'where':{'id':_0x2eebbb[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x43ca15,null))['then'](function(_0x12fb25){if(_0x12fb25){return _0x12fb25[_0x197c('0x8d')](_0x2eebbb[_0x197c('0x33')][_0x197c('0x63')]);}})[_0x197c('0x24')](function(_0x498cd6){if(_0x498cd6){return db['CmHopperBlack'][_0x197c('0x25')]({'where':{'ListId':_0x2eebbb[_0x197c('0x33')]['ids'],'CampaignId':_0x2eebbb[_0x197c('0x46')]['id']}})['then'](function(){return _0x498cd6;});}})[_0x197c('0x24')](respondWithStatusCode(_0x43ca15,null))['catch'](handleError(_0x43ca15,null));};
\ No newline at end of file
+var _0x336d=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','into','ListId','from','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','UserProfileResource','error','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','role','IvrCampaigns','UserProfileSection','getHoppers','findOne','CmHopper','rows','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x15b916,_0x39ccf5){var _0x4f6426=function(_0x1ba9ca){while(--_0x1ba9ca){_0x15b916['push'](_0x15b916['shift']());}};_0x4f6426(++_0x39ccf5);}(_0x336d,0xae));var _0xd336=function(_0x5cda54,_0x9b37fc){_0x5cda54=_0x5cda54-0x0;var _0x33d718=_0x336d[_0x5cda54];return _0x33d718;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd336('0x0'));var zipdir=require(_0xd336('0x1'));var jsonpatch=require(_0xd336('0x2'));var rp=require(_0xd336('0x3'));var moment=require(_0xd336('0x4'));var BPromise=require(_0xd336('0x5'));var Mustache=require(_0xd336('0x6'));var util=require(_0xd336('0x7'));var path=require(_0xd336('0x8'));var sox=require(_0xd336('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd336('0xa'));var _=require(_0xd336('0xb'));var squel=require(_0xd336('0xc'));var crypto=require('crypto');var jsforce=require(_0xd336('0xd'));var deskjs=require(_0xd336('0xe'));var toCsv=require(_0xd336('0xf'));var querystring=require(_0xd336('0x10'));var Papa=require(_0xd336('0x11'));var Redis=require(_0xd336('0x12'));var authService=require(_0xd336('0x13'));var qs=require(_0xd336('0x14'));var as=require(_0xd336('0x15'));var hardwareService=require(_0xd336('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xd336('0x17'));var config=require(_0xd336('0x18'));var licenseUtil=require(_0xd336('0x19'));var db=require(_0xd336('0x1a'))['db'];function respondWithStatusCode(_0x29aa4a,_0x276abb){_0x276abb=_0x276abb||0xcc;return function(_0x327229){if(_0x327229){return _0x29aa4a[_0xd336('0x1b')](_0x276abb);}return _0x29aa4a[_0xd336('0x1c')](_0x276abb)[_0xd336('0x1d')]();};}function respondWithResult(_0x4d4fca,_0x3a8a98){_0x3a8a98=_0x3a8a98||0xc8;return function(_0x4fc32e){if(_0x4fc32e){return _0x4d4fca[_0xd336('0x1c')](_0x3a8a98)[_0xd336('0x1e')](_0x4fc32e);}};}function respondWithFilteredResult(_0x1b3cd8,_0x1c8fd7){return function(_0x1e4716){if(_0x1e4716){var _0x96cab8=typeof _0x1c8fd7[_0xd336('0x1f')]===_0xd336('0x20')&&typeof _0x1c8fd7[_0xd336('0x21')]===_0xd336('0x20');var _0x2171a2=_0x1e4716[_0xd336('0x22')];var _0x3dfc7b=_0x96cab8?0x0:_0x1c8fd7[_0xd336('0x1f')];var _0x1eabe0=_0x96cab8?_0x1e4716[_0xd336('0x22')]:_0x1c8fd7[_0xd336('0x1f')]+_0x1c8fd7['limit'];var _0x3fd3d1;if(_0x1eabe0>=_0x2171a2){_0x1eabe0=_0x2171a2;_0x3fd3d1=0xc8;}else{_0x3fd3d1=0xce;}_0x1b3cd8[_0xd336('0x1c')](_0x3fd3d1);return _0x1b3cd8[_0xd336('0x23')]('Content-Range',_0x3dfc7b+'-'+_0x1eabe0+'/'+_0x2171a2)[_0xd336('0x1e')](_0x1e4716);}return null;};}function patchUpdates(_0x2a5349){return function(_0x4d7351){try{jsonpatch[_0xd336('0x24')](_0x4d7351,_0x2a5349,!![]);}catch(_0x190123){return BPromise['reject'](_0x190123);}return _0x4d7351[_0xd336('0x25')]();};}function saveUpdates(_0x4d76b2,_0x2dad56){return function(_0x3bf076){if(_0x3bf076){return _0x3bf076[_0xd336('0x26')](_0x4d76b2)[_0xd336('0x27')](function(_0x38736e){return _0x38736e;});}return null;};}function removeEntity(_0x4d7fa6,_0x4d6f4d){return function(_0xc1f71f){if(_0xc1f71f){return _0xc1f71f[_0xd336('0x28')]()[_0xd336('0x27')](function(){var _0xfa45e8=_0xc1f71f[_0xd336('0x29')]({'plain':!![]});var _0x2f16dd='IvrCampaigns';return db[_0xd336('0x2a')][_0xd336('0x28')]({'where':{'type':_0x2f16dd,'resourceId':_0xfa45e8['id']}})['then'](function(){return _0xc1f71f;});})['then'](function(){_0x4d7fa6[_0xd336('0x1c')](0xcc)[_0xd336('0x1d')]();});}};}function handleEntityNotFound(_0x4240bc,_0x2e0678){return function(_0xa99518){if(!_0xa99518){_0x4240bc[_0xd336('0x1b')](0x194);}return _0xa99518;};}function handleError(_0x2c11d6,_0x21f288){_0x21f288=_0x21f288||0x1f4;return function(_0x289051){logger[_0xd336('0x2b')](_0x289051['stack']);if(_0x289051['name']){delete _0x289051[_0xd336('0x2c')];}_0x2c11d6[_0xd336('0x1c')](_0x21f288)['send'](_0x289051);};}exports[_0xd336('0x2d')]=function(_0x337a90,_0x489dee){var _0x45aaa8={},_0x3c2439={},_0x389ed6={'count':0x0,'rows':[]};var _0x21c898=_[_0xd336('0x2e')](db[_0xd336('0x2f')][_0xd336('0x30')],function(_0x4cab5e){return{'name':_0x4cab5e[_0xd336('0x31')],'type':_0x4cab5e['type'][_0xd336('0x32')]};});_0x3c2439[_0xd336('0x33')]=_[_0xd336('0x2e')](_0x21c898,_0xd336('0x2c'));_0x3c2439[_0xd336('0x34')]=_[_0xd336('0x35')](_0x337a90[_0xd336('0x34')]);_0x3c2439[_0xd336('0x36')]=_[_0xd336('0x37')](_0x3c2439['model'],_0x3c2439[_0xd336('0x34')]);_0x45aaa8[_0xd336('0x38')]=_[_0xd336('0x37')](_0x3c2439[_0xd336('0x33')],qs[_0xd336('0x39')](_0x337a90[_0xd336('0x34')]['fields']));_0x45aaa8[_0xd336('0x38')]=_0x45aaa8[_0xd336('0x38')]['length']?_0x45aaa8[_0xd336('0x38')]:_0x3c2439['model'];if(!_0x337a90[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x45aaa8[_0xd336('0x21')]=qs[_0xd336('0x21')](_0x337a90[_0xd336('0x34')][_0xd336('0x21')]);_0x45aaa8[_0xd336('0x1f')]=qs[_0xd336('0x1f')](_0x337a90[_0xd336('0x34')][_0xd336('0x1f')]);}_0x45aaa8[_0xd336('0x3c')]=qs['sort'](_0x337a90[_0xd336('0x34')][_0xd336('0x3d')]);_0x45aaa8[_0xd336('0x3e')]=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x337a90['query'],_0x3c2439[_0xd336('0x36')]),_0x21c898);if(_0x337a90[_0xd336('0x34')][_0xd336('0x40')]){_0x45aaa8[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x45aaa8['where'],{'$or':_[_0xd336('0x2e')](_0x21c898,function(_0x3c126c){if(_0x3c126c[_0xd336('0x42')]!=='VIRTUAL'){var _0x877fe1={};_0x877fe1[_0x3c126c['name']]={'$like':'%'+_0x337a90['query']['filter']+'%'};return _0x877fe1;}})});}_0x45aaa8=_[_0xd336('0x41')]({},_0x45aaa8,_0x337a90['options']);var _0x418b28={'where':_0x45aaa8[_0xd336('0x3e')]};return db['Campaign'][_0xd336('0x22')](_0x418b28)[_0xd336('0x27')](function(_0x456c35){_0x389ed6[_0xd336('0x22')]=_0x456c35;if(_0x337a90[_0xd336('0x34')][_0xd336('0x43')]){_0x45aaa8[_0xd336('0x44')]=[{'all':!![]}];}return db[_0xd336('0x2f')][_0xd336('0x45')](_0x45aaa8);})[_0xd336('0x27')](function(_0x24c734){_0x389ed6['rows']=_0x24c734;return _0x389ed6;})['then'](respondWithFilteredResult(_0x489dee,_0x45aaa8))[_0xd336('0x46')](handleError(_0x489dee,null));};exports[_0xd336('0x47')]=function(_0x24d222,_0x5ec77b){var _0x112e84={'raw':![],'where':{'id':_0x24d222[_0xd336('0x48')]['id']}},_0x33fef7={};_0x33fef7['model']=_[_0xd336('0x35')](db[_0xd336('0x2f')][_0xd336('0x30')]);_0x33fef7['query']=_['keys'](_0x24d222['query']);_0x33fef7[_0xd336('0x36')]=_[_0xd336('0x37')](_0x33fef7['model'],_0x33fef7[_0xd336('0x34')]);_0x112e84[_0xd336('0x38')]=_[_0xd336('0x37')](_0x33fef7['model'],qs['fields'](_0x24d222[_0xd336('0x34')][_0xd336('0x39')]));_0x112e84[_0xd336('0x38')]=_0x112e84[_0xd336('0x38')][_0xd336('0x49')]?_0x112e84[_0xd336('0x38')]:_0x33fef7[_0xd336('0x33')];if(_0x24d222['query'][_0xd336('0x43')]){_0x112e84[_0xd336('0x44')]=[{'all':!![]}];}_0x112e84=_['merge']({},_0x112e84,_0x24d222[_0xd336('0x4a')]);return db[_0xd336('0x2f')][_0xd336('0x4b')](_0x112e84)[_0xd336('0x27')](handleEntityNotFound(_0x5ec77b,null))[_0xd336('0x27')](respondWithResult(_0x5ec77b,null))['catch'](handleError(_0x5ec77b,null));};exports[_0xd336('0x4c')]=function(_0x163c36,_0x34530e){return db['Campaign'][_0xd336('0x4c')](_0x163c36[_0xd336('0x4d')],{})['then'](function(_0x3a4ef9){var _0x2388b7=_0x163c36[_0xd336('0x4e')][_0xd336('0x29')]({'plain':!![]});if(!_0x2388b7)throw new Error(_0xd336('0x4f'));if(_0x2388b7['role']===_0xd336('0x4e')){var _0x3df648=_0x3a4ef9['get']({'plain':!![]});var _0x4040ca='IvrCampaigns';return db['UserProfileSection'][_0xd336('0x4b')]({'where':{'name':_0x4040ca,'userProfileId':_0x2388b7[_0xd336('0x50')]},'raw':!![]})[_0xd336('0x27')](function(_0x12f414){if(_0x12f414&&_0x12f414[_0xd336('0x51')]===0x0){return db['UserProfileResource'][_0xd336('0x4c')]({'name':_0x3df648[_0xd336('0x2c')],'resourceId':_0x3df648['id'],'type':_0x12f414[_0xd336('0x2c')],'sectionId':_0x12f414['id']},{})[_0xd336('0x27')](function(){return _0x3a4ef9;});}else{return _0x3a4ef9;}})[_0xd336('0x46')](function(_0x4bf412){logger[_0xd336('0x2b')](_0xd336('0x52'),_0x4bf412);throw _0x4bf412;});}return _0x3a4ef9;})['then'](respondWithResult(_0x34530e,0xc9))[_0xd336('0x46')](handleError(_0x34530e,null));};exports[_0xd336('0x53')]=function(_0x34761b,_0x2e72c0){var _0x865cc7={'where':{'id':_0x34761b[_0xd336('0x48')]['id']}},_0x179533={};_0x179533['model']=_[_0xd336('0x35')](db['Campaign'][_0xd336('0x30')]);_0x865cc7['attributes']=_[_0xd336('0x37')](_0x179533[_0xd336('0x33')],qs[_0xd336('0x39')](_0x34761b[_0xd336('0x34')][_0xd336('0x39')]));_0x865cc7['attributes']=_0x865cc7[_0xd336('0x38')]['length']?_0x865cc7[_0xd336('0x38')]:_0x179533[_0xd336('0x33')];if(_0x34761b['query'][_0xd336('0x43')]){_0x865cc7[_0xd336('0x44')]=[{'all':!![]}];}_0x865cc7=_[_0xd336('0x41')]({},_0x865cc7,_0x34761b[_0xd336('0x4a')]);return db['Campaign'][_0xd336('0x4b')](_0x865cc7)[_0xd336('0x27')](handleEntityNotFound(_0x2e72c0,null))['then'](function(_0x310cbd){if(_0x310cbd){var _0x1b436=_0x310cbd[_0xd336('0x29')]({'plain':!![]});_0x1b436=qs['omit'](_0x1b436,['id',_0xd336('0x54'),_0xd336('0x55')]);_0x34761b[_0xd336('0x4d')]=_[_0xd336('0x56')](_0x34761b[_0xd336('0x4d')],['id','createdAt',_0xd336('0x55')]);return db['Campaign'][_0xd336('0x4c')](_['merge'](_0x1b436,_0x34761b[_0xd336('0x4d')]),{'include':_0x34761b[_0xd336('0x34')][_0xd336('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0xde88fc){var _0x2e3bc5=_0x34761b[_0xd336('0x4e')][_0xd336('0x29')]({'plain':!![]});if(!_0x2e3bc5)throw new Error(_0xd336('0x4f'));if(_0x2e3bc5[_0xd336('0x57')]===_0xd336('0x4e')){var _0x3229c0=_0xde88fc['get']({'plain':!![]});var _0x1709cb=_0xd336('0x58');return db[_0xd336('0x59')][_0xd336('0x4b')]({'where':{'name':_0x1709cb,'userProfileId':_0x2e3bc5[_0xd336('0x50')]},'raw':!![]})[_0xd336('0x27')](function(_0x2693f3){if(_0x2693f3&&_0x2693f3['autoAssociation']===0x0){return db[_0xd336('0x2a')][_0xd336('0x4c')]({'name':_0x3229c0['name'],'resourceId':_0x3229c0['id'],'type':_0x2693f3[_0xd336('0x2c')],'sectionId':_0x2693f3['id']},{})[_0xd336('0x27')](function(){return _0xde88fc;});}else{return _0xde88fc;}})[_0xd336('0x46')](function(_0x50f288){logger[_0xd336('0x2b')](_0xd336('0x52'),_0x50f288);throw _0x50f288;});}return _0xde88fc;});}})[_0xd336('0x27')](respondWithResult(_0x2e72c0,0xc9))[_0xd336('0x46')](handleError(_0x2e72c0,null));};exports[_0xd336('0x26')]=function(_0x49d74e,_0x3e3911){if(_0x49d74e[_0xd336('0x4d')]['id']){delete _0x49d74e[_0xd336('0x4d')]['id'];}return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x49d74e[_0xd336('0x48')]['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x3e3911,null))[_0xd336('0x27')](saveUpdates(_0x49d74e[_0xd336('0x4d')],null))[_0xd336('0x27')](respondWithResult(_0x3e3911,null))['catch'](handleError(_0x3e3911,null));};exports[_0xd336('0x28')]=function(_0x54e68e,_0x29f840){return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x54e68e['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x29f840,null))[_0xd336('0x27')](removeEntity(_0x29f840,null))[_0xd336('0x46')](handleError(_0x29f840,null));};exports[_0xd336('0x5a')]=function(_0x434a29,_0x1c5563,_0x1fe9e4){var _0x4222e2={'raw':!![],'where':{}};var _0x46713c={};var _0x5022ba={'count':0x0,'rows':[]};return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0x434a29[_0xd336('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c5563,null))[_0xd336('0x27')](function(_0x35f41d){if(_0x35f41d){_0x46713c[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x5c')][_0xd336('0x30')]);_0x46713c[_0xd336('0x34')]=_[_0xd336('0x35')](_0x434a29[_0xd336('0x34')]);_0x46713c[_0xd336('0x36')]=_[_0xd336('0x37')](_0x46713c[_0xd336('0x33')],_0x46713c[_0xd336('0x34')]);_0x4222e2['attributes']=_[_0xd336('0x37')](_0x46713c[_0xd336('0x33')],qs[_0xd336('0x39')](_0x434a29[_0xd336('0x34')][_0xd336('0x39')]));_0x4222e2[_0xd336('0x38')]=_0x4222e2[_0xd336('0x38')][_0xd336('0x49')]?_0x4222e2[_0xd336('0x38')]:_0x46713c[_0xd336('0x33')];if(!_0x434a29['query']['hasOwnProperty'](_0xd336('0x3b'))){_0x4222e2[_0xd336('0x21')]=qs[_0xd336('0x21')](_0x434a29[_0xd336('0x34')]['limit']);_0x4222e2[_0xd336('0x1f')]=qs['offset'](_0x434a29[_0xd336('0x34')][_0xd336('0x1f')]);}_0x4222e2[_0xd336('0x3c')]=qs['sort'](_0x434a29[_0xd336('0x34')][_0xd336('0x3d')]);_0x4222e2[_0xd336('0x3e')]=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x434a29[_0xd336('0x34')],_0x46713c[_0xd336('0x36')]));_0x4222e2[_0xd336('0x3e')]['CampaignId']=_0x35f41d['id'];if(_0x434a29[_0xd336('0x34')]['filter']){_0x4222e2['where']=_[_0xd336('0x41')](_0x4222e2[_0xd336('0x3e')],{'$or':_['map'](_0x4222e2[_0xd336('0x38')],function(_0x2ff83c){var _0x1f999a={};_0x1f999a[_0x2ff83c]={'$like':'%'+_0x434a29[_0xd336('0x34')][_0xd336('0x40')]+'%'};return _0x1f999a;})});}_0x4222e2=_['merge']({},_0x4222e2,_0x434a29['options']);return db[_0xd336('0x5c')][_0xd336('0x22')]({'where':_0x4222e2[_0xd336('0x3e')]})[_0xd336('0x27')](function(_0x2cb6eb){_0x5022ba[_0xd336('0x22')]=_0x2cb6eb;if(_0x434a29['query'][_0xd336('0x43')]){_0x4222e2[_0xd336('0x44')]=[{'all':!![]}];}return db[_0xd336('0x5c')][_0xd336('0x45')](_0x4222e2);})['then'](function(_0xc9c6b3){_0x5022ba[_0xd336('0x5d')]=_0xc9c6b3;return _0x5022ba;});}})[_0xd336('0x27')](respondWithFilteredResult(_0x1c5563,_0x4222e2))[_0xd336('0x46')](handleError(_0x1c5563,null));};exports[_0xd336('0x5e')]=function(_0xca6ec4,_0x239358,_0x6fc3ad){var _0x30908a={'raw':!![],'where':{}};var _0x43c0f7={};var _0x3e0663={'count':0x0,'rows':[]};return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0xca6ec4[_0xd336('0x48')]['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x239358,null))[_0xd336('0x27')](function(_0x149acc){if(_0x149acc){_0x43c0f7[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x5f')][_0xd336('0x30')]);_0x43c0f7[_0xd336('0x34')]=_[_0xd336('0x35')](_0xca6ec4[_0xd336('0x34')]);_0x43c0f7[_0xd336('0x36')]=_[_0xd336('0x37')](_0x43c0f7[_0xd336('0x33')],_0x43c0f7[_0xd336('0x34')]);_0x30908a[_0xd336('0x38')]=_['intersection'](_0x43c0f7[_0xd336('0x33')],qs[_0xd336('0x39')](_0xca6ec4[_0xd336('0x34')][_0xd336('0x39')]));_0x30908a['attributes']=_0x30908a[_0xd336('0x38')]['length']?_0x30908a['attributes']:_0x43c0f7['model'];if(!_0xca6ec4[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x30908a[_0xd336('0x21')]=qs[_0xd336('0x21')](_0xca6ec4[_0xd336('0x34')]['limit']);_0x30908a[_0xd336('0x1f')]=qs[_0xd336('0x1f')](_0xca6ec4[_0xd336('0x34')]['offset']);}_0x30908a[_0xd336('0x3c')]=qs[_0xd336('0x3d')](_0xca6ec4[_0xd336('0x34')][_0xd336('0x3d')]);_0x30908a[_0xd336('0x3e')]=qs[_0xd336('0x36')](_['pick'](_0xca6ec4[_0xd336('0x34')],_0x43c0f7['filters']));_0x30908a[_0xd336('0x3e')][_0xd336('0x60')]=_0x149acc['id'];if(_0xca6ec4[_0xd336('0x34')][_0xd336('0x40')]){_0x30908a[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x30908a[_0xd336('0x3e')],{'$or':_[_0xd336('0x2e')](_0x30908a[_0xd336('0x38')],function(_0x24b2fd){var _0x3ce687={};_0x3ce687[_0x24b2fd]={'$like':'%'+_0xca6ec4[_0xd336('0x34')][_0xd336('0x40')]+'%'};return _0x3ce687;})});}_0x30908a=_[_0xd336('0x41')]({},_0x30908a,_0xca6ec4[_0xd336('0x4a')]);return db['CmHopperHistory'][_0xd336('0x22')]({'where':_0x30908a['where']})[_0xd336('0x27')](function(_0x2ae4dc){_0x3e0663[_0xd336('0x22')]=_0x2ae4dc;if(_0xca6ec4[_0xd336('0x34')][_0xd336('0x43')]){_0x30908a['include']=[{'all':!![]}];}return db[_0xd336('0x5f')][_0xd336('0x45')](_0x30908a);})[_0xd336('0x27')](function(_0x1c761c){_0x3e0663[_0xd336('0x5d')]=_0x1c761c;return _0x3e0663;});}})[_0xd336('0x27')](respondWithFilteredResult(_0x239358,_0x30908a))['catch'](handleError(_0x239358,null));};exports[_0xd336('0x61')]=function(_0x35d124,_0x12bb68,_0x5290d1){var _0x13e5f0={'raw':!![],'where':{}};var _0x1d5699={};var _0x28e29={'count':0x0,'rows':[]};return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0x35d124[_0xd336('0x48')]['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x12bb68,null))[_0xd336('0x27')](function(_0x5e038e){if(_0x5e038e){_0x1d5699[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x62')][_0xd336('0x30')]);_0x1d5699['query']=_['keys'](_0x35d124['query']);_0x1d5699[_0xd336('0x36')]=_[_0xd336('0x37')](_0x1d5699[_0xd336('0x33')],_0x1d5699[_0xd336('0x34')]);_0x13e5f0['attributes']=_[_0xd336('0x37')](_0x1d5699[_0xd336('0x33')],qs['fields'](_0x35d124[_0xd336('0x34')][_0xd336('0x39')]));_0x13e5f0[_0xd336('0x38')]=_0x13e5f0[_0xd336('0x38')]['length']?_0x13e5f0[_0xd336('0x38')]:_0x1d5699[_0xd336('0x33')];if(!_0x35d124[_0xd336('0x34')][_0xd336('0x3a')]('nolimit')){_0x13e5f0['limit']=qs[_0xd336('0x21')](_0x35d124[_0xd336('0x34')][_0xd336('0x21')]);_0x13e5f0['offset']=qs[_0xd336('0x1f')](_0x35d124[_0xd336('0x34')][_0xd336('0x1f')]);}_0x13e5f0[_0xd336('0x3c')]=qs[_0xd336('0x3d')](_0x35d124[_0xd336('0x34')][_0xd336('0x3d')]);_0x13e5f0[_0xd336('0x3e')]=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x35d124[_0xd336('0x34')],_0x1d5699[_0xd336('0x36')]));_0x13e5f0[_0xd336('0x3e')][_0xd336('0x60')]=_0x5e038e['id'];if(_0x35d124[_0xd336('0x34')]['filter']){_0x13e5f0[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x13e5f0[_0xd336('0x3e')],{'$or':_[_0xd336('0x2e')](_0x13e5f0['attributes'],function(_0x5129b1){var _0x287a5f={};_0x287a5f[_0x5129b1]={'$like':'%'+_0x35d124[_0xd336('0x34')][_0xd336('0x40')]+'%'};return _0x287a5f;})});}_0x13e5f0=_['merge']({},_0x13e5f0,_0x35d124[_0xd336('0x4a')]);return db[_0xd336('0x62')]['count']({'where':_0x13e5f0[_0xd336('0x3e')]})['then'](function(_0x46bb99){_0x28e29['count']=_0x46bb99;if(_0x35d124[_0xd336('0x34')][_0xd336('0x43')]){_0x13e5f0['include']=[{'all':!![]}];}return db[_0xd336('0x62')][_0xd336('0x45')](_0x13e5f0);})[_0xd336('0x27')](function(_0xed5080){_0x28e29[_0xd336('0x5d')]=_0xed5080;return _0x28e29;});}})[_0xd336('0x27')](respondWithFilteredResult(_0x12bb68,_0x13e5f0))[_0xd336('0x46')](handleError(_0x12bb68,null));};exports[_0xd336('0x63')]=function(_0x5f50ef,_0x218026,_0x5540f0){var _0x593429={'raw':!![],'where':{}};var _0x513cfe={};var _0x56125b={'count':0x0,'rows':[]};return db[_0xd336('0x2f')]['findOne']({'where':{'id':_0x5f50ef['params']['id']}})['then'](handleEntityNotFound(_0x218026,null))[_0xd336('0x27')](function(_0x2042d6){if(_0x2042d6){_0x513cfe['model']=_['keys'](db[_0xd336('0x64')][_0xd336('0x30')]);_0x513cfe[_0xd336('0x34')]=_[_0xd336('0x35')](_0x5f50ef[_0xd336('0x34')]);_0x513cfe['filters']=_[_0xd336('0x37')](_0x513cfe['model'],_0x513cfe[_0xd336('0x34')]);_0x593429[_0xd336('0x38')]=_[_0xd336('0x37')](_0x513cfe[_0xd336('0x33')],qs[_0xd336('0x39')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x39')]));_0x593429['attributes']=_0x593429[_0xd336('0x38')]['length']?_0x593429[_0xd336('0x38')]:_0x513cfe[_0xd336('0x33')];if(!_0x5f50ef[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x593429['limit']=qs[_0xd336('0x21')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x21')]);_0x593429['offset']=qs[_0xd336('0x1f')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x1f')]);}_0x593429['order']=qs[_0xd336('0x3d')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x3d')]);_0x593429['where']=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x5f50ef[_0xd336('0x34')],_0x513cfe['filters']));_0x593429[_0xd336('0x3e')][_0xd336('0x60')]=_0x2042d6['id'];if(_0x5f50ef[_0xd336('0x34')][_0xd336('0x40')]){_0x593429['where']=_['merge'](_0x593429['where'],{'$or':_[_0xd336('0x2e')](_0x593429[_0xd336('0x38')],function(_0x299aa9){var _0x357708={};_0x357708[_0x299aa9]={'$like':'%'+_0x5f50ef[_0xd336('0x34')]['filter']+'%'};return _0x357708;})});}_0x593429=_[_0xd336('0x41')]({},_0x593429,_0x5f50ef['options']);return db[_0xd336('0x64')][_0xd336('0x22')]({'where':_0x593429[_0xd336('0x3e')]})[_0xd336('0x27')](function(_0x508025){_0x56125b[_0xd336('0x22')]=_0x508025;if(_0x5f50ef[_0xd336('0x34')][_0xd336('0x43')]){_0x593429['include']=[{'all':!![]}];}return db[_0xd336('0x64')][_0xd336('0x45')](_0x593429);})[_0xd336('0x27')](function(_0x7f7454){_0x56125b[_0xd336('0x5d')]=_0x7f7454;return _0x56125b;});}})['then'](respondWithFilteredResult(_0x218026,_0x593429))[_0xd336('0x46')](handleError(_0x218026,null));};exports[_0xd336('0x65')]=function(_0x4a6e87,_0x55bba7,_0x20e939){var _0x3ead6e={};var _0x27ccf5={};var _0x31da91;var _0x50e3b1;return db[_0xd336('0x2f')]['findOne']({'where':{'id':_0x4a6e87[_0xd336('0x48')]['id']}})['then'](handleEntityNotFound(_0x55bba7,null))[_0xd336('0x27')](function(_0x21b247){if(_0x21b247){_0x31da91=_0x21b247;_0x27ccf5[_0xd336('0x33')]=_['keys'](db[_0xd336('0x66')][_0xd336('0x30')]);_0x27ccf5[_0xd336('0x34')]=_['keys'](_0x4a6e87[_0xd336('0x34')]);_0x27ccf5[_0xd336('0x36')]=_['intersection'](_0x27ccf5[_0xd336('0x33')],_0x27ccf5[_0xd336('0x34')]);_0x3ead6e[_0xd336('0x38')]=_[_0xd336('0x37')](_0x27ccf5[_0xd336('0x33')],qs['fields'](_0x4a6e87[_0xd336('0x34')][_0xd336('0x39')]));_0x3ead6e[_0xd336('0x38')]=_0x3ead6e[_0xd336('0x38')][_0xd336('0x49')]?_0x3ead6e[_0xd336('0x38')]:_0x27ccf5['model'];_0x3ead6e['order']=qs['sort'](_0x4a6e87[_0xd336('0x34')][_0xd336('0x3d')]);_0x3ead6e['where']=qs[_0xd336('0x36')](_['pick'](_0x4a6e87[_0xd336('0x34')],_0x27ccf5[_0xd336('0x36')]));if(_0x4a6e87['query']['filter']){_0x3ead6e[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x3ead6e[_0xd336('0x3e')],{'$or':_[_0xd336('0x2e')](_0x3ead6e[_0xd336('0x38')],function(_0x177761){var _0x28ccee={};_0x28ccee[_0x177761]={'$like':'%'+_0x4a6e87['query'][_0xd336('0x40')]+'%'};return _0x28ccee;})});}_0x3ead6e=_[_0xd336('0x41')]({},_0x3ead6e,_0x4a6e87[_0xd336('0x4a')]);return _0x31da91['getLists'](_0x3ead6e);}})[_0xd336('0x27')](function(_0x41d4ab){if(_0x41d4ab){_0x50e3b1=_0x41d4ab[_0xd336('0x49')];if(!_0x4a6e87[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x3ead6e[_0xd336('0x21')]=qs['limit'](_0x4a6e87['query'][_0xd336('0x21')]);_0x3ead6e['offset']=qs[_0xd336('0x1f')](_0x4a6e87['query'][_0xd336('0x1f')]);}return _0x31da91[_0xd336('0x65')](_0x3ead6e);}})[_0xd336('0x27')](function(_0x21dd89){if(_0x21dd89){return _0x21dd89?{'count':_0x50e3b1,'rows':_0x21dd89}:null;}})[_0xd336('0x27')](respondWithResult(_0x55bba7,null))['catch'](handleError(_0x55bba7,null));};exports[_0xd336('0x67')]=function(_0xdfda16,_0x4a500e,_0x99bd7f){var _0x4e202d,_0x51540b;var _0x57a266=[];var _0x5a2b37=moment()[_0xd336('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xd336('0x2f')]['find']({'where':{'id':_0xdfda16[_0xd336('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a500e,null))[_0xd336('0x27')](function(_0xbf861c){if(_0xbf861c){_0x51540b=_0xbf861c;return _0xbf861c[_0xd336('0x67')](_0xdfda16[_0xd336('0x4d')][_0xd336('0x69')],_[_0xd336('0x56')](_0xdfda16['body'],[_0xd336('0x69'),'id'])||{});}return null;})[_0xd336('0x6a')](function(_0x28e0f0){var _0x2ad7ae;var _0x1ee500;_0x4e202d=_0x28e0f0||[];var _0x507b91=[];if(_0x28e0f0){for(var _0x4a89e8=0x0;_0x4a89e8<_0x28e0f0[_0xd336('0x49')];_0x4a89e8+=0x1){var _0x5afac5=_0x28e0f0[_0x4a89e8][_0xd336('0x29')]({'plain':!![]});_0x51540b[_0xd336('0x6b')]=_0xdfda16[_0xd336('0x4d')][_0xd336('0x6b')]?_0xdfda16['body'][_0xd336('0x6b')]:_0x51540b[_0xd336('0x6b')];switch(_0x51540b['dialCheckDuplicateType']){case _0xd336('0x6c'):_0x2ad7ae=squel[_0xd336('0x6d')]()['into'](_0xd336('0x6e'))[_0xd336('0x6f')]([_0xd336('0x70'),_0xd336('0x71'),_0xd336('0x72'),'ListId',_0xd336('0x60'),'createdAt',_0xd336('0x55')],squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x70'),_0xd336('0x70'))[_0xd336('0x74')](_0xd336('0x75'),_0xd336('0x71'))[_0xd336('0x74')]('id','ContactId')[_0xd336('0x74')](_0x5afac5[_0xd336('0x76')]['toString'](),'ListId')[_0xd336('0x74')](_0xdfda16['params']['id'][_0xd336('0x77')](),_0xd336('0x60'))['field']('\x27'+_0x5a2b37+'\x27','createdAt')[_0xd336('0x74')]('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))['from'](_0xd336('0x78'))[_0xd336('0x3e')](_0xd336('0x79'))['where'](_0xd336('0x7a'),_0x5afac5[_0xd336('0x76')][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b'))[_0xd336('0x3e')](_0xd336('0x7c'),squel[_0xd336('0x73')]()[_0xd336('0x74')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xd336('0x7d'))[_0xd336('0x3e')](_0xd336('0x7e'),_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')]()))[_0xd336('0x3e')](_0xd336('0x7c'),squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x7f'))['from'](_0xd336('0x6e'))[_0xd336('0x3e')](_0xd336('0x7e'),_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')]())))[_0xd336('0x77')]();break;case'onlyIfOpen':_0x2ad7ae=squel[_0xd336('0x6d')]()[_0xd336('0x80')](_0xd336('0x6e'))[_0xd336('0x6f')](['phone',_0xd336('0x71'),_0xd336('0x72'),_0xd336('0x81'),_0xd336('0x60'),'createdAt',_0xd336('0x55')],squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x70'),_0xd336('0x70'))[_0xd336('0x74')](_0xd336('0x75'),_0xd336('0x71'))[_0xd336('0x74')]('id',_0xd336('0x72'))[_0xd336('0x74')](_0x5afac5['CmListId'][_0xd336('0x77')](),_0xd336('0x81'))[_0xd336('0x74')](_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')](),_0xd336('0x60'))['field']('\x27'+_0x5a2b37+'\x27','createdAt')['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))['from'](_0xd336('0x78'))[_0xd336('0x3e')]('deletedAt\x20IS\x20NULL')[_0xd336('0x3e')](_0xd336('0x7a'),_0x5afac5[_0xd336('0x76')][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b'))[_0xd336('0x3e')](_0xd336('0x7c'),squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x7f'))['from'](_0xd336('0x6e'))[_0xd336('0x3e')]('CampaignId\x20=\x20?',_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')]())))['toString']();break;default:_0x2ad7ae=squel[_0xd336('0x6d')]()['into'](_0xd336('0x6e'))[_0xd336('0x6f')]([_0xd336('0x70'),_0xd336('0x71'),_0xd336('0x72'),'ListId','CampaignId',_0xd336('0x54'),_0xd336('0x55')],squel['select']()['field']('phone',_0xd336('0x70'))[_0xd336('0x74')]('NOW()','scheduledAt')['field']('id',_0xd336('0x72'))[_0xd336('0x74')](_0x5afac5[_0xd336('0x76')]['toString'](),_0xd336('0x81'))[_0xd336('0x74')](_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')](),_0xd336('0x60'))['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x54'))[_0xd336('0x74')]('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))[_0xd336('0x82')](_0xd336('0x78'))[_0xd336('0x3e')](_0xd336('0x79'))[_0xd336('0x3e')](_0xd336('0x7a'),_0x5afac5[_0xd336('0x76')][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b')))[_0xd336('0x77')]();}_0x1ee500=squel[_0xd336('0x6d')]()[_0xd336('0x80')]('cm_hopper_additional_phones')[_0xd336('0x6f')](['cmHopperId',_0xd336('0x71'),_0xd336('0x70'),_0xd336('0x83'),_0xd336('0x54'),_0xd336('0x55')],squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x84'),'id')[_0xd336('0x74')](_0xd336('0x75'),_0xd336('0x71'))['field'](_0xd336('0x85'),_0xd336('0x70'))[_0xd336('0x74')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x54'))['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))[_0xd336('0x82')](_0xd336('0x86'),'ci')['join'](_0xd336('0x6e'),'h',_0xd336('0x87'))[_0xd336('0x3e')](_0xd336('0x88'),_0x5afac5['CmListId'][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x89'),_0xdfda16['params']['id'][_0xd336('0x77')]())['where'](_0xd336('0x8a'),_0x5a2b37))['toString']();_0x507b91['push'](db[_0xd336('0x8b')][_0xd336('0x34')](_0x2ad7ae));_0x57a266[_0xd336('0x8c')](db[_0xd336('0x8b')]['query'](_0x1ee500));}return BPromise[_0xd336('0x8d')](_0x507b91);}})[_0xd336('0x27')](function(){return BPromise['all'](_0x57a266);})[_0xd336('0x27')](function(){return _0x4e202d;})[_0xd336('0x27')](respondWithResult(_0x4a500e,null))['catch'](handleError(_0x4a500e,null));};exports[_0xd336('0x8e')]=function(_0x20eed7,_0x327d45,_0x63ab7d){return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x20eed7['params']['id']}})['then'](handleEntityNotFound(_0x327d45,null))[_0xd336('0x27')](function(_0x1ff1c9){if(_0x1ff1c9){return _0x1ff1c9[_0xd336('0x8e')](_0x20eed7[_0xd336('0x34')]['ids']);}})[_0xd336('0x27')](function(_0x2c84a3){if(_0x2c84a3){return db[_0xd336('0x5c')][_0xd336('0x28')]({'where':{'ListId':_0x20eed7['query'][_0xd336('0x69')],'CampaignId':_0x20eed7[_0xd336('0x48')]['id']}})[_0xd336('0x27')](function(){return _0x2c84a3;});}})[_0xd336('0x27')](respondWithStatusCode(_0x327d45,null))[_0xd336('0x46')](handleError(_0x327d45,null));};exports[_0xd336('0x8f')]=function(_0x490b6e,_0x205e59,_0x43ee1c){var _0x1be820={};var _0x29b59d={};var _0x57c9d3;var _0x49c9ad;return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0x490b6e['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x205e59,null))['then'](function(_0x4e0b2c){if(_0x4e0b2c){_0x57c9d3=_0x4e0b2c;_0x29b59d[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x66')][_0xd336('0x30')]);_0x29b59d[_0xd336('0x34')]=_['keys'](_0x490b6e[_0xd336('0x34')]);_0x29b59d[_0xd336('0x36')]=_[_0xd336('0x37')](_0x29b59d[_0xd336('0x33')],_0x29b59d['query']);_0x1be820[_0xd336('0x38')]=_[_0xd336('0x37')](_0x29b59d[_0xd336('0x33')],qs[_0xd336('0x39')](_0x490b6e[_0xd336('0x34')]['fields']));_0x1be820[_0xd336('0x38')]=_0x1be820[_0xd336('0x38')][_0xd336('0x49')]?_0x1be820[_0xd336('0x38')]:_0x29b59d[_0xd336('0x33')];_0x1be820['order']=qs[_0xd336('0x3d')](_0x490b6e[_0xd336('0x34')][_0xd336('0x3d')]);_0x1be820['where']=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x490b6e['query'],_0x29b59d[_0xd336('0x36')]));if(_0x490b6e[_0xd336('0x34')][_0xd336('0x40')]){_0x1be820[_0xd336('0x3e')]=_['merge'](_0x1be820['where'],{'$or':_[_0xd336('0x2e')](_0x1be820['attributes'],function(_0x483d41){var _0xbec22d={};_0xbec22d[_0x483d41]={'$like':'%'+_0x490b6e[_0xd336('0x34')]['filter']+'%'};return _0xbec22d;})});}_0x1be820=_[_0xd336('0x41')]({},_0x1be820,_0x490b6e['options']);return _0x57c9d3['getBlackLists'](_0x1be820);}})[_0xd336('0x27')](function(_0x15d57c){if(_0x15d57c){_0x49c9ad=_0x15d57c[_0xd336('0x49')];if(!_0x490b6e[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x1be820[_0xd336('0x21')]=qs[_0xd336('0x21')](_0x490b6e[_0xd336('0x34')][_0xd336('0x21')]);_0x1be820['offset']=qs['offset'](_0x490b6e['query']['offset']);}return _0x57c9d3[_0xd336('0x8f')](_0x1be820);}})[_0xd336('0x27')](function(_0x556f57){if(_0x556f57){return _0x556f57?{'count':_0x49c9ad,'rows':_0x556f57}:null;}})[_0xd336('0x27')](respondWithResult(_0x205e59,null))['catch'](handleError(_0x205e59,null));};exports[_0xd336('0x90')]=function(_0xf65e60,_0x16cfe6,_0x44e2fa){var _0x35b35d,_0x4c2437;var _0x32d6ab=[];var _0x21ed7b=moment()['format'](_0xd336('0x91'));return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0xf65e60['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x16cfe6,null))[_0xd336('0x27')](function(_0x5381b2){if(_0x5381b2){_0x4c2437=_0x5381b2;return _0x5381b2['addBlackLists'](_0xf65e60[_0xd336('0x4d')][_0xd336('0x69')],_[_0xd336('0x56')](_0xf65e60[_0xd336('0x4d')],['ids','id'])||{});}return null;})[_0xd336('0x6a')](function(_0x2e38bb){var _0xc17866;var _0x1def26;_0x35b35d=_0x2e38bb||[];var _0x10de6e=[];if(_0x2e38bb){for(var _0x599649=0x0;_0x599649<_0x2e38bb[_0xd336('0x49')];_0x599649+=0x1){var _0x5d2769=_0x2e38bb[_0x599649][_0xd336('0x29')]({'plain':!![]});_0xc17866=squel[_0xd336('0x6d')]()[_0xd336('0x80')](_0xd336('0x92'))[_0xd336('0x6f')]([_0xd336('0x70'),_0xd336('0x72'),_0xd336('0x81'),'CampaignId',_0xd336('0x54'),_0xd336('0x55')],squel['select']()['field'](_0xd336('0x70'),'phone')[_0xd336('0x74')]('id',_0xd336('0x72'))[_0xd336('0x74')](_0x5d2769[_0xd336('0x76')]['toString'](),_0xd336('0x81'))[_0xd336('0x74')](_0xf65e60[_0xd336('0x48')]['id']['toString'](),_0xd336('0x60'))[_0xd336('0x74')]('NOW()',_0xd336('0x54'))['field'](_0xd336('0x75'),_0xd336('0x55'))['from']('cm_contacts')['where'](_0xd336('0x79'))['where']('ListId\x20=\x20?',_0x5d2769['CmListId'][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b')))[_0xd336('0x77')]();_0x10de6e[_0xd336('0x8c')](db['sequelize'][_0xd336('0x34')](_0xc17866));}return BPromise[_0xd336('0x8d')](_0x10de6e);}})[_0xd336('0x27')](function(){return _0x35b35d;})[_0xd336('0x27')](respondWithResult(_0x16cfe6,null))[_0xd336('0x46')](handleError(_0x16cfe6,null));};exports[_0xd336('0x93')]=function(_0x175d57,_0x2664b8,_0x38ea0b){return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x175d57['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x2664b8,null))['then'](function(_0x1c8b86){if(_0x1c8b86){return _0x1c8b86[_0xd336('0x93')](_0x175d57['query'][_0xd336('0x69')]);}})[_0xd336('0x27')](function(_0x8b9ae6){if(_0x8b9ae6){return db[_0xd336('0x64')]['destroy']({'where':{'ListId':_0x175d57[_0xd336('0x34')][_0xd336('0x69')],'CampaignId':_0x175d57[_0xd336('0x48')]['id']}})[_0xd336('0x27')](function(){return _0x8b9ae6;});}})[_0xd336('0x27')](respondWithStatusCode(_0x2664b8,null))[_0xd336('0x46')](handleError(_0x2664b8,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index adc08af..9a6774d 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index dc7268c..77a407f 100644
--- a/server/api/campaign/campaign.rpc.js
+++ b/server/api/campaign/campaign.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde64=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','map','include','model','attributes','debug','lodash','util','moment','bluebird'];(function(_0x4330fb,_0x25240c){var _0xbd081a=function(_0x42bf28){while(--_0x42bf28){_0x4330fb['push'](_0x4330fb['shift']());}};_0xbd081a(++_0x25240c);}(_0xde64,0x17c));var _0x4de6=function(_0x2499c0,_0xd1f953){_0x2499c0=_0x2499c0-0x0;var _0x291404=_0xde64[_0x2499c0];return _0x291404;};'use strict';var _=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var moment=require(_0x4de6('0x2'));var BPromise=require(_0x4de6('0x3'));var rs=require(_0x4de6('0x4'));var fs=require('fs');var Redis=require(_0x4de6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4de6('0x6'));var logger=require(_0x4de6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4de6('0x8'));var client=jayson[_0x4de6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568496,_0x24edef,_0x35ae72){return new BPromise(function(_0x475fb9,_0x248e39){return client[_0x4de6('0xa')](_0x568496,_0x35ae72)[_0x4de6('0xb')](function(_0x48a974){logger[_0x4de6('0xc')](_0x4de6('0xd'),_0x24edef,_0x4de6('0xe'));logger['debug'](_0x4de6('0xf'),_0x24edef,_0x4de6('0xe'),JSON[_0x4de6('0x10')](_0x48a974));if(_0x48a974[_0x4de6('0x11')]){if(_0x48a974[_0x4de6('0x11')]['code']===0x1f4){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974[_0x4de6('0x11')]['message']);return _0x248e39(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974['error'][_0x4de6('0x12')]);return _0x475fb9(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}else{logger['info'](_0x4de6('0xd'),_0x24edef,'request\x20sent');_0x475fb9(_0x48a974['result'][_0x4de6('0x12')]);}})[_0x4de6('0x13')](function(_0x6dbcf3){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x6dbcf3);_0x248e39(_0x6dbcf3);});});}exports[_0x4de6('0x14')]=function(_0x324202){var _0x5aacb4=this;return new Promise(function(_0x420f7c,_0xea1610){return db[_0x4de6('0x15')][_0x4de6('0x16')]({'raw':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x18')]===undefined?!![]:![]:!![],'where':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x19')]||null:null,'attributes':_0x324202['options']?_0x324202[_0x4de6('0x17')]['attributes']||null:null,'limit':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x1a')]||null:null,'include':_0x324202['options']?_0x324202[_0x4de6('0x17')]['include']?_[_0x4de6('0x1b')](_0x324202[_0x4de6('0x17')][_0x4de6('0x1c')],function(_0x5ddbab){return{'model':db[_0x5ddbab[_0x4de6('0x1d')]],'as':_0x5ddbab['as'],'attributes':_0x5ddbab[_0x4de6('0x1e')],'include':_0x5ddbab[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x5ddbab[_0x4de6('0x1c')],function(_0x25a76b){return{'model':db[_0x25a76b[_0x4de6('0x1d')]],'as':_0x25a76b['as'],'attributes':_0x25a76b['attributes'],'include':_0x25a76b[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x25a76b[_0x4de6('0x1c')],function(_0x327215){return{'model':db[_0x327215[_0x4de6('0x1d')]],'as':_0x327215['as'],'attributes':_0x327215[_0x4de6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4de6('0xb')](function(_0x7bc61e){logger[_0x4de6('0xc')]('GetCampaign',_0x324202);logger[_0x4de6('0x1f')](_0x4de6('0x14'),_0x324202,JSON[_0x4de6('0x10')](_0x7bc61e));_0x420f7c(_0x7bc61e);})[_0x4de6('0x13')](function(_0x24a0a7){logger['error'](_0x4de6('0x14'),_0x24a0a7['message'],_0x324202);_0xea1610(_0x5aacb4[_0x4de6('0x11')](0x1f4,_0x24a0a7[_0x4de6('0x12')]));});});};
\ No newline at end of file
+var _0x1789=['debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','options','where','attributes','limit','include','model','map','then','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x5ed1c5,_0x266bf1){var _0x2ea2fc=function(_0x3e7976){while(--_0x3e7976){_0x5ed1c5['push'](_0x5ed1c5['shift']());}};_0x2ea2fc(++_0x266bf1);}(_0x1789,0x92));var _0x9178=function(_0x334ad2,_0xcd1829){_0x334ad2=_0x334ad2-0x0;var _0x1560eb=_0x1789[_0x334ad2];return _0x1560eb;};'use strict';var _=require(_0x9178('0x0'));var util=require(_0x9178('0x1'));var moment=require(_0x9178('0x2'));var BPromise=require('bluebird');var rs=require(_0x9178('0x3'));var fs=require('fs');var Redis=require(_0x9178('0x4'));var db=require(_0x9178('0x5'))['db'];var utils=require(_0x9178('0x6'));var logger=require(_0x9178('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9178('0x8'));var client=jayson[_0x9178('0x9')][_0x9178('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f00a8,_0x502d21,_0x1001b0){return new BPromise(function(_0x333b8b,_0x3bcc1b){return client[_0x9178('0xb')](_0x1f00a8,_0x1001b0)['then'](function(_0x4bd20e){logger['info'](_0x9178('0xc'),_0x502d21,_0x9178('0xd'));logger[_0x9178('0xe')](_0x9178('0xf'),_0x502d21,'request\x20sent',JSON[_0x9178('0x10')](_0x4bd20e));if(_0x4bd20e[_0x9178('0x11')]){if(_0x4bd20e['error']['code']===0x1f4){logger['error'](_0x9178('0xc'),_0x502d21,_0x4bd20e[_0x9178('0x11')]['message']);return _0x3bcc1b(_0x4bd20e[_0x9178('0x11')][_0x9178('0x12')]);}logger[_0x9178('0x11')]('Campaign,\x20%s,\x20%s',_0x502d21,_0x4bd20e[_0x9178('0x11')][_0x9178('0x12')]);return _0x333b8b(_0x4bd20e['error'][_0x9178('0x12')]);}else{logger['info'](_0x9178('0xc'),_0x502d21,_0x9178('0xd'));_0x333b8b(_0x4bd20e[_0x9178('0x13')][_0x9178('0x12')]);}})[_0x9178('0x14')](function(_0x31baa2){logger[_0x9178('0x11')](_0x9178('0xc'),_0x502d21,_0x31baa2);_0x3bcc1b(_0x31baa2);});});}exports[_0x9178('0x15')]=function(_0x3f3dd4){var _0x2184a0=this;return new Promise(function(_0x4393f3,_0x42c31b){return db[_0x9178('0x16')]['findAll']({'raw':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4[_0x9178('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4['options'][_0x9178('0x18')]||null:null,'attributes':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4[_0x9178('0x17')][_0x9178('0x19')]||null:null,'limit':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4[_0x9178('0x17')][_0x9178('0x1a')]||null:null,'include':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4['options'][_0x9178('0x1b')]?_['map'](_0x3f3dd4['options'][_0x9178('0x1b')],function(_0x19aafe){return{'model':db[_0x19aafe[_0x9178('0x1c')]],'as':_0x19aafe['as'],'attributes':_0x19aafe[_0x9178('0x19')],'include':_0x19aafe[_0x9178('0x1b')]?_[_0x9178('0x1d')](_0x19aafe[_0x9178('0x1b')],function(_0x23c04a){return{'model':db[_0x23c04a[_0x9178('0x1c')]],'as':_0x23c04a['as'],'attributes':_0x23c04a[_0x9178('0x19')],'include':_0x23c04a[_0x9178('0x1b')]?_[_0x9178('0x1d')](_0x23c04a[_0x9178('0x1b')],function(_0x3af74d){return{'model':db[_0x3af74d['model']],'as':_0x3af74d['as'],'attributes':_0x3af74d[_0x9178('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9178('0x1e')](function(_0x5c39ed){logger[_0x9178('0x1f')](_0x9178('0x15'),_0x3f3dd4);logger[_0x9178('0xe')](_0x9178('0x15'),_0x3f3dd4,JSON[_0x9178('0x10')](_0x5c39ed));_0x4393f3(_0x5c39ed);})[_0x9178('0x14')](function(_0x5d9747){logger[_0x9178('0x11')](_0x9178('0x15'),_0x5d9747['message'],_0x3f3dd4);_0x42c31b(_0x2184a0[_0x9178('0x11')](0x1f4,_0x5d9747[_0x9178('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 2a5ab09..c742e30 100644
--- a/server/api/campaign/index.js
+++ b/server/api/campaign/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaae=['index','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','delete','removeBlackLists','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xbaae,0x182));var _0xebaa=function(_0x1c0f97,_0x83214b){_0x1c0f97=_0x1c0f97-0x0;var _0x1ea59d=_0xbaae[_0x1c0f97];return _0x1ea59d;};'use strict';var multer=require(_0xebaa('0x0'));var util=require(_0xebaa('0x1'));var path=require(_0xebaa('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xebaa('0x3')]();var fs_extra=require(_0xebaa('0x4'));var auth=require(_0xebaa('0x5'));var interaction=require(_0xebaa('0x6'));var config=require(_0xebaa('0x7'));var controller=require(_0xebaa('0x8'));router['get']('/',auth[_0xebaa('0x9')](),controller[_0xebaa('0xa')]);router[_0xebaa('0xb')](_0xebaa('0xc'),auth[_0xebaa('0x9')](),controller[_0xebaa('0xd')]);router[_0xebaa('0xb')](_0xebaa('0xe'),auth[_0xebaa('0x9')](),controller['getHoppers']);router[_0xebaa('0xb')](_0xebaa('0xf'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x10')]);router['get'](_0xebaa('0x11'),auth[_0xebaa('0x9')](),controller['getHopperFinals']);router[_0xebaa('0xb')](_0xebaa('0x12'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xebaa('0xb')]('/:id/lists',auth[_0xebaa('0x9')](),controller[_0xebaa('0x13')]);router[_0xebaa('0xb')](_0xebaa('0x14'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xebaa('0x16')]);router[_0xebaa('0x17')](_0xebaa('0x18'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x19')]);router[_0xebaa('0x17')](_0xebaa('0x1a'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x1b')]);router[_0xebaa('0x17')](_0xebaa('0x14'),auth['isAuthenticated'](),controller[_0xebaa('0x1c')]);router['put'](_0xebaa('0xc'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x1d')]);router[_0xebaa('0x1e')](_0xebaa('0xc'),auth[_0xebaa('0x9')](),controller['destroy']);router[_0xebaa('0x1e')](_0xebaa('0x1a'),auth[_0xebaa('0x9')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0xebaa('0x9')](),controller[_0xebaa('0x1f')]);module[_0xebaa('0x20')]=router;
\ No newline at end of file
+var _0x05fd=['util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','/:id','delete','destroy','removeLists','removeBlackLists','exports','multer'];(function(_0x5cc2a3,_0x2d38a6){var _0x9d6e07=function(_0xa7d53f){while(--_0xa7d53f){_0x5cc2a3['push'](_0x5cc2a3['shift']());}};_0x9d6e07(++_0x2d38a6);}(_0x05fd,0x173));var _0xd05f=function(_0x466552,_0x3d4e47){_0x466552=_0x466552-0x0;var _0x3721c2=_0x05fd[_0x466552];return _0x3721c2;};'use strict';var multer=require(_0xd05f('0x0'));var util=require(_0xd05f('0x1'));var path=require('path');var timeout=require(_0xd05f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd05f('0x3'));var auth=require(_0xd05f('0x4'));var interaction=require(_0xd05f('0x5'));var config=require(_0xd05f('0x6'));var controller=require(_0xd05f('0x7'));router[_0xd05f('0x8')]('/',auth[_0xd05f('0x9')](),controller[_0xd05f('0xa')]);router[_0xd05f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd05f('0x8')](_0xd05f('0xb'),auth[_0xd05f('0x9')](),controller['getHoppers']);router[_0xd05f('0x8')](_0xd05f('0xc'),auth['isAuthenticated'](),controller[_0xd05f('0xd')]);router['get'](_0xd05f('0xe'),auth[_0xd05f('0x9')](),controller['getHopperFinals']);router[_0xd05f('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router['get'](_0xd05f('0xf'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x10')]);router[_0xd05f('0x8')](_0xd05f('0x11'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x12')]);router[_0xd05f('0x13')]('/',auth[_0xd05f('0x9')](),controller[_0xd05f('0x14')]);router[_0xd05f('0x13')](_0xd05f('0x15'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x16')]);router[_0xd05f('0x13')](_0xd05f('0xf'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x17')]);router[_0xd05f('0x13')]('/:id/blacklists',auth[_0xd05f('0x9')](),controller['addBlackLists']);router[_0xd05f('0x18')](_0xd05f('0x19'),auth[_0xd05f('0x9')](),controller['update']);router[_0xd05f('0x1a')]('/:id',auth[_0xd05f('0x9')](),controller[_0xd05f('0x1b')]);router[_0xd05f('0x1a')]('/:id/lists',auth[_0xd05f('0x9')](),controller[_0xd05f('0x1c')]);router[_0xd05f('0x1a')](_0xd05f('0x11'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x1d')]);module[_0xd05f('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index c87ba0b..4fd84ca 100644
--- a/server/api/cannedAnswer/cannedAnswer.attributes.js
+++ b/server/api/cannedAnswer/cannedAnswer.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5457=['medium','STRING','VIRTUAL','key','sequelize','TEXT'];(function(_0x33a645,_0x341973){var _0x40761d=function(_0x41a222){while(--_0x41a222){_0x33a645['push'](_0x33a645['shift']());}};_0x40761d(++_0x341973);}(_0x5457,0x70));var _0x7545=function(_0x5611af,_0x4f0e4d){_0x5611af=_0x5611af-0x0;var _0x11723d=_0x5457[_0x5611af];return _0x11723d;};'use strict';var Sequelize=require(_0x7545('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x7545('0x1')],'length':_0x7545('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7545('0x3')]},'name':{'type':Sequelize[_0x7545('0x4')],'get':function(){return this['getDataValue'](_0x7545('0x5'));}}};
\ No newline at end of file
+var _0x7dc0=['medium','STRING','VIRTUAL','getDataValue','key','sequelize','exports','TEXT'];(function(_0x5d78f0,_0x3784f9){var _0x4d1012=function(_0x23d0ba){while(--_0x23d0ba){_0x5d78f0['push'](_0x5d78f0['shift']());}};_0x4d1012(++_0x3784f9);}(_0x7dc0,0x9d));var _0x07dc=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x7dc0[_0x2cef86];return _0x46dfd6;};'use strict';var Sequelize=require(_0x07dc('0x0'));module[_0x07dc('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x07dc('0x2')],'length':_0x07dc('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x07dc('0x4')]},'name':{'type':Sequelize[_0x07dc('0x5')],'get':function(){return this[_0x07dc('0x6')](_0x07dc('0x7'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 6781a3c..79d03da 100644
--- a/server/api/cannedAnswer/cannedAnswer.controller.js
+++ b/server/api/cannedAnswer/cannedAnswer.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x10c5=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','findAll','catch','show','keys','rawAttributes','includeAll','find','params','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2b6bb1,_0x6ca1d7){var _0x3218b6=function(_0x5ce75c){while(--_0x5ce75c){_0x2b6bb1['push'](_0x2b6bb1['shift']());}};_0x3218b6(++_0x6ca1d7);}(_0x10c5,0x1ae));var _0x510c=function(_0x445199,_0x50daf7){_0x445199=_0x445199-0x0;var _0x1cc1a4=_0x10c5[_0x445199];return _0x1cc1a4;};'use strict';var emlformat=require(_0x510c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x510c('0x1'));var rp=require(_0x510c('0x2'));var moment=require(_0x510c('0x3'));var BPromise=require(_0x510c('0x4'));var Mustache=require(_0x510c('0x5'));var util=require(_0x510c('0x6'));var path=require('path');var sox=require(_0x510c('0x7'));var csv=require(_0x510c('0x8'));var ejs=require(_0x510c('0x9'));var fs=require('fs');var fs_extra=require(_0x510c('0xa'));var _=require(_0x510c('0xb'));var squel=require(_0x510c('0xc'));var crypto=require(_0x510c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x510c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x510c('0xf'));var Redis=require(_0x510c('0x10'));var authService=require(_0x510c('0x11'));var qs=require(_0x510c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x510c('0x13'));var logger=require(_0x510c('0x14'))(_0x510c('0x15'));var utils=require(_0x510c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x510c('0x17'));var db=require(_0x510c('0x18'))['db'];function respondWithStatusCode(_0x2b1c4c,_0xc05a86){_0xc05a86=_0xc05a86||0xcc;return function(_0x14f459){if(_0x14f459){return _0x2b1c4c[_0x510c('0x19')](_0xc05a86);}return _0x2b1c4c[_0x510c('0x1a')](_0xc05a86)[_0x510c('0x1b')]();};}function respondWithResult(_0x2ab106,_0x4a4a08){_0x4a4a08=_0x4a4a08||0xc8;return function(_0x593982){if(_0x593982){return _0x2ab106['status'](_0x4a4a08)[_0x510c('0x1c')](_0x593982);}};}function respondWithFilteredResult(_0x19c721,_0x429dc3){return function(_0x36c12c){if(_0x36c12c){var _0x16fe9b=typeof _0x429dc3[_0x510c('0x1d')]===_0x510c('0x1e')&&typeof _0x429dc3[_0x510c('0x1f')]===_0x510c('0x1e');var _0x39cbcc=_0x36c12c['count'];var _0x40ef25=_0x16fe9b?0x0:_0x429dc3['offset'];var _0x166dd8=_0x16fe9b?_0x36c12c['count']:_0x429dc3[_0x510c('0x1d')]+_0x429dc3[_0x510c('0x1f')];var _0x318b88;if(_0x166dd8>=_0x39cbcc){_0x166dd8=_0x39cbcc;_0x318b88=0xc8;}else{_0x318b88=0xce;}_0x19c721[_0x510c('0x1a')](_0x318b88);return _0x19c721['set'](_0x510c('0x20'),_0x40ef25+'-'+_0x166dd8+'/'+_0x39cbcc)[_0x510c('0x1c')](_0x36c12c);}return null;};}function patchUpdates(_0xa36377){return function(_0x4860f3){try{jsonpatch[_0x510c('0x21')](_0x4860f3,_0xa36377,!![]);}catch(_0x216d88){return BPromise[_0x510c('0x22')](_0x216d88);}return _0x4860f3['save']();};}function saveUpdates(_0x17f83b,_0x2e88eb){return function(_0x145c3f){if(_0x145c3f){return _0x145c3f[_0x510c('0x23')](_0x17f83b)['then'](function(_0x38a00e){return _0x38a00e;});}return null;};}function removeEntity(_0x57f055,_0x2acd6c){return function(_0x133555){if(_0x133555){return _0x133555[_0x510c('0x24')]()[_0x510c('0x25')](function(){var _0x2119c8=_0x133555[_0x510c('0x26')]({'plain':!![]});var _0x46f9fd=_0x510c('0x27');return db[_0x510c('0x28')][_0x510c('0x24')]({'where':{'type':_0x46f9fd,'resourceId':_0x2119c8['id']}})[_0x510c('0x25')](function(){return _0x133555;});})[_0x510c('0x25')](function(){_0x57f055[_0x510c('0x1a')](0xcc)[_0x510c('0x1b')]();});}};}function handleEntityNotFound(_0x1fc2cf,_0x550229){return function(_0x7c5f67){if(!_0x7c5f67){_0x1fc2cf[_0x510c('0x19')](0x194);}return _0x7c5f67;};}function handleError(_0x497bc2,_0x50dc65){_0x50dc65=_0x50dc65||0x1f4;return function(_0x165e1a){logger[_0x510c('0x29')](_0x165e1a[_0x510c('0x2a')]);if(_0x165e1a[_0x510c('0x2b')]){delete _0x165e1a[_0x510c('0x2b')];}_0x497bc2[_0x510c('0x1a')](_0x50dc65)[_0x510c('0x2c')](_0x165e1a);};}exports[_0x510c('0x2d')]=function(_0x85fa77,_0x9809ee){var _0x4ce854={},_0x3bec43={},_0x598977={'count':0x0,'rows':[]};var _0x3eb399=_[_0x510c('0x2e')](db[_0x510c('0x2f')]['rawAttributes'],function(_0x159cee){return{'name':_0x159cee[_0x510c('0x30')],'type':_0x159cee[_0x510c('0x31')]['key']};});_0x3bec43[_0x510c('0x32')]=_[_0x510c('0x2e')](_0x3eb399,_0x510c('0x2b'));_0x3bec43['query']=_['keys'](_0x85fa77['query']);_0x3bec43[_0x510c('0x33')]=_[_0x510c('0x34')](_0x3bec43[_0x510c('0x32')],_0x3bec43[_0x510c('0x35')]);_0x4ce854[_0x510c('0x36')]=_[_0x510c('0x34')](_0x3bec43['model'],qs[_0x510c('0x37')](_0x85fa77[_0x510c('0x35')][_0x510c('0x37')]));_0x4ce854[_0x510c('0x36')]=_0x4ce854[_0x510c('0x36')][_0x510c('0x38')]?_0x4ce854['attributes']:_0x3bec43[_0x510c('0x32')];if(!_0x85fa77[_0x510c('0x35')][_0x510c('0x39')](_0x510c('0x3a'))){_0x4ce854[_0x510c('0x1f')]=qs[_0x510c('0x1f')](_0x85fa77[_0x510c('0x35')][_0x510c('0x1f')]);_0x4ce854[_0x510c('0x1d')]=qs[_0x510c('0x1d')](_0x85fa77[_0x510c('0x35')][_0x510c('0x1d')]);}_0x4ce854[_0x510c('0x3b')]=qs['sort'](_0x85fa77[_0x510c('0x35')]['sort']);_0x4ce854[_0x510c('0x3c')]=qs[_0x510c('0x33')](_['pick'](_0x85fa77['query'],_0x3bec43['filters']),_0x3eb399);if(_0x85fa77[_0x510c('0x35')][_0x510c('0x3d')]){_0x4ce854[_0x510c('0x3c')]=_[_0x510c('0x3e')](_0x4ce854[_0x510c('0x3c')],{'$or':[{'key':{'$like':'%'+_0x85fa77[_0x510c('0x35')][_0x510c('0x3d')]+'%'}},{'value':{'$like':'%'+_0x85fa77['query'][_0x510c('0x3d')]+'%'}}]});}_0x4ce854=_[_0x510c('0x3e')]({},_0x4ce854,_0x85fa77['options']);var _0x1eec58={'where':_0x4ce854[_0x510c('0x3c')]};return db[_0x510c('0x2f')]['count'](_0x1eec58)[_0x510c('0x25')](function(_0x47c89f){_0x598977['count']=_0x47c89f;if(_0x85fa77[_0x510c('0x35')]['includeAll']){_0x4ce854['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x510c('0x3f')](_0x4ce854);})[_0x510c('0x25')](function(_0x1a2a02){_0x598977['rows']=_0x1a2a02;return _0x598977;})[_0x510c('0x25')](respondWithFilteredResult(_0x9809ee,_0x4ce854))[_0x510c('0x40')](handleError(_0x9809ee,null));};exports[_0x510c('0x41')]=function(_0x3fe8ba,_0x3b67f6){var _0xa75747={'raw':!![],'where':{'id':_0x3fe8ba['params']['id']}},_0x1b01c7={};_0x1b01c7['model']=_[_0x510c('0x42')](db[_0x510c('0x2f')][_0x510c('0x43')]);_0x1b01c7['query']=_[_0x510c('0x42')](_0x3fe8ba[_0x510c('0x35')]);_0x1b01c7[_0x510c('0x33')]=_['intersection'](_0x1b01c7[_0x510c('0x32')],_0x1b01c7[_0x510c('0x35')]);_0xa75747['attributes']=_[_0x510c('0x34')](_0x1b01c7[_0x510c('0x32')],qs[_0x510c('0x37')](_0x3fe8ba[_0x510c('0x35')][_0x510c('0x37')]));_0xa75747[_0x510c('0x36')]=_0xa75747['attributes'][_0x510c('0x38')]?_0xa75747[_0x510c('0x36')]:_0x1b01c7[_0x510c('0x32')];if(_0x3fe8ba[_0x510c('0x35')][_0x510c('0x44')]){_0xa75747['include']=[{'all':!![]}];}_0xa75747=_['merge']({},_0xa75747,_0x3fe8ba['options']);return db[_0x510c('0x2f')][_0x510c('0x45')](_0xa75747)[_0x510c('0x25')](handleEntityNotFound(_0x3b67f6,null))['then'](respondWithResult(_0x3b67f6,null))[_0x510c('0x40')](handleError(_0x3b67f6,null));};exports[_0x510c('0x23')]=function(_0xce72b4,_0xcf3283){if(_0xce72b4['body']['id']){delete _0xce72b4['body']['id'];}return db[_0x510c('0x2f')][_0x510c('0x45')]({'where':{'id':_0xce72b4[_0x510c('0x46')]['id']}})['then'](handleEntityNotFound(_0xcf3283,null))[_0x510c('0x25')](saveUpdates(_0xce72b4['body'],null))[_0x510c('0x25')](respondWithResult(_0xcf3283,null))[_0x510c('0x40')](handleError(_0xcf3283,null));};exports[_0x510c('0x24')]=function(_0x20f5f5,_0x5bf146){return db['CannedAnswer']['find']({'where':{'id':_0x20f5f5[_0x510c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bf146,null))[_0x510c('0x25')](removeEntity(_0x5bf146,null))[_0x510c('0x40')](handleError(_0x5bf146,null));};exports[_0x510c('0x47')]=function(_0x38fb20,_0x2cd45a){var _0x1ec7de={'key':_0x38fb20['body']['key']};if(_0x38fb20[_0x510c('0x48')][_0x510c('0x49')]){_0x1ec7de['MailAccountId']=_0x38fb20['body']['MailAccountId'];}else if(_0x38fb20[_0x510c('0x48')]['SmsAccountId']){_0x1ec7de[_0x510c('0x4a')]=_0x38fb20[_0x510c('0x48')]['SmsAccountId'];}else if(_0x38fb20[_0x510c('0x48')][_0x510c('0x4b')]){_0x1ec7de['OpenchannelAccountId']=_0x38fb20[_0x510c('0x48')]['OpenchannelAccountId'];}else if(_0x38fb20[_0x510c('0x48')]['ChatWebsiteId']){_0x1ec7de['ChatWebsiteId']=_0x38fb20[_0x510c('0x48')][_0x510c('0x4c')];}return db[_0x510c('0x2f')][_0x510c('0x45')]({'where':_0x1ec7de})['then'](function(_0x5442c1){if(_0x5442c1){throw new db[(_0x510c('0x4d'))][(_0x510c('0x4e'))](_0x510c('0x4f'));}return db[_0x510c('0x2f')][_0x510c('0x47')](_0x38fb20['body']);})['then'](function(_0x252e66){var _0x41238b=_0x38fb20[_0x510c('0x50')][_0x510c('0x26')]({'plain':!![]});if(!_0x41238b)throw new Error(_0x510c('0x51'));if(_0x41238b[_0x510c('0x52')]==='user'){var _0x386db3=_0x252e66[_0x510c('0x26')]({'plain':!![]});return db[_0x510c('0x53')][_0x510c('0x45')]({'where':{'name':_0x510c('0x27'),'userProfileId':_0x41238b[_0x510c('0x54')]},'raw':!![]})[_0x510c('0x25')](function(_0xd3e810){if(_0xd3e810&&_0xd3e810[_0x510c('0x55')]===0x0){return db[_0x510c('0x28')][_0x510c('0x47')]({'name':_0x386db3['name'],'resourceId':_0x386db3['id'],'type':_0xd3e810[_0x510c('0x2b')],'sectionId':_0xd3e810['id']},{})[_0x510c('0x25')](function(){return _0x252e66;});}else{return _0x252e66;}})[_0x510c('0x40')](function(_0x1ec79b){logger[_0x510c('0x29')](_0x510c('0x56'),_0x1ec79b);throw _0x1ec79b;});}return _0x252e66;})['then'](respondWithResult(_0x2cd45a,0xc9))[_0x510c('0x40')](handleError(_0x2cd45a,null));};
\ No newline at end of file
+var _0x9cd5=['map','CannedAnswer','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','options','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','CannedAnswers','error','name','send','index'];(function(_0x3808b5,_0x5907a0){var _0x352c3d=function(_0x334e63){while(--_0x334e63){_0x3808b5['push'](_0x3808b5['shift']());}};_0x352c3d(++_0x5907a0);}(_0x9cd5,0x1f1));var _0x59cd=function(_0x53fdd5,_0x1f3f58){_0x53fdd5=_0x53fdd5-0x0;var _0x1cc7bf=_0x9cd5[_0x53fdd5];return _0x1cc7bf;};'use strict';var emlformat=require(_0x59cd('0x0'));var rimraf=require(_0x59cd('0x1'));var zipdir=require(_0x59cd('0x2'));var jsonpatch=require(_0x59cd('0x3'));var rp=require(_0x59cd('0x4'));var moment=require('moment');var BPromise=require(_0x59cd('0x5'));var Mustache=require(_0x59cd('0x6'));var util=require(_0x59cd('0x7'));var path=require(_0x59cd('0x8'));var sox=require('sox');var csv=require(_0x59cd('0x9'));var ejs=require(_0x59cd('0xa'));var fs=require('fs');var fs_extra=require(_0x59cd('0xb'));var _=require(_0x59cd('0xc'));var squel=require(_0x59cd('0xd'));var crypto=require(_0x59cd('0xe'));var jsforce=require(_0x59cd('0xf'));var deskjs=require(_0x59cd('0x10'));var toCsv=require(_0x59cd('0x9'));var querystring=require(_0x59cd('0x11'));var Papa=require(_0x59cd('0x12'));var Redis=require(_0x59cd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x59cd('0x14'));var as=require(_0x59cd('0x15'));var hardwareService=require(_0x59cd('0x16'));var logger=require(_0x59cd('0x17'))(_0x59cd('0x18'));var utils=require(_0x59cd('0x19'));var config=require(_0x59cd('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x59cd('0x1b'))['db'];function respondWithStatusCode(_0x184d4b,_0x13e657){_0x13e657=_0x13e657||0xcc;return function(_0x513a5f){if(_0x513a5f){return _0x184d4b[_0x59cd('0x1c')](_0x13e657);}return _0x184d4b[_0x59cd('0x1d')](_0x13e657)[_0x59cd('0x1e')]();};}function respondWithResult(_0x195a8c,_0x264e4d){_0x264e4d=_0x264e4d||0xc8;return function(_0x3aa051){if(_0x3aa051){return _0x195a8c[_0x59cd('0x1d')](_0x264e4d)[_0x59cd('0x1f')](_0x3aa051);}};}function respondWithFilteredResult(_0x561fb5,_0x266d41){return function(_0x29aa0b){if(_0x29aa0b){var _0x3bab89=typeof _0x266d41[_0x59cd('0x20')]===_0x59cd('0x21')&&typeof _0x266d41['limit']===_0x59cd('0x21');var _0x21b9db=_0x29aa0b[_0x59cd('0x22')];var _0x5237e6=_0x3bab89?0x0:_0x266d41[_0x59cd('0x20')];var _0x5ecb02=_0x3bab89?_0x29aa0b['count']:_0x266d41[_0x59cd('0x20')]+_0x266d41[_0x59cd('0x23')];var _0x567691;if(_0x5ecb02>=_0x21b9db){_0x5ecb02=_0x21b9db;_0x567691=0xc8;}else{_0x567691=0xce;}_0x561fb5['status'](_0x567691);return _0x561fb5[_0x59cd('0x24')]('Content-Range',_0x5237e6+'-'+_0x5ecb02+'/'+_0x21b9db)[_0x59cd('0x1f')](_0x29aa0b);}return null;};}function patchUpdates(_0x304219){return function(_0x43c4c5){try{jsonpatch[_0x59cd('0x25')](_0x43c4c5,_0x304219,!![]);}catch(_0x5a49ab){return BPromise[_0x59cd('0x26')](_0x5a49ab);}return _0x43c4c5[_0x59cd('0x27')]();};}function saveUpdates(_0x2d0feb,_0x2d7157){return function(_0x5e5b20){if(_0x5e5b20){return _0x5e5b20[_0x59cd('0x28')](_0x2d0feb)[_0x59cd('0x29')](function(_0x3522d4){return _0x3522d4;});}return null;};}function removeEntity(_0xad36dc,_0xb1291){return function(_0x342bce){if(_0x342bce){return _0x342bce[_0x59cd('0x2a')]()[_0x59cd('0x29')](function(){var _0x490052=_0x342bce[_0x59cd('0x2b')]({'plain':!![]});var _0x3d2379=_0x59cd('0x2c');return db['UserProfileResource'][_0x59cd('0x2a')]({'where':{'type':_0x3d2379,'resourceId':_0x490052['id']}})[_0x59cd('0x29')](function(){return _0x342bce;});})[_0x59cd('0x29')](function(){_0xad36dc[_0x59cd('0x1d')](0xcc)[_0x59cd('0x1e')]();});}};}function handleEntityNotFound(_0x391d01,_0x1e47a6){return function(_0x6fb06b){if(!_0x6fb06b){_0x391d01[_0x59cd('0x1c')](0x194);}return _0x6fb06b;};}function handleError(_0x1d525d,_0x4cd1bd){_0x4cd1bd=_0x4cd1bd||0x1f4;return function(_0x46e532){logger[_0x59cd('0x2d')](_0x46e532['stack']);if(_0x46e532['name']){delete _0x46e532[_0x59cd('0x2e')];}_0x1d525d[_0x59cd('0x1d')](_0x4cd1bd)[_0x59cd('0x2f')](_0x46e532);};}exports[_0x59cd('0x30')]=function(_0x5dc6,_0x1a7e05){var _0x41b0b3={},_0x1f1af2={},_0x522f79={'count':0x0,'rows':[]};var _0x132b58=_[_0x59cd('0x31')](db[_0x59cd('0x32')]['rawAttributes'],function(_0x86cde2){return{'name':_0x86cde2['fieldName'],'type':_0x86cde2[_0x59cd('0x33')][_0x59cd('0x34')]};});_0x1f1af2[_0x59cd('0x35')]=_[_0x59cd('0x31')](_0x132b58,_0x59cd('0x2e'));_0x1f1af2[_0x59cd('0x36')]=_[_0x59cd('0x37')](_0x5dc6[_0x59cd('0x36')]);_0x1f1af2[_0x59cd('0x38')]=_[_0x59cd('0x39')](_0x1f1af2[_0x59cd('0x35')],_0x1f1af2[_0x59cd('0x36')]);_0x41b0b3[_0x59cd('0x3a')]=_[_0x59cd('0x39')](_0x1f1af2[_0x59cd('0x35')],qs[_0x59cd('0x3b')](_0x5dc6[_0x59cd('0x36')][_0x59cd('0x3b')]));_0x41b0b3[_0x59cd('0x3a')]=_0x41b0b3[_0x59cd('0x3a')][_0x59cd('0x3c')]?_0x41b0b3[_0x59cd('0x3a')]:_0x1f1af2[_0x59cd('0x35')];if(!_0x5dc6[_0x59cd('0x36')]['hasOwnProperty']('nolimit')){_0x41b0b3[_0x59cd('0x23')]=qs[_0x59cd('0x23')](_0x5dc6[_0x59cd('0x36')]['limit']);_0x41b0b3[_0x59cd('0x20')]=qs[_0x59cd('0x20')](_0x5dc6[_0x59cd('0x36')][_0x59cd('0x20')]);}_0x41b0b3[_0x59cd('0x3d')]=qs[_0x59cd('0x3e')](_0x5dc6[_0x59cd('0x36')][_0x59cd('0x3e')]);_0x41b0b3['where']=qs[_0x59cd('0x38')](_[_0x59cd('0x3f')](_0x5dc6[_0x59cd('0x36')],_0x1f1af2['filters']),_0x132b58);if(_0x5dc6[_0x59cd('0x36')][_0x59cd('0x40')]){_0x41b0b3['where']=_[_0x59cd('0x41')](_0x41b0b3[_0x59cd('0x42')],{'$or':[{'key':{'$like':'%'+_0x5dc6[_0x59cd('0x36')][_0x59cd('0x40')]+'%'}},{'value':{'$like':'%'+_0x5dc6[_0x59cd('0x36')][_0x59cd('0x40')]+'%'}}]});}_0x41b0b3=_[_0x59cd('0x41')]({},_0x41b0b3,_0x5dc6['options']);var _0x442e0c={'where':_0x41b0b3[_0x59cd('0x42')]};return db[_0x59cd('0x32')][_0x59cd('0x22')](_0x442e0c)[_0x59cd('0x29')](function(_0x1e550e){_0x522f79[_0x59cd('0x22')]=_0x1e550e;if(_0x5dc6['query'][_0x59cd('0x43')]){_0x41b0b3[_0x59cd('0x44')]=[{'all':!![]}];}return db[_0x59cd('0x32')][_0x59cd('0x45')](_0x41b0b3);})['then'](function(_0x2a5eff){_0x522f79['rows']=_0x2a5eff;return _0x522f79;})[_0x59cd('0x29')](respondWithFilteredResult(_0x1a7e05,_0x41b0b3))[_0x59cd('0x46')](handleError(_0x1a7e05,null));};exports[_0x59cd('0x47')]=function(_0x313796,_0x148e57){var _0x313b54={'raw':!![],'where':{'id':_0x313796[_0x59cd('0x48')]['id']}},_0x198dd1={};_0x198dd1[_0x59cd('0x35')]=_[_0x59cd('0x37')](db['CannedAnswer']['rawAttributes']);_0x198dd1[_0x59cd('0x36')]=_['keys'](_0x313796['query']);_0x198dd1['filters']=_['intersection'](_0x198dd1['model'],_0x198dd1[_0x59cd('0x36')]);_0x313b54[_0x59cd('0x3a')]=_['intersection'](_0x198dd1[_0x59cd('0x35')],qs[_0x59cd('0x3b')](_0x313796[_0x59cd('0x36')][_0x59cd('0x3b')]));_0x313b54[_0x59cd('0x3a')]=_0x313b54[_0x59cd('0x3a')][_0x59cd('0x3c')]?_0x313b54[_0x59cd('0x3a')]:_0x198dd1[_0x59cd('0x35')];if(_0x313796[_0x59cd('0x36')][_0x59cd('0x43')]){_0x313b54['include']=[{'all':!![]}];}_0x313b54=_[_0x59cd('0x41')]({},_0x313b54,_0x313796[_0x59cd('0x49')]);return db[_0x59cd('0x32')]['find'](_0x313b54)[_0x59cd('0x29')](handleEntityNotFound(_0x148e57,null))['then'](respondWithResult(_0x148e57,null))[_0x59cd('0x46')](handleError(_0x148e57,null));};exports[_0x59cd('0x28')]=function(_0x5bac72,_0x4f706c){if(_0x5bac72[_0x59cd('0x4a')]['id']){delete _0x5bac72[_0x59cd('0x4a')]['id'];}return db[_0x59cd('0x32')]['find']({'where':{'id':_0x5bac72[_0x59cd('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f706c,null))[_0x59cd('0x29')](saveUpdates(_0x5bac72[_0x59cd('0x4a')],null))[_0x59cd('0x29')](respondWithResult(_0x4f706c,null))[_0x59cd('0x46')](handleError(_0x4f706c,null));};exports[_0x59cd('0x2a')]=function(_0x22d2f6,_0xdf9712){return db[_0x59cd('0x32')]['find']({'where':{'id':_0x22d2f6['params']['id']}})[_0x59cd('0x29')](handleEntityNotFound(_0xdf9712,null))['then'](removeEntity(_0xdf9712,null))[_0x59cd('0x46')](handleError(_0xdf9712,null));};exports['create']=function(_0x149a06,_0x3aa8dc){var _0x230cd4={'key':_0x149a06[_0x59cd('0x4a')][_0x59cd('0x34')]};if(_0x149a06[_0x59cd('0x4a')]['MailAccountId']){_0x230cd4[_0x59cd('0x4b')]=_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4b')];}else if(_0x149a06['body']['SmsAccountId']){_0x230cd4[_0x59cd('0x4c')]=_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4c')];}else if(_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4d')]){_0x230cd4[_0x59cd('0x4d')]=_0x149a06[_0x59cd('0x4a')]['OpenchannelAccountId'];}else if(_0x149a06['body'][_0x59cd('0x4e')]){_0x230cd4[_0x59cd('0x4e')]=_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4e')];}return db[_0x59cd('0x32')][_0x59cd('0x4f')]({'where':_0x230cd4})[_0x59cd('0x29')](function(_0x1acf54){if(_0x1acf54){throw new db[(_0x59cd('0x50'))][(_0x59cd('0x51'))](_0x59cd('0x52'));}return db['CannedAnswer']['create'](_0x149a06[_0x59cd('0x4a')]);})['then'](function(_0xa47d22){var _0x1ff85c=_0x149a06[_0x59cd('0x53')]['get']({'plain':!![]});if(!_0x1ff85c)throw new Error(_0x59cd('0x54'));if(_0x1ff85c[_0x59cd('0x55')]===_0x59cd('0x53')){var _0x820f91=_0xa47d22[_0x59cd('0x2b')]({'plain':!![]});return db[_0x59cd('0x56')][_0x59cd('0x4f')]({'where':{'name':_0x59cd('0x2c'),'userProfileId':_0x1ff85c[_0x59cd('0x57')]},'raw':!![]})[_0x59cd('0x29')](function(_0x51c1ce){if(_0x51c1ce&&_0x51c1ce[_0x59cd('0x58')]===0x0){return db['UserProfileResource'][_0x59cd('0x59')]({'name':_0x820f91[_0x59cd('0x2e')],'resourceId':_0x820f91['id'],'type':_0x51c1ce['name'],'sectionId':_0x51c1ce['id']},{})[_0x59cd('0x29')](function(){return _0xa47d22;});}else{return _0xa47d22;}})['catch'](function(_0x1b71de){logger[_0x59cd('0x2d')](_0x59cd('0x5a'),_0x1b71de);throw _0x1b71de;});}return _0xa47d22;})[_0x59cd('0x29')](respondWithResult(_0x3aa8dc,0xc9))[_0x59cd('0x46')](handleError(_0x3aa8dc,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index a090a3a..34c3137 100644
--- a/server/api/cannedAnswer/cannedAnswer.model.js
+++ b/server/api/cannedAnswer/cannedAnswer.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe82b=['tools_canned_answers','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x41130b,_0x2654b1){var _0x1ff258=function(_0x284984){while(--_0x284984){_0x41130b['push'](_0x41130b['shift']());}};_0x1ff258(++_0x2654b1);}(_0xe82b,0x11a));var _0xbe82=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xe82b[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var logger=require('../../config/logger')(_0xbe82('0x2'));var moment=require(_0xbe82('0x3'));var BPromise=require(_0xbe82('0x4'));var rp=require(_0xbe82('0x5'));var fs=require('fs');var path=require(_0xbe82('0x6'));var rimraf=require(_0xbe82('0x7'));var config=require('../../config/environment');var attributes=require(_0xbe82('0x8'));module[_0xbe82('0x9')]=function(_0x5e33b2,_0x1f02d7){return _0x5e33b2[_0xbe82('0xa')](_0xbe82('0xb'),attributes,{'tableName':_0xbe82('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe82('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd592=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x119f3c,_0x4bee97){var _0x335bfc=function(_0x2102cd){while(--_0x2102cd){_0x119f3c['push'](_0x119f3c['shift']());}};_0x335bfc(++_0x4bee97);}(_0xd592,0x97));var _0x2d59=function(_0x26c264,_0xd8bc65){_0x26c264=_0x26c264-0x0;var _0x2a40a4=_0xd592[_0x26c264];return _0x2a40a4;};'use strict';var _=require(_0x2d59('0x0'));var util=require(_0x2d59('0x1'));var logger=require(_0x2d59('0x2'))(_0x2d59('0x3'));var moment=require(_0x2d59('0x4'));var BPromise=require(_0x2d59('0x5'));var rp=require(_0x2d59('0x6'));var fs=require('fs');var path=require(_0x2d59('0x7'));var rimraf=require(_0x2d59('0x8'));var config=require(_0x2d59('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0x2d59('0xa')]=function(_0x5f059b,_0x44f619){return _0x5f059b[_0x2d59('0xb')](_0x2d59('0xc'),attributes,{'tableName':_0x2d59('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2d59('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 037be3e..9787022 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27e671,_0x4dee15){var _0x4b0b6d=function(_0x2bd1da){while(--_0x2bd1da){_0x27e671['push'](_0x27e671['shift']());}};_0x4b0b6d(++_0x4dee15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30d199,_0x287cb0){var _0x5c465d=function(_0x4bc356){while(--_0x4bc356){_0x30d199['push'](_0x30d199['shift']());}};_0x5c465d(++_0x287cb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 2de9dd7..ba0e9b4 100644
--- a/server/api/cannedAnswer/index.js
+++ b/server/api/cannedAnswer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7663=['../../config/environment','./cannedAnswer.controller','index','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2ce0a2,_0x1529ae){var _0x201721=function(_0x145f8d){while(--_0x145f8d){_0x2ce0a2['push'](_0x2ce0a2['shift']());}};_0x201721(++_0x1529ae);}(_0x7663,0x142));var _0x3766=function(_0x3073d5,_0xd1fdf5){_0x3073d5=_0x3073d5-0x0;var _0x56ee5a=_0x7663[_0x3073d5];return _0x56ee5a;};'use strict';var multer=require(_0x3766('0x0'));var util=require(_0x3766('0x1'));var path=require(_0x3766('0x2'));var timeout=require(_0x3766('0x3'));var express=require(_0x3766('0x4'));var router=express['Router']();var fs_extra=require(_0x3766('0x5'));var auth=require(_0x3766('0x6'));var interaction=require(_0x3766('0x7'));var config=require(_0x3766('0x8'));var controller=require(_0x3766('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3766('0xa')]);router[_0x3766('0xb')]('/:id',auth[_0x3766('0xc')](),controller[_0x3766('0xd')]);router[_0x3766('0xe')]('/',auth[_0x3766('0xc')](),controller[_0x3766('0xf')]);router[_0x3766('0x10')](_0x3766('0x11'),auth['isAuthenticated'](),controller[_0x3766('0x12')]);router[_0x3766('0x13')](_0x3766('0x11'),auth[_0x3766('0xc')](),controller[_0x3766('0x14')]);module[_0x3766('0x15')]=router;
\ No newline at end of file
+var _0x8c26=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','put','delete','destroy'];(function(_0x52ef9a,_0x312e31){var _0x424c2b=function(_0x231947){while(--_0x231947){_0x52ef9a['push'](_0x52ef9a['shift']());}};_0x424c2b(++_0x312e31);}(_0x8c26,0x1e1));var _0x68c2=function(_0x5e31d6,_0x238cb5){_0x5e31d6=_0x5e31d6-0x0;var _0x2e206a=_0x8c26[_0x5e31d6];return _0x2e206a;};'use strict';var multer=require(_0x68c2('0x0'));var util=require(_0x68c2('0x1'));var path=require(_0x68c2('0x2'));var timeout=require(_0x68c2('0x3'));var express=require('express');var router=express[_0x68c2('0x4')]();var fs_extra=require(_0x68c2('0x5'));var auth=require(_0x68c2('0x6'));var interaction=require(_0x68c2('0x7'));var config=require(_0x68c2('0x8'));var controller=require(_0x68c2('0x9'));router[_0x68c2('0xa')]('/',auth['isAuthenticated'](),controller[_0x68c2('0xb')]);router['get'](_0x68c2('0xc'),auth[_0x68c2('0xd')](),controller[_0x68c2('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x68c2('0xf')]);router[_0x68c2('0x10')]('/:id',auth[_0x68c2('0xd')](),controller['update']);router[_0x68c2('0x11')](_0x68c2('0xc'),auth[_0x68c2('0xd')](),controller[_0x68c2('0x12')]);module[_0x68c2('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 71339cc..f8a5ac7 100644
--- a/server/api/cdr/cdr.attributes.js
+++ b/server/api/cdr/cdr.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf45e=['INTEGER','sequelize','DATE','STRING'];(function(_0x10b099,_0x847335){var _0xace9f7=function(_0x3e5ccb){while(--_0x3e5ccb){_0x10b099['push'](_0x10b099['shift']());}};_0xace9f7(++_0x847335);}(_0xf45e,0x115));var _0xef45=function(_0x4b531b,_0x299078){_0x4b531b=_0x4b531b-0x0;var _0x1bc994=_0xf45e[_0x4b531b];return _0x1bc994;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xef45('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xef45('0x2')]},'src':{'type':Sequelize[_0xef45('0x2')]},'dst':{'type':Sequelize[_0xef45('0x2')]},'dcontext':{'type':Sequelize[_0xef45('0x2')]},'channel':{'type':Sequelize[_0xef45('0x2')]},'dstchannel':{'type':Sequelize[_0xef45('0x2')]},'lastapp':{'type':Sequelize[_0xef45('0x2')]},'lastdata':{'type':Sequelize[_0xef45('0x2')]},'duration':{'type':Sequelize[_0xef45('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xef45('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xef45('0x2')]},'amaflags':{'type':Sequelize[_0xef45('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xef45('0x2')]},'userfield':{'type':Sequelize[_0xef45('0x2')]},'uniqueid':{'type':Sequelize[_0xef45('0x2')]},'linkedid':{'type':Sequelize[_0xef45('0x2')]},'sequence':{'type':Sequelize[_0xef45('0x2')]},'peeraccount':{'type':Sequelize[_0xef45('0x2')]},'type':{'type':Sequelize[_0xef45('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6449=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x504b50,_0x3ee98c){var _0x4f627c=function(_0x3120cf){while(--_0x3120cf){_0x504b50['push'](_0x504b50['shift']());}};_0x4f627c(++_0x3ee98c);}(_0x6449,0xee));var _0x9644=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x6449[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require('sequelize');module[_0x9644('0x0')]={'calldate':{'type':Sequelize[_0x9644('0x1')],'allowNull':![],'defaultValue':_0x9644('0x2')},'clid':{'type':Sequelize[_0x9644('0x3')]},'src':{'type':Sequelize[_0x9644('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x9644('0x3')]},'channel':{'type':Sequelize[_0x9644('0x3')]},'dstchannel':{'type':Sequelize[_0x9644('0x3')]},'lastapp':{'type':Sequelize[_0x9644('0x3')]},'lastdata':{'type':Sequelize[_0x9644('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9644('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9644('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9644('0x3')]},'userfield':{'type':Sequelize[_0x9644('0x3')]},'uniqueid':{'type':Sequelize[_0x9644('0x3')]},'linkedid':{'type':Sequelize[_0x9644('0x3')]},'sequence':{'type':Sequelize[_0x9644('0x3')]},'peeraccount':{'type':Sequelize[_0x9644('0x3')]},'type':{'type':Sequelize[_0x9644('0x3')]},'tag':{'type':Sequelize[_0x9644('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index bcb1507..66690b5 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x826a=['key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','Cdr','fieldName','type'];(function(_0x5ab238,_0x4ddda9){var _0x236db6=function(_0x5f1f3f){while(--_0x5f1f3f){_0x5ab238['push'](_0x5ab238['shift']());}};_0x236db6(++_0x4ddda9);}(_0x826a,0x1aa));var _0xa826=function(_0x7f4ea5,_0x1655e0){_0x7f4ea5=_0x7f4ea5-0x0;var _0x26f5b7=_0x826a[_0x7f4ea5];return _0x26f5b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa826('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa826('0x1'));var rp=require('request-promise');var moment=require(_0xa826('0x2'));var BPromise=require(_0xa826('0x3'));var Mustache=require(_0xa826('0x4'));var util=require(_0xa826('0x5'));var path=require('path');var sox=require(_0xa826('0x6'));var csv=require(_0xa826('0x7'));var ejs=require(_0xa826('0x8'));var fs=require('fs');var fs_extra=require(_0xa826('0x9'));var _=require(_0xa826('0xa'));var squel=require(_0xa826('0xb'));var crypto=require(_0xa826('0xc'));var jsforce=require(_0xa826('0xd'));var deskjs=require(_0xa826('0xe'));var toCsv=require(_0xa826('0x7'));var querystring=require(_0xa826('0xf'));var Papa=require(_0xa826('0x10'));var Redis=require(_0xa826('0x11'));var authService=require(_0xa826('0x12'));var qs=require(_0xa826('0x13'));var as=require(_0xa826('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa826('0x15'))('api');var utils=require(_0xa826('0x16'));var config=require(_0xa826('0x17'));var licenseUtil=require(_0xa826('0x18'));var db=require(_0xa826('0x19'))['db'];function respondWithStatusCode(_0x212fac,_0x40838f){_0x40838f=_0x40838f||0xcc;return function(_0x2f1d39){if(_0x2f1d39){return _0x212fac['sendStatus'](_0x40838f);}return _0x212fac[_0xa826('0x1a')](_0x40838f)['end']();};}function respondWithResult(_0x3e99b0,_0x41c0c2){_0x41c0c2=_0x41c0c2||0xc8;return function(_0x5dc0c7){if(_0x5dc0c7){return _0x3e99b0['status'](_0x41c0c2)['json'](_0x5dc0c7);}};}function respondWithFilteredResult(_0x1b6d16,_0x4f25bd){return function(_0x4c546b){if(_0x4c546b){var _0x9a3788=typeof _0x4f25bd[_0xa826('0x1b')]===_0xa826('0x1c')&&typeof _0x4f25bd['limit']===_0xa826('0x1c');var _0x312e14=_0x4c546b[_0xa826('0x1d')];var _0x453c5d=_0x9a3788?0x0:_0x4f25bd[_0xa826('0x1b')];var _0x48930f=_0x9a3788?_0x4c546b[_0xa826('0x1d')]:_0x4f25bd[_0xa826('0x1b')]+_0x4f25bd[_0xa826('0x1e')];var _0x57e96e;if(_0x48930f>=_0x312e14){_0x48930f=_0x312e14;_0x57e96e=0xc8;}else{_0x57e96e=0xce;}_0x1b6d16['status'](_0x57e96e);return _0x1b6d16[_0xa826('0x1f')](_0xa826('0x20'),_0x453c5d+'-'+_0x48930f+'/'+_0x312e14)[_0xa826('0x21')](_0x4c546b);}return null;};}function patchUpdates(_0x8d1650){return function(_0x124564){try{jsonpatch['apply'](_0x124564,_0x8d1650,!![]);}catch(_0x3171ff){return BPromise[_0xa826('0x22')](_0x3171ff);}return _0x124564[_0xa826('0x23')]();};}function saveUpdates(_0x5d410f,_0x5ddeef){return function(_0x361ca5){if(_0x361ca5){return _0x361ca5[_0xa826('0x24')](_0x5d410f)[_0xa826('0x25')](function(_0x4eb4f3){return _0x4eb4f3;});}return null;};}function removeEntity(_0x1d7adf,_0x26ef25){return function(_0x1d4ade){if(_0x1d4ade){return _0x1d4ade[_0xa826('0x26')]()[_0xa826('0x25')](function(){_0x1d7adf['status'](0xcc)[_0xa826('0x27')]();});}};}function handleEntityNotFound(_0x4fa5db,_0x17ef2d){return function(_0x174f16){if(!_0x174f16){_0x4fa5db['sendStatus'](0x194);}return _0x174f16;};}function handleError(_0xfc0448,_0xfa4d94){_0xfa4d94=_0xfa4d94||0x1f4;return function(_0x38c919){logger[_0xa826('0x28')](_0x38c919[_0xa826('0x29')]);if(_0x38c919[_0xa826('0x2a')]){delete _0x38c919[_0xa826('0x2a')];}_0xfc0448[_0xa826('0x1a')](_0xfa4d94)[_0xa826('0x2b')](_0x38c919);};}exports[_0xa826('0x2c')]=function(_0x1e35de,_0x473d8d){var _0x1f2749={},_0x2cb586={},_0x2253c7={'count':0x0,'rows':[]};var _0x27f8f9=_['map'](db[_0xa826('0x2d')]['rawAttributes'],function(_0x2dd810){return{'name':_0x2dd810[_0xa826('0x2e')],'type':_0x2dd810[_0xa826('0x2f')][_0xa826('0x30')]};});_0x2cb586[_0xa826('0x31')]=_['map'](_0x27f8f9,'name');_0x2cb586[_0xa826('0x32')]=_[_0xa826('0x33')](_0x1e35de[_0xa826('0x32')]);_0x2cb586[_0xa826('0x34')]=_['intersection'](_0x2cb586[_0xa826('0x31')],_0x2cb586[_0xa826('0x32')]);_0x1f2749['attributes']=_[_0xa826('0x35')](_0x2cb586['model'],qs[_0xa826('0x36')](_0x1e35de[_0xa826('0x32')][_0xa826('0x36')]));_0x1f2749[_0xa826('0x37')]=_0x1f2749[_0xa826('0x37')]['length']?_0x1f2749[_0xa826('0x37')]:_0x2cb586[_0xa826('0x31')];if(!_0x1e35de[_0xa826('0x32')][_0xa826('0x38')](_0xa826('0x39'))){_0x1f2749[_0xa826('0x1e')]=qs[_0xa826('0x1e')](_0x1e35de[_0xa826('0x32')][_0xa826('0x1e')]);_0x1f2749[_0xa826('0x1b')]=qs[_0xa826('0x1b')](_0x1e35de['query'][_0xa826('0x1b')]);}_0x1f2749['order']=qs[_0xa826('0x3a')](_0x1e35de['query'][_0xa826('0x3a')]);_0x1f2749[_0xa826('0x3b')]=qs[_0xa826('0x34')](_[_0xa826('0x3c')](_0x1e35de[_0xa826('0x32')],_0x2cb586[_0xa826('0x34')]),_0x27f8f9);if(_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]){_0x1f2749[_0xa826('0x3b')]=_[_0xa826('0x3e')](_0x1f2749[_0xa826('0x3b')],{'$or':_[_0xa826('0x3f')](_0x27f8f9,function(_0x5911d3){if(_0x5911d3[_0xa826('0x2f')]!==_0xa826('0x40')){var _0x251208={};_0x251208[_0x5911d3['name']]={'$like':'%'+_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]+'%'};return _0x251208;}})});}_0x1f2749=_['merge']({},_0x1f2749,_0x1e35de[_0xa826('0x41')]);var _0x47d9f1={'where':_0x1f2749['where']};return db[_0xa826('0x2d')][_0xa826('0x1d')](_0x47d9f1)[_0xa826('0x25')](function(_0x308d4){_0x2253c7[_0xa826('0x1d')]=_0x308d4;if(_0x1e35de[_0xa826('0x32')]['includeAll']){_0x1f2749[_0xa826('0x42')]=[{'all':!![]}];}return db[_0xa826('0x2d')][_0xa826('0x43')](_0x1f2749);})[_0xa826('0x25')](function(_0x244fd3){_0x2253c7[_0xa826('0x44')]=_0x244fd3;return _0x2253c7;})['then'](respondWithFilteredResult(_0x473d8d,_0x1f2749))[_0xa826('0x45')](handleError(_0x473d8d,null));};exports[_0xa826('0x46')]=function(_0x405ee1,_0x162be1){var _0x258e57={'raw':!![],'where':{'id':_0x405ee1[_0xa826('0x47')]['id']}},_0x53b70e={};_0x53b70e[_0xa826('0x31')]=_[_0xa826('0x33')](db[_0xa826('0x2d')][_0xa826('0x48')]);_0x53b70e[_0xa826('0x32')]=_[_0xa826('0x33')](_0x405ee1[_0xa826('0x32')]);_0x53b70e[_0xa826('0x34')]=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],_0x53b70e[_0xa826('0x32')]);_0x258e57['attributes']=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],qs[_0xa826('0x36')](_0x405ee1['query'][_0xa826('0x36')]));_0x258e57[_0xa826('0x37')]=_0x258e57[_0xa826('0x37')][_0xa826('0x49')]?_0x258e57[_0xa826('0x37')]:_0x53b70e['model'];if(_0x405ee1[_0xa826('0x32')][_0xa826('0x4a')]){_0x258e57[_0xa826('0x42')]=[{'all':!![]}];}_0x258e57=_[_0xa826('0x3e')]({},_0x258e57,_0x405ee1[_0xa826('0x41')]);return db[_0xa826('0x2d')][_0xa826('0x4b')](_0x258e57)['then'](handleEntityNotFound(_0x162be1,null))[_0xa826('0x25')](respondWithResult(_0x162be1,null))['catch'](handleError(_0x162be1,null));};exports['create']=function(_0x4b4352,_0x26a858){return db[_0xa826('0x2d')][_0xa826('0x4c')](_0x4b4352[_0xa826('0x4d')],{})['then'](respondWithResult(_0x26a858,0xc9))[_0xa826('0x45')](handleError(_0x26a858,null));};exports['update']=function(_0x5e0947,_0xedcbc2){if(_0x5e0947[_0xa826('0x4d')]['id']){delete _0x5e0947['body']['id'];}return db[_0xa826('0x2d')][_0xa826('0x4b')]({'where':{'id':_0x5e0947['params']['id']}})['then'](handleEntityNotFound(_0xedcbc2,null))['then'](saveUpdates(_0x5e0947['body'],null))['then'](respondWithResult(_0xedcbc2,null))['catch'](handleError(_0xedcbc2,null));};exports['destroy']=function(_0xb3fae0,_0x5d5269){return db[_0xa826('0x2d')]['find']({'where':{'id':_0xb3fae0[_0xa826('0x47')]['id']}})[_0xa826('0x25')](handleEntityNotFound(_0x5d5269,null))[_0xa826('0x25')](removeEntity(_0x5d5269,null))[_0xa826('0x45')](handleError(_0x5d5269,null));};exports[_0xa826('0x4e')]=function(_0x52cf5e,_0x209704){return db['Cdr']['describe']()[_0xa826('0x25')](respondWithResult(_0x209704,null))[_0xa826('0x45')](handleError(_0x209704,null));};
\ No newline at end of file
+var _0x7a59=['describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','Cdr','findAll','show','params','keys','include','find','create','body','catch','update'];(function(_0x272700,_0x525483){var _0x3927a4=function(_0x5a98e0){while(--_0x5a98e0){_0x272700['push'](_0x272700['shift']());}};_0x3927a4(++_0x525483);}(_0x7a59,0x16e));var _0x97a5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x7a59[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x97a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a5('0x1'));var rp=require(_0x97a5('0x2'));var moment=require(_0x97a5('0x3'));var BPromise=require(_0x97a5('0x4'));var Mustache=require(_0x97a5('0x5'));var util=require('util');var path=require(_0x97a5('0x6'));var sox=require(_0x97a5('0x7'));var csv=require(_0x97a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a5('0x9'));var _=require(_0x97a5('0xa'));var squel=require(_0x97a5('0xb'));var crypto=require(_0x97a5('0xc'));var jsforce=require(_0x97a5('0xd'));var deskjs=require(_0x97a5('0xe'));var toCsv=require(_0x97a5('0x8'));var querystring=require('querystring');var Papa=require(_0x97a5('0xf'));var Redis=require(_0x97a5('0x10'));var authService=require(_0x97a5('0x11'));var qs=require(_0x97a5('0x12'));var as=require(_0x97a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97a5('0x14'));var utils=require(_0x97a5('0x15'));var config=require(_0x97a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x97a5('0x17'))['db'];function respondWithStatusCode(_0x350720,_0x55305a){_0x55305a=_0x55305a||0xcc;return function(_0x4f85a0){if(_0x4f85a0){return _0x350720[_0x97a5('0x18')](_0x55305a);}return _0x350720[_0x97a5('0x19')](_0x55305a)['end']();};}function respondWithResult(_0x595437,_0x51d5e2){_0x51d5e2=_0x51d5e2||0xc8;return function(_0x5a4471){if(_0x5a4471){return _0x595437[_0x97a5('0x19')](_0x51d5e2)[_0x97a5('0x1a')](_0x5a4471);}};}function respondWithFilteredResult(_0x3603e4,_0x4d8ba7){return function(_0x1a7a62){if(_0x1a7a62){var _0x3fa986=typeof _0x4d8ba7['offset']===_0x97a5('0x1b')&&typeof _0x4d8ba7['limit']===_0x97a5('0x1b');var _0x55071b=_0x1a7a62['count'];var _0x52ce92=_0x3fa986?0x0:_0x4d8ba7[_0x97a5('0x1c')];var _0x5c5740=_0x3fa986?_0x1a7a62[_0x97a5('0x1d')]:_0x4d8ba7[_0x97a5('0x1c')]+_0x4d8ba7[_0x97a5('0x1e')];var _0x1efe8c;if(_0x5c5740>=_0x55071b){_0x5c5740=_0x55071b;_0x1efe8c=0xc8;}else{_0x1efe8c=0xce;}_0x3603e4['status'](_0x1efe8c);return _0x3603e4['set'](_0x97a5('0x1f'),_0x52ce92+'-'+_0x5c5740+'/'+_0x55071b)[_0x97a5('0x1a')](_0x1a7a62);}return null;};}function patchUpdates(_0x4e3386){return function(_0x51858b){try{jsonpatch[_0x97a5('0x20')](_0x51858b,_0x4e3386,!![]);}catch(_0x3d7dba){return BPromise[_0x97a5('0x21')](_0x3d7dba);}return _0x51858b['save']();};}function saveUpdates(_0x34fb55,_0x3a5849){return function(_0x23f4f8){if(_0x23f4f8){return _0x23f4f8['update'](_0x34fb55)[_0x97a5('0x22')](function(_0x33d6da){return _0x33d6da;});}return null;};}function removeEntity(_0x4e2074,_0x5e731e){return function(_0x469592){if(_0x469592){return _0x469592[_0x97a5('0x23')]()[_0x97a5('0x22')](function(){_0x4e2074[_0x97a5('0x19')](0xcc)[_0x97a5('0x24')]();});}};}function handleEntityNotFound(_0x302d78,_0xf7ad1e){return function(_0x4743e0){if(!_0x4743e0){_0x302d78['sendStatus'](0x194);}return _0x4743e0;};}function handleError(_0x2038dd,_0x46ee45){_0x46ee45=_0x46ee45||0x1f4;return function(_0x2ca97c){logger[_0x97a5('0x25')](_0x2ca97c[_0x97a5('0x26')]);if(_0x2ca97c[_0x97a5('0x27')]){delete _0x2ca97c['name'];}_0x2038dd[_0x97a5('0x19')](_0x46ee45)[_0x97a5('0x28')](_0x2ca97c);};}exports['index']=function(_0x274ccb,_0x52248f){var _0x48f1c1={},_0x1bdb74={},_0x2eaae4={'count':0x0,'rows':[]};var _0x5c1c67=_[_0x97a5('0x29')](db['Cdr'][_0x97a5('0x2a')],function(_0x3c5d02){return{'name':_0x3c5d02[_0x97a5('0x2b')],'type':_0x3c5d02[_0x97a5('0x2c')]['key']};});_0x1bdb74['model']=_[_0x97a5('0x29')](_0x5c1c67,_0x97a5('0x27'));_0x1bdb74[_0x97a5('0x2d')]=_['keys'](_0x274ccb[_0x97a5('0x2d')]);_0x1bdb74[_0x97a5('0x2e')]=_['intersection'](_0x1bdb74[_0x97a5('0x2f')],_0x1bdb74[_0x97a5('0x2d')]);_0x48f1c1['attributes']=_[_0x97a5('0x30')](_0x1bdb74[_0x97a5('0x2f')],qs[_0x97a5('0x31')](_0x274ccb['query'][_0x97a5('0x31')]));_0x48f1c1[_0x97a5('0x32')]=_0x48f1c1[_0x97a5('0x32')][_0x97a5('0x33')]?_0x48f1c1[_0x97a5('0x32')]:_0x1bdb74[_0x97a5('0x2f')];if(!_0x274ccb[_0x97a5('0x2d')]['hasOwnProperty'](_0x97a5('0x34'))){_0x48f1c1[_0x97a5('0x1e')]=qs[_0x97a5('0x1e')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1e')]);_0x48f1c1[_0x97a5('0x1c')]=qs[_0x97a5('0x1c')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1c')]);}_0x48f1c1[_0x97a5('0x35')]=qs[_0x97a5('0x36')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x36')]);_0x48f1c1['where']=qs[_0x97a5('0x2e')](_[_0x97a5('0x37')](_0x274ccb[_0x97a5('0x2d')],_0x1bdb74[_0x97a5('0x2e')]),_0x5c1c67);if(_0x274ccb[_0x97a5('0x2d')]['filter']){_0x48f1c1['where']=_[_0x97a5('0x38')](_0x48f1c1[_0x97a5('0x39')],{'$or':_[_0x97a5('0x29')](_0x5c1c67,function(_0x45a548){if(_0x45a548[_0x97a5('0x2c')]!==_0x97a5('0x3a')){var _0x57333b={};_0x57333b[_0x45a548[_0x97a5('0x27')]]={'$like':'%'+_0x274ccb['query'][_0x97a5('0x3b')]+'%'};return _0x57333b;}})});}_0x48f1c1=_[_0x97a5('0x38')]({},_0x48f1c1,_0x274ccb[_0x97a5('0x3c')]);var _0x798318={'where':_0x48f1c1[_0x97a5('0x39')]};return db['Cdr'][_0x97a5('0x1d')](_0x798318)[_0x97a5('0x22')](function(_0x64505){_0x2eaae4[_0x97a5('0x1d')]=_0x64505;if(_0x274ccb[_0x97a5('0x2d')]['includeAll']){_0x48f1c1['include']=[{'all':!![]}];}return db[_0x97a5('0x3d')][_0x97a5('0x3e')](_0x48f1c1);})[_0x97a5('0x22')](function(_0x20dbc6){_0x2eaae4['rows']=_0x20dbc6;return _0x2eaae4;})[_0x97a5('0x22')](respondWithFilteredResult(_0x52248f,_0x48f1c1))['catch'](handleError(_0x52248f,null));};exports[_0x97a5('0x3f')]=function(_0x331108,_0x111e72){var _0x5baf77={'raw':!![],'where':{'id':_0x331108[_0x97a5('0x40')]['id']}},_0xefb019={};_0xefb019['model']=_[_0x97a5('0x41')](db[_0x97a5('0x3d')][_0x97a5('0x2a')]);_0xefb019[_0x97a5('0x2d')]=_[_0x97a5('0x41')](_0x331108[_0x97a5('0x2d')]);_0xefb019[_0x97a5('0x2e')]=_[_0x97a5('0x30')](_0xefb019[_0x97a5('0x2f')],_0xefb019[_0x97a5('0x2d')]);_0x5baf77[_0x97a5('0x32')]=_[_0x97a5('0x30')](_0xefb019['model'],qs[_0x97a5('0x31')](_0x331108[_0x97a5('0x2d')][_0x97a5('0x31')]));_0x5baf77['attributes']=_0x5baf77[_0x97a5('0x32')][_0x97a5('0x33')]?_0x5baf77[_0x97a5('0x32')]:_0xefb019[_0x97a5('0x2f')];if(_0x331108[_0x97a5('0x2d')]['includeAll']){_0x5baf77[_0x97a5('0x42')]=[{'all':!![]}];}_0x5baf77=_[_0x97a5('0x38')]({},_0x5baf77,_0x331108[_0x97a5('0x3c')]);return db[_0x97a5('0x3d')][_0x97a5('0x43')](_0x5baf77)['then'](handleEntityNotFound(_0x111e72,null))[_0x97a5('0x22')](respondWithResult(_0x111e72,null))['catch'](handleError(_0x111e72,null));};exports[_0x97a5('0x44')]=function(_0x235f9d,_0x330f6a){return db['Cdr'][_0x97a5('0x44')](_0x235f9d[_0x97a5('0x45')],{})[_0x97a5('0x22')](respondWithResult(_0x330f6a,0xc9))[_0x97a5('0x46')](handleError(_0x330f6a,null));};exports[_0x97a5('0x47')]=function(_0x42ced6,_0x49b215){if(_0x42ced6[_0x97a5('0x45')]['id']){delete _0x42ced6[_0x97a5('0x45')]['id'];}return db[_0x97a5('0x3d')][_0x97a5('0x43')]({'where':{'id':_0x42ced6['params']['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x49b215,null))[_0x97a5('0x22')](saveUpdates(_0x42ced6['body'],null))[_0x97a5('0x22')](respondWithResult(_0x49b215,null))[_0x97a5('0x46')](handleError(_0x49b215,null));};exports[_0x97a5('0x23')]=function(_0x56890f,_0x2a6fa0){return db[_0x97a5('0x3d')]['find']({'where':{'id':_0x56890f[_0x97a5('0x40')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x2a6fa0,null))[_0x97a5('0x22')](removeEntity(_0x2a6fa0,null))['catch'](handleError(_0x2a6fa0,null));};exports[_0x97a5('0x48')]=function(_0xc3c9e5,_0x7adad){return db['Cdr']['describe']()[_0x97a5('0x22')](respondWithResult(_0x7adad,null))[_0x97a5('0x46')](handleError(_0x7adad,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 6b5c418..526a101 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x400a3b,_0x5a5189){var _0x53426b=function(_0x113d6d){while(--_0x113d6d){_0x400a3b['push'](_0x400a3b['shift']());}};_0x53426b(++_0x5a5189);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3bbce0,_0x1a8d2c){var _0x40a716=function(_0x28c470){while(--_0x28c470){_0x3bbce0['push'](_0x3bbce0['shift']());}};_0x40a716(++_0x1a8d2c);}(_0x7a54,0x106));var _0x47a5=function(_0x26ac6e,_0xb38c5e){_0x26ac6e=_0x26ac6e-0x0;var _0x275731=_0x7a54[_0x26ac6e];return _0x275731;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 9f86bcb..88064a0 100644
--- a/server/api/cdr/cdr.rpc.js
+++ b/server/api/cdr/cdr.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd892=['request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s'];(function(_0x2f77d6,_0x815a1d){var _0x5bf9eb=function(_0xb05bb5){while(--_0xb05bb5){_0x2f77d6['push'](_0x2f77d6['shift']());}};_0x5bf9eb(++_0x815a1d);}(_0xd892,0x18f));var _0x2d89=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xd892[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x2d89('0x0'));var util=require(_0x2d89('0x1'));var moment=require(_0x2d89('0x2'));var BPromise=require(_0x2d89('0x3'));var rs=require(_0x2d89('0x4'));var fs=require('fs');var Redis=require(_0x2d89('0x5'));var db=require(_0x2d89('0x6'))['db'];var utils=require(_0x2d89('0x7'));var logger=require(_0x2d89('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2d89('0x9'));var client=jayson[_0x2d89('0xa')][_0x2d89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x363cb9,_0x370d2a,_0xa3365d){return new BPromise(function(_0x14332c,_0xd82516){return client[_0x2d89('0xc')](_0x363cb9,_0xa3365d)[_0x2d89('0xd')](function(_0x470a45){logger['info'](_0x2d89('0xe'),_0x370d2a,_0x2d89('0xf'));logger[_0x2d89('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x370d2a,'request\x20sent',JSON[_0x2d89('0x11')](_0x470a45));if(_0x470a45[_0x2d89('0x12')]){if(_0x470a45[_0x2d89('0x12')][_0x2d89('0x13')]===0x1f4){logger[_0x2d89('0x12')](_0x2d89('0xe'),_0x370d2a,_0x470a45[_0x2d89('0x12')][_0x2d89('0x14')]);return _0xd82516(_0x470a45[_0x2d89('0x12')]['message']);}logger[_0x2d89('0x12')](_0x2d89('0xe'),_0x370d2a,_0x470a45[_0x2d89('0x12')][_0x2d89('0x14')]);return _0x14332c(_0x470a45[_0x2d89('0x12')][_0x2d89('0x14')]);}else{logger[_0x2d89('0x15')](_0x2d89('0xe'),_0x370d2a,_0x2d89('0xf'));_0x14332c(_0x470a45['result'][_0x2d89('0x14')]);}})[_0x2d89('0x16')](function(_0x2f62e4){logger[_0x2d89('0x12')](_0x2d89('0xe'),_0x370d2a,_0x2f62e4);_0xd82516(_0x2f62e4);});});}
\ No newline at end of file
+var _0x3e55=['code','Cdr,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xd4fcd0,_0x10ed9c){var _0x841d2=function(_0x5e6054){while(--_0x5e6054){_0xd4fcd0['push'](_0xd4fcd0['shift']());}};_0x841d2(++_0x10ed9c);}(_0x3e55,0x9e));var _0x53e5=function(_0x333690,_0x33b5cb){_0x333690=_0x333690-0x0;var _0x33b681=_0x3e55[_0x333690];return _0x33b681;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x53e5('0x0'));var BPromise=require(_0x53e5('0x1'));var rs=require(_0x53e5('0x2'));var fs=require('fs');var Redis=require(_0x53e5('0x3'));var db=require(_0x53e5('0x4'))['db'];var utils=require(_0x53e5('0x5'));var logger=require('../../config/logger')(_0x53e5('0x6'));var config=require('../../config/environment');var jayson=require(_0x53e5('0x7'));var client=jayson[_0x53e5('0x8')][_0x53e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a1158,_0x44b561,_0x4479cd){return new BPromise(function(_0x5f33ad,_0x11fa2c){return client[_0x53e5('0xa')](_0x1a1158,_0x4479cd)[_0x53e5('0xb')](function(_0x195d2f){logger[_0x53e5('0xc')]('Cdr,\x20%s,\x20%s',_0x44b561,_0x53e5('0xd'));logger[_0x53e5('0xe')](_0x53e5('0xf'),_0x44b561,'request\x20sent',JSON[_0x53e5('0x10')](_0x195d2f));if(_0x195d2f[_0x53e5('0x11')]){if(_0x195d2f[_0x53e5('0x11')][_0x53e5('0x12')]===0x1f4){logger['error'](_0x53e5('0x13'),_0x44b561,_0x195d2f[_0x53e5('0x11')][_0x53e5('0x14')]);return _0x11fa2c(_0x195d2f['error'][_0x53e5('0x14')]);}logger[_0x53e5('0x11')](_0x53e5('0x13'),_0x44b561,_0x195d2f[_0x53e5('0x11')]['message']);return _0x5f33ad(_0x195d2f[_0x53e5('0x11')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x44b561,_0x53e5('0xd'));_0x5f33ad(_0x195d2f[_0x53e5('0x15')][_0x53e5('0x14')]);}})['catch'](function(_0x20393e){logger[_0x53e5('0x11')](_0x53e5('0x13'),_0x44b561,_0x20393e);_0x11fa2c(_0x20393e);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3dd46ec..0e8b163 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x39eaf1,_0x56f6b9){var _0x116705=function(_0x242c21){while(--_0x242c21){_0x39eaf1['push'](_0x39eaf1['shift']());}};_0x116705(++_0x56f6b9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 16ece3c..e844475 100644
--- a/server/api/chatApplication/chatApplication.attributes.js
+++ b/server/api/chatApplication/chatApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c76=['exports','noop','STRING','*,*,*,*','sequelize'];(function(_0x983327,_0x54bbf9){var _0x30e0c2=function(_0x22cedc){while(--_0x22cedc){_0x983327['push'](_0x983327['shift']());}};_0x30e0c2(++_0x54bbf9);}(_0x9c76,0x199));var _0x69c7=function(_0x1c73e8,_0x5349ec){_0x1c73e8=_0x1c73e8-0x0;var _0x5f2c5b=_0x9c76[_0x1c73e8];return _0x5f2c5b;};'use strict';var Sequelize=require(_0x69c7('0x0'));module[_0x69c7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x69c7('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x69c7('0x3')]},'interval':{'type':Sequelize[_0x69c7('0x3')],'defaultValue':_0x69c7('0x4')}};
\ No newline at end of file
+var _0xdb9c=['TEXT','exports','STRING'];(function(_0x534027,_0x381ca3){var _0x2c8b53=function(_0x3f8343){while(--_0x3f8343){_0x534027['push'](_0x534027['shift']());}};_0x2c8b53(++_0x381ca3);}(_0xdb9c,0x1cf));var _0xcdb9=function(_0x21a897,_0xfde1f8){_0x21a897=_0x21a897-0x0;var _0x1d841c=_0xdb9c[_0x21a897];return _0x1d841c;};'use strict';var Sequelize=require('sequelize');module[_0xcdb9('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcdb9('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcdb9('0x2')]()},'description':{'type':Sequelize[_0xcdb9('0x1')]},'interval':{'type':Sequelize[_0xcdb9('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 8b682b7..e3cf006 100644
--- a/server/api/chatApplication/chatApplication.controller.js
+++ b/server/api/chatApplication/chatApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb077=['intersection','fields','length','include','merge','catch','body','find','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','count','offset','limit','apply','reject','save','update','destroy','then','status','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','attributes'];(function(_0x23e797,_0x1dc763){var _0xa5e856=function(_0x4578af){while(--_0x4578af){_0x23e797['push'](_0x23e797['shift']());}};_0xa5e856(++_0x1dc763);}(_0xb077,0x7a));var _0x7b07=function(_0x52551d,_0x9d47ba){_0x52551d=_0x52551d-0x0;var _0x5df61d=_0xb077[_0x52551d];return _0x5df61d;};'use strict';var emlformat=require(_0x7b07('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b07('0x1'));var rp=require('request-promise');var moment=require(_0x7b07('0x2'));var BPromise=require(_0x7b07('0x3'));var Mustache=require(_0x7b07('0x4'));var util=require(_0x7b07('0x5'));var path=require(_0x7b07('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b07('0x7'));var fs=require('fs');var fs_extra=require(_0x7b07('0x8'));var _=require(_0x7b07('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7b07('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7b07('0xb'));var querystring=require(_0x7b07('0xc'));var Papa=require(_0x7b07('0xd'));var Redis=require(_0x7b07('0xe'));var authService=require(_0x7b07('0xf'));var qs=require(_0x7b07('0x10'));var as=require(_0x7b07('0x11'));var hardwareService=require(_0x7b07('0x12'));var logger=require(_0x7b07('0x13'))('api');var utils=require(_0x7b07('0x14'));var config=require(_0x7b07('0x15'));var licenseUtil=require(_0x7b07('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe825c4,_0x3d73c6){_0x3d73c6=_0x3d73c6||0xcc;return function(_0x9f3404){if(_0x9f3404){return _0xe825c4[_0x7b07('0x17')](_0x3d73c6);}return _0xe825c4['status'](_0x3d73c6)[_0x7b07('0x18')]();};}function respondWithResult(_0x10fc29,_0x44cf4c){_0x44cf4c=_0x44cf4c||0xc8;return function(_0x5ded26){if(_0x5ded26){return _0x10fc29['status'](_0x44cf4c)[_0x7b07('0x19')](_0x5ded26);}};}function respondWithFilteredResult(_0x389f3c,_0x2acc2f){return function(_0x2f6e33){if(_0x2f6e33){var _0x4b7d85=typeof _0x2acc2f['offset']==='undefined'&&typeof _0x2acc2f['limit']===_0x7b07('0x1a');var _0x18311b=_0x2f6e33[_0x7b07('0x1b')];var _0x3aab02=_0x4b7d85?0x0:_0x2acc2f[_0x7b07('0x1c')];var _0x282b2f=_0x4b7d85?_0x2f6e33[_0x7b07('0x1b')]:_0x2acc2f[_0x7b07('0x1c')]+_0x2acc2f[_0x7b07('0x1d')];var _0x2d9278;if(_0x282b2f>=_0x18311b){_0x282b2f=_0x18311b;_0x2d9278=0xc8;}else{_0x2d9278=0xce;}_0x389f3c['status'](_0x2d9278);return _0x389f3c['set']('Content-Range',_0x3aab02+'-'+_0x282b2f+'/'+_0x18311b)[_0x7b07('0x19')](_0x2f6e33);}return null;};}function patchUpdates(_0x3d0f65){return function(_0x2e5e24){try{jsonpatch[_0x7b07('0x1e')](_0x2e5e24,_0x3d0f65,!![]);}catch(_0x2f97ab){return BPromise[_0x7b07('0x1f')](_0x2f97ab);}return _0x2e5e24[_0x7b07('0x20')]();};}function saveUpdates(_0x481812,_0xe41126){return function(_0x44e774){if(_0x44e774){return _0x44e774[_0x7b07('0x21')](_0x481812)['then'](function(_0xf43662){return _0xf43662;});}return null;};}function removeEntity(_0x5ed88d,_0x2b81cf){return function(_0x5e858d){if(_0x5e858d){return _0x5e858d[_0x7b07('0x22')]()[_0x7b07('0x23')](function(){_0x5ed88d[_0x7b07('0x24')](0xcc)[_0x7b07('0x18')]();});}};}function handleEntityNotFound(_0x572e32,_0x3a960c){return function(_0x54943d){if(!_0x54943d){_0x572e32[_0x7b07('0x17')](0x194);}return _0x54943d;};}function handleError(_0x343e21,_0x4ded23){_0x4ded23=_0x4ded23||0x1f4;return function(_0x447119){logger[_0x7b07('0x25')](_0x447119[_0x7b07('0x26')]);if(_0x447119[_0x7b07('0x27')]){delete _0x447119[_0x7b07('0x27')];}_0x343e21[_0x7b07('0x24')](_0x4ded23)[_0x7b07('0x28')](_0x447119);};}exports[_0x7b07('0x29')]=function(_0x4777cc,_0x232f70){var _0xcaeb2a={'raw':!![],'where':{'id':_0x4777cc[_0x7b07('0x2a')]['id']}},_0xa78d19={};_0xa78d19[_0x7b07('0x2b')]=_[_0x7b07('0x2c')](db[_0x7b07('0x2d')]['rawAttributes']);_0xa78d19['query']=_[_0x7b07('0x2c')](_0x4777cc[_0x7b07('0x2e')]);_0xa78d19[_0x7b07('0x2f')]=_['intersection'](_0xa78d19[_0x7b07('0x2b')],_0xa78d19[_0x7b07('0x2e')]);_0xcaeb2a[_0x7b07('0x30')]=_[_0x7b07('0x31')](_0xa78d19['model'],qs[_0x7b07('0x32')](_0x4777cc['query'][_0x7b07('0x32')]));_0xcaeb2a['attributes']=_0xcaeb2a[_0x7b07('0x30')][_0x7b07('0x33')]?_0xcaeb2a['attributes']:_0xa78d19['model'];if(_0x4777cc[_0x7b07('0x2e')]['includeAll']){_0xcaeb2a[_0x7b07('0x34')]=[{'all':!![]}];}_0xcaeb2a=_[_0x7b07('0x35')]({},_0xcaeb2a,_0x4777cc['options']);return db[_0x7b07('0x2d')]['find'](_0xcaeb2a)[_0x7b07('0x23')](handleEntityNotFound(_0x232f70,null))[_0x7b07('0x23')](respondWithResult(_0x232f70,null))[_0x7b07('0x36')](handleError(_0x232f70,null));};exports[_0x7b07('0x21')]=function(_0xcfc128,_0x19c41f){if(_0xcfc128[_0x7b07('0x37')]['id']){delete _0xcfc128[_0x7b07('0x37')]['id'];}return db[_0x7b07('0x2d')][_0x7b07('0x38')]({'where':{'id':_0xcfc128[_0x7b07('0x2a')]['id']}})[_0x7b07('0x23')](handleEntityNotFound(_0x19c41f,null))[_0x7b07('0x23')](saveUpdates(_0xcfc128[_0x7b07('0x37')],null))[_0x7b07('0x23')](respondWithResult(_0x19c41f,null))[_0x7b07('0x36')](handleError(_0x19c41f,null));};exports[_0x7b07('0x22')]=function(_0x409f8d,_0x46f5bd){return db[_0x7b07('0x2d')]['find']({'where':{'id':_0x409f8d[_0x7b07('0x2a')]['id']}})[_0x7b07('0x23')](handleEntityNotFound(_0x46f5bd,null))[_0x7b07('0x23')](removeEntity(_0x46f5bd,null))[_0x7b07('0x36')](handleError(_0x46f5bd,null));};
\ No newline at end of file
+var _0x847d=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','show','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','merge','find','catch','body','params','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x210d00,_0x2a89a3){var _0x53db70=function(_0x5655d1){while(--_0x5655d1){_0x210d00['push'](_0x210d00['shift']());}};_0x53db70(++_0x2a89a3);}(_0x847d,0x14a));var _0xd847=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x847d[_0x466af7];return _0x348c96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd847('0x0'));var zipdir=require(_0xd847('0x1'));var jsonpatch=require(_0xd847('0x2'));var rp=require('request-promise');var moment=require(_0xd847('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd847('0x4'));var util=require(_0xd847('0x5'));var path=require('path');var sox=require(_0xd847('0x6'));var csv=require(_0xd847('0x7'));var ejs=require(_0xd847('0x8'));var fs=require('fs');var fs_extra=require(_0xd847('0x9'));var _=require('lodash');var squel=require(_0xd847('0xa'));var crypto=require(_0xd847('0xb'));var jsforce=require(_0xd847('0xc'));var deskjs=require(_0xd847('0xd'));var toCsv=require(_0xd847('0x7'));var querystring=require(_0xd847('0xe'));var Papa=require(_0xd847('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd847('0x10'));var logger=require(_0xd847('0x11'))(_0xd847('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd847('0x13'));var db=require(_0xd847('0x14'))['db'];function respondWithStatusCode(_0x344d39,_0x2ea8e7){_0x2ea8e7=_0x2ea8e7||0xcc;return function(_0x1e4e26){if(_0x1e4e26){return _0x344d39[_0xd847('0x15')](_0x2ea8e7);}return _0x344d39[_0xd847('0x16')](_0x2ea8e7)[_0xd847('0x17')]();};}function respondWithResult(_0x1c827a,_0x2faa39){_0x2faa39=_0x2faa39||0xc8;return function(_0x3c4805){if(_0x3c4805){return _0x1c827a['status'](_0x2faa39)[_0xd847('0x18')](_0x3c4805);}};}function respondWithFilteredResult(_0x165fbe,_0xd69fc9){return function(_0x404bdb){if(_0x404bdb){var _0x16c79a=typeof _0xd69fc9['offset']===_0xd847('0x19')&&typeof _0xd69fc9[_0xd847('0x1a')]===_0xd847('0x19');var _0x1a01ad=_0x404bdb['count'];var _0x1ef765=_0x16c79a?0x0:_0xd69fc9['offset'];var _0x4b6264=_0x16c79a?_0x404bdb[_0xd847('0x1b')]:_0xd69fc9[_0xd847('0x1c')]+_0xd69fc9[_0xd847('0x1a')];var _0x3905b8;if(_0x4b6264>=_0x1a01ad){_0x4b6264=_0x1a01ad;_0x3905b8=0xc8;}else{_0x3905b8=0xce;}_0x165fbe['status'](_0x3905b8);return _0x165fbe[_0xd847('0x1d')]('Content-Range',_0x1ef765+'-'+_0x4b6264+'/'+_0x1a01ad)['json'](_0x404bdb);}return null;};}function patchUpdates(_0x25e139){return function(_0x2c1091){try{jsonpatch[_0xd847('0x1e')](_0x2c1091,_0x25e139,!![]);}catch(_0x2a57df){return BPromise[_0xd847('0x1f')](_0x2a57df);}return _0x2c1091[_0xd847('0x20')]();};}function saveUpdates(_0x1490a1,_0x39c465){return function(_0x1eaf08){if(_0x1eaf08){return _0x1eaf08[_0xd847('0x21')](_0x1490a1)[_0xd847('0x22')](function(_0x3795fc){return _0x3795fc;});}return null;};}function removeEntity(_0x4a1691,_0x560563){return function(_0x26a787){if(_0x26a787){return _0x26a787[_0xd847('0x23')]()[_0xd847('0x22')](function(){_0x4a1691['status'](0xcc)[_0xd847('0x17')]();});}};}function handleEntityNotFound(_0x246920,_0x74bf0e){return function(_0x64b701){if(!_0x64b701){_0x246920[_0xd847('0x15')](0x194);}return _0x64b701;};}function handleError(_0x5b8e2a,_0x24793c){_0x24793c=_0x24793c||0x1f4;return function(_0x460eba){logger[_0xd847('0x24')](_0x460eba['stack']);if(_0x460eba[_0xd847('0x25')]){delete _0x460eba[_0xd847('0x25')];}_0x5b8e2a[_0xd847('0x16')](_0x24793c)[_0xd847('0x26')](_0x460eba);};}exports[_0xd847('0x27')]=function(_0x3301cd,_0x5c0099){var _0x1e6119={'raw':!![],'where':{'id':_0x3301cd['params']['id']}},_0x5375fe={};_0x5375fe['model']=_[_0xd847('0x28')](db[_0xd847('0x29')][_0xd847('0x2a')]);_0x5375fe[_0xd847('0x2b')]=_[_0xd847('0x28')](_0x3301cd[_0xd847('0x2b')]);_0x5375fe[_0xd847('0x2c')]=_[_0xd847('0x2d')](_0x5375fe[_0xd847('0x2e')],_0x5375fe[_0xd847('0x2b')]);_0x1e6119[_0xd847('0x2f')]=_[_0xd847('0x2d')](_0x5375fe['model'],qs['fields'](_0x3301cd[_0xd847('0x2b')][_0xd847('0x30')]));_0x1e6119[_0xd847('0x2f')]=_0x1e6119[_0xd847('0x2f')][_0xd847('0x31')]?_0x1e6119['attributes']:_0x5375fe[_0xd847('0x2e')];if(_0x3301cd['query'][_0xd847('0x32')]){_0x1e6119['include']=[{'all':!![]}];}_0x1e6119=_[_0xd847('0x33')]({},_0x1e6119,_0x3301cd['options']);return db[_0xd847('0x29')][_0xd847('0x34')](_0x1e6119)['then'](handleEntityNotFound(_0x5c0099,null))['then'](respondWithResult(_0x5c0099,null))[_0xd847('0x35')](handleError(_0x5c0099,null));};exports[_0xd847('0x21')]=function(_0x429bb5,_0x2d2c94){if(_0x429bb5[_0xd847('0x36')]['id']){delete _0x429bb5[_0xd847('0x36')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x429bb5[_0xd847('0x37')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x2d2c94,null))[_0xd847('0x22')](saveUpdates(_0x429bb5['body'],null))[_0xd847('0x22')](respondWithResult(_0x2d2c94,null))[_0xd847('0x35')](handleError(_0x2d2c94,null));};exports['destroy']=function(_0x547794,_0x3e5590){return db['ChatApplication'][_0xd847('0x34')]({'where':{'id':_0x547794[_0xd847('0x37')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x3e5590,null))['then'](removeEntity(_0x3e5590,null))['catch'](handleError(_0x3e5590,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 791e586..39a8224 100644
--- a/server/api/chatApplication/chatApplication.model.js
+++ b/server/api/chatApplication/chatApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaffb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x57169f,_0x2695f6){var _0xb9279=function(_0x4a4e32){while(--_0x4a4e32){_0x57169f['push'](_0x57169f['shift']());}};_0xb9279(++_0x2695f6);}(_0xaffb,0x85));var _0xbaff=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0xaffb[_0x5401ae];return _0x286068;};'use strict';var _=require(_0xbaff('0x0'));var util=require(_0xbaff('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbaff('0x2'));var BPromise=require(_0xbaff('0x3'));var rp=require(_0xbaff('0x4'));var fs=require('fs');var path=require(_0xbaff('0x5'));var rimraf=require(_0xbaff('0x6'));var config=require(_0xbaff('0x7'));var attributes=require(_0xbaff('0x8'));module[_0xbaff('0x9')]=function(_0x2e7034,_0xd86e22){return _0x2e7034[_0xbaff('0xa')](_0xbaff('0xb'),attributes,{'tableName':_0xbaff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbaff('0xd'),'collate':_0xbaff('0xe')});};
\ No newline at end of file
+var _0x3423=['exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x431640,_0x1bd49a){var _0xd9dd62=function(_0x418069){while(--_0x418069){_0x431640['push'](_0x431640['shift']());}};_0xd9dd62(++_0x1bd49a);}(_0x3423,0x1f0));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3342('0x0'));var util=require(_0x3342('0x1'));var logger=require('../../config/logger')(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require('./chatApplication.attributes');module[_0x3342('0x8')]=function(_0x43d55b,_0x3a56ff){return _0x43d55b[_0x3342('0x9')](_0x3342('0xa'),attributes,{'tableName':_0x3342('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3342('0xc'),'collate':_0x3342('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 9b7cf35..03a140b 100644
--- a/server/api/chatApplication/chatApplication.rpc.js
+++ b/server/api/chatApplication/chatApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3864=['error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x13d153,_0x3edda1){var _0x508a08=function(_0x465db7){while(--_0x465db7){_0x13d153['push'](_0x13d153['shift']());}};_0x508a08(++_0x3edda1);}(_0x3864,0x124));var _0x4386=function(_0x3515e4,_0x1b3681){_0x3515e4=_0x3515e4-0x0;var _0x5ce445=_0x3864[_0x3515e4];return _0x5ce445;};'use strict';var _=require(_0x4386('0x0'));var util=require(_0x4386('0x1'));var moment=require(_0x4386('0x2'));var BPromise=require('bluebird');var rs=require(_0x4386('0x3'));var fs=require('fs');var Redis=require(_0x4386('0x4'));var db=require(_0x4386('0x5'))['db'];var utils=require(_0x4386('0x6'));var logger=require('../../config/logger')(_0x4386('0x7'));var config=require(_0x4386('0x8'));var jayson=require(_0x4386('0x9'));var client=jayson['client'][_0x4386('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x749358,_0x4ee23b,_0x4cd0db){return new BPromise(function(_0x115fde,_0x33b78f){return client[_0x4386('0xb')](_0x749358,_0x4cd0db)[_0x4386('0xc')](function(_0x1b6c79){logger[_0x4386('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4ee23b,_0x4386('0xe'));logger[_0x4386('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4ee23b,'request\x20sent',JSON['stringify'](_0x1b6c79));if(_0x1b6c79['error']){if(_0x1b6c79[_0x4386('0x10')][_0x4386('0x11')]===0x1f4){logger[_0x4386('0x10')](_0x4386('0x12'),_0x4ee23b,_0x1b6c79[_0x4386('0x10')][_0x4386('0x13')]);return _0x33b78f(_0x1b6c79[_0x4386('0x10')][_0x4386('0x13')]);}logger[_0x4386('0x10')](_0x4386('0x12'),_0x4ee23b,_0x1b6c79[_0x4386('0x10')]['message']);return _0x115fde(_0x1b6c79[_0x4386('0x10')]['message']);}else{logger[_0x4386('0xd')](_0x4386('0x12'),_0x4ee23b,'request\x20sent');_0x115fde(_0x1b6c79[_0x4386('0x14')]['message']);}})[_0x4386('0x15')](function(_0x5c5ff7){logger['error'](_0x4386('0x12'),_0x4ee23b,_0x5c5ff7);_0x33b78f(_0x5c5ff7);});});}
\ No newline at end of file
+var _0x21e5=['http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','randomstring','ioredis','rpc','client'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x21e5,0x172));var _0x521e=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x21e5[_0x11155f];return _0xd07e48;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x521e('0x0'));var fs=require('fs');var Redis=require(_0x521e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x521e('0x2'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x521e('0x3')][_0x521e('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x469924,_0x79be67,_0x5da1a7){return new BPromise(function(_0x465446,_0x47e015){return client[_0x521e('0x5')](_0x469924,_0x5da1a7)[_0x521e('0x6')](function(_0x3d8726){logger[_0x521e('0x7')]('ChatApplication,\x20%s,\x20%s',_0x79be67,'request\x20sent');logger[_0x521e('0x8')](_0x521e('0x9'),_0x79be67,_0x521e('0xa'),JSON['stringify'](_0x3d8726));if(_0x3d8726[_0x521e('0xb')]){if(_0x3d8726[_0x521e('0xb')][_0x521e('0xc')]===0x1f4){logger[_0x521e('0xb')](_0x521e('0xd'),_0x79be67,_0x3d8726['error'][_0x521e('0xe')]);return _0x47e015(_0x3d8726['error'][_0x521e('0xe')]);}logger[_0x521e('0xb')](_0x521e('0xd'),_0x79be67,_0x3d8726[_0x521e('0xb')][_0x521e('0xe')]);return _0x465446(_0x3d8726[_0x521e('0xb')][_0x521e('0xe')]);}else{logger['info'](_0x521e('0xd'),_0x79be67,_0x521e('0xa'));_0x465446(_0x3d8726[_0x521e('0xf')][_0x521e('0xe')]);}})[_0x521e('0x10')](function(_0x4fb816){logger['error'](_0x521e('0xd'),_0x79be67,_0x4fb816);_0x47e015(_0x4fb816);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 0673885..baa34ba 100644
--- a/server/api/chatApplication/index.js
+++ b/server/api/chatApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3acd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0xaf2f45,_0x23d92a){var _0xa228b8=function(_0x390d4f){while(--_0x390d4f){_0xaf2f45['push'](_0xaf2f45['shift']());}};_0xa228b8(++_0x23d92a);}(_0x3acd,0x14e));var _0xd3ac=function(_0x255a7f,_0x107d6e){_0x255a7f=_0x255a7f-0x0;var _0x57e195=_0x3acd[_0x255a7f];return _0x57e195;};'use strict';var multer=require(_0xd3ac('0x0'));var util=require(_0xd3ac('0x1'));var path=require(_0xd3ac('0x2'));var timeout=require(_0xd3ac('0x3'));var express=require(_0xd3ac('0x4'));var router=express['Router']();var fs_extra=require(_0xd3ac('0x5'));var auth=require(_0xd3ac('0x6'));var interaction=require(_0xd3ac('0x7'));var config=require(_0xd3ac('0x8'));var controller=require(_0xd3ac('0x9'));router[_0xd3ac('0xa')](_0xd3ac('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd3ac('0xc')]('/:id',auth[_0xd3ac('0xd')](),controller[_0xd3ac('0xe')]);router[_0xd3ac('0xf')](_0xd3ac('0xb'),auth[_0xd3ac('0xd')](),controller['destroy']);module[_0xd3ac('0x10')]=router;
\ No newline at end of file
+var _0x568d=['../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x246419,_0x554ea8){var _0x5c54c6=function(_0xc723fc){while(--_0xc723fc){_0x246419['push'](_0x246419['shift']());}};_0x5c54c6(++_0x554ea8);}(_0x568d,0xf9));var _0xd568=function(_0x7a35b1,_0x925417){_0x7a35b1=_0x7a35b1-0x0;var _0x3c4535=_0x568d[_0x7a35b1];return _0x3c4535;};'use strict';var multer=require(_0xd568('0x0'));var util=require(_0xd568('0x1'));var path=require(_0xd568('0x2'));var timeout=require('connect-timeout');var express=require(_0xd568('0x3'));var router=express[_0xd568('0x4')]();var fs_extra=require(_0xd568('0x5'));var auth=require(_0xd568('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd568('0x7'));var controller=require(_0xd568('0x8'));router[_0xd568('0x9')](_0xd568('0xa'),auth[_0xd568('0xb')](),controller[_0xd568('0xc')]);router[_0xd568('0xd')](_0xd568('0xa'),auth[_0xd568('0xb')](),controller['update']);router[_0xd568('0xe')](_0xd568('0xa'),auth[_0xd568('0xb')](),controller[_0xd568('0xf')]);module[_0xd568('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 69664c1..7a2eed1 100644
--- a/server/api/chatGroup/chatGroup.attributes.js
+++ b/server/api/chatGroup/chatGroup.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1dbb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x43dbd8,_0x4f70e6){var _0x4dac4d=function(_0x213056){while(--_0x213056){_0x43dbd8['push'](_0x43dbd8['shift']());}};_0x4dac4d(++_0x4f70e6);}(_0x1dbb,0xed));var _0xb1db=function(_0x317554,_0x53e29f){_0x317554=_0x317554-0x0;var _0x4db3d6=_0x1dbb[_0x317554];return _0x4db3d6;};'use strict';var Sequelize=require(_0xb1db('0x0'));module[_0xb1db('0x1')]={'name':{'type':Sequelize[_0xb1db('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb1db('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4df9=['exports','BOOLEAN'];(function(_0x470f24,_0x2436a9){var _0x2c6fc8=function(_0x3ef190){while(--_0x3ef190){_0x470f24['push'](_0x470f24['shift']());}};_0x2c6fc8(++_0x2436a9);}(_0x4df9,0x19a));var _0x94df=function(_0x1654ec,_0x584374){_0x1654ec=_0x1654ec-0x0;var _0x329fbf=_0x4df9[_0x1654ec];return _0x329fbf;};'use strict';var Sequelize=require('sequelize');module[_0x94df('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x94df('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index e714363..de02b90 100644
--- a/server/api/chatGroup/chatGroup.controller.js
+++ b/server/api/chatGroup/chatGroup.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ca0=['include','findAll','show','params','rawAttributes','options','find','create','body','destroy','describe','catch','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','ChatGroup','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ca0,0x142));var _0x00ca=function(_0x2c48f3,_0x58ec6c){_0x2c48f3=_0x2c48f3-0x0;var _0x234a62=_0x0ca0[_0x2c48f3];return _0x234a62;};'use strict';var emlformat=require(_0x00ca('0x0'));var rimraf=require(_0x00ca('0x1'));var zipdir=require(_0x00ca('0x2'));var jsonpatch=require(_0x00ca('0x3'));var rp=require(_0x00ca('0x4'));var moment=require(_0x00ca('0x5'));var BPromise=require(_0x00ca('0x6'));var Mustache=require('mustache');var util=require(_0x00ca('0x7'));var path=require(_0x00ca('0x8'));var sox=require(_0x00ca('0x9'));var csv=require(_0x00ca('0xa'));var ejs=require(_0x00ca('0xb'));var fs=require('fs');var fs_extra=require(_0x00ca('0xc'));var _=require(_0x00ca('0xd'));var squel=require('squel');var crypto=require(_0x00ca('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x00ca('0xf'));var toCsv=require(_0x00ca('0xa'));var querystring=require('querystring');var Papa=require(_0x00ca('0x10'));var Redis=require(_0x00ca('0x11'));var authService=require(_0x00ca('0x12'));var qs=require(_0x00ca('0x13'));var as=require(_0x00ca('0x14'));var hardwareService=require(_0x00ca('0x15'));var logger=require(_0x00ca('0x16'))(_0x00ca('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x00ca('0x18'));var db=require('../../mysqldb')['db'];config[_0x00ca('0x19')]=_[_0x00ca('0x1a')](config[_0x00ca('0x19')],{'host':_0x00ca('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x00ca('0x19')]));require(_0x00ca('0x1c'))[_0x00ca('0x1d')](socket);function respondWithStatusCode(_0x599f36,_0x2c2841){_0x2c2841=_0x2c2841||0xcc;return function(_0x498762){if(_0x498762){return _0x599f36[_0x00ca('0x1e')](_0x2c2841);}return _0x599f36[_0x00ca('0x1f')](_0x2c2841)[_0x00ca('0x20')]();};}function respondWithResult(_0x568e98,_0x314898){_0x314898=_0x314898||0xc8;return function(_0x4916d2){if(_0x4916d2){return _0x568e98[_0x00ca('0x1f')](_0x314898)[_0x00ca('0x21')](_0x4916d2);}};}function respondWithFilteredResult(_0x55c9cf,_0x7752c8){return function(_0x3849e5){if(_0x3849e5){var _0x1b61ae=typeof _0x7752c8[_0x00ca('0x22')]===_0x00ca('0x23')&&typeof _0x7752c8['limit']===_0x00ca('0x23');var _0x4cc0a9=_0x3849e5[_0x00ca('0x24')];var _0x44ce38=_0x1b61ae?0x0:_0x7752c8[_0x00ca('0x22')];var _0x52c013=_0x1b61ae?_0x3849e5[_0x00ca('0x24')]:_0x7752c8['offset']+_0x7752c8[_0x00ca('0x25')];var _0x10619b;if(_0x52c013>=_0x4cc0a9){_0x52c013=_0x4cc0a9;_0x10619b=0xc8;}else{_0x10619b=0xce;}_0x55c9cf[_0x00ca('0x1f')](_0x10619b);return _0x55c9cf['set'](_0x00ca('0x26'),_0x44ce38+'-'+_0x52c013+'/'+_0x4cc0a9)['json'](_0x3849e5);}return null;};}function patchUpdates(_0x4ae11f){return function(_0x197713){try{jsonpatch[_0x00ca('0x27')](_0x197713,_0x4ae11f,!![]);}catch(_0x1a6d08){return BPromise[_0x00ca('0x28')](_0x1a6d08);}return _0x197713['save']();};}function saveUpdates(_0x1111b5,_0x245176){return function(_0x33cea2){if(_0x33cea2){return _0x33cea2[_0x00ca('0x29')](_0x1111b5)['then'](function(_0x1c1188){return _0x1c1188;});}return null;};}function removeEntity(_0x51ec44,_0x32c023){return function(_0xd1939b){if(_0xd1939b){return _0xd1939b['destroy']()[_0x00ca('0x2a')](function(){_0x51ec44['status'](0xcc)[_0x00ca('0x20')]();});}};}function handleEntityNotFound(_0x20be1f,_0x3d89c1){return function(_0x4bb609){if(!_0x4bb609){_0x20be1f['sendStatus'](0x194);}return _0x4bb609;};}function handleError(_0x1d66d4,_0xe45610){_0xe45610=_0xe45610||0x1f4;return function(_0x187c61){logger[_0x00ca('0x2b')](_0x187c61[_0x00ca('0x2c')]);if(_0x187c61['name']){delete _0x187c61[_0x00ca('0x2d')];}_0x1d66d4['status'](_0xe45610)[_0x00ca('0x2e')](_0x187c61);};}exports[_0x00ca('0x2f')]=function(_0x4decf3,_0x518f0c){var _0x5391b1={},_0xf31194={},_0x33c461={'count':0x0,'rows':[]};var _0x102dec=_['map'](db['ChatGroup']['rawAttributes'],function(_0x226bac){return{'name':_0x226bac[_0x00ca('0x30')],'type':_0x226bac[_0x00ca('0x31')]['key']};});_0xf31194[_0x00ca('0x32')]=_[_0x00ca('0x33')](_0x102dec,_0x00ca('0x2d'));_0xf31194['query']=_[_0x00ca('0x34')](_0x4decf3[_0x00ca('0x35')]);_0xf31194[_0x00ca('0x36')]=_[_0x00ca('0x37')](_0xf31194[_0x00ca('0x32')],_0xf31194[_0x00ca('0x35')]);_0x5391b1['attributes']=_[_0x00ca('0x37')](_0xf31194[_0x00ca('0x32')],qs[_0x00ca('0x38')](_0x4decf3[_0x00ca('0x35')][_0x00ca('0x38')]));_0x5391b1[_0x00ca('0x39')]=_0x5391b1[_0x00ca('0x39')][_0x00ca('0x3a')]?_0x5391b1[_0x00ca('0x39')]:_0xf31194[_0x00ca('0x32')];if(!_0x4decf3[_0x00ca('0x35')][_0x00ca('0x3b')](_0x00ca('0x3c'))){_0x5391b1['limit']=qs[_0x00ca('0x25')](_0x4decf3[_0x00ca('0x35')][_0x00ca('0x25')]);_0x5391b1[_0x00ca('0x22')]=qs[_0x00ca('0x22')](_0x4decf3[_0x00ca('0x35')][_0x00ca('0x22')]);}_0x5391b1[_0x00ca('0x3d')]=qs[_0x00ca('0x3e')](_0x4decf3['query'][_0x00ca('0x3e')]);_0x5391b1[_0x00ca('0x3f')]=qs[_0x00ca('0x36')](_[_0x00ca('0x40')](_0x4decf3['query'],_0xf31194[_0x00ca('0x36')]),_0x102dec);if(_0x4decf3[_0x00ca('0x35')][_0x00ca('0x41')]){_0x5391b1[_0x00ca('0x3f')]=_['merge'](_0x5391b1['where'],{'$or':_['map'](_0x102dec,function(_0x45ff7e){if(_0x45ff7e[_0x00ca('0x31')]!==_0x00ca('0x42')){var _0xd7b2e2={};_0xd7b2e2[_0x45ff7e[_0x00ca('0x2d')]]={'$like':'%'+_0x4decf3[_0x00ca('0x35')][_0x00ca('0x41')]+'%'};return _0xd7b2e2;}})});}_0x5391b1=_[_0x00ca('0x43')]({},_0x5391b1,_0x4decf3['options']);var _0x5c090a={'where':_0x5391b1[_0x00ca('0x3f')]};return db[_0x00ca('0x44')][_0x00ca('0x24')](_0x5c090a)[_0x00ca('0x2a')](function(_0x7c901){_0x33c461[_0x00ca('0x24')]=_0x7c901;if(_0x4decf3[_0x00ca('0x35')][_0x00ca('0x45')]){_0x5391b1[_0x00ca('0x46')]=[{'all':!![]}];}return db[_0x00ca('0x44')][_0x00ca('0x47')](_0x5391b1);})[_0x00ca('0x2a')](function(_0x1193b4){_0x33c461['rows']=_0x1193b4;return _0x33c461;})[_0x00ca('0x2a')](respondWithFilteredResult(_0x518f0c,_0x5391b1))['catch'](handleError(_0x518f0c,null));};exports[_0x00ca('0x48')]=function(_0x360315,_0x5d58b5){var _0x37a040={'raw':!![],'where':{'id':_0x360315[_0x00ca('0x49')]['id']}},_0x47ca7c={};_0x47ca7c[_0x00ca('0x32')]=_[_0x00ca('0x34')](db['ChatGroup'][_0x00ca('0x4a')]);_0x47ca7c[_0x00ca('0x35')]=_[_0x00ca('0x34')](_0x360315[_0x00ca('0x35')]);_0x47ca7c[_0x00ca('0x36')]=_[_0x00ca('0x37')](_0x47ca7c['model'],_0x47ca7c[_0x00ca('0x35')]);_0x37a040['attributes']=_['intersection'](_0x47ca7c[_0x00ca('0x32')],qs[_0x00ca('0x38')](_0x360315[_0x00ca('0x35')][_0x00ca('0x38')]));_0x37a040[_0x00ca('0x39')]=_0x37a040[_0x00ca('0x39')][_0x00ca('0x3a')]?_0x37a040[_0x00ca('0x39')]:_0x47ca7c[_0x00ca('0x32')];if(_0x360315[_0x00ca('0x35')]['includeAll']){_0x37a040['include']=[{'all':!![]}];}_0x37a040=_[_0x00ca('0x43')]({},_0x37a040,_0x360315[_0x00ca('0x4b')]);return db['ChatGroup'][_0x00ca('0x4c')](_0x37a040)[_0x00ca('0x2a')](handleEntityNotFound(_0x5d58b5,null))[_0x00ca('0x2a')](respondWithResult(_0x5d58b5,null))['catch'](handleError(_0x5d58b5,null));};exports[_0x00ca('0x4d')]=function(_0xabe623,_0x1d5af1){return db[_0x00ca('0x44')][_0x00ca('0x4d')](_0xabe623[_0x00ca('0x4e')],{})[_0x00ca('0x2a')](respondWithResult(_0x1d5af1,0xc9))['catch'](handleError(_0x1d5af1,null));};exports[_0x00ca('0x29')]=function(_0x327423,_0x276d98){if(_0x327423[_0x00ca('0x4e')]['id']){delete _0x327423['body']['id'];}return db[_0x00ca('0x44')]['find']({'where':{'id':_0x327423[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x276d98,null))[_0x00ca('0x2a')](saveUpdates(_0x327423['body'],null))[_0x00ca('0x2a')](respondWithResult(_0x276d98,null))['catch'](handleError(_0x276d98,null));};exports[_0x00ca('0x4f')]=function(_0x2f221a,_0x144949){return db[_0x00ca('0x44')][_0x00ca('0x4c')]({'where':{'id':_0x2f221a[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x144949,null))[_0x00ca('0x2a')](removeEntity(_0x144949,null))['catch'](handleError(_0x144949,null));};exports[_0x00ca('0x50')]=function(_0x5252e5,_0x3f82c3){return db[_0x00ca('0x44')][_0x00ca('0x50')]()[_0x00ca('0x2a')](respondWithResult(_0x3f82c3,null))[_0x00ca('0x51')](handleError(_0x3f82c3,null));};exports[_0x00ca('0x52')]=function(_0x3ebb0c,_0x362b8c,_0x3c15d3){return db[_0x00ca('0x53')][_0x00ca('0x24')]({'where':{'ChatGroupId':_0x3ebb0c[_0x00ca('0x49')]['id'],'ToId':_0x3ebb0c[_0x00ca('0x54')]['id'],'read':![]}})['then'](function(_0x2c0095){return{'id':_[_0x00ca('0x55')](_0x3ebb0c[_0x00ca('0x49')]['id']),'count':_0x2c0095};})[_0x00ca('0x2a')](respondWithResult(_0x362b8c,null))[_0x00ca('0x51')](handleError(_0x362b8c,null));};exports[_0x00ca('0x56')]=function(_0x54f5fe,_0x6071dc,_0x34ab37){return db[_0x00ca('0x44')][_0x00ca('0x4c')]({'where':{'id':_0x54f5fe['params']['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x6071dc,null))[_0x00ca('0x2a')](function(_0x19aa69){if(_0x19aa69){return _0x19aa69['addMembers'](_0x54f5fe['body'][_0x00ca('0x57')],_[_0x00ca('0x58')](_0x54f5fe[_0x00ca('0x4e')],[_0x00ca('0x57'),'id'])||{});}})[_0x00ca('0x2a')](respondWithResult(_0x6071dc,null))[_0x00ca('0x51')](handleError(_0x6071dc,null));};exports[_0x00ca('0x59')]=function(_0x4e190f,_0x2bb36a,_0x585e0a){var _0x36302d={};var _0x643c24={};var _0x4f58c1;var _0x24e054;return db[_0x00ca('0x44')]['findOne']({'where':{'id':_0x4e190f[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x2bb36a,null))[_0x00ca('0x2a')](function(_0x238038){if(_0x238038){_0x4f58c1=_0x238038;_0x643c24[_0x00ca('0x32')]=_['keys'](db['User'][_0x00ca('0x4a')]);_0x643c24[_0x00ca('0x35')]=_['keys'](_0x4e190f[_0x00ca('0x35')]);_0x643c24[_0x00ca('0x36')]=_['intersection'](_0x643c24[_0x00ca('0x32')],_0x643c24[_0x00ca('0x35')]);_0x36302d[_0x00ca('0x39')]=_['intersection'](_0x643c24[_0x00ca('0x32')],qs[_0x00ca('0x38')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x38')]));_0x36302d[_0x00ca('0x39')]=_0x36302d['attributes']['length']?_0x36302d[_0x00ca('0x39')]:_0x643c24[_0x00ca('0x32')];_0x36302d[_0x00ca('0x3d')]=qs[_0x00ca('0x3e')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x3e')]);_0x36302d[_0x00ca('0x3f')]=qs[_0x00ca('0x36')](_[_0x00ca('0x40')](_0x4e190f[_0x00ca('0x35')],_0x643c24[_0x00ca('0x36')]));if(_0x4e190f[_0x00ca('0x35')][_0x00ca('0x41')]){_0x36302d['where']=_[_0x00ca('0x43')](_0x36302d[_0x00ca('0x3f')],{'$or':_['map'](_0x36302d[_0x00ca('0x39')],function(_0x305d7b){var _0x306ce8={};_0x306ce8[_0x305d7b]={'$like':'%'+_0x4e190f[_0x00ca('0x35')][_0x00ca('0x41')]+'%'};return _0x306ce8;})});}_0x36302d=_[_0x00ca('0x43')]({},_0x36302d,_0x4e190f[_0x00ca('0x4b')]);return _0x4f58c1[_0x00ca('0x59')](_0x36302d);}})['then'](function(_0x413e3f){if(_0x413e3f){_0x24e054=_0x413e3f['length'];if(!_0x4e190f[_0x00ca('0x35')][_0x00ca('0x3b')](_0x00ca('0x3c'))){_0x36302d['limit']=qs[_0x00ca('0x25')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x25')]);_0x36302d[_0x00ca('0x22')]=qs[_0x00ca('0x22')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x22')]);}return _0x4f58c1['getMembers'](_0x36302d);}})[_0x00ca('0x2a')](function(_0x1008f2){if(_0x1008f2){return _0x1008f2?{'count':_0x24e054,'rows':_0x1008f2}:null;}})[_0x00ca('0x2a')](respondWithResult(_0x2bb36a,null))[_0x00ca('0x51')](handleError(_0x2bb36a,null));};exports['removeMembers']=function(_0x297d5e,_0x114e38,_0x41b315){return db[_0x00ca('0x44')]['find']({'where':{'id':_0x297d5e[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x114e38,null))['then'](function(_0x22b3b3){if(_0x22b3b3){return _0x22b3b3[_0x00ca('0x5a')](_0x297d5e[_0x00ca('0x35')][_0x00ca('0x57')]);}})['then'](respondWithStatusCode(_0x114e38,null))[_0x00ca('0x51')](handleError(_0x114e38,null));};exports[_0x00ca('0x5b')]=function(_0x356544,_0x353a66,_0x41441a){if(_0x356544[_0x00ca('0x4e')]['id']){delete _0x356544['body']['id'];}return db[_0x00ca('0x44')]['find']({'where':{'id':_0x356544[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x353a66,null))['then'](function(_0x43e895){if(_0x43e895){_0x356544['body'][_0x00ca('0x5c')]=_0x43e895['id'];return db[_0x00ca('0x53')]['create'](_0x356544['body']);}})[_0x00ca('0x2a')](respondWithResult(_0x353a66,null))[_0x00ca('0x51')](handleError(_0x353a66,null));};exports[_0x00ca('0x5d')]=function(_0x4e3018,_0x47c260,_0x168648){var _0xe3b893={};var _0x37340a={};var _0x4c4397;var _0x4c4a94;return db[_0x00ca('0x44')][_0x00ca('0x5e')]({'where':{'id':_0x4e3018[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x47c260,null))[_0x00ca('0x2a')](function(_0x3ce5d7){if(_0x3ce5d7){_0x4c4397=_0x3ce5d7;_0x37340a[_0x00ca('0x32')]=_['keys'](db['ChatInternalMessage'][_0x00ca('0x4a')]);_0x37340a['query']=_[_0x00ca('0x34')](_0x4e3018['query']);_0x37340a['filters']=_[_0x00ca('0x37')](_0x37340a[_0x00ca('0x32')],_0x37340a[_0x00ca('0x35')]);_0xe3b893[_0x00ca('0x39')]=_['intersection'](_0x37340a['model'],qs[_0x00ca('0x38')](_0x4e3018[_0x00ca('0x35')][_0x00ca('0x38')]));_0xe3b893[_0x00ca('0x39')]=_0xe3b893[_0x00ca('0x39')][_0x00ca('0x3a')]?_0xe3b893[_0x00ca('0x39')]:_0x37340a[_0x00ca('0x32')];_0xe3b893[_0x00ca('0x3d')]=qs['sort'](_0x4e3018[_0x00ca('0x35')][_0x00ca('0x3e')]);_0xe3b893[_0x00ca('0x3f')]=qs[_0x00ca('0x36')](_[_0x00ca('0x40')](_0x4e3018[_0x00ca('0x35')],_0x37340a[_0x00ca('0x36')]));if(_0x4e3018[_0x00ca('0x35')]['filter']){_0xe3b893[_0x00ca('0x3f')]=_['merge'](_0xe3b893[_0x00ca('0x3f')],{'$or':_[_0x00ca('0x33')](_0xe3b893[_0x00ca('0x39')],function(_0x44c401){var _0x191fe3={};_0x191fe3[_0x44c401]={'$like':'%'+_0x4e3018['query']['filter']+'%'};return _0x191fe3;})});}if(_0x4e3018['query'][_0x00ca('0x5f')]){var _0xa169f6=_0x4e3018[_0x00ca('0x35')][_0x00ca('0x5f')]['split'](',');var _0x534df9={};_0x534df9[_0xa169f6[0x0]]={'$gte':moment(_0xa169f6[0x1])[_0x00ca('0x60')](_0x00ca('0x61'))};_0xe3b893[_0x00ca('0x3f')]=_[_0x00ca('0x43')](_0xe3b893[_0x00ca('0x3f')],_0x534df9);}_0xe3b893=_[_0x00ca('0x43')]({},_0xe3b893,_0x4e3018[_0x00ca('0x4b')]);return _0x4c4397[_0x00ca('0x5d')](_0xe3b893);}})[_0x00ca('0x2a')](function(_0xcebd8){if(_0xcebd8){_0x4c4a94=_0xcebd8[_0x00ca('0x3a')];if(!_0x4e3018[_0x00ca('0x35')][_0x00ca('0x3b')](_0x00ca('0x3c'))){_0xe3b893[_0x00ca('0x25')]=qs[_0x00ca('0x25')](_0x4e3018['query']['limit']);_0xe3b893[_0x00ca('0x22')]=qs['offset'](_0x4e3018[_0x00ca('0x35')][_0x00ca('0x22')]);}return _0x4c4397[_0x00ca('0x5d')](_0xe3b893);}})[_0x00ca('0x2a')](function(_0x175caf){if(_0x175caf){return _0x175caf?{'count':_0x4c4a94,'rows':_0x175caf}:null;}})['then'](respondWithResult(_0x47c260,null))['catch'](handleError(_0x47c260,null));};
\ No newline at end of file
+var _0xed08=['find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','removeMembers','getMessages','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','length','include'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xed08,0x7a));var _0x8ed0=function(_0x54e29a,_0x1c9650){_0x54e29a=_0x54e29a-0x0;var _0x49bda7=_0xed08[_0x54e29a];return _0x49bda7;};'use strict';var emlformat=require(_0x8ed0('0x0'));var rimraf=require(_0x8ed0('0x1'));var zipdir=require(_0x8ed0('0x2'));var jsonpatch=require(_0x8ed0('0x3'));var rp=require('request-promise');var moment=require(_0x8ed0('0x4'));var BPromise=require(_0x8ed0('0x5'));var Mustache=require('mustache');var util=require(_0x8ed0('0x6'));var path=require('path');var sox=require(_0x8ed0('0x7'));var csv=require(_0x8ed0('0x8'));var ejs=require(_0x8ed0('0x9'));var fs=require('fs');var fs_extra=require(_0x8ed0('0xa'));var _=require('lodash');var squel=require(_0x8ed0('0xb'));var crypto=require('crypto');var jsforce=require(_0x8ed0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8ed0('0xd'));var Papa=require(_0x8ed0('0xe'));var Redis=require(_0x8ed0('0xf'));var authService=require(_0x8ed0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ed0('0x11'));var hardwareService=require(_0x8ed0('0x12'));var logger=require(_0x8ed0('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8ed0('0x14'));var licenseUtil=require(_0x8ed0('0x15'));var db=require(_0x8ed0('0x16'))['db'];config[_0x8ed0('0x17')]=_[_0x8ed0('0x18')](config['redis'],{'host':_0x8ed0('0x19'),'port':0x18eb});var socket=require(_0x8ed0('0x1a'))(new Redis(config[_0x8ed0('0x17')]));require(_0x8ed0('0x1b'))['register'](socket);function respondWithStatusCode(_0x1aa3ac,_0x51e341){_0x51e341=_0x51e341||0xcc;return function(_0x5ead40){if(_0x5ead40){return _0x1aa3ac[_0x8ed0('0x1c')](_0x51e341);}return _0x1aa3ac[_0x8ed0('0x1d')](_0x51e341)[_0x8ed0('0x1e')]();};}function respondWithResult(_0x4644c4,_0x4dfb4b){_0x4dfb4b=_0x4dfb4b||0xc8;return function(_0x734a42){if(_0x734a42){return _0x4644c4['status'](_0x4dfb4b)['json'](_0x734a42);}};}function respondWithFilteredResult(_0x39c61c,_0x261b58){return function(_0x340a4a){if(_0x340a4a){var _0x2da6ce=typeof _0x261b58[_0x8ed0('0x1f')]===_0x8ed0('0x20')&&typeof _0x261b58['limit']==='undefined';var _0x1c6163=_0x340a4a['count'];var _0x524d7d=_0x2da6ce?0x0:_0x261b58[_0x8ed0('0x1f')];var _0x4768a3=_0x2da6ce?_0x340a4a[_0x8ed0('0x21')]:_0x261b58[_0x8ed0('0x1f')]+_0x261b58[_0x8ed0('0x22')];var _0x489ca0;if(_0x4768a3>=_0x1c6163){_0x4768a3=_0x1c6163;_0x489ca0=0xc8;}else{_0x489ca0=0xce;}_0x39c61c[_0x8ed0('0x1d')](_0x489ca0);return _0x39c61c[_0x8ed0('0x23')](_0x8ed0('0x24'),_0x524d7d+'-'+_0x4768a3+'/'+_0x1c6163)[_0x8ed0('0x25')](_0x340a4a);}return null;};}function patchUpdates(_0x587536){return function(_0x4d0111){try{jsonpatch['apply'](_0x4d0111,_0x587536,!![]);}catch(_0x434107){return BPromise[_0x8ed0('0x26')](_0x434107);}return _0x4d0111[_0x8ed0('0x27')]();};}function saveUpdates(_0x367fbf,_0x1ad4d5){return function(_0x41e011){if(_0x41e011){return _0x41e011['update'](_0x367fbf)[_0x8ed0('0x28')](function(_0x1297ec){return _0x1297ec;});}return null;};}function removeEntity(_0x3f015f,_0x41a340){return function(_0x4d7f62){if(_0x4d7f62){return _0x4d7f62[_0x8ed0('0x29')]()[_0x8ed0('0x28')](function(){_0x3f015f[_0x8ed0('0x1d')](0xcc)[_0x8ed0('0x1e')]();});}};}function handleEntityNotFound(_0x1045cb,_0x360ca5){return function(_0x55ce28){if(!_0x55ce28){_0x1045cb[_0x8ed0('0x1c')](0x194);}return _0x55ce28;};}function handleError(_0x389ac9,_0x33310f){_0x33310f=_0x33310f||0x1f4;return function(_0x329a17){logger[_0x8ed0('0x2a')](_0x329a17['stack']);if(_0x329a17[_0x8ed0('0x2b')]){delete _0x329a17[_0x8ed0('0x2b')];}_0x389ac9[_0x8ed0('0x1d')](_0x33310f)[_0x8ed0('0x2c')](_0x329a17);};}exports[_0x8ed0('0x2d')]=function(_0x47db4a,_0x2983db){var _0x5e93bc={},_0x1813d7={},_0x16b23a={'count':0x0,'rows':[]};var _0x4a2ebe=_[_0x8ed0('0x2e')](db[_0x8ed0('0x2f')][_0x8ed0('0x30')],function(_0x38d4a9){return{'name':_0x38d4a9[_0x8ed0('0x31')],'type':_0x38d4a9[_0x8ed0('0x32')][_0x8ed0('0x33')]};});_0x1813d7[_0x8ed0('0x34')]=_['map'](_0x4a2ebe,_0x8ed0('0x2b'));_0x1813d7['query']=_[_0x8ed0('0x35')](_0x47db4a['query']);_0x1813d7[_0x8ed0('0x36')]=_[_0x8ed0('0x37')](_0x1813d7[_0x8ed0('0x34')],_0x1813d7[_0x8ed0('0x38')]);_0x5e93bc[_0x8ed0('0x39')]=_[_0x8ed0('0x37')](_0x1813d7['model'],qs['fields'](_0x47db4a[_0x8ed0('0x38')][_0x8ed0('0x3a')]));_0x5e93bc[_0x8ed0('0x39')]=_0x5e93bc[_0x8ed0('0x39')]['length']?_0x5e93bc['attributes']:_0x1813d7[_0x8ed0('0x34')];if(!_0x47db4a['query'][_0x8ed0('0x3b')](_0x8ed0('0x3c'))){_0x5e93bc[_0x8ed0('0x22')]=qs[_0x8ed0('0x22')](_0x47db4a[_0x8ed0('0x38')][_0x8ed0('0x22')]);_0x5e93bc['offset']=qs[_0x8ed0('0x1f')](_0x47db4a['query']['offset']);}_0x5e93bc['order']=qs[_0x8ed0('0x3d')](_0x47db4a['query'][_0x8ed0('0x3d')]);_0x5e93bc[_0x8ed0('0x3e')]=qs[_0x8ed0('0x36')](_['pick'](_0x47db4a[_0x8ed0('0x38')],_0x1813d7[_0x8ed0('0x36')]),_0x4a2ebe);if(_0x47db4a[_0x8ed0('0x38')]['filter']){_0x5e93bc[_0x8ed0('0x3e')]=_['merge'](_0x5e93bc[_0x8ed0('0x3e')],{'$or':_[_0x8ed0('0x2e')](_0x4a2ebe,function(_0x1854d2){if(_0x1854d2['type']!==_0x8ed0('0x3f')){var _0xe6863b={};_0xe6863b[_0x1854d2[_0x8ed0('0x2b')]]={'$like':'%'+_0x47db4a[_0x8ed0('0x38')]['filter']+'%'};return _0xe6863b;}})});}_0x5e93bc=_[_0x8ed0('0x40')]({},_0x5e93bc,_0x47db4a[_0x8ed0('0x41')]);var _0x14e687={'where':_0x5e93bc[_0x8ed0('0x3e')]};return db[_0x8ed0('0x2f')][_0x8ed0('0x21')](_0x14e687)[_0x8ed0('0x28')](function(_0x580a30){_0x16b23a[_0x8ed0('0x21')]=_0x580a30;if(_0x47db4a[_0x8ed0('0x38')][_0x8ed0('0x42')]){_0x5e93bc['include']=[{'all':!![]}];}return db[_0x8ed0('0x2f')][_0x8ed0('0x43')](_0x5e93bc);})[_0x8ed0('0x28')](function(_0x1857f9){_0x16b23a[_0x8ed0('0x44')]=_0x1857f9;return _0x16b23a;})[_0x8ed0('0x28')](respondWithFilteredResult(_0x2983db,_0x5e93bc))[_0x8ed0('0x45')](handleError(_0x2983db,null));};exports[_0x8ed0('0x46')]=function(_0x1e5d58,_0x1a6bd8){var _0x10c2a6={'raw':!![],'where':{'id':_0x1e5d58[_0x8ed0('0x47')]['id']}},_0x202811={};_0x202811[_0x8ed0('0x34')]=_[_0x8ed0('0x35')](db[_0x8ed0('0x2f')][_0x8ed0('0x30')]);_0x202811['query']=_[_0x8ed0('0x35')](_0x1e5d58[_0x8ed0('0x38')]);_0x202811[_0x8ed0('0x36')]=_['intersection'](_0x202811[_0x8ed0('0x34')],_0x202811['query']);_0x10c2a6[_0x8ed0('0x39')]=_[_0x8ed0('0x37')](_0x202811[_0x8ed0('0x34')],qs['fields'](_0x1e5d58['query'][_0x8ed0('0x3a')]));_0x10c2a6[_0x8ed0('0x39')]=_0x10c2a6[_0x8ed0('0x39')][_0x8ed0('0x48')]?_0x10c2a6[_0x8ed0('0x39')]:_0x202811[_0x8ed0('0x34')];if(_0x1e5d58[_0x8ed0('0x38')]['includeAll']){_0x10c2a6[_0x8ed0('0x49')]=[{'all':!![]}];}_0x10c2a6=_['merge']({},_0x10c2a6,_0x1e5d58[_0x8ed0('0x41')]);return db['ChatGroup'][_0x8ed0('0x4a')](_0x10c2a6)[_0x8ed0('0x28')](handleEntityNotFound(_0x1a6bd8,null))[_0x8ed0('0x28')](respondWithResult(_0x1a6bd8,null))[_0x8ed0('0x45')](handleError(_0x1a6bd8,null));};exports[_0x8ed0('0x4b')]=function(_0x1d7851,_0x5c37af){return db['ChatGroup'][_0x8ed0('0x4b')](_0x1d7851[_0x8ed0('0x4c')],{})[_0x8ed0('0x28')](respondWithResult(_0x5c37af,0xc9))[_0x8ed0('0x45')](handleError(_0x5c37af,null));};exports[_0x8ed0('0x4d')]=function(_0x255f7f,_0x4cb4ca){if(_0x255f7f['body']['id']){delete _0x255f7f[_0x8ed0('0x4c')]['id'];}return db[_0x8ed0('0x2f')]['find']({'where':{'id':_0x255f7f['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x4cb4ca,null))[_0x8ed0('0x28')](saveUpdates(_0x255f7f['body'],null))['then'](respondWithResult(_0x4cb4ca,null))['catch'](handleError(_0x4cb4ca,null));};exports['destroy']=function(_0x193abb,_0x1b7d9e){return db[_0x8ed0('0x2f')][_0x8ed0('0x4a')]({'where':{'id':_0x193abb[_0x8ed0('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b7d9e,null))['then'](removeEntity(_0x1b7d9e,null))['catch'](handleError(_0x1b7d9e,null));};exports[_0x8ed0('0x4e')]=function(_0x119fae,_0x5c1f1c){return db[_0x8ed0('0x2f')][_0x8ed0('0x4e')]()['then'](respondWithResult(_0x5c1f1c,null))['catch'](handleError(_0x5c1f1c,null));};exports[_0x8ed0('0x4f')]=function(_0x3a42ad,_0x380ac8,_0x32f3b1){return db[_0x8ed0('0x50')][_0x8ed0('0x21')]({'where':{'ChatGroupId':_0x3a42ad['params']['id'],'ToId':_0x3a42ad[_0x8ed0('0x51')]['id'],'read':![]}})[_0x8ed0('0x28')](function(_0x45e51a){return{'id':_[_0x8ed0('0x52')](_0x3a42ad[_0x8ed0('0x47')]['id']),'count':_0x45e51a};})['then'](respondWithResult(_0x380ac8,null))[_0x8ed0('0x45')](handleError(_0x380ac8,null));};exports[_0x8ed0('0x53')]=function(_0x3067e4,_0x271a6c,_0x4aaf1a){return db[_0x8ed0('0x2f')]['find']({'where':{'id':_0x3067e4['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x271a6c,null))[_0x8ed0('0x28')](function(_0x57f82a){if(_0x57f82a){return _0x57f82a['addMembers'](_0x3067e4[_0x8ed0('0x4c')][_0x8ed0('0x54')],_[_0x8ed0('0x55')](_0x3067e4['body'],[_0x8ed0('0x54'),'id'])||{});}})[_0x8ed0('0x28')](respondWithResult(_0x271a6c,null))['catch'](handleError(_0x271a6c,null));};exports[_0x8ed0('0x56')]=function(_0x15bdaa,_0x21f9e1,_0x137ef2){var _0x56c4a7={};var _0x57e080={};var _0x24fe7c;var _0x4c0ed5;return db['ChatGroup'][_0x8ed0('0x57')]({'where':{'id':_0x15bdaa['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x21f9e1,null))[_0x8ed0('0x28')](function(_0x349dd7){if(_0x349dd7){_0x24fe7c=_0x349dd7;_0x57e080['model']=_[_0x8ed0('0x35')](db[_0x8ed0('0x58')][_0x8ed0('0x30')]);_0x57e080[_0x8ed0('0x38')]=_[_0x8ed0('0x35')](_0x15bdaa[_0x8ed0('0x38')]);_0x57e080[_0x8ed0('0x36')]=_[_0x8ed0('0x37')](_0x57e080[_0x8ed0('0x34')],_0x57e080[_0x8ed0('0x38')]);_0x56c4a7[_0x8ed0('0x39')]=_[_0x8ed0('0x37')](_0x57e080[_0x8ed0('0x34')],qs[_0x8ed0('0x3a')](_0x15bdaa[_0x8ed0('0x38')][_0x8ed0('0x3a')]));_0x56c4a7[_0x8ed0('0x39')]=_0x56c4a7[_0x8ed0('0x39')][_0x8ed0('0x48')]?_0x56c4a7['attributes']:_0x57e080[_0x8ed0('0x34')];_0x56c4a7[_0x8ed0('0x59')]=qs['sort'](_0x15bdaa[_0x8ed0('0x38')]['sort']);_0x56c4a7[_0x8ed0('0x3e')]=qs[_0x8ed0('0x36')](_['pick'](_0x15bdaa[_0x8ed0('0x38')],_0x57e080[_0x8ed0('0x36')]));if(_0x15bdaa['query']['filter']){_0x56c4a7['where']=_[_0x8ed0('0x40')](_0x56c4a7['where'],{'$or':_[_0x8ed0('0x2e')](_0x56c4a7[_0x8ed0('0x39')],function(_0x3d1d47){var _0x21d3f7={};_0x21d3f7[_0x3d1d47]={'$like':'%'+_0x15bdaa[_0x8ed0('0x38')]['filter']+'%'};return _0x21d3f7;})});}_0x56c4a7=_[_0x8ed0('0x40')]({},_0x56c4a7,_0x15bdaa[_0x8ed0('0x41')]);return _0x24fe7c[_0x8ed0('0x56')](_0x56c4a7);}})[_0x8ed0('0x28')](function(_0x2d89e7){if(_0x2d89e7){_0x4c0ed5=_0x2d89e7[_0x8ed0('0x48')];if(!_0x15bdaa['query'][_0x8ed0('0x3b')](_0x8ed0('0x3c'))){_0x56c4a7[_0x8ed0('0x22')]=qs[_0x8ed0('0x22')](_0x15bdaa[_0x8ed0('0x38')]['limit']);_0x56c4a7[_0x8ed0('0x1f')]=qs['offset'](_0x15bdaa[_0x8ed0('0x38')][_0x8ed0('0x1f')]);}return _0x24fe7c[_0x8ed0('0x56')](_0x56c4a7);}})['then'](function(_0x27a577){if(_0x27a577){return _0x27a577?{'count':_0x4c0ed5,'rows':_0x27a577}:null;}})[_0x8ed0('0x28')](respondWithResult(_0x21f9e1,null))['catch'](handleError(_0x21f9e1,null));};exports[_0x8ed0('0x5a')]=function(_0x3dd1ac,_0xca2045,_0xd6da19){return db[_0x8ed0('0x2f')][_0x8ed0('0x4a')]({'where':{'id':_0x3dd1ac[_0x8ed0('0x47')]['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0xca2045,null))[_0x8ed0('0x28')](function(_0x172bbb){if(_0x172bbb){return _0x172bbb[_0x8ed0('0x5a')](_0x3dd1ac['query'][_0x8ed0('0x54')]);}})[_0x8ed0('0x28')](respondWithStatusCode(_0xca2045,null))[_0x8ed0('0x45')](handleError(_0xca2045,null));};exports['addMessage']=function(_0x16b0f9,_0x7a5396,_0x3719d6){if(_0x16b0f9[_0x8ed0('0x4c')]['id']){delete _0x16b0f9[_0x8ed0('0x4c')]['id'];}return db[_0x8ed0('0x2f')][_0x8ed0('0x4a')]({'where':{'id':_0x16b0f9['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x7a5396,null))[_0x8ed0('0x28')](function(_0x3a6b92){if(_0x3a6b92){_0x16b0f9['body']['ChatGroupId']=_0x3a6b92['id'];return db[_0x8ed0('0x50')]['create'](_0x16b0f9['body']);}})['then'](respondWithResult(_0x7a5396,null))[_0x8ed0('0x45')](handleError(_0x7a5396,null));};exports[_0x8ed0('0x5b')]=function(_0x9ba15,_0x54511a,_0x99334f){var _0x59a495={};var _0x3f8115={};var _0xfff855;var _0x287f34;return db['ChatGroup']['findOne']({'where':{'id':_0x9ba15[_0x8ed0('0x47')]['id']}})['then'](handleEntityNotFound(_0x54511a,null))['then'](function(_0x377d19){if(_0x377d19){_0xfff855=_0x377d19;_0x3f8115['model']=_[_0x8ed0('0x35')](db['ChatInternalMessage'][_0x8ed0('0x30')]);_0x3f8115[_0x8ed0('0x38')]=_[_0x8ed0('0x35')](_0x9ba15['query']);_0x3f8115['filters']=_[_0x8ed0('0x37')](_0x3f8115[_0x8ed0('0x34')],_0x3f8115['query']);_0x59a495['attributes']=_[_0x8ed0('0x37')](_0x3f8115[_0x8ed0('0x34')],qs['fields'](_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x3a')]));_0x59a495['attributes']=_0x59a495['attributes'][_0x8ed0('0x48')]?_0x59a495[_0x8ed0('0x39')]:_0x3f8115['model'];_0x59a495[_0x8ed0('0x59')]=qs[_0x8ed0('0x3d')](_0x9ba15['query'][_0x8ed0('0x3d')]);_0x59a495[_0x8ed0('0x3e')]=qs['filters'](_[_0x8ed0('0x5c')](_0x9ba15[_0x8ed0('0x38')],_0x3f8115['filters']));if(_0x9ba15['query'][_0x8ed0('0x5d')]){_0x59a495[_0x8ed0('0x3e')]=_['merge'](_0x59a495[_0x8ed0('0x3e')],{'$or':_['map'](_0x59a495[_0x8ed0('0x39')],function(_0x387d70){var _0x297e15={};_0x297e15[_0x387d70]={'$like':'%'+_0x9ba15['query']['filter']+'%'};return _0x297e15;})});}if(_0x9ba15['query'][_0x8ed0('0x5e')]){var _0x1b04ee=_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x5e')][_0x8ed0('0x5f')](',');var _0x4ab876={};_0x4ab876[_0x1b04ee[0x0]]={'$gte':moment(_0x1b04ee[0x1])[_0x8ed0('0x60')](_0x8ed0('0x61'))};_0x59a495[_0x8ed0('0x3e')]=_[_0x8ed0('0x40')](_0x59a495[_0x8ed0('0x3e')],_0x4ab876);}_0x59a495=_[_0x8ed0('0x40')]({},_0x59a495,_0x9ba15[_0x8ed0('0x41')]);return _0xfff855[_0x8ed0('0x5b')](_0x59a495);}})['then'](function(_0x381d8e){if(_0x381d8e){_0x287f34=_0x381d8e[_0x8ed0('0x48')];if(!_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x3b')](_0x8ed0('0x3c'))){_0x59a495[_0x8ed0('0x22')]=qs[_0x8ed0('0x22')](_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x22')]);_0x59a495['offset']=qs[_0x8ed0('0x1f')](_0x9ba15['query']['offset']);}return _0xfff855[_0x8ed0('0x5b')](_0x59a495);}})[_0x8ed0('0x28')](function(_0xa6e989){if(_0xa6e989){return _0xa6e989?{'count':_0x287f34,'rows':_0xa6e989}:null;}})[_0x8ed0('0x28')](respondWithResult(_0x54511a,null))['catch'](handleError(_0x54511a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 803190b..6650d2e 100644
--- a/server/api/chatGroup/chatGroup.events.js
+++ b/server/api/chatGroup/chatGroup.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7750=['hook','events','ChatGroup','setMaxListeners','emit'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7750,0x182));var _0x0775=function(_0x248ab0,_0x5a7934){_0x248ab0=_0x248ab0-0x0;var _0x54f4ee=_0x7750[_0x248ab0];return _0x54f4ee;};'use strict';var EventEmitter=require(_0x0775('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x0775('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0775('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x255bdc){return function(_0x26b370,_0x114bbd,_0x3a2f34){ChatGroupEvents[_0x0775('0x3')](_0x255bdc+':'+_0x26b370['id'],_0x26b370);ChatGroupEvents[_0x0775('0x3')](_0x255bdc,_0x26b370);_0x3a2f34(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0775('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xdb21=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x295a55,_0x56e0dc){var _0x3890cf=function(_0x284d42){while(--_0x284d42){_0x295a55['push'](_0x295a55['shift']());}};_0x3890cf(++_0x56e0dc);}(_0xdb21,0x135));var _0x1db2=function(_0x4f3949,_0x1b28b5){_0x4f3949=_0x4f3949-0x0;var _0x2bbb60=_0xdb21[_0x4f3949];return _0x2bbb60;};'use strict';var EventEmitter=require(_0x1db2('0x0'));var ChatGroup=require(_0x1db2('0x1'))['db'][_0x1db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1db2('0x3')](0x0);var events={'afterCreate':_0x1db2('0x4'),'afterUpdate':_0x1db2('0x5'),'afterDestroy':_0x1db2('0x6')};function emitEvent(_0xdc2c0c){return function(_0x4102c4,_0x54a04e,_0x3b16c7){ChatGroupEvents['emit'](_0xdc2c0c+':'+_0x4102c4['id'],_0x4102c4);ChatGroupEvents['emit'](_0xdc2c0c,_0x4102c4);_0x3b16c7(null);};}for(var e in events){if(events[_0x1db2('0x7')](e)){var event=events[e];ChatGroup[_0x1db2('0x8')](e,emitEvent(event));}}module[_0x1db2('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index b53b939..0457e5e 100644
--- a/server/api/chatGroup/chatGroup.model.js
+++ b/server/api/chatGroup/chatGroup.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d22=['bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','util','../../config/logger','api','moment'];(function(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0x0d22,0xe6));var _0x20d2=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0x0d22[_0x38aeea];return _0x5e8d2c;};'use strict';var _=require('lodash');var util=require(_0x20d2('0x0'));var logger=require(_0x20d2('0x1'))(_0x20d2('0x2'));var moment=require(_0x20d2('0x3'));var BPromise=require(_0x20d2('0x4'));var rp=require(_0x20d2('0x5'));var fs=require('fs');var path=require(_0x20d2('0x6'));var rimraf=require(_0x20d2('0x7'));var config=require(_0x20d2('0x8'));var attributes=require(_0x20d2('0x9'));module[_0x20d2('0xa')]=function(_0x4ea7d3,_0x431c77){return _0x4ea7d3[_0x20d2('0xb')](_0x20d2('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2275=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','ChatGroup','lodash','util','../../config/logger','moment'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x2275,0x132));var _0x5227=function(_0x387ce6,_0x3a45c4){_0x387ce6=_0x387ce6-0x0;var _0x8d2923=_0x2275[_0x387ce6];return _0x8d2923;};'use strict';var _=require(_0x5227('0x0'));var util=require(_0x5227('0x1'));var logger=require(_0x5227('0x2'))('api');var moment=require(_0x5227('0x3'));var BPromise=require('bluebird');var rp=require(_0x5227('0x4'));var fs=require('fs');var path=require(_0x5227('0x5'));var rimraf=require('rimraf');var config=require(_0x5227('0x6'));var attributes=require(_0x5227('0x7'));module[_0x5227('0x8')]=function(_0x4c0469,_0xd3d705){return _0x4c0469['define'](_0x5227('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 14998c5..637cba7 100644
--- a/server/api/chatGroup/chatGroup.rpc.js
+++ b/server/api/chatGroup/chatGroup.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4784=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5e7bbc,_0x413a95){var _0x3d6abc=function(_0x10d177){while(--_0x10d177){_0x5e7bbc['push'](_0x5e7bbc['shift']());}};_0x3d6abc(++_0x413a95);}(_0x4784,0xe4));var _0x4478=function(_0x2c072b,_0x6c4449){_0x2c072b=_0x2c072b-0x0;var _0x167ee3=_0x4784[_0x2c072b];return _0x167ee3;};'use strict';var _=require(_0x4478('0x0'));var util=require(_0x4478('0x1'));var moment=require(_0x4478('0x2'));var BPromise=require(_0x4478('0x3'));var rs=require(_0x4478('0x4'));var fs=require('fs');var Redis=require(_0x4478('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4478('0x6'));var logger=require(_0x4478('0x7'))(_0x4478('0x8'));var config=require('../../config/environment');var jayson=require(_0x4478('0x9'));var client=jayson['client'][_0x4478('0xa')]({'port':0x232a});config['redis']=_[_0x4478('0xb')](config[_0x4478('0xc')],{'host':_0x4478('0xd'),'port':0x18eb});var socket=require(_0x4478('0xe'))(new Redis(config[_0x4478('0xc')]));require('./chatGroup.socket')[_0x4478('0xf')](socket);function respondWithRpcPromise(_0x2747ad,_0x2bca2c,_0x3cf977){return new BPromise(function(_0xcc937d,_0x2d95ef){return client[_0x4478('0x10')](_0x2747ad,_0x3cf977)['then'](function(_0x21e831){logger[_0x4478('0x11')](_0x4478('0x12'),_0x2bca2c,_0x4478('0x13'));logger[_0x4478('0x14')](_0x4478('0x15'),_0x2bca2c,'request\x20sent',JSON[_0x4478('0x16')](_0x21e831));if(_0x21e831[_0x4478('0x17')]){if(_0x21e831[_0x4478('0x17')][_0x4478('0x18')]===0x1f4){logger[_0x4478('0x17')]('ChatGroup,\x20%s,\x20%s',_0x2bca2c,_0x21e831['error'][_0x4478('0x19')]);return _0x2d95ef(_0x21e831[_0x4478('0x17')][_0x4478('0x19')]);}logger[_0x4478('0x17')](_0x4478('0x12'),_0x2bca2c,_0x21e831[_0x4478('0x17')][_0x4478('0x19')]);return _0xcc937d(_0x21e831['error'][_0x4478('0x19')]);}else{logger[_0x4478('0x11')](_0x4478('0x12'),_0x2bca2c,_0x4478('0x13'));_0xcc937d(_0x21e831[_0x4478('0x1a')]['message']);}})[_0x4478('0x1b')](function(_0x12b731){logger['error'](_0x4478('0x12'),_0x2bca2c,_0x12b731);_0x2d95ef(_0x12b731);});});}
\ No newline at end of file
+var _0x95f4=['catch','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3e16c4,_0x1f1954){var _0x5945d1=function(_0x404a8f){while(--_0x404a8f){_0x3e16c4['push'](_0x3e16c4['shift']());}};_0x5945d1(++_0x1f1954);}(_0x95f4,0xf1));var _0x495f=function(_0x3206cb,_0x3d3f65){_0x3206cb=_0x3206cb-0x0;var _0x4be1ea=_0x95f4[_0x3206cb];return _0x4be1ea;};'use strict';var _=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var moment=require(_0x495f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x495f('0x3'));var db=require(_0x495f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x495f('0x5'));var config=require(_0x495f('0x6'));var jayson=require(_0x495f('0x7'));var client=jayson['client'][_0x495f('0x8')]({'port':0x232a});config[_0x495f('0x9')]=_[_0x495f('0xa')](config['redis'],{'host':_0x495f('0xb'),'port':0x18eb});var socket=require(_0x495f('0xc'))(new Redis(config[_0x495f('0x9')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x3f5880,_0x48c225,_0x415017){return new BPromise(function(_0x508c3d,_0x2b6d9d){return client[_0x495f('0xd')](_0x3f5880,_0x415017)[_0x495f('0xe')](function(_0x2a90c0){logger['info'](_0x495f('0xf'),_0x48c225,_0x495f('0x10'));logger[_0x495f('0x11')](_0x495f('0x12'),_0x48c225,_0x495f('0x10'),JSON['stringify'](_0x2a90c0));if(_0x2a90c0[_0x495f('0x13')]){if(_0x2a90c0[_0x495f('0x13')][_0x495f('0x14')]===0x1f4){logger[_0x495f('0x13')](_0x495f('0xf'),_0x48c225,_0x2a90c0[_0x495f('0x13')][_0x495f('0x15')]);return _0x2b6d9d(_0x2a90c0['error'][_0x495f('0x15')]);}logger[_0x495f('0x13')](_0x495f('0xf'),_0x48c225,_0x2a90c0[_0x495f('0x13')]['message']);return _0x508c3d(_0x2a90c0[_0x495f('0x13')][_0x495f('0x15')]);}else{logger['info'](_0x495f('0xf'),_0x48c225,_0x495f('0x10'));_0x508c3d(_0x2a90c0[_0x495f('0x16')]['message']);}})[_0x495f('0x17')](function(_0x3dc481){logger[_0x495f('0x13')](_0x495f('0xf'),_0x48c225,_0x3dc481);_0x2b6d9d(_0x3dc481);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index c914cb2..7478a85 100644
--- a/server/api/chatGroup/chatGroup.socket.js
+++ b/server/api/chatGroup/chatGroup.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd578=['register','./chatGroup.events','remove','update'];(function(_0x2e8cbd,_0x3015b6){var _0x18107c=function(_0x51150c){while(--_0x51150c){_0x2e8cbd['push'](_0x2e8cbd['shift']());}};_0x18107c(++_0x3015b6);}(_0xd578,0x18d));var _0x8d57=function(_0x56fae,_0x2d1fe0){_0x56fae=_0x56fae-0x0;var _0x1eeed7=_0xd578[_0x56fae];return _0x1eeed7;};'use strict';var ChatGroupEvents=require(_0x8d57('0x0'));var events=['save',_0x8d57('0x1'),_0x8d57('0x2')];function createListener(_0xa581c1,_0x4850c0){return function(_0x5173e2){_0x4850c0['emit'](_0xa581c1,_0x5173e2);};}function removeListener(_0x54c6e6,_0x21f998){return function(){ChatGroupEvents['removeListener'](_0x54c6e6,_0x21f998);};}exports[_0x8d57('0x3')]=function(_0x5e5fc0){for(var _0x2d781c=0x0,_0x1443ee=events['length'];_0x2d781c<_0x1443ee;_0x2d781c++){var _0x24a4c4=events[_0x2d781c];var _0x1c068a=createListener('chatGroup:'+_0x24a4c4,_0x5e5fc0);ChatGroupEvents['on'](_0x24a4c4,_0x1c068a);}};
\ No newline at end of file
+var _0x2b98=['update','register','length','chatGroup:','./chatGroup.events','remove'];(function(_0x335c97,_0x485355){var _0x36ac8e=function(_0x582562){while(--_0x582562){_0x335c97['push'](_0x335c97['shift']());}};_0x36ac8e(++_0x485355);}(_0x2b98,0x1f0));var _0x82b9=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x2b98[_0x9df060];return _0x338dfe;};'use strict';var ChatGroupEvents=require(_0x82b9('0x0'));var events=['save',_0x82b9('0x1'),_0x82b9('0x2')];function createListener(_0x3eb099,_0x5ca328){return function(_0x285393){_0x5ca328['emit'](_0x3eb099,_0x285393);};}function removeListener(_0x53bda9,_0x36aec0){return function(){ChatGroupEvents['removeListener'](_0x53bda9,_0x36aec0);};}exports[_0x82b9('0x3')]=function(_0x439941){for(var _0x5b2727=0x0,_0x2af581=events[_0x82b9('0x4')];_0x5b2727<_0x2af581;_0x5b2727++){var _0x55c248=events[_0x5b2727];var _0x360b47=createListener(_0x82b9('0x5')+_0x55c248,_0x439941);ChatGroupEvents['on'](_0x55c248,_0x360b47);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index c28c62b..c8c04da 100644
--- a/server/api/chatGroup/index.js
+++ b/server/api/chatGroup/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb059=['destroy','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','/:id','isAuthenticated','show','getUnread','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers','delete'];(function(_0xa34bda,_0x34f584){var _0x37c970=function(_0xa3eca2){while(--_0xa3eca2){_0xa34bda['push'](_0xa34bda['shift']());}};_0x37c970(++_0x34f584);}(_0xb059,0x12b));var _0x9b05=function(_0x16152d,_0x5a5b49){_0x16152d=_0x16152d-0x0;var _0x1768d8=_0xb059[_0x16152d];return _0x1768d8;};'use strict';var multer=require(_0x9b05('0x0'));var util=require(_0x9b05('0x1'));var path=require(_0x9b05('0x2'));var timeout=require(_0x9b05('0x3'));var express=require(_0x9b05('0x4'));var router=express[_0x9b05('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9b05('0x6'));var interaction=require(_0x9b05('0x7'));var config=require(_0x9b05('0x8'));var controller=require(_0x9b05('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9b05('0xa')]);router[_0x9b05('0xb')](_0x9b05('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9b05('0xd'),auth[_0x9b05('0xe')](),controller[_0x9b05('0xf')]);router['get']('/:id/unread',auth['isAuthenticated'](),controller[_0x9b05('0x10')]);router[_0x9b05('0xb')]('/:id/members',auth[_0x9b05('0xe')](),controller[_0x9b05('0x11')]);router[_0x9b05('0xb')](_0x9b05('0x12'),auth['isAuthenticated'](),controller[_0x9b05('0x13')]);router['post']('/',auth[_0x9b05('0xe')](),controller[_0x9b05('0x14')]);router[_0x9b05('0x15')](_0x9b05('0x16'),auth[_0x9b05('0xe')](),controller[_0x9b05('0x17')]);router[_0x9b05('0x15')](_0x9b05('0x12'),auth[_0x9b05('0xe')](),controller['addMessage']);router['put'](_0x9b05('0xd'),auth[_0x9b05('0xe')](),controller['update']);router[_0x9b05('0x18')](_0x9b05('0xd'),auth[_0x9b05('0xe')](),controller[_0x9b05('0x19')]);router[_0x9b05('0x18')](_0x9b05('0x16'),auth[_0x9b05('0xe')](),controller[_0x9b05('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x3734=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','/describe','get','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','/:id','update','delete','destroy','removeMembers'];(function(_0xcb5530,_0x1de24a){var _0x3bb3e7=function(_0x461fa8){while(--_0x461fa8){_0xcb5530['push'](_0xcb5530['shift']());}};_0x3bb3e7(++_0x1de24a);}(_0x3734,0x179));var _0x4373=function(_0x290be4,_0x2df3bd){_0x290be4=_0x290be4-0x0;var _0x2cbe14=_0x3734[_0x290be4];return _0x2cbe14;};'use strict';var multer=require(_0x4373('0x0'));var util=require(_0x4373('0x1'));var path=require(_0x4373('0x2'));var timeout=require(_0x4373('0x3'));var express=require(_0x4373('0x4'));var router=express[_0x4373('0x5')]();var fs_extra=require(_0x4373('0x6'));var auth=require(_0x4373('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4373('0x8'));var controller=require(_0x4373('0x9'));router['get']('/',auth[_0x4373('0xa')](),controller['index']);router['get'](_0x4373('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4373('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4373('0xd')]);router['get'](_0x4373('0xe'),auth['isAuthenticated'](),controller[_0x4373('0xf')]);router[_0x4373('0xc')](_0x4373('0x10'),auth[_0x4373('0xa')](),controller[_0x4373('0x11')]);router[_0x4373('0xc')](_0x4373('0x12'),auth[_0x4373('0xa')](),controller[_0x4373('0x13')]);router[_0x4373('0x14')]('/',auth['isAuthenticated'](),controller[_0x4373('0x15')]);router[_0x4373('0x14')]('/:id/members',auth[_0x4373('0xa')](),controller[_0x4373('0x16')]);router[_0x4373('0x14')](_0x4373('0x12'),auth['isAuthenticated'](),controller[_0x4373('0x17')]);router['put'](_0x4373('0x18'),auth[_0x4373('0xa')](),controller[_0x4373('0x19')]);router[_0x4373('0x1a')](_0x4373('0x18'),auth[_0x4373('0xa')](),controller[_0x4373('0x1b')]);router[_0x4373('0x1a')]('/:id/members',auth[_0x4373('0xa')](),controller[_0x4373('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 08a1f24..3483e33 100644
--- a/server/api/chatInteraction/chatInteraction.attributes.js
+++ b/server/api/chatInteraction/chatInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3613=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long'];(function(_0x495291,_0x3ba520){var _0x13a724=function(_0x7dcdd1){while(--_0x7dcdd1){_0x495291['push'](_0x495291['shift']());}};_0x13a724(++_0x3ba520);}(_0x3613,0x6e));var _0x3361=function(_0x9ddaa0,_0x1d3878){_0x9ddaa0=_0x9ddaa0-0x0;var _0x14dce9=_0x3613[_0x9ddaa0];return _0x14dce9;};'use strict';var Sequelize=require(_0x3361('0x0'));module[_0x3361('0x1')]={'closed':{'type':Sequelize[_0x3361('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3361('0x3')]},'ratingType':{'type':Sequelize[_0x3361('0x4')](_0x3361('0x5'),_0x3361('0x6')),'defaultValue':_0x3361('0x5')},'ratingMessage':{'type':Sequelize[_0x3361('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x3361('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3361('0x8')]},'secondDisposition':{'type':Sequelize[_0x3361('0x8')]},'thirdDisposition':{'type':Sequelize[_0x3361('0x8')]},'note':{'type':Sequelize[_0x3361('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x3361('0x8')]},'osName':{'type':Sequelize[_0x3361('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3361('0x7')]},'customerIp':{'type':Sequelize[_0x3361('0x8')]},'formData':{'type':Sequelize[_0x3361('0x7')](_0x3361('0x9'))},'read1stAt':{'type':Sequelize[_0x3361('0xa')]},'lastMsgAt':{'type':Sequelize[_0x3361('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x3361('0x4')]('in',_0x3361('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3361('0x8')]},'customerPort':{'type':Sequelize[_0x3361('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x3361('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x3361('0x3')]}};
\ No newline at end of file
+var _0x0b89=['ENUM','thumb','star','TEXT','STRING','DATE','long','INTEGER','sequelize','BOOLEAN'];(function(_0x415210,_0x33aff1){var _0x2cb0fa=function(_0x2ad5a1){while(--_0x2ad5a1){_0x415210['push'](_0x415210['shift']());}};_0x2cb0fa(++_0x33aff1);}(_0x0b89,0xc6));var _0x90b8=function(_0x38ddfc,_0x572362){_0x38ddfc=_0x38ddfc-0x0;var _0x1a8e60=_0x0b89[_0x38ddfc];return _0x1a8e60;};'use strict';var Sequelize=require(_0x90b8('0x0'));module['exports']={'closed':{'type':Sequelize[_0x90b8('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x90b8('0x2')]('star',_0x90b8('0x3')),'defaultValue':_0x90b8('0x4')},'ratingMessage':{'type':Sequelize[_0x90b8('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x90b8('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x90b8('0x7')]},'disposition':{'type':Sequelize[_0x90b8('0x6')]},'secondDisposition':{'type':Sequelize[_0x90b8('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x90b8('0x6')]},'browserName':{'type':Sequelize[_0x90b8('0x6')]},'browserVersion':{'type':Sequelize[_0x90b8('0x6')]},'osName':{'type':Sequelize[_0x90b8('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x90b8('0x6')]},'deviceVendor':{'type':Sequelize[_0x90b8('0x6')]},'deviceType':{'type':Sequelize[_0x90b8('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x90b8('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x90b8('0x8'))},'read1stAt':{'type':Sequelize[_0x90b8('0x7')]},'lastMsgAt':{'type':Sequelize[_0x90b8('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x90b8('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x90b8('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x90b8('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x90b8('0x9')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 0a248d5..1f0a28a 100644
--- a/server/api/chatInteraction/chatInteraction.controller.js
+++ b/server/api/chatInteraction/chatInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e1=['User','ChatWebsiteId','ContactId','format','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','hasOwnProperty','nolimit','order','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','sort','secret','includeAgent','push','addTags','setTags','ids','spread','Tag','color','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','ChatWebsite','Owner','get','mkdirSync','Chat','Account','toString','closedAt','browserName','osName','referer','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','read','value','renderFile','views','transcript-','.pdf','err','unlinkSync','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','update','destroy','end','sendStatus','stack','name','send','merge','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','getOptions','findAll','chat','query','show','params','model','keys','ChatInteraction','filters','intersection','attributes','fields','length','includeAll','include','options','create','find','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','basename','filename','mimetype','Unauthorized','Attachment','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages'];(function(_0x2196f3,_0x25609c){var _0x3b865f=function(_0x344ba9){while(--_0x344ba9){_0x2196f3['push'](_0x2196f3['shift']());}};_0x3b865f(++_0x25609c);}(_0x70e1,0x124));var _0x170e=function(_0x78e522,_0x37c539){_0x78e522=_0x78e522-0x0;var _0x4a170d=_0x70e1[_0x78e522];return _0x4a170d;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x170e('0x0'));var rp=require(_0x170e('0x1'));var moment=require(_0x170e('0x2'));var BPromise=require(_0x170e('0x3'));var Mustache=require('mustache');var util=require(_0x170e('0x4'));var path=require(_0x170e('0x5'));var ejs=require(_0x170e('0x6'));var fs=require('fs');var _=require(_0x170e('0x7'));var Redis=require(_0x170e('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0x170e('0x9'));var pdf=require(_0x170e('0xa'));var logger=require('../../config/logger')(_0x170e('0xb'));var config=require('../../config/environment');var db=require(_0x170e('0xc'))['db'];config[_0x170e('0xd')]=_['defaults'](config[_0x170e('0xd')],{'host':_0x170e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x170e('0xd')]));require(_0x170e('0xf'))['register'](socket);var jayson=require(_0x170e('0x10'));var client=jayson[_0x170e('0x11')][_0x170e('0x12')]({'port':0x232b});var client9004=jayson[_0x170e('0x11')][_0x170e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x14ba22,_0x4e8ab7,_0x459732,_0x303eaa){return new BPromise(function(_0xa4b7a3,_0x5ea7b7){var _0x321eff=_0x303eaa||client;return _0x321eff[_0x170e('0x13')](_0x14ba22,_0x459732)[_0x170e('0x14')](function(_0x13e27e){logger['info'](_0x170e('0x15'),_0x4e8ab7,_0x170e('0x16'));logger[_0x170e('0x17')](_0x170e('0x18'),_0x4e8ab7,'request\x20sent',JSON[_0x170e('0x19')](_0x13e27e));if(_0x13e27e[_0x170e('0x1a')]){if(_0x13e27e['error'][_0x170e('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4e8ab7,_0x13e27e[_0x170e('0x1a')][_0x170e('0x1c')]);return _0x5ea7b7(_0x13e27e[_0x170e('0x1a')]['message']);}logger[_0x170e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x4e8ab7,_0x13e27e[_0x170e('0x1a')][_0x170e('0x1c')]);return _0xa4b7a3(_0x13e27e['error']['message']);}else{logger['info'](_0x170e('0x15'),_0x4e8ab7,_0x170e('0x16'));_0xa4b7a3(_0x13e27e[_0x170e('0x1d')]['message']);}})[_0x170e('0x1e')](function(_0x1d66ad){logger[_0x170e('0x1a')](_0x170e('0x15'),_0x4e8ab7,_0x1d66ad);_0x5ea7b7(_0x1d66ad);});});}function respondWithStatusCode(_0x2cf0ae,_0x10b52a){_0x10b52a=_0x10b52a||0xcc;return function(_0x2a5aa9){if(_0x2a5aa9){return _0x2cf0ae['sendStatus'](_0x10b52a);}return _0x2cf0ae['status'](_0x10b52a)['end']();};}function respondWithResult(_0x568dfd,_0x4743df){_0x4743df=_0x4743df||0xc8;return function(_0x54b9a1){if(_0x54b9a1){return _0x568dfd[_0x170e('0x1f')](_0x4743df)['json'](_0x54b9a1);}};}function respondWithFilteredResult(_0x334b50,_0xd7789f){return function(_0x380577){if(_0x380577){var _0x4456c0=typeof _0xd7789f[_0x170e('0x20')]===_0x170e('0x21')&&typeof _0xd7789f[_0x170e('0x22')]==='undefined';var _0x1e642d=_0x380577['count'];var _0x50f318=_0x4456c0?0x0:_0xd7789f[_0x170e('0x20')];var _0xa739fd=_0x4456c0?_0x380577[_0x170e('0x23')]:_0xd7789f[_0x170e('0x20')]+_0xd7789f[_0x170e('0x22')];var _0x87e16e;if(_0xa739fd>=_0x1e642d){_0xa739fd=_0x1e642d;_0x87e16e=0xc8;}else{_0x87e16e=0xce;}_0x334b50[_0x170e('0x1f')](_0x87e16e);return _0x334b50['set']('Content-Range',_0x50f318+'-'+_0xa739fd+'/'+_0x1e642d)['json'](_0x380577);}return null;};}function saveUpdates(_0x2d6761){return function(_0x43a999){if(_0x43a999){return _0x43a999[_0x170e('0x24')](_0x2d6761)[_0x170e('0x14')](function(_0x3ddd26){return _0x3ddd26;});}return null;};}function removeEntity(_0x391874){return function(_0x5954a0){if(_0x5954a0){return _0x5954a0[_0x170e('0x25')]()[_0x170e('0x14')](function(){_0x391874[_0x170e('0x1f')](0xcc)[_0x170e('0x26')]();});}};}function handleEntityNotFound(_0x39855e){return function(_0x2016be){if(!_0x2016be){_0x39855e[_0x170e('0x27')](0x194);}return _0x2016be;};}function handleError(_0x5e05a4,_0x1ce8ea){_0x1ce8ea=_0x1ce8ea||0x1f4;return function(_0x3790ae){logger['error'](_0x3790ae[_0x170e('0x28')]);if(_0x3790ae['name']){delete _0x3790ae[_0x170e('0x29')];}_0x5e05a4[_0x170e('0x1f')](_0x1ce8ea)[_0x170e('0x2a')](_0x3790ae);};}function getMustacheRender(_0x47110c,_0x1e86a5){return Mustache['render'](_0x47110c,_[_0x170e('0x2b')](_0x1e86a5[_0x170e('0x2c')],{'contact':_0x1e86a5[_0x170e('0x2d')],'message':_0x1e86a5['message'],'agent':_0x1e86a5[_0x170e('0x2e')],'interaction':_0x1e86a5[_0x170e('0x2f')],'account':_0x1e86a5[_0x170e('0x30')]}))||'';}exports[_0x170e('0x31')]=function(_0x5986d4,_0x113959){var _0x259245={};var _0x13b321=_[_0x170e('0x32')](db['ChatInteraction'][_0x170e('0x33')],function(_0x16a305){return{'name':_0x16a305[_0x170e('0x34')],'type':_0x16a305[_0x170e('0x35')]['key']};});_0x259245=qs[_0x170e('0x36')](_0x13b321,_0x5986d4);return interaction[_0x170e('0x37')](_0x170e('0x38'),_0x5986d4[_0x170e('0x39')],_0x5986d4['user'],_0x259245,_0x13b321)[_0x170e('0x14')](respondWithFilteredResult(_0x113959,_0x259245))['catch'](handleError(_0x113959,null));};exports[_0x170e('0x3a')]=function(_0x2f4638,_0x496793){var _0x461766={'raw':![],'where':{'id':_0x2f4638[_0x170e('0x3b')]['id']}},_0x1b8d40={};_0x1b8d40[_0x170e('0x3c')]=_[_0x170e('0x3d')](db[_0x170e('0x3e')][_0x170e('0x33')]);_0x1b8d40[_0x170e('0x39')]=_[_0x170e('0x3d')](_0x2f4638[_0x170e('0x39')]);_0x1b8d40[_0x170e('0x3f')]=_[_0x170e('0x40')](_0x1b8d40[_0x170e('0x3c')],_0x1b8d40[_0x170e('0x39')]);_0x461766[_0x170e('0x41')]=_['intersection'](_0x1b8d40[_0x170e('0x3c')],qs[_0x170e('0x42')](_0x2f4638['query'][_0x170e('0x42')]));_0x461766[_0x170e('0x41')]=_0x461766[_0x170e('0x41')][_0x170e('0x43')]?_0x461766[_0x170e('0x41')]:_0x1b8d40[_0x170e('0x3c')];if(_0x2f4638[_0x170e('0x39')][_0x170e('0x44')]){_0x461766[_0x170e('0x45')]=[{'all':!![]}];}_0x461766=_[_0x170e('0x2b')]({},_0x461766,_0x2f4638[_0x170e('0x46')]);return db[_0x170e('0x3e')]['find'](_0x461766)['then'](handleEntityNotFound(_0x496793,null))['then'](respondWithResult(_0x496793,null))[_0x170e('0x1e')](handleError(_0x496793,null));};exports[_0x170e('0x47')]=function(_0x11fc40,_0x447441){return db[_0x170e('0x3e')][_0x170e('0x47')](_0x11fc40[_0x170e('0x2c')],{})[_0x170e('0x14')](respondWithResult(_0x447441,0xc9))[_0x170e('0x1e')](handleError(_0x447441,null));};exports[_0x170e('0x24')]=function(_0x3b224b,_0x589a0a){if(_0x3b224b[_0x170e('0x2c')]['id']){delete _0x3b224b['body']['id'];}return db['ChatInteraction'][_0x170e('0x48')]({'where':{'id':_0x3b224b[_0x170e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x589a0a,null))[_0x170e('0x14')](saveUpdates(_0x3b224b[_0x170e('0x2c')],null))[_0x170e('0x14')](respondWithResult(_0x589a0a,null))[_0x170e('0x1e')](handleError(_0x589a0a,null));};exports[_0x170e('0x25')]=function(_0x3749d0,_0x129e16){return db['ChatInteraction']['find']({'where':{'id':_0x3749d0[_0x170e('0x3b')]['id']}})[_0x170e('0x14')](handleEntityNotFound(_0x129e16,null))[_0x170e('0x14')](removeEntity(_0x129e16,null))[_0x170e('0x1e')](handleError(_0x129e16,null));};exports['describe']=function(_0x281f50,_0x3a0fee){return db['ChatInteraction'][_0x170e('0x49')]()[_0x170e('0x14')](respondWithResult(_0x3a0fee,null))[_0x170e('0x1e')](handleError(_0x3a0fee,null));};exports[_0x170e('0x4a')]=function(_0x2986e3,_0xf992a7){var _0x4f1b41=_0x2986e3['params']['id'];var _0x5bc945;var _0x486e1e;var _0xa8061;return db[_0x170e('0x3e')][_0x170e('0x4b')]({'where':{'id':_0x4f1b41}})['then'](function(_0x1654cc){_0x5bc945=_0x1654cc;return db['ChatWebsite'][_0x170e('0x4b')]({'where':{'id':_0x1654cc['ChatWebsiteId']},'attributes':['id',_0x170e('0x4c'),_0x170e('0x4d'),_0x170e('0x4e'),_0x170e('0x4f'),_0x170e('0x50')],'raw':!![]});})[_0x170e('0x14')](function(_0x169cc2){if(_0x169cc2&&_0x169cc2[_0x170e('0x4c')]&&_0x169cc2['vidaooEscalation']){_0x486e1e=_0x169cc2;var _0x5a50c3={'interaction':{'id':_0x4f1b41},'agent':{'id':_0x2986e3['user']['id'],'name':_0x2986e3[_0x170e('0x51')]['name'],'fullname':_0x2986e3[_0x170e('0x51')][_0x170e('0x52')],'email':_0x2986e3[_0x170e('0x51')][_0x170e('0x53')]},'contact':_0x2986e3[_0x170e('0x2c')][_0x170e('0x2d')],'account':_0x2986e3[_0x170e('0x2c')][_0x170e('0x30')]};var _0x21860c={'rejectUnauthorized':![],'method':_0x170e('0x54'),'url':_0x170e('0x55'),'headers':{'X-APIKEY':_0x169cc2[_0x170e('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2986e3[_0x170e('0x51')][_0x170e('0x53')]],'buttons':null,'topic':_0x486e1e[_0x170e('0x4e')],'note':_['isNull'](_0x486e1e['vidaooNote'])?null:getMustacheRender(_0x486e1e[_0x170e('0x4f')],_0x5a50c3),'metadata':null},'redirect':_0x170e('0x56'),'json':!![]};try{if(!_['isNull'](_0x486e1e[_0x170e('0x50')])){var _0x5c1f5f=getMustacheRender(_0x486e1e[_0x170e('0x50')],_0x5a50c3);var _0x1ebc34=JSON[_0x170e('0x57')](_0x5c1f5f);_0x21860c[_0x170e('0x2c')][_0x170e('0x58')]=_0x1ebc34;}}catch(_0x27be7e){throw new db[(_0x170e('0x59'))][(_0x170e('0x5a'))](_0x170e('0x5b'));}return rp(_0x21860c);}else{throw new db[(_0x170e('0x59'))][(_0x170e('0x5a'))](_0x170e('0x5c'));}})[_0x170e('0x14')](function(_0x27e4cf){_0xa8061=_0x27e4cf;if(_0xa8061['id']){var _0x1c0d0b={'body':_0xa8061[_0x170e('0x5d')],'ChatWebsiteId':_0x486e1e['id'],'ChatInteractionId':_0x5bc945['id'],'direction':_0x170e('0x5e'),'UserId':_0x2986e3[_0x170e('0x51')]['id']};return db[_0x170e('0x5f')][_0x170e('0x47')](_0x1c0d0b,{});}else{throw new db['Sequelize'][(_0x170e('0x5a'))](_0x170e('0x60'));}})[_0x170e('0x14')](function(){return _0x5bc945[_0x170e('0x61')]({'vidaooSessionId':_0xa8061['id']});})['then'](respondWithResult(_0xf992a7,null))['catch'](handleError(_0xf992a7,null));};exports[_0x170e('0x62')]=function(_0x33711c,_0xfdee2d){if(_0x33711c[_0x170e('0x2c')]['id']){delete _0x33711c['body']['id'];}return db[_0x170e('0x3e')]['find']({'where':{'id':_0x33711c[_0x170e('0x3b')]['id']},'include':[{'model':db['CmContact'],'as':_0x170e('0x63')}]})[_0x170e('0x14')](handleEntityNotFound(_0xfdee2d,null))[_0x170e('0x14')](saveUpdates(_0x33711c['body'],null))[_0x170e('0x14')](respondWithResult(_0xfdee2d,null))[_0x170e('0x1e')](handleError(_0xfdee2d,null));};exports['abandon']=function(_0x270259,_0x2aab5e){if(_0x270259[_0x170e('0x2c')]['id']){delete _0x270259[_0x170e('0x2c')]['id'];}return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x270259[_0x170e('0x3b')]['id']}})['then'](function(_0x258b07){if(!_0x258b07){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x170e('0x64'),0x194,_0x170e('0x65'));_0x2aab5e[_0x170e('0x27')](0x194);}else{if(_0x258b07[_0x170e('0x66')]){throw new db[(_0x170e('0x59'))][(_0x170e('0x5a'))](_0x170e('0x67'));}}return _0x258b07;})[_0x170e('0x14')](function(_0x309d03){if(_0x309d03){return _0x309d03[_0x170e('0x24')]({'closed':_0x270259[_0x170e('0x2c')][_0x170e('0x68')],'disposition':_0x270259[_0x170e('0x2c')][_0x170e('0x69')]})[_0x170e('0x14')](function(_0x852d8){return _0x852d8;});}})[_0x170e('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0x170e('0x64'),_0x270259[_0x170e('0x2c')],client9004);})[_0x170e('0x14')](respondWithResult(_0x2aab5e,null))[_0x170e('0x1e')](handleError(_0x2aab5e,null));};exports[_0x170e('0x6a')]=function(_0x7b1011,_0xf6a202){_0x7b1011[_0x170e('0x2c')]['name']=_0x7b1011[_0x170e('0x6b')]['originalname'];_0x7b1011['body'][_0x170e('0x6c')]=_0x7b1011['file'][_0x170e('0x6d')];_0x7b1011[_0x170e('0x2c')]['type']=_0x7b1011[_0x170e('0x6b')][_0x170e('0x6e')];return db['Attachment'][_0x170e('0x47')](_0x7b1011[_0x170e('0x2c')])[_0x170e('0x14')](respondWithResult(_0xf6a202,0xc9))['catch'](handleError(_0xf6a202,null));};exports['attachmentDownload']=function(_0x58a11b,_0x26e291){return db[_0x170e('0x3e')][_0x170e('0x4b')]({'where':{'id':_0x58a11b[_0x170e('0x3b')]['id']},'raw':!![]})[_0x170e('0x14')](handleEntityNotFound(_0x26e291,null))[_0x170e('0x14')](function(_0x15aeab){if(_0x15aeab){if(_0x15aeab[_0x170e('0x68')]){return _0x26e291[_0x170e('0x1f')](0x193)['json']({'status':0x193,'message':_0x170e('0x6f')});}return db[_0x170e('0x70')][_0x170e('0x4b')]({'where':{'id':_0x58a11b[_0x170e('0x39')][_0x170e('0x71')]},'raw':!![]})['then'](handleEntityNotFound(_0x26e291,null));}})[_0x170e('0x14')](function(_0x1cf558){if(_0x1cf558){var _0x3538b5=_0x1cf558[_0x170e('0x72')]!==null;var _0xefd4c3=path['join'](config[_0x170e('0x73')],_0x170e('0x74'));if(_0x3538b5){_0xefd4c3=path[_0x170e('0x75')](_0xefd4c3,_0x170e('0x76'));}var _0x27c0f3=path[_0x170e('0x75')](_0xefd4c3,_0x1cf558['basename']);return _0x26e291[_0x170e('0x77')](_0x27c0f3);}})[_0x170e('0x1e')](handleError(_0x26e291,null));};exports[_0x170e('0x78')]=function(_0x4a5f73,_0x3a1aa6){var _0x4747d4=null;var _0x1e1c6e=null;var _0x1ee0f3=null;if(_0x4a5f73[_0x170e('0x2c')]['id']){delete _0x4a5f73[_0x170e('0x2c')]['id'];}if(_0x4a5f73[_0x170e('0x2c')][_0x170e('0x79')]){_0x1ee0f3=path[_0x170e('0x75')](config[_0x170e('0x73')],_0x170e('0x7a'),util['format'](_0x170e('0x7b'),Date['now']()));_0x4a5f73[_0x170e('0x2c')][_0x170e('0x7c')]=_0x1ee0f3;}return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x4a5f73[_0x170e('0x3b')]['id']},'include':[{'model':db[_0x170e('0x5f')],'as':_0x170e('0x7d'),'include':[{'model':db[_0x170e('0x7e')],'as':_0x170e('0x7e')}]}]})[_0x170e('0x14')](handleEntityNotFound(_0x3a1aa6,null))[_0x170e('0x14')](saveUpdates(_0x4a5f73[_0x170e('0x2c')],null))[_0x170e('0x14')](function(_0x2333ae){if(_0x2333ae){_0x4747d4=_0x2333ae;return db['ChatWebsite'][_0x170e('0x48')]({'where':{'id':_0x4747d4[_0x170e('0x7f')]}});}})[_0x170e('0x14')](function(_0x44d68f){if(_0x44d68f){_0x1e1c6e=_0x44d68f;return db['CmContact'][_0x170e('0x48')]({'where':{'id':_0x4747d4[_0x170e('0x80')]}});}})[_0x170e('0x14')](function(_0x288c72){if(_0x288c72){if(_0x1ee0f3){var _0x4481e6=null;for(var _0xa2abaa=0x1;_0xa2abaa<_0x4747d4[_0x170e('0x7d')][_0x170e('0x43')];++_0xa2abaa){_0x4481e6=_0x4747d4[_0x170e('0x7d')][_0xa2abaa];var _0x389e1c=_0x4481e6['UserId']?util[_0x170e('0x81')]('%s%d',_0x1e1c6e[_0x170e('0x82')],_0x4481e6[_0x170e('0x66')]):'System';var _0x68e882=_0x4a5f73[_0x170e('0x2c')][_0x170e('0x83')]||util[_0x170e('0x81')](_0x170e('0x84'),_0x170e('0x85'),_0x4481e6[_0x170e('0x80')]);switch(_0x1e1c6e[_0x170e('0x86')]){case _0x170e('0x87'):_0x389e1c=_0x4481e6[_0x170e('0x66')]?util[_0x170e('0x81')](_0x170e('0x84'),_0x1e1c6e[_0x170e('0x82')],_0x4481e6['UserId']):_0x170e('0x88');break;case _0x170e('0x89'):_0x389e1c=_0x4481e6[_0x170e('0x66')]?_0x4481e6[_0x170e('0x7e')]['alias']||_0x4481e6['User'][_0x170e('0x52')]:_0x170e('0x88');break;case'agent_fullname':_0x389e1c=_0x4481e6['UserId']?_0x4481e6[_0x170e('0x7e')][_0x170e('0x52')]:_0x170e('0x88');break;default:_0x389e1c=_0x4481e6[_0x170e('0x66')]?util[_0x170e('0x81')](_0x170e('0x84'),_0x1e1c6e[_0x170e('0x82')],_0x4481e6[_0x170e('0x66')]):_0x170e('0x88');}var _0x1172bb=util[_0x170e('0x81')](_0x170e('0x8a'),moment(_0x4481e6[_0x170e('0x8b')])[_0x170e('0x81')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4481e6[_0x170e('0x8c')]==='in'?_0x68e882:_0x389e1c,_0x4481e6['body']);if(!_0x4481e6['secret']){fs[_0x170e('0x8d')](_0x1ee0f3,_0x1172bb);}}return db[_0x170e('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x170e('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x170e('0x90'),'raw':!![]}]}]});}}})['then'](function(_0x5e37ff){if(!_0x5e37ff||!_0x5e37ff[_0x170e('0x91')]||!_0x4a5f73[_0x170e('0x2c')])return _0x4747d4;var _0xf150e7=_0x5e37ff[_0x170e('0x92')]();return respondWithRpcPromise(_0x170e('0x93'),'sendMail',{'account':_0xf150e7,'message':{'from':util[_0x170e('0x81')](_0x170e('0x94'),_0x5e37ff[_0x170e('0x29')],_0x5e37ff[_0x170e('0x53')]||_0x5e37ff['Smtp'][_0x170e('0x51')]),'to':_0x4a5f73[_0x170e('0x2c')][_0x170e('0x79')],'subject':_0x170e('0x95'),'text':util[_0x170e('0x81')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4a5f73[_0x170e('0x2c')][_0x170e('0x79')]),'attachments':[{'path':_0x1ee0f3}]}})['then'](function(){return _0x4747d4;})['catch'](function(_0x3c36cf){logger['error'](_0x3c36cf);});})['then'](respondWithStatusCode(_0x3a1aa6,0xc8))['catch'](handleError(_0x3a1aa6,null));};exports[_0x170e('0x96')]=function(_0x56e189,_0x44c952){return db['ChatMessage'][_0x170e('0x48')]({'where':{'id':_0x56e189[_0x170e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x44c952,null))[_0x170e('0x14')](function(_0x4e6e14){if(_0x4e6e14){return _0x4e6e14[_0x170e('0x96')](_0x56e189['body']['ids'],_[_0x170e('0x97')](_0x56e189['body'],['ids','id'])||{});}})[_0x170e('0x14')](respondWithResult(_0x44c952,null))[_0x170e('0x1e')](handleError(_0x44c952,null));};exports[_0x170e('0x98')]=function(_0x3fc59c,_0x5b1925){var _0x2df274={'raw':![],'where':{}};var _0x44acfb={};var _0x1a1acb={'count':0x0,'rows':[]};return db[_0x170e('0x3e')][_0x170e('0x4b')]({'where':{'id':_0x3fc59c['params']['id']}})['then'](handleEntityNotFound(_0x5b1925,null))[_0x170e('0x14')](function(_0x1395f3){if(_0x1395f3){_0x44acfb[_0x170e('0x3c')]=_[_0x170e('0x3d')](db[_0x170e('0x5f')][_0x170e('0x33')]);_0x44acfb[_0x170e('0x39')]=_[_0x170e('0x3d')](_0x3fc59c[_0x170e('0x39')]);_0x44acfb[_0x170e('0x3f')]=_[_0x170e('0x40')](_0x44acfb[_0x170e('0x3c')],_0x44acfb['query']);_0x2df274[_0x170e('0x41')]=_['intersection'](_0x44acfb[_0x170e('0x3c')],qs[_0x170e('0x42')](_0x3fc59c[_0x170e('0x39')][_0x170e('0x42')]));_0x2df274[_0x170e('0x41')]=_0x2df274['attributes']['length']?_0x2df274[_0x170e('0x41')]:_0x44acfb[_0x170e('0x3c')];if(!_0x3fc59c[_0x170e('0x39')][_0x170e('0x99')](_0x170e('0x9a'))){_0x2df274[_0x170e('0x22')]=qs[_0x170e('0x22')](_0x3fc59c[_0x170e('0x39')][_0x170e('0x22')]);_0x2df274[_0x170e('0x20')]=qs[_0x170e('0x20')](_0x3fc59c['query']['offset']);}_0x2df274[_0x170e('0x9b')]=qs['sort'](_0x3fc59c[_0x170e('0x39')]['sort']);_0x2df274[_0x170e('0x9c')]=qs[_0x170e('0x3f')](_[_0x170e('0x9d')](_0x3fc59c[_0x170e('0x39')],_0x44acfb[_0x170e('0x3f')]));_0x2df274[_0x170e('0x9c')][_0x170e('0x9e')]=_0x1395f3['id'];if(_0x3fc59c['query'][_0x170e('0x9f')]){_0x2df274[_0x170e('0x9c')]=_['merge'](_0x2df274[_0x170e('0x9c')],{'$or':_['map'](_0x2df274[_0x170e('0x41')],function(_0x826f57){var _0x40ce4e={};_0x40ce4e[_0x826f57]={'$like':'%'+_0x3fc59c[_0x170e('0x39')][_0x170e('0x9f')]+'%'};return _0x40ce4e;})});}if(_0x3fc59c[_0x170e('0x39')][_0x170e('0xa0')]){var _0x5a4c25=_0x3fc59c[_0x170e('0x39')][_0x170e('0xa0')]['split'](',');var _0x421626={};_0x421626[_0x5a4c25[0x0]]={'$gte':moment(_0x5a4c25[0x1])[_0x170e('0x81')](_0x170e('0xa1'))};_0x2df274[_0x170e('0x9c')]=_[_0x170e('0x2b')](_0x2df274[_0x170e('0x9c')],_0x421626);}_0x2df274=_[_0x170e('0x2b')]({},_0x2df274,_0x3fc59c[_0x170e('0x46')]);return db[_0x170e('0x5f')][_0x170e('0x23')]({'where':_0x2df274[_0x170e('0x9c')]})['then'](function(_0x411b6e){_0x1a1acb[_0x170e('0x23')]=_0x411b6e;if(_0x3fc59c[_0x170e('0x39')]['includeAll']){_0x2df274[_0x170e('0x45')]=[{'all':!![]}];}return db['ChatMessage'][_0x170e('0x37')](_0x2df274);})[_0x170e('0x14')](function(_0x373ab8){_0x1a1acb[_0x170e('0xa2')]=_0x373ab8;return _0x1a1acb;});}})[_0x170e('0x14')](respondWithFilteredResult(_0x5b1925,_0x2df274))[_0x170e('0x1e')](handleError(_0x5b1925,null));};exports['getMyMessages']=function(_0x3729ec,_0x32d3c7){var _0x582b7a={'where':{}},_0x3a1f0c={},_0x1350a6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x170e('0x4b')]({'where':{'id':_0x3729ec[_0x170e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x32d3c7,null))[_0x170e('0x14')](function(_0x1f0933){if(_0x1f0933){_0x3a1f0c[_0x170e('0x3c')]=_['keys'](db[_0x170e('0x5f')][_0x170e('0x33')]);_0x3a1f0c[_0x170e('0x39')]=_['keys'](_0x3729ec['query']);_0x3a1f0c['filters']=_['intersection'](_0x3a1f0c[_0x170e('0x3c')],_0x3a1f0c['query']);_0x582b7a[_0x170e('0x41')]=_[_0x170e('0x40')](_0x3a1f0c[_0x170e('0x3c')],qs['fields'](_0x3729ec[_0x170e('0x39')][_0x170e('0x42')]));_0x582b7a['attributes']=_0x582b7a['attributes'][_0x170e('0x43')]?_0x582b7a[_0x170e('0x41')]:_0x3a1f0c['model'];if(!_0x3729ec['query']['hasOwnProperty'](_0x170e('0x9a'))){_0x582b7a[_0x170e('0x22')]=qs['limit'](_0x3729ec[_0x170e('0x39')][_0x170e('0x22')]);_0x582b7a[_0x170e('0x20')]=qs[_0x170e('0x20')](_0x3729ec[_0x170e('0x39')]['offset']);}_0x582b7a[_0x170e('0x9b')]=qs[_0x170e('0xa3')](_0x3729ec[_0x170e('0x39')][_0x170e('0xa3')]);_0x582b7a[_0x170e('0x9c')]=qs[_0x170e('0x3f')](_[_0x170e('0x9d')](_0x3729ec[_0x170e('0x39')],_0x3a1f0c[_0x170e('0x3f')]));_0x582b7a[_0x170e('0x9c')][_0x170e('0x9e')]=_0x1f0933['id'];if(_0x3729ec[_0x170e('0x39')][_0x170e('0x9f')]){_0x582b7a[_0x170e('0x9c')]=_['merge'](_0x582b7a[_0x170e('0x9c')],{'$or':_[_0x170e('0x32')](_0x582b7a[_0x170e('0x41')],function(_0x529e38){var _0x523532={};_0x523532[_0x529e38]={'$like':'%'+_0x3729ec[_0x170e('0x39')][_0x170e('0x9f')]+'%'};return _0x523532;})});}_0x582b7a['where'][_0x170e('0xa4')]=![];if(_0x3729ec[_0x170e('0x39')]['id']){_0x582b7a[_0x170e('0x9c')]['id']={'$gt':_0x3729ec['query']['id']};}_0x582b7a=_['merge']({},_0x582b7a,_0x3729ec[_0x170e('0x46')]);return db['ChatMessage'][_0x170e('0x23')]({'where':_0x582b7a['where']})[_0x170e('0x14')](function(_0x100d0c){_0x1350a6[_0x170e('0x23')]=_0x100d0c;_0x582b7a[_0x170e('0x45')]=[];if(_0x3729ec['query'][_0x170e('0xa5')]){_0x582b7a[_0x170e('0x45')][_0x170e('0xa6')]({'model':db[_0x170e('0x7e')],'as':'User','attributes':['id','fullname','alias']});}if(_0x3729ec[_0x170e('0x39')][_0x170e('0x44')]){_0x582b7a[_0x170e('0x45')]=[{'all':!![]}];}return db[_0x170e('0x5f')][_0x170e('0x37')](_0x582b7a);})[_0x170e('0x14')](function(_0x1e0496){_0x1350a6['rows']=_0x1e0496;return _0x1350a6;});}})[_0x170e('0x14')](respondWithFilteredResult(_0x32d3c7,_0x582b7a))[_0x170e('0x1e')](handleError(_0x32d3c7,null));};exports[_0x170e('0xa7')]=function(_0x5dee75,_0x13fd57){return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x5dee75[_0x170e('0x3b')]['id']}})[_0x170e('0x14')](handleEntityNotFound(_0x13fd57,null))[_0x170e('0x14')](function(_0x2b86cd){if(_0x2b86cd){return _0x2b86cd[_0x170e('0xa8')](_0x5dee75[_0x170e('0x2c')][_0x170e('0xa9')],_[_0x170e('0x97')](_0x5dee75[_0x170e('0x2c')],[_0x170e('0xa9'),'id'])||{})[_0x170e('0xaa')](function(){return db[_0x170e('0xab')][_0x170e('0x37')]({'attributes':['id',_0x170e('0x29'),_0x170e('0xac')],'where':{'id':_0x5dee75['body'][_0x170e('0xa9')]}});})[_0x170e('0x14')](function(_0xbf958c){socket['emit'](_0x170e('0xad'),{'id':Number(_0x5dee75[_0x170e('0x3b')]['id']),'tags':_0xbf958c||[]});return{'id':Number(_0x5dee75[_0x170e('0x3b')]['id']),'tags':_0xbf958c||[]};});}})[_0x170e('0x14')](respondWithResult(_0x13fd57,null))[_0x170e('0x1e')](handleError(_0x13fd57,null));};exports[_0x170e('0xae')]=function(_0x2f614b,_0x1f1c8c){return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x2f614b[_0x170e('0x3b')]['id']}})[_0x170e('0x14')](handleEntityNotFound(_0x1f1c8c,null))[_0x170e('0x14')](function(_0x210b81){if(_0x210b81){return _0x210b81[_0x170e('0xae')](_0x2f614b[_0x170e('0x39')]['ids']);}})[_0x170e('0x14')](respondWithStatusCode(_0x1f1c8c,null))[_0x170e('0x1e')](handleError(_0x1f1c8c,null));};exports[_0x170e('0x77')]=function(_0xa7daad,_0x28d0e7){var _0x510ea7=moment()['unix']()['toString']();var _0xcbb72b=path[_0x170e('0x75')](config[_0x170e('0x73')],_0x170e('0xaf'),_0x170e('0xb0'),_0x170e('0xb1'));var _0x528260=path[_0x170e('0x75')](config[_0x170e('0x73')],_0x170e('0xaf'),_0x170e('0xb0'),_0x170e('0xb2'));var _0x2e3a23=path[_0x170e('0x75')](_0xcbb72b,_0x510ea7);var _0x5c7e7c=util[_0x170e('0x81')](_0x170e('0xb3'),_0xa7daad[_0x170e('0x3b')]['id'],_0x510ea7);var _0x15becc=path['join'](_0xcbb72b,_0x5c7e7c);var _0x48254b=[];_0x48254b[_0x170e('0xa6')]({'model':db[_0x170e('0x7e')],'as':'User','attributes':['id',_0x170e('0x52')],'raw':!![]});_0x48254b['push']({'model':db[_0x170e('0xb4')],'as':'Contact','attributes':['id',_0x170e('0xb5'),_0x170e('0xb6')],'raw':!![]});if(_0xa7daad[_0x170e('0x39')]['attachments']){_0x48254b[_0x170e('0xa6')]({'model':db[_0x170e('0x70')],'as':_0x170e('0x70'),'raw':!![]});}var _0x556a05=[{'model':db[_0x170e('0x5f')],'as':'Messages','attributes':['id',_0x170e('0x2c'),_0x170e('0x8b'),_0x170e('0x8c'),'secret','read'],'include':_0x48254b}];_0x556a05[_0x170e('0xa6')]({'model':db[_0x170e('0xb7')],'as':'Account','attributes':['id',_0x170e('0x29')]});_0x556a05[_0x170e('0xa6')]({'model':db['User'],'as':_0x170e('0xb8'),'attributes':['id',_0x170e('0x52')]});return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0xa7daad[_0x170e('0x3b')]['id']},'include':_0x556a05})[_0x170e('0x14')](handleEntityNotFound(_0x28d0e7,null))[_0x170e('0x14')](function(_0x204445){if(_0x204445){var _0x536061=_0x204445[_0x170e('0xb9')]({'plain':!![]});fs[_0x170e('0xba')](_0x2e3a23);var _0x23bc71={'channel':_0x170e('0xbb'),'account':_0x536061[_0x170e('0xbc')][_0x170e('0x29')],'agent':_0x536061[_0x170e('0xb8')]?_0x536061[_0x170e('0xb8')]['fullname']:'N.A.','createdAt':moment(_0x536061[_0x170e('0x8b')])[_0x170e('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0x170e('0xbd')](),'closedAt':_0x536061[_0x170e('0x68')]?moment(_0x536061[_0x170e('0xbe')])[_0x170e('0x81')](_0x170e('0xa1'))[_0x170e('0xbd')]():'','disposition':_0x536061['disposition'],'chatInfo':{'browser':_0x536061[_0x170e('0xbf')],'os':_0x536061[_0x170e('0xc0')],'referer':_0x536061[_0x170e('0xc1')],'customerIp':_0x536061['customerIp'],'customerPort':_0x536061[_0x170e('0xc2')]?_0x536061[_0x170e('0xc2')]:_0x170e('0xc3')},'messages':_(_0x536061[_0x170e('0x7d')])[_0x170e('0xc4')]()[_0x170e('0x9f')]({'secret':![]})[_0x170e('0x32')](function(_0x324c33){if(_0x324c33[_0x170e('0x70')]){var _0x7aca0=path[_0x170e('0x75')](_0x528260,_0x324c33[_0x170e('0x70')]['basename']);if(fs[_0x170e('0xc5')](_0x7aca0)){fs[_0x170e('0xc6')](_0x7aca0)[_0x170e('0xc7')](fs[_0x170e('0xc8')](path[_0x170e('0x75')](_0x2e3a23,_0x324c33[_0x170e('0x70')]['basename'])));}}return{'date':moment(_0x324c33[_0x170e('0x8b')])[_0x170e('0x81')](_0x170e('0xa1'))['toString'](),'sender':_0x324c33[_0x170e('0x8c')]===_0x170e('0x5e')?_0x324c33[_0x170e('0x7e')]?_0x324c33[_0x170e('0x7e')]['fullname']:_0x170e('0x88'):_0x324c33[_0x170e('0x63')]['firstName']+(_0x324c33['Contact'][_0x170e('0xb6')]?'\x20'+_0x324c33[_0x170e('0x63')][_0x170e('0xb6')]:''),'body':_0x324c33['Attachment']?_0x324c33[_0x170e('0x70')][_0x170e('0x6c')]:_0x324c33[_0x170e('0x2c')],'direction':_0x324c33[_0x170e('0x8c')]===_0x170e('0x5e')?'A':'C','secret':_0x324c33[_0x170e('0xa4')],'read':_0x324c33[_0x170e('0xc9')],'attachment':_0x324c33[_0x170e('0x70')]};})[_0x170e('0xca')]()};return ejs[_0x170e('0xcb')](path[_0x170e('0x75')](config['root'],_0x170e('0xaf'),_0x170e('0xcc'),'downloadInteraction.ejs'),{'interaction':_0x23bc71})['then'](function(_0x4eb17f){var _0x3f6497=path[_0x170e('0x75')](_0x2e3a23,_0x170e('0xcd')+_0x536061['id']+'-'+_0x510ea7+_0x170e('0xce'));var _0x1be69d={'path':_0x3f6497,'channel':'Chat','interactionId':_0x536061['id']};return pdf['createPdfFromHTML'](_0x4eb17f,_0x1be69d);})['then'](function(){return new Promise(function(_0x445359,_0x51ec03){zipdir(_0x2e3a23,{'saveTo':_0x15becc},function(_0x315b9f,_0x2b17ce){if(_0x315b9f)return _0x51ec03(_0x315b9f);return _0x445359(_0x2b17ce);});})[_0x170e('0x14')](function(){return new BPromise(function(_0x535edb,_0x36a053){rimraf(_0x2e3a23,function(_0x5bc016){if(_0x5bc016)_0x36a053(_0x5bc016);return _0x535edb();});});})[_0x170e('0x14')](function(){return _0x28d0e7[_0x170e('0x77')](_0x15becc,_0x5c7e7c,function(_0x1933f3){if(_0x1933f3){logger['error'](_0x170e('0xcf'),_0x1933f3);}else{fs[_0x170e('0xd0')](_0x15becc);}});});});}else{return _0x28d0e7['sendStatus'](0xc8);}})[_0x170e('0x1e')](handleError(_0x28d0e7,null));};
\ No newline at end of file
+var _0x2faf=['secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','rows','hasOwnProperty','ChatInteractionId','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','createdAt','Account','get','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','tail','existsSync','pipe','createWriteStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','status','stack','name','send','render','merge','interaction','account','map','type','getOptions','chat','query','user','params','model','ChatInteraction','rawAttributes','keys','filters','intersection','attributes','fields','length','includeAll','create','body','find','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','User','ChatWebsite','ContactId','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction'];(function(_0x4b649b,_0x544487){var _0x1a92a8=function(_0xa0f8b6){while(--_0xa0f8b6){_0x4b649b['push'](_0x4b649b['shift']());}};_0x1a92a8(++_0x544487);}(_0x2faf,0x114));var _0xf2fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2faf[_0xa464c9];return _0x3d73c4;};'use strict';var rimraf=require(_0xf2fa('0x0'));var zipdir=require(_0xf2fa('0x1'));var rp=require('request-promise');var moment=require(_0xf2fa('0x2'));var BPromise=require(_0xf2fa('0x3'));var Mustache=require(_0xf2fa('0x4'));var util=require(_0xf2fa('0x5'));var path=require(_0xf2fa('0x6'));var ejs=require(_0xf2fa('0x7'));var fs=require('fs');var _=require(_0xf2fa('0x8'));var Redis=require(_0xf2fa('0x9'));var interaction=require(_0xf2fa('0xa'));var qs=require(_0xf2fa('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0xf2fa('0xc'))('api');var config=require('../../config/environment');var db=require(_0xf2fa('0xd'))['db'];config['redis']=_['defaults'](config[_0xf2fa('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2fa('0xf'))(new Redis(config['redis']));require(_0xf2fa('0x10'))[_0xf2fa('0x11')](socket);var jayson=require(_0xf2fa('0x12'));var client=jayson[_0xf2fa('0x13')]['http']({'port':0x232b});var client9004=jayson[_0xf2fa('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x153a45,_0xe024e6,_0x375f1d,_0x339a55){return new BPromise(function(_0x1e133e,_0x26c9cf){var _0xa131ad=_0x339a55||client;return _0xa131ad[_0xf2fa('0x14')](_0x153a45,_0x375f1d)[_0xf2fa('0x15')](function(_0x5e24fb){logger[_0xf2fa('0x16')](_0xf2fa('0x17'),_0xe024e6,'request\x20sent');logger[_0xf2fa('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xe024e6,'request\x20sent',JSON[_0xf2fa('0x19')](_0x5e24fb));if(_0x5e24fb[_0xf2fa('0x1a')]){if(_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1b')]===0x1f4){logger[_0xf2fa('0x1a')](_0xf2fa('0x17'),_0xe024e6,_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);return _0x26c9cf(_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);}logger['error'](_0xf2fa('0x17'),_0xe024e6,_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);return _0x1e133e(_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);}else{logger['info'](_0xf2fa('0x17'),_0xe024e6,_0xf2fa('0x1d'));_0x1e133e(_0x5e24fb['result'][_0xf2fa('0x1c')]);}})[_0xf2fa('0x1e')](function(_0x4c47a9){logger[_0xf2fa('0x1a')](_0xf2fa('0x17'),_0xe024e6,_0x4c47a9);_0x26c9cf(_0x4c47a9);});});}function respondWithStatusCode(_0x1b99c7,_0x40dc30){_0x40dc30=_0x40dc30||0xcc;return function(_0x178e8a){if(_0x178e8a){return _0x1b99c7[_0xf2fa('0x1f')](_0x40dc30);}return _0x1b99c7['status'](_0x40dc30)[_0xf2fa('0x20')]();};}function respondWithResult(_0x9a8a7d,_0xb69e9e){_0xb69e9e=_0xb69e9e||0xc8;return function(_0x4722ca){if(_0x4722ca){return _0x9a8a7d['status'](_0xb69e9e)['json'](_0x4722ca);}};}function respondWithFilteredResult(_0x2c9429,_0x589b2d){return function(_0x52bedf){if(_0x52bedf){var _0x216862=typeof _0x589b2d[_0xf2fa('0x21')]===_0xf2fa('0x22')&&typeof _0x589b2d[_0xf2fa('0x23')]==='undefined';var _0x29e753=_0x52bedf[_0xf2fa('0x24')];var _0x5d70fb=_0x216862?0x0:_0x589b2d['offset'];var _0x26c676=_0x216862?_0x52bedf['count']:_0x589b2d[_0xf2fa('0x21')]+_0x589b2d[_0xf2fa('0x23')];var _0x35bbea;if(_0x26c676>=_0x29e753){_0x26c676=_0x29e753;_0x35bbea=0xc8;}else{_0x35bbea=0xce;}_0x2c9429['status'](_0x35bbea);return _0x2c9429[_0xf2fa('0x25')](_0xf2fa('0x26'),_0x5d70fb+'-'+_0x26c676+'/'+_0x29e753)[_0xf2fa('0x27')](_0x52bedf);}return null;};}function saveUpdates(_0xf3f270){return function(_0x3e75d6){if(_0x3e75d6){return _0x3e75d6[_0xf2fa('0x28')](_0xf3f270)[_0xf2fa('0x15')](function(_0x5c61dc){return _0x5c61dc;});}return null;};}function removeEntity(_0xe31ce6){return function(_0x4eb599){if(_0x4eb599){return _0x4eb599[_0xf2fa('0x29')]()[_0xf2fa('0x15')](function(){_0xe31ce6[_0xf2fa('0x2a')](0xcc)[_0xf2fa('0x20')]();});}};}function handleEntityNotFound(_0x4545b2){return function(_0x3605a7){if(!_0x3605a7){_0x4545b2['sendStatus'](0x194);}return _0x3605a7;};}function handleError(_0x57148c,_0x124179){_0x124179=_0x124179||0x1f4;return function(_0x285f27){logger['error'](_0x285f27[_0xf2fa('0x2b')]);if(_0x285f27[_0xf2fa('0x2c')]){delete _0x285f27['name'];}_0x57148c[_0xf2fa('0x2a')](_0x124179)[_0xf2fa('0x2d')](_0x285f27);};}function getMustacheRender(_0x46768f,_0xd3df82){return Mustache[_0xf2fa('0x2e')](_0x46768f,_[_0xf2fa('0x2f')](_0xd3df82['body'],{'contact':_0xd3df82['contact'],'message':_0xd3df82[_0xf2fa('0x1c')],'agent':_0xd3df82['agent'],'interaction':_0xd3df82[_0xf2fa('0x30')],'account':_0xd3df82[_0xf2fa('0x31')]}))||'';}exports['index']=function(_0x4c3def,_0x5017dd){var _0x1a07da={};var _0x294467=_[_0xf2fa('0x32')](db['ChatInteraction']['rawAttributes'],function(_0x421a9f){return{'name':_0x421a9f['fieldName'],'type':_0x421a9f[_0xf2fa('0x33')]['key']};});_0x1a07da=qs[_0xf2fa('0x34')](_0x294467,_0x4c3def);return interaction['findAll'](_0xf2fa('0x35'),_0x4c3def[_0xf2fa('0x36')],_0x4c3def[_0xf2fa('0x37')],_0x1a07da,_0x294467)['then'](respondWithFilteredResult(_0x5017dd,_0x1a07da))[_0xf2fa('0x1e')](handleError(_0x5017dd,null));};exports['show']=function(_0x112ee1,_0x438e12){var _0x426885={'raw':![],'where':{'id':_0x112ee1[_0xf2fa('0x38')]['id']}},_0x381c8e={};_0x381c8e[_0xf2fa('0x39')]=_['keys'](db[_0xf2fa('0x3a')][_0xf2fa('0x3b')]);_0x381c8e['query']=_[_0xf2fa('0x3c')](_0x112ee1[_0xf2fa('0x36')]);_0x381c8e[_0xf2fa('0x3d')]=_[_0xf2fa('0x3e')](_0x381c8e['model'],_0x381c8e[_0xf2fa('0x36')]);_0x426885[_0xf2fa('0x3f')]=_['intersection'](_0x381c8e['model'],qs[_0xf2fa('0x40')](_0x112ee1[_0xf2fa('0x36')][_0xf2fa('0x40')]));_0x426885[_0xf2fa('0x3f')]=_0x426885[_0xf2fa('0x3f')][_0xf2fa('0x41')]?_0x426885[_0xf2fa('0x3f')]:_0x381c8e[_0xf2fa('0x39')];if(_0x112ee1['query'][_0xf2fa('0x42')]){_0x426885['include']=[{'all':!![]}];}_0x426885=_[_0xf2fa('0x2f')]({},_0x426885,_0x112ee1['options']);return db[_0xf2fa('0x3a')]['find'](_0x426885)['then'](handleEntityNotFound(_0x438e12,null))['then'](respondWithResult(_0x438e12,null))[_0xf2fa('0x1e')](handleError(_0x438e12,null));};exports[_0xf2fa('0x43')]=function(_0x1fe147,_0x34419f){return db['ChatInteraction'][_0xf2fa('0x43')](_0x1fe147['body'],{})[_0xf2fa('0x15')](respondWithResult(_0x34419f,0xc9))[_0xf2fa('0x1e')](handleError(_0x34419f,null));};exports[_0xf2fa('0x28')]=function(_0x3b187f,_0xdf38ae){if(_0x3b187f['body']['id']){delete _0x3b187f[_0xf2fa('0x44')]['id'];}return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x3b187f[_0xf2fa('0x38')]['id']}})[_0xf2fa('0x15')](handleEntityNotFound(_0xdf38ae,null))[_0xf2fa('0x15')](saveUpdates(_0x3b187f[_0xf2fa('0x44')],null))['then'](respondWithResult(_0xdf38ae,null))[_0xf2fa('0x1e')](handleError(_0xdf38ae,null));};exports[_0xf2fa('0x29')]=function(_0x496cc8,_0x2a092f){return db['ChatInteraction'][_0xf2fa('0x45')]({'where':{'id':_0x496cc8[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0x2a092f,null))['then'](removeEntity(_0x2a092f,null))[_0xf2fa('0x1e')](handleError(_0x2a092f,null));};exports[_0xf2fa('0x46')]=function(_0x34f35e,_0x31a9c3){return db[_0xf2fa('0x3a')]['describe']()[_0xf2fa('0x15')](respondWithResult(_0x31a9c3,null))[_0xf2fa('0x1e')](handleError(_0x31a9c3,null));};exports['createVidaooSession']=function(_0x5ae15c,_0x2b7012){var _0x47cd30=_0x5ae15c[_0xf2fa('0x38')]['id'];var _0x32e7c4;var _0x347523;var _0x59c6f8;return db[_0xf2fa('0x3a')][_0xf2fa('0x47')]({'where':{'id':_0x47cd30}})[_0xf2fa('0x15')](function(_0x33369a){_0x32e7c4=_0x33369a;return db['ChatWebsite']['findOne']({'where':{'id':_0x33369a[_0xf2fa('0x48')]},'attributes':['id',_0xf2fa('0x49'),_0xf2fa('0x4a'),_0xf2fa('0x4b'),_0xf2fa('0x4c'),_0xf2fa('0x4d')],'raw':!![]});})[_0xf2fa('0x15')](function(_0x2d9f72){if(_0x2d9f72&&_0x2d9f72[_0xf2fa('0x49')]&&_0x2d9f72[_0xf2fa('0x4a')]){_0x347523=_0x2d9f72;var _0x48d55c={'interaction':{'id':_0x47cd30},'agent':{'id':_0x5ae15c['user']['id'],'name':_0x5ae15c['user'][_0xf2fa('0x2c')],'fullname':_0x5ae15c['user'][_0xf2fa('0x4e')],'email':_0x5ae15c[_0xf2fa('0x37')][_0xf2fa('0x4f')]},'contact':_0x5ae15c[_0xf2fa('0x44')][_0xf2fa('0x50')],'account':_0x5ae15c[_0xf2fa('0x44')]['account']};var _0x1e5e67={'rejectUnauthorized':![],'method':_0xf2fa('0x51'),'url':_0xf2fa('0x52'),'headers':{'X-APIKEY':_0x2d9f72[_0xf2fa('0x49')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5ae15c[_0xf2fa('0x37')]['email']],'buttons':null,'topic':_0x347523['vidaooTopic'],'note':_[_0xf2fa('0x53')](_0x347523[_0xf2fa('0x4c')])?null:getMustacheRender(_0x347523['vidaooNote'],_0x48d55c),'metadata':null},'redirect':_0xf2fa('0x54'),'json':!![]};try{if(!_[_0xf2fa('0x53')](_0x347523[_0xf2fa('0x4d')])){var _0xb0f779=getMustacheRender(_0x347523[_0xf2fa('0x4d')],_0x48d55c);var _0x230b66=JSON['parse'](_0xb0f779);_0x1e5e67[_0xf2fa('0x44')][_0xf2fa('0x55')]=_0x230b66;}}catch(_0x235cb4){throw new db[(_0xf2fa('0x56'))][(_0xf2fa('0x57'))](_0xf2fa('0x58'));}return rp(_0x1e5e67);}else{throw new db['Sequelize'][(_0xf2fa('0x57'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xf2fa('0x15')](function(_0x1b8cc6){_0x59c6f8=_0x1b8cc6;if(_0x59c6f8['id']){var _0x4d1715={'body':_0x59c6f8[_0xf2fa('0x59')],'ChatWebsiteId':_0x347523['id'],'ChatInteractionId':_0x32e7c4['id'],'direction':_0xf2fa('0x5a'),'UserId':_0x5ae15c[_0xf2fa('0x37')]['id']};return db[_0xf2fa('0x5b')][_0xf2fa('0x43')](_0x4d1715,{});}else{throw new db[(_0xf2fa('0x56'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xf2fa('0x15')](function(){return _0x32e7c4[_0xf2fa('0x5c')]({'vidaooSessionId':_0x59c6f8['id']});})[_0xf2fa('0x15')](respondWithResult(_0x2b7012,null))[_0xf2fa('0x1e')](handleError(_0x2b7012,null));};exports[_0xf2fa('0x5d')]=function(_0x5bb579,_0x237a6f){if(_0x5bb579[_0xf2fa('0x44')]['id']){delete _0x5bb579[_0xf2fa('0x44')]['id'];}return db[_0xf2fa('0x3a')]['find']({'where':{'id':_0x5bb579[_0xf2fa('0x38')]['id']},'include':[{'model':db[_0xf2fa('0x5e')],'as':'Contact'}]})[_0xf2fa('0x15')](handleEntityNotFound(_0x237a6f,null))[_0xf2fa('0x15')](saveUpdates(_0x5bb579[_0xf2fa('0x44')],null))[_0xf2fa('0x15')](respondWithResult(_0x237a6f,null))[_0xf2fa('0x1e')](handleError(_0x237a6f,null));};exports[_0xf2fa('0x5f')]=function(_0x203349,_0x122470){if(_0x203349['body']['id']){delete _0x203349[_0xf2fa('0x44')]['id'];}return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x203349['params']['id']}})[_0xf2fa('0x15')](function(_0x40493d){if(!_0x40493d){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xf2fa('0x60'));_0x122470['sendStatus'](0x194);}else{if(_0x40493d[_0xf2fa('0x61')]){throw new db[(_0xf2fa('0x56'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x40493d;})[_0xf2fa('0x15')](function(_0x3b16ff){if(_0x3b16ff){return _0x3b16ff[_0xf2fa('0x28')]({'closed':_0x203349[_0xf2fa('0x44')][_0xf2fa('0x62')],'disposition':_0x203349['body'][_0xf2fa('0x63')]})[_0xf2fa('0x15')](function(_0x2c83f7){return _0x2c83f7;});}})['then'](function(){return respondWithRpcPromise(_0xf2fa('0x64'),_0xf2fa('0x5f'),_0x203349[_0xf2fa('0x44')],client9004);})[_0xf2fa('0x15')](respondWithResult(_0x122470,null))['catch'](handleError(_0x122470,null));};exports[_0xf2fa('0x65')]=function(_0x215845,_0x5a4a96){_0x215845[_0xf2fa('0x44')][_0xf2fa('0x2c')]=_0x215845['file'][_0xf2fa('0x66')];_0x215845['body'][_0xf2fa('0x67')]=_0x215845['file'][_0xf2fa('0x68')];_0x215845['body'][_0xf2fa('0x33')]=_0x215845['file']['mimetype'];return db[_0xf2fa('0x69')][_0xf2fa('0x43')](_0x215845[_0xf2fa('0x44')])['then'](respondWithResult(_0x5a4a96,0xc9))[_0xf2fa('0x1e')](handleError(_0x5a4a96,null));};exports[_0xf2fa('0x6a')]=function(_0x22db86,_0x4e4d1d){return db['ChatInteraction'][_0xf2fa('0x47')]({'where':{'id':_0x22db86['params']['id']},'raw':!![]})[_0xf2fa('0x15')](handleEntityNotFound(_0x4e4d1d,null))[_0xf2fa('0x15')](function(_0x52386d){if(_0x52386d){if(_0x52386d[_0xf2fa('0x62')]){return _0x4e4d1d[_0xf2fa('0x2a')](0x193)[_0xf2fa('0x27')]({'status':0x193,'message':_0xf2fa('0x6b')});}return db['Attachment']['findOne']({'where':{'id':_0x22db86[_0xf2fa('0x36')][_0xf2fa('0x6c')]},'raw':!![]})[_0xf2fa('0x15')](handleEntityNotFound(_0x4e4d1d,null));}})[_0xf2fa('0x15')](function(_0x126f28){if(_0x126f28){var _0xa068a2=_0x126f28[_0xf2fa('0x6d')]!==null;var _0x2ef7ec=path[_0xf2fa('0x6e')](config['root'],_0xf2fa('0x6f'));if(_0xa068a2){_0x2ef7ec=path['join'](_0x2ef7ec,_0xf2fa('0x70'));}var _0x4ccf37=path[_0xf2fa('0x6e')](_0x2ef7ec,_0x126f28[_0xf2fa('0x67')]);return _0x4e4d1d[_0xf2fa('0x71')](_0x4ccf37);}})[_0xf2fa('0x1e')](handleError(_0x4e4d1d,null));};exports[_0xf2fa('0x72')]=function(_0x46a15a,_0x40b0c2){var _0x411d64=null;var _0x4bb0f4=null;var _0x524fc6=null;if(_0x46a15a['body']['id']){delete _0x46a15a[_0xf2fa('0x44')]['id'];}if(_0x46a15a['body'][_0xf2fa('0x73')]){_0x524fc6=path['join'](config[_0xf2fa('0x74')],_0xf2fa('0x75'),util[_0xf2fa('0x76')]('transcript-%s.txt',Date[_0xf2fa('0x77')]()));_0x46a15a['body'][_0xf2fa('0x78')]=_0x524fc6;}return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x46a15a['params']['id']},'include':[{'model':db[_0xf2fa('0x5b')],'as':'Messages','include':[{'model':db[_0xf2fa('0x79')],'as':'User'}]}]})[_0xf2fa('0x15')](handleEntityNotFound(_0x40b0c2,null))[_0xf2fa('0x15')](saveUpdates(_0x46a15a[_0xf2fa('0x44')],null))[_0xf2fa('0x15')](function(_0x188bae){if(_0x188bae){_0x411d64=_0x188bae;return db[_0xf2fa('0x7a')][_0xf2fa('0x45')]({'where':{'id':_0x411d64[_0xf2fa('0x48')]}});}})['then'](function(_0x32a7e8){if(_0x32a7e8){_0x4bb0f4=_0x32a7e8;return db[_0xf2fa('0x5e')]['find']({'where':{'id':_0x411d64[_0xf2fa('0x7b')]}});}})[_0xf2fa('0x15')](function(_0x5012e2){if(_0x5012e2){if(_0x524fc6){var _0xb2a141=null;for(var _0x4f67a9=0x1;_0x4f67a9<_0x411d64[_0xf2fa('0x7c')][_0xf2fa('0x41')];++_0x4f67a9){_0xb2a141=_0x411d64['Messages'][_0x4f67a9];var _0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?util[_0xf2fa('0x76')](_0xf2fa('0x7d'),_0x4bb0f4[_0xf2fa('0x7e')],_0xb2a141[_0xf2fa('0x61')]):_0xf2fa('0x7f');var _0x14eabf=_0x46a15a[_0xf2fa('0x44')][_0xf2fa('0x80')]||util[_0xf2fa('0x76')](_0xf2fa('0x7d'),_0xf2fa('0x81'),_0xb2a141[_0xf2fa('0x7b')]);switch(_0x4bb0f4['agentIdentifier']){case _0xf2fa('0x82'):_0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?util['format'](_0xf2fa('0x7d'),_0x4bb0f4[_0xf2fa('0x7e')],_0xb2a141[_0xf2fa('0x61')]):_0xf2fa('0x7f');break;case'agent_alias':_0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?_0xb2a141[_0xf2fa('0x79')][_0xf2fa('0x83')]||_0xb2a141[_0xf2fa('0x79')][_0xf2fa('0x4e')]:'System';break;case _0xf2fa('0x84'):_0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?_0xb2a141[_0xf2fa('0x79')][_0xf2fa('0x4e')]:_0xf2fa('0x7f');break;default:_0x45b8ba=_0xb2a141['UserId']?util[_0xf2fa('0x76')](_0xf2fa('0x7d'),_0x4bb0f4[_0xf2fa('0x7e')],_0xb2a141[_0xf2fa('0x61')]):_0xf2fa('0x7f');}var _0x10fae9=util[_0xf2fa('0x76')](_0xf2fa('0x85'),moment(_0xb2a141['createdAt'])[_0xf2fa('0x76')](_0xf2fa('0x86')),_0xb2a141[_0xf2fa('0x87')]==='in'?_0x14eabf:_0x45b8ba,_0xb2a141[_0xf2fa('0x44')]);if(!_0xb2a141[_0xf2fa('0x88')]){fs[_0xf2fa('0x89')](_0x524fc6,_0x10fae9);}}return db[_0xf2fa('0x8a')][_0xf2fa('0x47')]({'where':{'service':!![]},'include':[{'model':db[_0xf2fa('0x8b')],'as':_0xf2fa('0x8c'),'raw':!![],'include':[{'model':db[_0xf2fa('0x8d')],'as':_0xf2fa('0x8d'),'raw':!![]}]}]});}}})[_0xf2fa('0x15')](function(_0x4526cb){if(!_0x4526cb||!_0x4526cb[_0xf2fa('0x8c')]||!_0x46a15a[_0xf2fa('0x44')])return _0x411d64;var _0x30dd7c=_0x4526cb[_0xf2fa('0x8e')]();return respondWithRpcPromise(_0xf2fa('0x8f'),'sendMail',{'account':_0x30dd7c,'message':{'from':util[_0xf2fa('0x76')]('\x22%s\x22\x20<%s>',_0x4526cb[_0xf2fa('0x2c')],_0x4526cb[_0xf2fa('0x4f')]||_0x4526cb[_0xf2fa('0x8c')][_0xf2fa('0x37')]),'to':_0x46a15a[_0xf2fa('0x44')][_0xf2fa('0x73')],'subject':_0xf2fa('0x90'),'text':util[_0xf2fa('0x76')](_0xf2fa('0x91'),_0x46a15a[_0xf2fa('0x44')][_0xf2fa('0x73')]),'attachments':[{'path':_0x524fc6}]}})[_0xf2fa('0x15')](function(){return _0x411d64;})[_0xf2fa('0x1e')](function(_0x4f2d36){logger['error'](_0x4f2d36);});})['then'](respondWithStatusCode(_0x40b0c2,0xc8))[_0xf2fa('0x1e')](handleError(_0x40b0c2,null));};exports[_0xf2fa('0x92')]=function(_0x2a4c02,_0x2cc662){return db['ChatMessage'][_0xf2fa('0x45')]({'where':{'id':_0x2a4c02[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0x2cc662,null))[_0xf2fa('0x15')](function(_0x4d3776){if(_0x4d3776){return _0x4d3776['addMessage'](_0x2a4c02[_0xf2fa('0x44')]['ids'],_[_0xf2fa('0x93')](_0x2a4c02[_0xf2fa('0x44')],[_0xf2fa('0x94'),'id'])||{});}})[_0xf2fa('0x15')](respondWithResult(_0x2cc662,null))[_0xf2fa('0x1e')](handleError(_0x2cc662,null));};exports[_0xf2fa('0x95')]=function(_0x5d097e,_0x4bb3c2){var _0x512d89={'raw':![],'where':{}};var _0x5b17ae={};var _0x409764={'count':0x0,'rows':[]};return db[_0xf2fa('0x3a')][_0xf2fa('0x47')]({'where':{'id':_0x5d097e[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0x4bb3c2,null))[_0xf2fa('0x15')](function(_0x524c48){if(_0x524c48){_0x5b17ae[_0xf2fa('0x39')]=_['keys'](db[_0xf2fa('0x5b')][_0xf2fa('0x3b')]);_0x5b17ae['query']=_['keys'](_0x5d097e[_0xf2fa('0x36')]);_0x5b17ae['filters']=_[_0xf2fa('0x3e')](_0x5b17ae['model'],_0x5b17ae[_0xf2fa('0x36')]);_0x512d89[_0xf2fa('0x3f')]=_[_0xf2fa('0x3e')](_0x5b17ae['model'],qs['fields'](_0x5d097e[_0xf2fa('0x36')]['fields']));_0x512d89[_0xf2fa('0x3f')]=_0x512d89[_0xf2fa('0x3f')][_0xf2fa('0x41')]?_0x512d89[_0xf2fa('0x3f')]:_0x5b17ae['model'];if(!_0x5d097e[_0xf2fa('0x36')]['hasOwnProperty'](_0xf2fa('0x96'))){_0x512d89[_0xf2fa('0x23')]=qs['limit'](_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x23')]);_0x512d89['offset']=qs[_0xf2fa('0x21')](_0x5d097e['query']['offset']);}_0x512d89[_0xf2fa('0x97')]=qs[_0xf2fa('0x98')](_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x98')]);_0x512d89[_0xf2fa('0x99')]=qs[_0xf2fa('0x3d')](_[_0xf2fa('0x9a')](_0x5d097e[_0xf2fa('0x36')],_0x5b17ae['filters']));_0x512d89[_0xf2fa('0x99')]['ChatInteractionId']=_0x524c48['id'];if(_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x9b')]){_0x512d89[_0xf2fa('0x99')]=_[_0xf2fa('0x2f')](_0x512d89[_0xf2fa('0x99')],{'$or':_[_0xf2fa('0x32')](_0x512d89['attributes'],function(_0x10136a){var _0x44f34a={};_0x44f34a[_0x10136a]={'$like':'%'+_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x9b')]+'%'};return _0x44f34a;})});}if(_0x5d097e[_0xf2fa('0x36')]['$gte']){var _0x2b5a04=_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x9c')][_0xf2fa('0x9d')](',');var _0x9ddd6={};_0x9ddd6[_0x2b5a04[0x0]]={'$gte':moment(_0x2b5a04[0x1])['format'](_0xf2fa('0x9e'))};_0x512d89[_0xf2fa('0x99')]=_[_0xf2fa('0x2f')](_0x512d89[_0xf2fa('0x99')],_0x9ddd6);}_0x512d89=_[_0xf2fa('0x2f')]({},_0x512d89,_0x5d097e[_0xf2fa('0x9f')]);return db[_0xf2fa('0x5b')][_0xf2fa('0x24')]({'where':_0x512d89[_0xf2fa('0x99')]})['then'](function(_0x52f48f){_0x409764[_0xf2fa('0x24')]=_0x52f48f;if(_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x42')]){_0x512d89[_0xf2fa('0xa0')]=[{'all':!![]}];}return db[_0xf2fa('0x5b')][_0xf2fa('0xa1')](_0x512d89);})[_0xf2fa('0x15')](function(_0x4e7161){_0x409764[_0xf2fa('0xa2')]=_0x4e7161;return _0x409764;});}})[_0xf2fa('0x15')](respondWithFilteredResult(_0x4bb3c2,_0x512d89))[_0xf2fa('0x1e')](handleError(_0x4bb3c2,null));};exports['getMyMessages']=function(_0x4dd93c,_0x2ac43c){var _0x59b864={'where':{}},_0x53221c={},_0x1ae891={'count':0x0,'rows':[]};return db[_0xf2fa('0x3a')]['findOne']({'where':{'id':_0x4dd93c[_0xf2fa('0x38')]['id']}})[_0xf2fa('0x15')](handleEntityNotFound(_0x2ac43c,null))[_0xf2fa('0x15')](function(_0x4ae4df){if(_0x4ae4df){_0x53221c['model']=_[_0xf2fa('0x3c')](db['ChatMessage'][_0xf2fa('0x3b')]);_0x53221c[_0xf2fa('0x36')]=_[_0xf2fa('0x3c')](_0x4dd93c['query']);_0x53221c[_0xf2fa('0x3d')]=_[_0xf2fa('0x3e')](_0x53221c[_0xf2fa('0x39')],_0x53221c[_0xf2fa('0x36')]);_0x59b864[_0xf2fa('0x3f')]=_[_0xf2fa('0x3e')](_0x53221c[_0xf2fa('0x39')],qs['fields'](_0x4dd93c[_0xf2fa('0x36')]['fields']));_0x59b864[_0xf2fa('0x3f')]=_0x59b864[_0xf2fa('0x3f')]['length']?_0x59b864['attributes']:_0x53221c[_0xf2fa('0x39')];if(!_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0xa3')]('nolimit')){_0x59b864['limit']=qs[_0xf2fa('0x23')](_0x4dd93c['query'][_0xf2fa('0x23')]);_0x59b864[_0xf2fa('0x21')]=qs[_0xf2fa('0x21')](_0x4dd93c['query'][_0xf2fa('0x21')]);}_0x59b864[_0xf2fa('0x97')]=qs[_0xf2fa('0x98')](_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0x98')]);_0x59b864[_0xf2fa('0x99')]=qs['filters'](_[_0xf2fa('0x9a')](_0x4dd93c[_0xf2fa('0x36')],_0x53221c[_0xf2fa('0x3d')]));_0x59b864[_0xf2fa('0x99')][_0xf2fa('0xa4')]=_0x4ae4df['id'];if(_0x4dd93c['query'][_0xf2fa('0x9b')]){_0x59b864[_0xf2fa('0x99')]=_[_0xf2fa('0x2f')](_0x59b864[_0xf2fa('0x99')],{'$or':_[_0xf2fa('0x32')](_0x59b864[_0xf2fa('0x3f')],function(_0x3bde55){var _0x20357f={};_0x20357f[_0x3bde55]={'$like':'%'+_0x4dd93c['query'][_0xf2fa('0x9b')]+'%'};return _0x20357f;})});}_0x59b864[_0xf2fa('0x99')][_0xf2fa('0x88')]=![];if(_0x4dd93c['query']['id']){_0x59b864[_0xf2fa('0x99')]['id']={'$gt':_0x4dd93c[_0xf2fa('0x36')]['id']};}_0x59b864=_[_0xf2fa('0x2f')]({},_0x59b864,_0x4dd93c[_0xf2fa('0x9f')]);return db['ChatMessage']['count']({'where':_0x59b864[_0xf2fa('0x99')]})[_0xf2fa('0x15')](function(_0x5776d7){_0x1ae891['count']=_0x5776d7;_0x59b864[_0xf2fa('0xa0')]=[];if(_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0xa5')]){_0x59b864[_0xf2fa('0xa0')][_0xf2fa('0xa6')]({'model':db['User'],'as':'User','attributes':['id',_0xf2fa('0x4e'),_0xf2fa('0x83')]});}if(_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0x42')]){_0x59b864[_0xf2fa('0xa0')]=[{'all':!![]}];}return db[_0xf2fa('0x5b')][_0xf2fa('0xa1')](_0x59b864);})[_0xf2fa('0x15')](function(_0x430fdb){_0x1ae891['rows']=_0x430fdb;return _0x1ae891;});}})['then'](respondWithFilteredResult(_0x2ac43c,_0x59b864))['catch'](handleError(_0x2ac43c,null));};exports['addTags']=function(_0x2dd141,_0x16f79d){return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x2dd141['params']['id']}})[_0xf2fa('0x15')](handleEntityNotFound(_0x16f79d,null))[_0xf2fa('0x15')](function(_0x424dc4){if(_0x424dc4){return _0x424dc4[_0xf2fa('0xa7')](_0x2dd141[_0xf2fa('0x44')][_0xf2fa('0x94')],_[_0xf2fa('0x93')](_0x2dd141[_0xf2fa('0x44')],[_0xf2fa('0x94'),'id'])||{})[_0xf2fa('0xa8')](function(){return db[_0xf2fa('0xa9')][_0xf2fa('0xa1')]({'attributes':['id',_0xf2fa('0x2c'),'color'],'where':{'id':_0x2dd141[_0xf2fa('0x44')][_0xf2fa('0x94')]}});})[_0xf2fa('0x15')](function(_0x20a488){socket[_0xf2fa('0xaa')](_0xf2fa('0xab'),{'id':Number(_0x2dd141[_0xf2fa('0x38')]['id']),'tags':_0x20a488||[]});return{'id':Number(_0x2dd141['params']['id']),'tags':_0x20a488||[]};});}})[_0xf2fa('0x15')](respondWithResult(_0x16f79d,null))[_0xf2fa('0x1e')](handleError(_0x16f79d,null));};exports[_0xf2fa('0xac')]=function(_0x3b645a,_0xfb9985){return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x3b645a[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0xfb9985,null))[_0xf2fa('0x15')](function(_0x567bc8){if(_0x567bc8){return _0x567bc8[_0xf2fa('0xac')](_0x3b645a[_0xf2fa('0x36')][_0xf2fa('0x94')]);}})[_0xf2fa('0x15')](respondWithStatusCode(_0xfb9985,null))[_0xf2fa('0x1e')](handleError(_0xfb9985,null));};exports[_0xf2fa('0x71')]=function(_0x38b6e4,_0x278409){var _0x40433f=moment()[_0xf2fa('0xad')]()[_0xf2fa('0xae')]();var _0x428d86=path['join'](config[_0xf2fa('0x74')],_0xf2fa('0xaf'),_0xf2fa('0xb0'),_0xf2fa('0xb1'));var _0x3a23a6=path['join'](config[_0xf2fa('0x74')],_0xf2fa('0xaf'),'files',_0xf2fa('0xb2'));var _0x121fc8=path['join'](_0x428d86,_0x40433f);var _0x553b27=util[_0xf2fa('0x76')](_0xf2fa('0xb3'),_0x38b6e4['params']['id'],_0x40433f);var _0x59201f=path[_0xf2fa('0x6e')](_0x428d86,_0x553b27);var _0x3f0502=[];_0x3f0502['push']({'model':db[_0xf2fa('0x79')],'as':_0xf2fa('0x79'),'attributes':['id',_0xf2fa('0x4e')],'raw':!![]});_0x3f0502[_0xf2fa('0xa6')]({'model':db['CmContact'],'as':_0xf2fa('0xb4'),'attributes':['id',_0xf2fa('0xb5'),_0xf2fa('0xb6')],'raw':!![]});if(_0x38b6e4[_0xf2fa('0x36')][_0xf2fa('0xb2')]){_0x3f0502[_0xf2fa('0xa6')]({'model':db[_0xf2fa('0x69')],'as':_0xf2fa('0x69'),'raw':!![]});}var _0x32e3d9=[{'model':db['ChatMessage'],'as':_0xf2fa('0x7c'),'attributes':['id','body',_0xf2fa('0xb7'),'direction',_0xf2fa('0x88'),'read'],'include':_0x3f0502}];_0x32e3d9['push']({'model':db[_0xf2fa('0x7a')],'as':_0xf2fa('0xb8'),'attributes':['id',_0xf2fa('0x2c')]});_0x32e3d9[_0xf2fa('0xa6')]({'model':db[_0xf2fa('0x79')],'as':'Owner','attributes':['id',_0xf2fa('0x4e')]});return db[_0xf2fa('0x3a')]['find']({'where':{'id':_0x38b6e4[_0xf2fa('0x38')]['id']},'include':_0x32e3d9})[_0xf2fa('0x15')](handleEntityNotFound(_0x278409,null))[_0xf2fa('0x15')](function(_0x4e5c7f){if(_0x4e5c7f){var _0x2eab29=_0x4e5c7f[_0xf2fa('0xb9')]({'plain':!![]});fs['mkdirSync'](_0x121fc8);var _0x10663f={'channel':_0xf2fa('0xba'),'account':_0x2eab29[_0xf2fa('0xb8')][_0xf2fa('0x2c')],'agent':_0x2eab29[_0xf2fa('0xbb')]?_0x2eab29['Owner'][_0xf2fa('0x4e')]:_0xf2fa('0xbc'),'createdAt':moment(_0x2eab29[_0xf2fa('0xb7')])[_0xf2fa('0x76')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2eab29[_0xf2fa('0x62')]?moment(_0x2eab29[_0xf2fa('0xbd')])[_0xf2fa('0x76')](_0xf2fa('0x9e'))[_0xf2fa('0xae')]():'','disposition':_0x2eab29[_0xf2fa('0x63')],'chatInfo':{'browser':_0x2eab29[_0xf2fa('0xbe')],'os':_0x2eab29[_0xf2fa('0xbf')],'referer':_0x2eab29[_0xf2fa('0xc0')],'customerIp':_0x2eab29[_0xf2fa('0xc1')],'customerPort':_0x2eab29['customerPort']?_0x2eab29['customerPort']:_0xf2fa('0xbc')},'messages':_(_0x2eab29[_0xf2fa('0x7c')])[_0xf2fa('0xc2')]()[_0xf2fa('0x9b')]({'secret':![]})[_0xf2fa('0x32')](function(_0x5aea6e){if(_0x5aea6e[_0xf2fa('0x69')]){var _0x269b60=path[_0xf2fa('0x6e')](_0x3a23a6,_0x5aea6e[_0xf2fa('0x69')][_0xf2fa('0x67')]);if(fs[_0xf2fa('0xc3')](_0x269b60)){fs['createReadStream'](_0x269b60)[_0xf2fa('0xc4')](fs[_0xf2fa('0xc5')](path[_0xf2fa('0x6e')](_0x121fc8,_0x5aea6e[_0xf2fa('0x69')]['basename'])));}}return{'date':moment(_0x5aea6e[_0xf2fa('0xb7')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf2fa('0xae')](),'sender':_0x5aea6e[_0xf2fa('0x87')]===_0xf2fa('0x5a')?_0x5aea6e[_0xf2fa('0x79')]?_0x5aea6e[_0xf2fa('0x79')][_0xf2fa('0x4e')]:_0xf2fa('0x7f'):_0x5aea6e[_0xf2fa('0xb4')][_0xf2fa('0xb5')]+(_0x5aea6e[_0xf2fa('0xb4')][_0xf2fa('0xb6')]?'\x20'+_0x5aea6e[_0xf2fa('0xb4')]['lastName']:''),'body':_0x5aea6e['Attachment']?_0x5aea6e['Attachment']['basename']:_0x5aea6e[_0xf2fa('0x44')],'direction':_0x5aea6e[_0xf2fa('0x87')]===_0xf2fa('0x5a')?'A':'C','secret':_0x5aea6e[_0xf2fa('0x88')],'read':_0x5aea6e[_0xf2fa('0xc6')],'attachment':_0x5aea6e[_0xf2fa('0x69')]};})[_0xf2fa('0xc7')]()};return ejs[_0xf2fa('0xc8')](path[_0xf2fa('0x6e')](config[_0xf2fa('0x74')],_0xf2fa('0xaf'),_0xf2fa('0xc9'),_0xf2fa('0xca')),{'interaction':_0x10663f})['then'](function(_0x580e53){var _0x426fcf=path[_0xf2fa('0x6e')](_0x121fc8,_0xf2fa('0xcb')+_0x2eab29['id']+'-'+_0x40433f+'.pdf');var _0x4c8b88={'path':_0x426fcf,'channel':_0xf2fa('0xba'),'interactionId':_0x2eab29['id']};return pdf[_0xf2fa('0xcc')](_0x580e53,_0x4c8b88);})[_0xf2fa('0x15')](function(){return new Promise(function(_0x1b336e,_0x343241){zipdir(_0x121fc8,{'saveTo':_0x59201f},function(_0x5848ea,_0x3d49f9){if(_0x5848ea)return _0x343241(_0x5848ea);return _0x1b336e(_0x3d49f9);});})[_0xf2fa('0x15')](function(){return new BPromise(function(_0x59eaf4,_0x438f3d){rimraf(_0x121fc8,function(_0x40b2b9){if(_0x40b2b9)_0x438f3d(_0x40b2b9);return _0x59eaf4();});});})['then'](function(){return _0x278409[_0xf2fa('0x71')](_0x59201f,_0x553b27,function(_0x5a482c){if(_0x5a482c){logger[_0xf2fa('0x1a')]('err',_0x5a482c);}else{fs[_0xf2fa('0xcd')](_0x59201f);}});});});}else{return _0x278409['sendStatus'](0xc8);}})['catch'](handleError(_0x278409,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 5833d48..da7bc7c 100644
--- a/server/api/chatInteraction/chatInteraction.events.js
+++ b/server/api/chatInteraction/chatInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb67d=['findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','then','setDataValue','map'];(function(_0x2f10e3,_0x5018fe){var _0x37264=function(_0x6e2ce1){while(--_0x6e2ce1){_0x2f10e3['push'](_0x2f10e3['shift']());}};_0x37264(++_0x5018fe);}(_0xb67d,0x116));var _0xdb67=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb67d[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xdb67('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xdb67('0x1')];var ChatMessage=require(_0xdb67('0x2'))['db'][_0xdb67('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdb67('0x4')](0x0);var events={'afterCreate':_0xdb67('0x5'),'afterUpdate':_0xdb67('0x6'),'afterDestroy':'remove'};function emitEvent(_0x293dcb){return function(_0x990fca,_0x1f085d,_0x292cca){_0x990fca['getUsers']({'attributes':['id'],'raw':!![]})[_0xdb67('0x7')](function(_0x10fb08){_0x990fca[_0xdb67('0x8')]('Users',_0x10fb08[_0xdb67('0x9')](function(_0x7b2620){return{'id':_0x7b2620['id']};}));return ChatMessage[_0xdb67('0xa')]({'where':{'ChatInteractionId':_0x990fca['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdb67('0x7')](function(_0x2ab672){_0x990fca['setDataValue'](_0xdb67('0xb'),_0x2ab672[_0xdb67('0xc')]);ChatInteractionEvents['emit'](_0x293dcb+':'+_0x990fca['id'],_0x990fca);ChatInteractionEvents[_0xdb67('0xd')](_0x293dcb,_0x990fca);_0x292cca(null);})['catch'](_0x292cca(null));};}for(var e in events){if(events[_0xdb67('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xdb67('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x7ed4=['then','setDataValue','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x7ed4,0x182));var _0x47ed=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x7ed4[_0x4cc280];return _0x16ed24;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x47ed('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x47ed('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47ed('0x1'),'afterUpdate':_0x47ed('0x2'),'afterDestroy':_0x47ed('0x3')};function emitEvent(_0x2b8bf2){return function(_0x2a7ebd,_0x53d383,_0x497689){_0x2a7ebd['getUsers']({'attributes':['id'],'raw':!![]})[_0x47ed('0x4')](function(_0x26bd9a){_0x2a7ebd[_0x47ed('0x5')]('Users',_0x26bd9a['map'](function(_0x374ed6){return{'id':_0x374ed6['id']};}));return ChatMessage[_0x47ed('0x6')]({'where':{'ChatInteractionId':_0x2a7ebd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x47ed('0x4')](function(_0x20d1b0){_0x2a7ebd[_0x47ed('0x5')](_0x47ed('0x7'),_0x20d1b0[_0x47ed('0x8')]);ChatInteractionEvents[_0x47ed('0x9')](_0x2b8bf2+':'+_0x2a7ebd['id'],_0x2a7ebd);ChatInteractionEvents['emit'](_0x2b8bf2,_0x2a7ebd);_0x497689(null);})['catch'](_0x497689(null));};}for(var e in events){if(events[_0x47ed('0xa')](e)){var event=events[e];ChatInteraction[_0x47ed('0xb')](e,emitEvent(event));}}module[_0x47ed('0xc')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index e6b26a7..0bd14c9 100644
--- a/server/api/chatInteraction/chatInteraction.model.js
+++ b/server/api/chatInteraction/chatInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaefa=['closedAt','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed'];(function(_0x51c343,_0xf63b5){var _0x4d3855=function(_0x55721a){while(--_0x55721a){_0x51c343['push'](_0x51c343['shift']());}};_0x4d3855(++_0xf63b5);}(_0xaefa,0x64));var _0xaaef=function(_0x386c03,_0x32b041){_0x386c03=_0x386c03-0x0;var _0x4806fa=_0xaefa[_0x386c03];return _0x4806fa;};'use strict';var _=require('lodash');var util=require(_0xaaef('0x0'));var logger=require(_0xaaef('0x1'))('api');var moment=require(_0xaaef('0x2'));var BPromise=require(_0xaaef('0x3'));var rp=require(_0xaaef('0x4'));var fs=require('fs');var path=require(_0xaaef('0x5'));var rimraf=require('rimraf');var config=require(_0xaaef('0x6'));var attributes=require(_0xaaef('0x7'));module[_0xaaef('0x8')]=function(_0x54b113,_0x260933){return _0x54b113[_0xaaef('0x9')](_0xaaef('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x800f18,_0x1f0b5a,_0x29659){if(_0x800f18[_0xaaef('0xb')]('closed')){_0x800f18[_0xaaef('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x29659(null,_0x800f18);}},'charset':'utf8mb4','collate':_0xaaef('0xd')});};
\ No newline at end of file
+var _0xd1cc=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt'];(function(_0x3f0c4d,_0x36c466){var _0x4789fd=function(_0x3e2c36){while(--_0x3e2c36){_0x3f0c4d['push'](_0x3f0c4d['shift']());}};_0x4789fd(++_0x36c466);}(_0xd1cc,0x76));var _0xcd1c=function(_0x6d7d6d,_0x401215){_0x6d7d6d=_0x6d7d6d-0x0;var _0x34dc6d=_0xd1cc[_0x6d7d6d];return _0x34dc6d;};'use strict';var _=require(_0xcd1c('0x0'));var util=require('util');var logger=require(_0xcd1c('0x1'))(_0xcd1c('0x2'));var moment=require(_0xcd1c('0x3'));var BPromise=require(_0xcd1c('0x4'));var rp=require(_0xcd1c('0x5'));var fs=require('fs');var path=require(_0xcd1c('0x6'));var rimraf=require(_0xcd1c('0x7'));var config=require(_0xcd1c('0x8'));var attributes=require(_0xcd1c('0x9'));module['exports']=function(_0x18aed3,_0x2c0bae){return _0x18aed3[_0xcd1c('0xa')](_0xcd1c('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4bfc3d,_0x2b153,_0x3b3f54){if(_0x4bfc3d[_0xcd1c('0xc')](_0xcd1c('0xd'))){_0x4bfc3d[_0xcd1c('0xe')]=moment()[_0xcd1c('0xf')](_0xcd1c('0x10'));}_0x3b3f54(null,_0x4bfc3d);}},'charset':_0xcd1c('0x11'),'collate':_0xcd1c('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 040937b..e8bbf46 100644
--- a/server/api/chatInteraction/chatInteraction.rpc.js
+++ b/server/api/chatInteraction/chatInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2000=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','ChatInteraction','update','raw','options','attributes','limit','info','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','where','addTags','body','ids','omit','AddTags','lodash'];(function(_0x53e4ab,_0x22e0cb){var _0x21bb4f=function(_0x107787){while(--_0x107787){_0x53e4ab['push'](_0x53e4ab['shift']());}};_0x21bb4f(++_0x22e0cb);}(_0x2000,0x13f));var _0x0200=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0x2000[_0x1d3791];return _0x40fbf5;};'use strict';var _=require(_0x0200('0x0'));var util=require(_0x0200('0x1'));var moment=require('moment');var BPromise=require(_0x0200('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0200('0x3'));var db=require(_0x0200('0x4'))['db'];var utils=require(_0x0200('0x5'));var logger=require(_0x0200('0x6'))(_0x0200('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0200('0x8')][_0x0200('0x9')]({'port':0x232a});config[_0x0200('0xa')]=_['defaults'](config[_0x0200('0xa')],{'host':_0x0200('0xb'),'port':0x18eb});var socket=require(_0x0200('0xc'))(new Redis(config[_0x0200('0xa')]));require('./chatInteraction.socket')[_0x0200('0xd')](socket);function respondWithRpcPromise(_0x22b43a,_0x4071df,_0x10a728){return new BPromise(function(_0x264556,_0x42c5e0){return client[_0x0200('0xe')](_0x22b43a,_0x10a728)[_0x0200('0xf')](function(_0x37b067){logger['info'](_0x0200('0x10'),_0x4071df,'request\x20sent');logger[_0x0200('0x11')](_0x0200('0x12'),_0x4071df,_0x0200('0x13'),JSON['stringify'](_0x37b067));if(_0x37b067[_0x0200('0x14')]){if(_0x37b067[_0x0200('0x14')]['code']===0x1f4){logger[_0x0200('0x14')](_0x0200('0x10'),_0x4071df,_0x37b067[_0x0200('0x14')]['message']);return _0x42c5e0(_0x37b067[_0x0200('0x14')]['message']);}logger[_0x0200('0x14')](_0x0200('0x10'),_0x4071df,_0x37b067[_0x0200('0x14')]['message']);return _0x264556(_0x37b067[_0x0200('0x14')][_0x0200('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4071df,_0x0200('0x13'));_0x264556(_0x37b067[_0x0200('0x16')][_0x0200('0x15')]);}})['catch'](function(_0x5d2850){logger[_0x0200('0x14')](_0x0200('0x10'),_0x4071df,_0x5d2850);_0x42c5e0(_0x5d2850);});});}exports['UpdateChatInteraction']=function(_0x21c8ed){var _0x1aadd4=this;return new Promise(function(_0x302c4f,_0x149929){return db[_0x0200('0x17')][_0x0200('0x18')](_0x21c8ed['body'],{'raw':_0x21c8ed['options']?_0x21c8ed['options'][_0x0200('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21c8ed[_0x0200('0x1a')]?_0x21c8ed['options']['where']||null:null,'attributes':_0x21c8ed[_0x0200('0x1a')]?_0x21c8ed[_0x0200('0x1a')][_0x0200('0x1b')]||null:null,'limit':_0x21c8ed[_0x0200('0x1a')]?_0x21c8ed['options'][_0x0200('0x1c')]||null:null})[_0x0200('0xf')](function(_0x5df627){logger[_0x0200('0x1d')]('UpdateChatInteraction',_0x21c8ed);logger[_0x0200('0x11')](_0x0200('0x1e'),_0x21c8ed,JSON[_0x0200('0x1f')](_0x5df627));_0x302c4f(_0x5df627);})[_0x0200('0x20')](function(_0x2ea1d4){logger[_0x0200('0x14')](_0x0200('0x1e'),_0x2ea1d4[_0x0200('0x15')],_0x21c8ed);_0x149929(_0x1aadd4[_0x0200('0x14')](0x1f4,_0x2ea1d4[_0x0200('0x15')]));});});};exports[_0x0200('0x21')]=function(_0x52d7c5){return new Promise(function(_0x1bbc61,_0x40cbbc){return db['ChatInteraction']['find']({'where':_0x52d7c5[_0x0200('0x1a')]?_0x52d7c5[_0x0200('0x1a')][_0x0200('0x22')]||null:null})[_0x0200('0xf')](function(_0x1b676f){if(_0x1b676f){return _0x1b676f[_0x0200('0x23')](_0x52d7c5[_0x0200('0x24')][_0x0200('0x25')],_[_0x0200('0x26')](_0x52d7c5[_0x0200('0x24')],[_0x0200('0x25'),'id'])||{});}})['spread'](function(_0x219c0e){logger['info'](_0x0200('0x27'),_0x52d7c5);logger[_0x0200('0x11')](_0x0200('0x27'),_0x52d7c5,JSON[_0x0200('0x1f')](_0x219c0e));_0x1bbc61(_0x219c0e);})[_0x0200('0x20')](function(_0x1318b8){logger[_0x0200('0x14')](_0x0200('0x27'),_0x1318b8[_0x0200('0x15')],_0x52d7c5);_0x40cbbc(_this[_0x0200('0x14')](0x1f4,_0x1318b8[_0x0200('0x15')]));});});};
\ No newline at end of file
+var _0xf7f4=['find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateChatInteraction','update','body','options','where','attributes','limit','AddTagsToChatInteraction','ChatInteraction'];(function(_0xe33dfe,_0x326077){var _0x4eaed0=function(_0x5c448a){while(--_0x5c448a){_0xe33dfe['push'](_0xe33dfe['shift']());}};_0x4eaed0(++_0x326077);}(_0xf7f4,0xd8));var _0x4f7f=function(_0x30b734,_0x17baf6){_0x30b734=_0x30b734-0x0;var _0x2c4c07=_0xf7f4[_0x30b734];return _0x2c4c07;};'use strict';var _=require(_0x4f7f('0x0'));var util=require('util');var moment=require(_0x4f7f('0x1'));var BPromise=require(_0x4f7f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f7f('0x3'));var db=require(_0x4f7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f7f('0x5'))(_0x4f7f('0x6'));var config=require(_0x4f7f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4f7f('0x8')][_0x4f7f('0x9')]({'port':0x232a});config[_0x4f7f('0xa')]=_['defaults'](config['redis'],{'host':_0x4f7f('0xb'),'port':0x18eb});var socket=require(_0x4f7f('0xc'))(new Redis(config[_0x4f7f('0xa')]));require(_0x4f7f('0xd'))[_0x4f7f('0xe')](socket);function respondWithRpcPromise(_0x13b0b9,_0x2f1c06,_0xf556a0){return new BPromise(function(_0x5cf9a6,_0x3ad9b4){return client['request'](_0x13b0b9,_0xf556a0)[_0x4f7f('0xf')](function(_0x5bc629){logger[_0x4f7f('0x10')](_0x4f7f('0x11'),_0x2f1c06,'request\x20sent');logger[_0x4f7f('0x12')](_0x4f7f('0x13'),_0x2f1c06,'request\x20sent',JSON[_0x4f7f('0x14')](_0x5bc629));if(_0x5bc629[_0x4f7f('0x15')]){if(_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x16')]===0x1f4){logger[_0x4f7f('0x15')](_0x4f7f('0x11'),_0x2f1c06,_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);return _0x3ad9b4(_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);}logger[_0x4f7f('0x15')](_0x4f7f('0x11'),_0x2f1c06,_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);return _0x5cf9a6(_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);}else{logger[_0x4f7f('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2f1c06,_0x4f7f('0x18'));_0x5cf9a6(_0x5bc629[_0x4f7f('0x19')][_0x4f7f('0x17')]);}})[_0x4f7f('0x1a')](function(_0x292683){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2f1c06,_0x292683);_0x3ad9b4(_0x292683);});});}exports[_0x4f7f('0x1b')]=function(_0x52300d){var _0x362b3c=this;return new Promise(function(_0x4e023f,_0x1dbbca){return db['ChatInteraction'][_0x4f7f('0x1c')](_0x52300d[_0x4f7f('0x1d')],{'raw':_0x52300d[_0x4f7f('0x1e')]?_0x52300d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52300d[_0x4f7f('0x1e')]?_0x52300d['options'][_0x4f7f('0x1f')]||null:null,'attributes':_0x52300d[_0x4f7f('0x1e')]?_0x52300d[_0x4f7f('0x1e')][_0x4f7f('0x20')]||null:null,'limit':_0x52300d[_0x4f7f('0x1e')]?_0x52300d[_0x4f7f('0x1e')][_0x4f7f('0x21')]||null:null})[_0x4f7f('0xf')](function(_0x5c9366){logger[_0x4f7f('0x10')]('UpdateChatInteraction',_0x52300d);logger['debug']('UpdateChatInteraction',_0x52300d,JSON[_0x4f7f('0x14')](_0x5c9366));_0x4e023f(_0x5c9366);})[_0x4f7f('0x1a')](function(_0x15286a){logger[_0x4f7f('0x15')](_0x4f7f('0x1b'),_0x15286a[_0x4f7f('0x17')],_0x52300d);_0x1dbbca(_0x362b3c[_0x4f7f('0x15')](0x1f4,_0x15286a[_0x4f7f('0x17')]));});});};exports[_0x4f7f('0x22')]=function(_0x50719f){return new Promise(function(_0x555a15,_0x340fc3){return db[_0x4f7f('0x23')][_0x4f7f('0x24')]({'where':_0x50719f[_0x4f7f('0x1e')]?_0x50719f[_0x4f7f('0x1e')][_0x4f7f('0x1f')]||null:null})[_0x4f7f('0xf')](function(_0x15513b){if(_0x15513b){return _0x15513b[_0x4f7f('0x25')](_0x50719f[_0x4f7f('0x1d')][_0x4f7f('0x26')],_[_0x4f7f('0x27')](_0x50719f[_0x4f7f('0x1d')],[_0x4f7f('0x26'),'id'])||{});}})[_0x4f7f('0x28')](function(_0x392a61){logger[_0x4f7f('0x10')](_0x4f7f('0x29'),_0x50719f);logger[_0x4f7f('0x12')](_0x4f7f('0x29'),_0x50719f,JSON[_0x4f7f('0x14')](_0x392a61));_0x555a15(_0x392a61);})[_0x4f7f('0x1a')](function(_0x550052){logger[_0x4f7f('0x15')](_0x4f7f('0x29'),_0x550052[_0x4f7f('0x17')],_0x50719f);_0x340fc3(_this[_0x4f7f('0x15')](0x1f4,_0x550052[_0x4f7f('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 63d2b79..0ef2291 100644
--- a/server/api/chatInteraction/chatInteraction.socket.js
+++ b/server/api/chatInteraction/chatInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x28bc=['emit','removeListener','register','length','chatInteraction:','remove'];(function(_0x6bd2c1,_0x1ff03d){var _0x4f7c03=function(_0x3238d4){while(--_0x3238d4){_0x6bd2c1['push'](_0x6bd2c1['shift']());}};_0x4f7c03(++_0x1ff03d);}(_0x28bc,0xf5));var _0xc28b=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x28bc[_0x35a274];return _0x40d905;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xc28b('0x0'),'update'];function createListener(_0x2bf447,_0x39a141){return function(_0x57b981){_0x39a141[_0xc28b('0x1')](_0x2bf447,_0x57b981);};}function removeListener(_0x38b1eb,_0x491178){return function(){ChatInteractionEvents[_0xc28b('0x2')](_0x38b1eb,_0x491178);};}exports[_0xc28b('0x3')]=function(_0x1e2848){for(var _0x5c1be7=0x0,_0x4cdf9c=events[_0xc28b('0x4')];_0x5c1be7<_0x4cdf9c;_0x5c1be7++){var _0x2266d2=events[_0x5c1be7];var _0x20b169=createListener(_0xc28b('0x5')+_0x2266d2,_0x1e2848);ChatInteractionEvents['on'](_0x2266d2,_0x20b169);}};
\ No newline at end of file
+var _0x58e4=['emit','register','length','chatInteraction:','./chatInteraction.events','remove','update'];(function(_0x2b7b29,_0x59b527){var _0x179776=function(_0x414f34){while(--_0x414f34){_0x2b7b29['push'](_0x2b7b29['shift']());}};_0x179776(++_0x59b527);}(_0x58e4,0x1c4));var _0x458e=function(_0x2e9b61,_0x2120cf){_0x2e9b61=_0x2e9b61-0x0;var _0x597ccd=_0x58e4[_0x2e9b61];return _0x597ccd;};'use strict';var ChatInteractionEvents=require(_0x458e('0x0'));var events=['save',_0x458e('0x1'),_0x458e('0x2')];function createListener(_0x1cfd14,_0x34c66f){return function(_0x22d432){_0x34c66f[_0x458e('0x3')](_0x1cfd14,_0x22d432);};}function removeListener(_0x17f459,_0x304b9c){return function(){ChatInteractionEvents['removeListener'](_0x17f459,_0x304b9c);};}exports[_0x458e('0x4')]=function(_0x2c628a){for(var _0x4eb896=0x0,_0x4a54c0=events[_0x458e('0x5')];_0x4eb896<_0x4a54c0;_0x4eb896++){var _0x3025b9=events[_0x4eb896];var _0x2d4560=createListener(_0x458e('0x6')+_0x3025b9,_0x2c628a);ChatInteractionEvents['on'](_0x3025b9,_0x2d4560);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 226bf0a..386323d 100644
--- a/server/api/chatInteraction/index.js
+++ b/server/api/chatInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15b4=['/:id/attachment_upload','file','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','/:id/download','download','post','create','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace'];(function(_0x4d9acc,_0x5c8738){var _0x5e0d3a=function(_0x5ce4c1){while(--_0x5ce4c1){_0x4d9acc['push'](_0x4d9acc['shift']());}};_0x5e0d3a(++_0x5c8738);}(_0x15b4,0x74));var _0x415b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x15b4[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x415b('0x0'));var util=require(_0x415b('0x1'));var path=require(_0x415b('0x2'));var timeout=require(_0x415b('0x3'));var express=require(_0x415b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x415b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x415b('0x6'));router[_0x415b('0x7')]('/',auth[_0x415b('0x8')](),controller[_0x415b('0x9')]);router[_0x415b('0x7')](_0x415b('0xa'),auth[_0x415b('0x8')](),controller[_0x415b('0xb')]);router['get'](_0x415b('0xc'),auth[_0x415b('0xd')](),controller[_0x415b('0xe')]);router[_0x415b('0x7')](_0x415b('0xf'),auth[_0x415b('0xd')](),controller[_0x415b('0x10')]);router['get']('/:id/messages',auth[_0x415b('0x8')](),controller[_0x415b('0x11')]);router[_0x415b('0x7')](_0x415b('0x12'),auth[_0x415b('0xd')](),controller['getMyMessages']);router['get'](_0x415b('0x13'),auth[_0x415b('0x8')](),controller[_0x415b('0x14')]);router[_0x415b('0x15')]('/',auth['isAuthenticated'](),controller[_0x415b('0x16')]);router[_0x415b('0x15')]('/:id/vidaoo',auth[_0x415b('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x235b51,_0x19bb43,_0xcda6b3){_0xcda6b3(null,path[_0x415b('0x17')](config[_0x415b('0x18')],_0x415b('0x19')));},'filename':function(_0x5776aa,_0x585e9e,_0x34a243){_0x34a243(null,util[_0x415b('0x1a')](_0x415b('0x1b'),Date[_0x415b('0x1c')](),_0x585e9e[_0x415b('0x1d')][_0x415b('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x415b('0x15')](_0x415b('0x1f'),upload['single'](_0x415b('0x20')),controller['attachmentUpload']);router[_0x415b('0x15')]('/:id/messages',auth[_0x415b('0xd')](),controller['addMessage']);router[_0x415b('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x415b('0x21')](_0x415b('0x22'),'chatinteraction:addtags'),controller[_0x415b('0x23')]);router[_0x415b('0x24')](_0x415b('0xc'),auth[_0x415b('0x8')](),interaction[_0x415b('0x21')]('chat',_0x415b('0x25')),controller[_0x415b('0x26')]);router[_0x415b('0x24')](_0x415b('0x27'),controller[_0x415b('0x28')]);router['put'](_0x415b('0x29'),auth[_0x415b('0xd')](),controller[_0x415b('0x2a')]);router[_0x415b('0x24')](_0x415b('0x2b'),controller['close']);router[_0x415b('0x2c')](_0x415b('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x415b('0x22'),_0x415b('0x2d')),controller[_0x415b('0x2e')]);router[_0x415b('0x2c')](_0x415b('0x2f'),auth['isAuthenticated'](),controller['removeTags']);module[_0x415b('0x30')]=router;
\ No newline at end of file
+var _0xc1e2=['attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','path','express','Router','fs-extra','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','diskStorage','join','root','server/files/attachments/','%s-%s','originalname','single'];(function(_0x2d486b,_0x5f213c){var _0x4291d1=function(_0x2cebcb){while(--_0x2cebcb){_0x2d486b['push'](_0x2d486b['shift']());}};_0x4291d1(++_0x5f213c);}(_0xc1e2,0xa5));var _0x2c1e=function(_0x2708c3,_0x2149c4){_0x2708c3=_0x2708c3-0x0;var _0x803a64=_0xc1e2[_0x2708c3];return _0x803a64;};'use strict';var multer=require(_0x2c1e('0x0'));var util=require('util');var path=require(_0x2c1e('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c1e('0x2'));var router=express[_0x2c1e('0x3')]();var fs_extra=require(_0x2c1e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c1e('0x5'));var controller=require(_0x2c1e('0x6'));router[_0x2c1e('0x7')]('/',auth[_0x2c1e('0x8')](),controller[_0x2c1e('0x9')]);router[_0x2c1e('0x7')](_0x2c1e('0xa'),auth[_0x2c1e('0x8')](),controller[_0x2c1e('0xb')]);router['get'](_0x2c1e('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x2c1e('0xd')]);router['get'](_0x2c1e('0xe'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x10')]);router['get']('/:id/messages',auth[_0x2c1e('0x8')](),controller[_0x2c1e('0x11')]);router['get'](_0x2c1e('0x12'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x13')]);router[_0x2c1e('0x7')](_0x2c1e('0x14'),auth['isAuthenticated'](),controller[_0x2c1e('0x15')]);router['post']('/',auth[_0x2c1e('0x8')](),controller[_0x2c1e('0x16')]);router[_0x2c1e('0x17')]('/:id/vidaoo',auth[_0x2c1e('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x2c1e('0x18')]({'destination':function(_0x5c7e5c,_0x13f03d,_0xb473db){_0xb473db(null,path[_0x2c1e('0x19')](config[_0x2c1e('0x1a')],_0x2c1e('0x1b')));},'filename':function(_0x407590,_0x2ed754,_0x5715c6){_0x5715c6(null,util['format'](_0x2c1e('0x1c'),Date['now'](),_0x2ed754[_0x2c1e('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2c1e('0x17')]('/:id/attachment_upload',upload[_0x2c1e('0x1e')]('file'),controller[_0x2c1e('0x1f')]);router['post'](_0x2c1e('0x20'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x21')]);router[_0x2c1e('0x17')]('/:id/tags',auth[_0x2c1e('0x8')](),interaction[_0x2c1e('0x22')](_0x2c1e('0x23'),_0x2c1e('0x24')),controller[_0x2c1e('0x25')]);router[_0x2c1e('0x26')](_0x2c1e('0xc'),auth['isAuthenticated'](),interaction[_0x2c1e('0x22')](_0x2c1e('0x23'),'chatinteraction:update'),controller['update']);router['put'](_0x2c1e('0x27'),controller[_0x2c1e('0x28')]);router['put'](_0x2c1e('0x29'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x2a')]);router['put']('/:id/close',controller[_0x2c1e('0x2b')]);router[_0x2c1e('0x2c')](_0x2c1e('0xc'),auth[_0x2c1e('0x8')](),interaction[_0x2c1e('0x22')](_0x2c1e('0x23'),_0x2c1e('0x2d')),controller[_0x2c1e('0x2e')]);router[_0x2c1e('0x2c')](_0x2c1e('0x2f'),auth[_0x2c1e('0x8')](),controller['removeTags']);module[_0x2c1e('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 878c200..9a07860 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9ac5=['INTEGER','sequelize','exports','BOOLEAN'];(function(_0x8a0aed,_0x9370b5){var _0x3723fa=function(_0x25a50f){while(--_0x25a50f){_0x8a0aed['push'](_0x8a0aed['shift']());}};_0x3723fa(++_0x9370b5);}(_0x9ac5,0x141));var _0x59ac=function(_0x27eea1,_0x144cea){_0x27eea1=_0x27eea1-0x0;var _0x3e4f5b=_0x9ac5[_0x27eea1];return _0x3e4f5b;};'use strict';var Sequelize=require(_0x59ac('0x0'));module[_0x59ac('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x59ac('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x59ac('0x3')]}};
\ No newline at end of file
+var _0xb0de=['medium','INTEGER','sequelize','TEXT'];(function(_0xc7006a,_0x26fe34){var _0x4b49d9=function(_0x4ee238){while(--_0x4ee238){_0xc7006a['push'](_0xc7006a['shift']());}};_0x4b49d9(++_0x26fe34);}(_0xb0de,0xc2));var _0xeb0d=function(_0x17369c,_0x57e58f){_0x17369c=_0x17369c-0x0;var _0x5d558e=_0xb0de[_0x17369c];return _0x5d558e;};'use strict';var Sequelize=require(_0xeb0d('0x0'));module['exports']={'body':{'type':Sequelize[_0xeb0d('0x1')](_0xeb0d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xeb0d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index c89704c..d55dd93 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.controller.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8dd0=['attributes','fields','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','rawAttributes','length','include','create','body','find','params','describe','get','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','ChatInternalMessage','fieldName','type','key','model','map','query','keys','intersection'];(function(_0x2aa9da,_0x33c82d){var _0x5d2c88=function(_0x127a78){while(--_0x127a78){_0x2aa9da['push'](_0x2aa9da['shift']());}};_0x5d2c88(++_0x33c82d);}(_0x8dd0,0x112));var _0x08dd=function(_0x4ca280,_0x1a1c4b){_0x4ca280=_0x4ca280-0x0;var _0x4bff7a=_0x8dd0[_0x4ca280];return _0x4bff7a;};'use strict';var emlformat=require(_0x08dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x08dd('0x1'));var jsonpatch=require(_0x08dd('0x2'));var rp=require(_0x08dd('0x3'));var moment=require(_0x08dd('0x4'));var BPromise=require(_0x08dd('0x5'));var Mustache=require(_0x08dd('0x6'));var util=require(_0x08dd('0x7'));var path=require(_0x08dd('0x8'));var sox=require(_0x08dd('0x9'));var csv=require(_0x08dd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08dd('0xb'));var _=require(_0x08dd('0xc'));var squel=require(_0x08dd('0xd'));var crypto=require(_0x08dd('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x08dd('0xa'));var querystring=require(_0x08dd('0xf'));var Papa=require(_0x08dd('0x10'));var Redis=require(_0x08dd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x08dd('0x12'));var as=require(_0x08dd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x08dd('0x14'));var utils=require(_0x08dd('0x15'));var config=require(_0x08dd('0x16'));var licenseUtil=require(_0x08dd('0x17'));var db=require(_0x08dd('0x18'))['db'];config[_0x08dd('0x19')]=_['defaults'](config[_0x08dd('0x19')],{'host':_0x08dd('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x08dd('0x19')]));require(_0x08dd('0x1b'))['register'](socket);function respondWithStatusCode(_0x4fd31a,_0x2d1c8a){_0x2d1c8a=_0x2d1c8a||0xcc;return function(_0x17045b){if(_0x17045b){return _0x4fd31a[_0x08dd('0x1c')](_0x2d1c8a);}return _0x4fd31a[_0x08dd('0x1d')](_0x2d1c8a)[_0x08dd('0x1e')]();};}function respondWithResult(_0x2ab3c6,_0x492528){_0x492528=_0x492528||0xc8;return function(_0x7e227b){if(_0x7e227b){return _0x2ab3c6['status'](_0x492528)[_0x08dd('0x1f')](_0x7e227b);}};}function respondWithFilteredResult(_0x314356,_0x4ff1c2){return function(_0x87ad4){if(_0x87ad4){var _0x178fae=typeof _0x4ff1c2['offset']===_0x08dd('0x20')&&typeof _0x4ff1c2[_0x08dd('0x21')]===_0x08dd('0x20');var _0x109d03=_0x87ad4[_0x08dd('0x22')];var _0xf4d44a=_0x178fae?0x0:_0x4ff1c2[_0x08dd('0x23')];var _0x2454aa=_0x178fae?_0x87ad4[_0x08dd('0x22')]:_0x4ff1c2[_0x08dd('0x23')]+_0x4ff1c2[_0x08dd('0x21')];var _0x37d398;if(_0x2454aa>=_0x109d03){_0x2454aa=_0x109d03;_0x37d398=0xc8;}else{_0x37d398=0xce;}_0x314356[_0x08dd('0x1d')](_0x37d398);return _0x314356['set'](_0x08dd('0x24'),_0xf4d44a+'-'+_0x2454aa+'/'+_0x109d03)[_0x08dd('0x1f')](_0x87ad4);}return null;};}function patchUpdates(_0xa566de){return function(_0x2da508){try{jsonpatch[_0x08dd('0x25')](_0x2da508,_0xa566de,!![]);}catch(_0x46beaa){return BPromise[_0x08dd('0x26')](_0x46beaa);}return _0x2da508['save']();};}function saveUpdates(_0x31947a,_0x14008b){return function(_0x1155c7){if(_0x1155c7){return _0x1155c7[_0x08dd('0x27')](_0x31947a)['then'](function(_0xb3c9d5){return _0xb3c9d5;});}return null;};}function removeEntity(_0x268a03,_0xc0eb9d){return function(_0x46fe8f){if(_0x46fe8f){return _0x46fe8f[_0x08dd('0x28')]()[_0x08dd('0x29')](function(){_0x268a03['status'](0xcc)[_0x08dd('0x1e')]();});}};}function handleEntityNotFound(_0x3e4042,_0x2c047f){return function(_0x388a24){if(!_0x388a24){_0x3e4042[_0x08dd('0x1c')](0x194);}return _0x388a24;};}function handleError(_0x47b19a,_0x3ecac3){_0x3ecac3=_0x3ecac3||0x1f4;return function(_0x4ba6ad){logger[_0x08dd('0x2a')](_0x4ba6ad[_0x08dd('0x2b')]);if(_0x4ba6ad[_0x08dd('0x2c')]){delete _0x4ba6ad[_0x08dd('0x2c')];}_0x47b19a['status'](_0x3ecac3)[_0x08dd('0x2d')](_0x4ba6ad);};}exports[_0x08dd('0x2e')]=function(_0x4b4efd,_0x204fc7){var _0x50e8b3={},_0x380bbc={},_0x28ecbc={'count':0x0,'rows':[]};var _0x4e736f=_['map'](db[_0x08dd('0x2f')]['rawAttributes'],function(_0xfbbfe2){return{'name':_0xfbbfe2[_0x08dd('0x30')],'type':_0xfbbfe2[_0x08dd('0x31')][_0x08dd('0x32')]};});_0x380bbc[_0x08dd('0x33')]=_[_0x08dd('0x34')](_0x4e736f,_0x08dd('0x2c'));_0x380bbc[_0x08dd('0x35')]=_[_0x08dd('0x36')](_0x4b4efd[_0x08dd('0x35')]);_0x380bbc['filters']=_[_0x08dd('0x37')](_0x380bbc[_0x08dd('0x33')],_0x380bbc['query']);_0x50e8b3[_0x08dd('0x38')]=_['intersection'](_0x380bbc[_0x08dd('0x33')],qs[_0x08dd('0x39')](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x39')]));_0x50e8b3[_0x08dd('0x38')]=_0x50e8b3[_0x08dd('0x38')]['length']?_0x50e8b3[_0x08dd('0x38')]:_0x380bbc['model'];if(!_0x4b4efd['query']['hasOwnProperty'](_0x08dd('0x3a'))){_0x50e8b3[_0x08dd('0x21')]=qs[_0x08dd('0x21')](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x21')]);_0x50e8b3['offset']=qs['offset'](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x23')]);}_0x50e8b3[_0x08dd('0x3b')]=qs['sort'](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x3c')]);_0x50e8b3[_0x08dd('0x3d')]=qs[_0x08dd('0x3e')](_[_0x08dd('0x3f')](_0x4b4efd['query'],_0x380bbc[_0x08dd('0x3e')]),_0x4e736f);if(_0x4b4efd['query']['filter']){_0x50e8b3[_0x08dd('0x3d')]=_['merge'](_0x50e8b3[_0x08dd('0x3d')],{'$or':_['map'](_0x4e736f,function(_0x38e071){if(_0x38e071['type']!==_0x08dd('0x40')){var _0x567fa8={};_0x567fa8[_0x38e071[_0x08dd('0x2c')]]={'$like':'%'+_0x4b4efd['query'][_0x08dd('0x41')]+'%'};return _0x567fa8;}})});}_0x50e8b3=_[_0x08dd('0x42')]({},_0x50e8b3,_0x4b4efd[_0x08dd('0x43')]);var _0x1693c9={'where':_0x50e8b3[_0x08dd('0x3d')]};return db[_0x08dd('0x2f')]['count'](_0x1693c9)['then'](function(_0x3adc1a){_0x28ecbc['count']=_0x3adc1a;if(_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x44')]){_0x50e8b3['include']=[{'all':!![]}];}return db[_0x08dd('0x2f')][_0x08dd('0x45')](_0x50e8b3);})[_0x08dd('0x29')](function(_0x4c88a0){_0x28ecbc['rows']=_0x4c88a0;return _0x28ecbc;})[_0x08dd('0x29')](respondWithFilteredResult(_0x204fc7,_0x50e8b3))[_0x08dd('0x46')](handleError(_0x204fc7,null));};exports[_0x08dd('0x47')]=function(_0x15e0f6,_0xb17f88){var _0x193fc0={'raw':!![],'where':{'id':_0x15e0f6['params']['id']}},_0x9aea12={};_0x9aea12[_0x08dd('0x33')]=_[_0x08dd('0x36')](db[_0x08dd('0x2f')][_0x08dd('0x48')]);_0x9aea12['query']=_[_0x08dd('0x36')](_0x15e0f6[_0x08dd('0x35')]);_0x9aea12[_0x08dd('0x3e')]=_['intersection'](_0x9aea12['model'],_0x9aea12[_0x08dd('0x35')]);_0x193fc0['attributes']=_[_0x08dd('0x37')](_0x9aea12[_0x08dd('0x33')],qs['fields'](_0x15e0f6[_0x08dd('0x35')][_0x08dd('0x39')]));_0x193fc0[_0x08dd('0x38')]=_0x193fc0[_0x08dd('0x38')][_0x08dd('0x49')]?_0x193fc0[_0x08dd('0x38')]:_0x9aea12[_0x08dd('0x33')];if(_0x15e0f6['query'][_0x08dd('0x44')]){_0x193fc0[_0x08dd('0x4a')]=[{'all':!![]}];}_0x193fc0=_['merge']({},_0x193fc0,_0x15e0f6[_0x08dd('0x43')]);return db['ChatInternalMessage']['find'](_0x193fc0)['then'](handleEntityNotFound(_0xb17f88,null))[_0x08dd('0x29')](respondWithResult(_0xb17f88,null))[_0x08dd('0x46')](handleError(_0xb17f88,null));};exports[_0x08dd('0x4b')]=function(_0x31a4d9,_0x4b803b){return db[_0x08dd('0x2f')][_0x08dd('0x4b')](_0x31a4d9[_0x08dd('0x4c')],{})[_0x08dd('0x29')](respondWithResult(_0x4b803b,0xc9))[_0x08dd('0x46')](handleError(_0x4b803b,null));};exports['update']=function(_0x164810,_0x26352f){if(_0x164810[_0x08dd('0x4c')]['id']){delete _0x164810[_0x08dd('0x4c')]['id'];}return db[_0x08dd('0x2f')][_0x08dd('0x4d')]({'where':{'id':_0x164810[_0x08dd('0x4e')]['id']}})[_0x08dd('0x29')](handleEntityNotFound(_0x26352f,null))['then'](saveUpdates(_0x164810[_0x08dd('0x4c')],null))['then'](respondWithResult(_0x26352f,null))[_0x08dd('0x46')](handleError(_0x26352f,null));};exports['destroy']=function(_0x10b14d,_0x5803a6){return db[_0x08dd('0x2f')][_0x08dd('0x4d')]({'where':{'id':_0x10b14d[_0x08dd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5803a6,null))['then'](removeEntity(_0x5803a6,null))[_0x08dd('0x46')](handleError(_0x5803a6,null));};exports[_0x08dd('0x4f')]=function(_0x5753d6,_0x192ccf){return db['ChatInternalMessage'][_0x08dd('0x4f')]()[_0x08dd('0x29')](respondWithResult(_0x192ccf,null))[_0x08dd('0x46')](handleError(_0x192ccf,null));};function wrapUser(_0x54f692){return function(_0x209e86){var _0x35e6fe=_0x54f692[_0x08dd('0x50')]({'plain':!![]});_0x35e6fe['messages']=[];if(_0x209e86){_0x35e6fe[_0x08dd('0x51')]=_0x209e86['createdAt'];_0x35e6fe['lastMessage']=_0x209e86;}else{_0x35e6fe[_0x08dd('0x51')]=moment(0x0)[_0x08dd('0x52')](_0x08dd('0x53'));_0x35e6fe[_0x08dd('0x54')]={};}return _0x35e6fe;};}exports['getUsers']=function(_0x2037b9,_0x5438e7,_0x58a357){var _0x546fa9=[];return db[_0x08dd('0x55')][_0x08dd('0x45')]({'where':{'role':[_0x08dd('0x56'),_0x08dd('0x57'),'user']},'attributes':['id',_0x08dd('0x58'),'name',_0x08dd('0x59'),_0x08dd('0x5a'),'internal',_0x08dd('0x5b'),_0x08dd('0x5c'),_0x08dd('0x5d'),_0x08dd('0x5e')],'order':qs[_0x08dd('0x3c')](_0x08dd('0x5f')),'include':[{'model':db[_0x08dd('0x60')],'as':_0x08dd('0x61'),'attributes':['id','name',_0x08dd('0x31')],'through':{'attributes':[]}}]})[_0x08dd('0x29')](function(_0x572dcc){if(_0x572dcc){var _0x52cfe2=_0x2037b9[_0x08dd('0x62')][_0x08dd('0x50')]({'plain':!![]});if(!_0x52cfe2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52cfe2['role']===_0x08dd('0x62')){return db[_0x08dd('0x63')][_0x08dd('0x4d')]({'where':{'name':_0x08dd('0x64'),'userProfileId':_0x52cfe2[_0x08dd('0x65')]},'raw':!![]})['then'](function(_0x344730){if(_0x344730){if(_0x344730[_0x08dd('0x66')]===0x0){return db[_0x08dd('0x67')]['findAll']({'where':{'sectionId':_0x344730['id']},'raw':!![]})['then'](function(_0x2fac51){var _0x15e042=[];if(_['isEmpty'](_0x2fac51)){_0x15e042=_[_0x08dd('0x41')](_0x572dcc,function(_0x36733a){if(_0x36733a[_0x08dd('0x59')]!==_0x08dd('0x56')){return _0x36733a;}});return _0x15e042;}else{for(var _0x143115=0x0;_0x143115<_0x572dcc[_0x08dd('0x49')];_0x143115++){var _0xc1b5e1=_0x572dcc[_0x143115];if(_0xc1b5e1[_0x08dd('0x59')]===_0x08dd('0x56')){var _0x5cd9d1=_[_0x08dd('0x4d')](_0x2fac51,function(_0x445d25){return _0x445d25[_0x08dd('0x68')]===_0xc1b5e1['id'];});if(_0x5cd9d1)_0x15e042[_0x08dd('0x69')](_0xc1b5e1);}else{_0x15e042[_0x08dd('0x69')](_0xc1b5e1);}}return _0x15e042;}});}else{return _0x572dcc;}}else{var _0x127992=_[_0x08dd('0x41')](_0x572dcc,function(_0x238455){if(_0x238455['role']!=='agent'){return _0x238455;}});return _0x127992;}});}else{return _0x572dcc;}}})[_0x08dd('0x29')](function(_0x594cf6){var _0x358641=[];if(_0x594cf6){_0x546fa9=_0x594cf6;for(var _0x1bfe6a=0x0;_0x1bfe6a<_0x594cf6[_0x08dd('0x49')];_0x1bfe6a+=0x1){_0x546fa9[_0x1bfe6a][_0x08dd('0x6a')]=[];_0x358641['push'](db[_0x08dd('0x2f')][_0x08dd('0x4d')]({'where':{'FromId':[_0x2037b9[_0x08dd('0x62')]['id'],_0x594cf6[_0x1bfe6a]['id']],'ToId':[_0x2037b9[_0x08dd('0x62')]['id'],_0x594cf6[_0x1bfe6a]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x08dd('0x6b'),_0x08dd('0x6c'),'body'],'order':qs[_0x08dd('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x08dd('0x29')](wrapUser(_0x594cf6[_0x1bfe6a])));}return BPromise[_0x08dd('0x6d')](_0x358641);}return[];})['then'](function(_0x266fd3){return{'rows':_0x266fd3,'count':_0x266fd3[_0x08dd('0x49')]};})[_0x08dd('0x29')](respondWithResult(_0x5438e7,null))['catch'](handleError(_0x5438e7,null));};
\ No newline at end of file
+var _0xbd7d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','rows','catch','params','find','body','update','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','agent','admin','user','fullname','userpic','online','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xf0b5aa,_0x2bf688){var _0x116c02=function(_0x3d6d94){while(--_0x3d6d94){_0xf0b5aa['push'](_0xf0b5aa['shift']());}};_0x116c02(++_0x2bf688);}(_0xbd7d,0x1a6));var _0xdbd7=function(_0x5d23c2,_0x314419){_0x5d23c2=_0x5d23c2-0x0;var _0x50b8f0=_0xbd7d[_0x5d23c2];return _0x50b8f0;};'use strict';var emlformat=require(_0xdbd7('0x0'));var rimraf=require(_0xdbd7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbd7('0x2'));var rp=require(_0xdbd7('0x3'));var moment=require(_0xdbd7('0x4'));var BPromise=require(_0xdbd7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdbd7('0x6'));var csv=require(_0xdbd7('0x7'));var ejs=require(_0xdbd7('0x8'));var fs=require('fs');var fs_extra=require(_0xdbd7('0x9'));var _=require(_0xdbd7('0xa'));var squel=require(_0xdbd7('0xb'));var crypto=require(_0xdbd7('0xc'));var jsforce=require(_0xdbd7('0xd'));var deskjs=require(_0xdbd7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbd7('0xf'));var Papa=require(_0xdbd7('0x10'));var Redis=require(_0xdbd7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdbd7('0x12'));var hardwareService=require(_0xdbd7('0x13'));var logger=require(_0xdbd7('0x14'))(_0xdbd7('0x15'));var utils=require(_0xdbd7('0x16'));var config=require(_0xdbd7('0x17'));var licenseUtil=require(_0xdbd7('0x18'));var db=require(_0xdbd7('0x19'))['db'];config[_0xdbd7('0x1a')]=_[_0xdbd7('0x1b')](config[_0xdbd7('0x1a')],{'host':_0xdbd7('0x1c'),'port':0x18eb});var socket=require(_0xdbd7('0x1d'))(new Redis(config[_0xdbd7('0x1a')]));require(_0xdbd7('0x1e'))[_0xdbd7('0x1f')](socket);function respondWithStatusCode(_0x1347ed,_0x3286ab){_0x3286ab=_0x3286ab||0xcc;return function(_0xd13b4a){if(_0xd13b4a){return _0x1347ed[_0xdbd7('0x20')](_0x3286ab);}return _0x1347ed[_0xdbd7('0x21')](_0x3286ab)[_0xdbd7('0x22')]();};}function respondWithResult(_0x4ae3f3,_0x22a553){_0x22a553=_0x22a553||0xc8;return function(_0x230499){if(_0x230499){return _0x4ae3f3[_0xdbd7('0x21')](_0x22a553)[_0xdbd7('0x23')](_0x230499);}};}function respondWithFilteredResult(_0x34a468,_0x1718b0){return function(_0x44d192){if(_0x44d192){var _0x439677=typeof _0x1718b0[_0xdbd7('0x24')]===_0xdbd7('0x25')&&typeof _0x1718b0[_0xdbd7('0x26')]===_0xdbd7('0x25');var _0x375f13=_0x44d192[_0xdbd7('0x27')];var _0x1f25ae=_0x439677?0x0:_0x1718b0[_0xdbd7('0x24')];var _0x509c99=_0x439677?_0x44d192[_0xdbd7('0x27')]:_0x1718b0[_0xdbd7('0x24')]+_0x1718b0['limit'];var _0x3e703f;if(_0x509c99>=_0x375f13){_0x509c99=_0x375f13;_0x3e703f=0xc8;}else{_0x3e703f=0xce;}_0x34a468['status'](_0x3e703f);return _0x34a468[_0xdbd7('0x28')](_0xdbd7('0x29'),_0x1f25ae+'-'+_0x509c99+'/'+_0x375f13)[_0xdbd7('0x23')](_0x44d192);}return null;};}function patchUpdates(_0x55ce67){return function(_0x4a106e){try{jsonpatch[_0xdbd7('0x2a')](_0x4a106e,_0x55ce67,!![]);}catch(_0x36d0c2){return BPromise[_0xdbd7('0x2b')](_0x36d0c2);}return _0x4a106e[_0xdbd7('0x2c')]();};}function saveUpdates(_0x4a339f,_0xad2939){return function(_0x5e2c99){if(_0x5e2c99){return _0x5e2c99['update'](_0x4a339f)[_0xdbd7('0x2d')](function(_0x294889){return _0x294889;});}return null;};}function removeEntity(_0x5a510e,_0x525d7b){return function(_0x3845fe){if(_0x3845fe){return _0x3845fe[_0xdbd7('0x2e')]()[_0xdbd7('0x2d')](function(){_0x5a510e[_0xdbd7('0x21')](0xcc)[_0xdbd7('0x22')]();});}};}function handleEntityNotFound(_0x5b7a54,_0x1d835e){return function(_0xb05d91){if(!_0xb05d91){_0x5b7a54['sendStatus'](0x194);}return _0xb05d91;};}function handleError(_0x15347f,_0x159630){_0x159630=_0x159630||0x1f4;return function(_0x5a926f){logger['error'](_0x5a926f[_0xdbd7('0x2f')]);if(_0x5a926f['name']){delete _0x5a926f[_0xdbd7('0x30')];}_0x15347f[_0xdbd7('0x21')](_0x159630)['send'](_0x5a926f);};}exports[_0xdbd7('0x31')]=function(_0x74e3f5,_0x2f9118){var _0x174316={},_0x286c41={},_0x495eef={'count':0x0,'rows':[]};var _0x51faaa=_[_0xdbd7('0x32')](db['ChatInternalMessage']['rawAttributes'],function(_0x574d7c){return{'name':_0x574d7c[_0xdbd7('0x33')],'type':_0x574d7c[_0xdbd7('0x34')]['key']};});_0x286c41[_0xdbd7('0x35')]=_[_0xdbd7('0x32')](_0x51faaa,_0xdbd7('0x30'));_0x286c41[_0xdbd7('0x36')]=_[_0xdbd7('0x37')](_0x74e3f5[_0xdbd7('0x36')]);_0x286c41[_0xdbd7('0x38')]=_[_0xdbd7('0x39')](_0x286c41['model'],_0x286c41[_0xdbd7('0x36')]);_0x174316[_0xdbd7('0x3a')]=_[_0xdbd7('0x39')](_0x286c41['model'],qs[_0xdbd7('0x3b')](_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x3b')]));_0x174316[_0xdbd7('0x3a')]=_0x174316[_0xdbd7('0x3a')][_0xdbd7('0x3c')]?_0x174316[_0xdbd7('0x3a')]:_0x286c41[_0xdbd7('0x35')];if(!_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x3d')]('nolimit')){_0x174316[_0xdbd7('0x26')]=qs[_0xdbd7('0x26')](_0x74e3f5[_0xdbd7('0x36')]['limit']);_0x174316[_0xdbd7('0x24')]=qs[_0xdbd7('0x24')](_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x24')]);}_0x174316['order']=qs[_0xdbd7('0x3e')](_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x3e')]);_0x174316[_0xdbd7('0x3f')]=qs[_0xdbd7('0x38')](_[_0xdbd7('0x40')](_0x74e3f5[_0xdbd7('0x36')],_0x286c41[_0xdbd7('0x38')]),_0x51faaa);if(_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x41')]){_0x174316['where']=_[_0xdbd7('0x42')](_0x174316[_0xdbd7('0x3f')],{'$or':_[_0xdbd7('0x32')](_0x51faaa,function(_0x41e1d5){if(_0x41e1d5[_0xdbd7('0x34')]!==_0xdbd7('0x43')){var _0x4bbf8b={};_0x4bbf8b[_0x41e1d5['name']]={'$like':'%'+_0x74e3f5[_0xdbd7('0x36')]['filter']+'%'};return _0x4bbf8b;}})});}_0x174316=_[_0xdbd7('0x42')]({},_0x174316,_0x74e3f5[_0xdbd7('0x44')]);var _0x5e3e5a={'where':_0x174316[_0xdbd7('0x3f')]};return db[_0xdbd7('0x45')][_0xdbd7('0x27')](_0x5e3e5a)['then'](function(_0x273b29){_0x495eef['count']=_0x273b29;if(_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x46')]){_0x174316[_0xdbd7('0x47')]=[{'all':!![]}];}return db[_0xdbd7('0x45')]['findAll'](_0x174316);})[_0xdbd7('0x2d')](function(_0x20b343){_0x495eef[_0xdbd7('0x48')]=_0x20b343;return _0x495eef;})[_0xdbd7('0x2d')](respondWithFilteredResult(_0x2f9118,_0x174316))[_0xdbd7('0x49')](handleError(_0x2f9118,null));};exports['show']=function(_0x1feca8,_0x4eca72){var _0xe2b428={'raw':!![],'where':{'id':_0x1feca8[_0xdbd7('0x4a')]['id']}},_0x45bc2e={};_0x45bc2e[_0xdbd7('0x35')]=_[_0xdbd7('0x37')](db['ChatInternalMessage']['rawAttributes']);_0x45bc2e[_0xdbd7('0x36')]=_[_0xdbd7('0x37')](_0x1feca8[_0xdbd7('0x36')]);_0x45bc2e[_0xdbd7('0x38')]=_[_0xdbd7('0x39')](_0x45bc2e[_0xdbd7('0x35')],_0x45bc2e['query']);_0xe2b428[_0xdbd7('0x3a')]=_[_0xdbd7('0x39')](_0x45bc2e[_0xdbd7('0x35')],qs[_0xdbd7('0x3b')](_0x1feca8['query'][_0xdbd7('0x3b')]));_0xe2b428['attributes']=_0xe2b428['attributes'][_0xdbd7('0x3c')]?_0xe2b428[_0xdbd7('0x3a')]:_0x45bc2e[_0xdbd7('0x35')];if(_0x1feca8[_0xdbd7('0x36')][_0xdbd7('0x46')]){_0xe2b428[_0xdbd7('0x47')]=[{'all':!![]}];}_0xe2b428=_[_0xdbd7('0x42')]({},_0xe2b428,_0x1feca8['options']);return db[_0xdbd7('0x45')][_0xdbd7('0x4b')](_0xe2b428)[_0xdbd7('0x2d')](handleEntityNotFound(_0x4eca72,null))[_0xdbd7('0x2d')](respondWithResult(_0x4eca72,null))['catch'](handleError(_0x4eca72,null));};exports['create']=function(_0x146ceb,_0x54be24){return db['ChatInternalMessage']['create'](_0x146ceb[_0xdbd7('0x4c')],{})[_0xdbd7('0x2d')](respondWithResult(_0x54be24,0xc9))[_0xdbd7('0x49')](handleError(_0x54be24,null));};exports[_0xdbd7('0x4d')]=function(_0x33fcd1,_0x576a41){if(_0x33fcd1[_0xdbd7('0x4c')]['id']){delete _0x33fcd1[_0xdbd7('0x4c')]['id'];}return db[_0xdbd7('0x45')][_0xdbd7('0x4b')]({'where':{'id':_0x33fcd1[_0xdbd7('0x4a')]['id']}})[_0xdbd7('0x2d')](handleEntityNotFound(_0x576a41,null))[_0xdbd7('0x2d')](saveUpdates(_0x33fcd1[_0xdbd7('0x4c')],null))[_0xdbd7('0x2d')](respondWithResult(_0x576a41,null))[_0xdbd7('0x49')](handleError(_0x576a41,null));};exports[_0xdbd7('0x2e')]=function(_0x13836c,_0x58c5ea){return db[_0xdbd7('0x45')]['find']({'where':{'id':_0x13836c[_0xdbd7('0x4a')]['id']}})[_0xdbd7('0x2d')](handleEntityNotFound(_0x58c5ea,null))[_0xdbd7('0x2d')](removeEntity(_0x58c5ea,null))['catch'](handleError(_0x58c5ea,null));};exports['describe']=function(_0x436124,_0x380bae){return db[_0xdbd7('0x45')][_0xdbd7('0x4e')]()[_0xdbd7('0x2d')](respondWithResult(_0x380bae,null))[_0xdbd7('0x49')](handleError(_0x380bae,null));};function wrapUser(_0xb0bd93){return function(_0x50f22d){var _0x11e457=_0xb0bd93[_0xdbd7('0x4f')]({'plain':!![]});_0x11e457[_0xdbd7('0x50')]=[];if(_0x50f22d){_0x11e457['lastMessageAt']=_0x50f22d[_0xdbd7('0x51')];_0x11e457[_0xdbd7('0x52')]=_0x50f22d;}else{_0x11e457[_0xdbd7('0x53')]=moment(0x0)[_0xdbd7('0x54')](_0xdbd7('0x55'));_0x11e457['lastMessage']={};}return _0x11e457;};}exports[_0xdbd7('0x56')]=function(_0x5eaf0b,_0x55345a,_0x443716){var _0x4209b9=[];return db['User'][_0xdbd7('0x57')]({'where':{'role':[_0xdbd7('0x58'),_0xdbd7('0x59'),_0xdbd7('0x5a')]},'attributes':['id',_0xdbd7('0x5b'),_0xdbd7('0x30'),'role',_0xdbd7('0x5c'),'internal',_0xdbd7('0x5d'),'lastLoginAt',_0xdbd7('0x5e'),'showWebBar'],'order':qs[_0xdbd7('0x3e')](_0xdbd7('0x5f')),'include':[{'model':db[_0xdbd7('0x60')],'as':_0xdbd7('0x61'),'attributes':['id',_0xdbd7('0x30'),_0xdbd7('0x34')],'through':{'attributes':[]}}]})[_0xdbd7('0x2d')](function(_0x42a35b){if(_0x42a35b){var _0x4c735d=_0x5eaf0b[_0xdbd7('0x5a')][_0xdbd7('0x4f')]({'plain':!![]});if(!_0x4c735d)throw new Error(_0xdbd7('0x62'));if(_0x4c735d[_0xdbd7('0x63')]==='user'){return db[_0xdbd7('0x64')][_0xdbd7('0x4b')]({'where':{'name':'Agents','userProfileId':_0x4c735d[_0xdbd7('0x65')]},'raw':!![]})['then'](function(_0x533311){if(_0x533311){if(_0x533311[_0xdbd7('0x66')]===0x0){return db[_0xdbd7('0x67')][_0xdbd7('0x57')]({'where':{'sectionId':_0x533311['id']},'raw':!![]})[_0xdbd7('0x2d')](function(_0x4ef8fd){var _0x42eb39=[];if(_['isEmpty'](_0x4ef8fd)){_0x42eb39=_['filter'](_0x42a35b,function(_0x4925d5){if(_0x4925d5['role']!==_0xdbd7('0x58')){return _0x4925d5;}});return _0x42eb39;}else{for(var _0x529ce6=0x0;_0x529ce6<_0x42a35b[_0xdbd7('0x3c')];_0x529ce6++){var _0x59cb03=_0x42a35b[_0x529ce6];if(_0x59cb03[_0xdbd7('0x63')]===_0xdbd7('0x58')){var _0x5f0ab4=_['find'](_0x4ef8fd,function(_0x3588fd){return _0x3588fd[_0xdbd7('0x68')]===_0x59cb03['id'];});if(_0x5f0ab4)_0x42eb39[_0xdbd7('0x69')](_0x59cb03);}else{_0x42eb39['push'](_0x59cb03);}}return _0x42eb39;}});}else{return _0x42a35b;}}else{var _0x12b688=_[_0xdbd7('0x41')](_0x42a35b,function(_0x4bd285){if(_0x4bd285[_0xdbd7('0x63')]!==_0xdbd7('0x58')){return _0x4bd285;}});return _0x12b688;}});}else{return _0x42a35b;}}})[_0xdbd7('0x2d')](function(_0x5c6c0d){var _0x47b70b=[];if(_0x5c6c0d){_0x4209b9=_0x5c6c0d;for(var _0x43403a=0x0;_0x43403a<_0x5c6c0d[_0xdbd7('0x3c')];_0x43403a+=0x1){_0x4209b9[_0x43403a][_0xdbd7('0x50')]=[];_0x47b70b[_0xdbd7('0x69')](db[_0xdbd7('0x45')][_0xdbd7('0x4b')]({'where':{'FromId':[_0x5eaf0b[_0xdbd7('0x5a')]['id'],_0x5c6c0d[_0x43403a]['id']],'ToId':[_0x5eaf0b[_0xdbd7('0x5a')]['id'],_0x5c6c0d[_0x43403a]['id']],'ChatGroupId':null},'attributes':['id',_0xdbd7('0x51'),_0xdbd7('0x6a'),_0xdbd7('0x6b'),_0xdbd7('0x6c'),_0xdbd7('0x4c')],'order':qs[_0xdbd7('0x3e')](_0xdbd7('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdbd7('0x2d')](wrapUser(_0x5c6c0d[_0x43403a])));}return BPromise[_0xdbd7('0x6e')](_0x47b70b);}return[];})['then'](function(_0x233045){return{'rows':_0x233045,'count':_0x233045['length']};})[_0xdbd7('0x2d')](respondWithResult(_0x55345a,null))['catch'](handleError(_0x55345a,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index a2d3002..5d14210 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.events.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x32e3=['update','remove','emit','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x32e3,0x1d8));var _0x332e=function(_0x5cd3d5,_0x326da8){_0x5cd3d5=_0x5cd3d5-0x0;var _0x3d1993=_0x32e3[_0x5cd3d5];return _0x3d1993;};'use strict';var EventEmitter=require(_0x332e('0x0'));var ChatInternalMessage=require(_0x332e('0x1'))['db'][_0x332e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x332e('0x3')](0x0);var events={'afterCreate':_0x332e('0x4'),'afterUpdate':_0x332e('0x5'),'afterDestroy':_0x332e('0x6')};function emitEvent(_0x4512b3){return function(_0x5c866b,_0x1017db,_0x1a5500){ChatInternalMessageEvents[_0x332e('0x7')](_0x4512b3+':'+_0x5c866b['id'],_0x5c866b);ChatInternalMessageEvents[_0x332e('0x7')](_0x4512b3,_0x5c866b);_0x1a5500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x332e('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xf628=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','emit','hasOwnProperty'];(function(_0x398a4b,_0x3474fb){var _0x493eda=function(_0x388dbb){while(--_0x388dbb){_0x398a4b['push'](_0x398a4b['shift']());}};_0x493eda(++_0x3474fb);}(_0xf628,0x7f));var _0x8f62=function(_0x46ce86,_0x2e07e0){_0x46ce86=_0x46ce86-0x0;var _0x29e3b6=_0xf628[_0x46ce86];return _0x29e3b6;};'use strict';var EventEmitter=require(_0x8f62('0x0'));var ChatInternalMessage=require(_0x8f62('0x1'))['db'][_0x8f62('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8f62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x393c04){return function(_0x18593f,_0x1706d2,_0x2377a5){ChatInternalMessageEvents[_0x8f62('0x4')](_0x393c04+':'+_0x18593f['id'],_0x18593f);ChatInternalMessageEvents['emit'](_0x393c04,_0x18593f);_0x2377a5(null);};}for(var e in events){if(events[_0x8f62('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x8f62('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 33cd22c..07bc515 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.model.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f39=['request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x5f39,0x1cb));var _0x95f3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5f39[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x95f3('0x0'));var util=require(_0x95f3('0x1'));var logger=require(_0x95f3('0x2'))(_0x95f3('0x3'));var moment=require(_0x95f3('0x4'));var BPromise=require(_0x95f3('0x5'));var rp=require(_0x95f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95f3('0x7'));var config=require(_0x95f3('0x8'));var attributes=require(_0x95f3('0x9'));module[_0x95f3('0xa')]=function(_0x4b0f91,_0xf57150){return _0x4b0f91[_0x95f3('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x95f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x95f3('0xd'),'collate':_0x95f3('0xe')});};
\ No newline at end of file
+var _0xc7b4=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','lodash'];(function(_0x3e6ac0,_0x34b200){var _0xe1dee5=function(_0x8864a8){while(--_0x8864a8){_0x3e6ac0['push'](_0x3e6ac0['shift']());}};_0xe1dee5(++_0x34b200);}(_0xc7b4,0x8b));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c7b('0x0'));var util=require(_0x4c7b('0x1'));var logger=require('../../config/logger')(_0x4c7b('0x2'));var moment=require(_0x4c7b('0x3'));var BPromise=require(_0x4c7b('0x4'));var rp=require(_0x4c7b('0x5'));var fs=require('fs');var path=require(_0x4c7b('0x6'));var rimraf=require(_0x4c7b('0x7'));var config=require(_0x4c7b('0x8'));var attributes=require(_0x4c7b('0x9'));module[_0x4c7b('0xa')]=function(_0xa2f065,_0x20234b){return _0xa2f065[_0x4c7b('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x4c7b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c7b('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index da3f461..ffe6b11 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8881=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xb37185,_0x3ec508){var _0x575b45=function(_0x2d9b5a){while(--_0x2d9b5a){_0xb37185['push'](_0xb37185['shift']());}};_0x575b45(++_0x3ec508);}(_0x8881,0xd0));var _0x1888=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x8881[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x1888('0x0'));var util=require(_0x1888('0x1'));var moment=require(_0x1888('0x2'));var BPromise=require(_0x1888('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1888('0x4'))['db'];var utils=require(_0x1888('0x5'));var logger=require('../../config/logger')(_0x1888('0x6'));var config=require('../../config/environment');var jayson=require(_0x1888('0x7'));var client=jayson['client'][_0x1888('0x8')]({'port':0x232a});config[_0x1888('0x9')]=_[_0x1888('0xa')](config[_0x1888('0x9')],{'host':_0x1888('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1888('0x9')]));require(_0x1888('0xc'))[_0x1888('0xd')](socket);function respondWithRpcPromise(_0x276def,_0x37837b,_0x2b9bf9){return new BPromise(function(_0x22ff6b,_0x1da670){return client[_0x1888('0xe')](_0x276def,_0x2b9bf9)[_0x1888('0xf')](function(_0x5eb1a2){logger[_0x1888('0x10')](_0x1888('0x11'),_0x37837b,_0x1888('0x12'));logger[_0x1888('0x13')](_0x1888('0x14'),_0x37837b,_0x1888('0x12'),JSON[_0x1888('0x15')](_0x5eb1a2));if(_0x5eb1a2[_0x1888('0x16')]){if(_0x5eb1a2['error']['code']===0x1f4){logger[_0x1888('0x16')](_0x1888('0x11'),_0x37837b,_0x5eb1a2['error'][_0x1888('0x17')]);return _0x1da670(_0x5eb1a2[_0x1888('0x16')][_0x1888('0x17')]);}logger[_0x1888('0x16')](_0x1888('0x11'),_0x37837b,_0x5eb1a2[_0x1888('0x16')]['message']);return _0x22ff6b(_0x5eb1a2[_0x1888('0x16')]['message']);}else{logger[_0x1888('0x10')](_0x1888('0x11'),_0x37837b,_0x1888('0x12'));_0x22ff6b(_0x5eb1a2[_0x1888('0x18')][_0x1888('0x17')]);}})[_0x1888('0x19')](function(_0x3b3f3e){logger[_0x1888('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x37837b,_0x3b3f3e);_0x1da670(_0x3b3f3e);});});}
\ No newline at end of file
+var _0xde84=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','register','info','ChatInternalMessage,\x20%s,\x20%s','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2f6322,_0xaf6305){var _0x77bcf6=function(_0x358932){while(--_0x358932){_0x2f6322['push'](_0x2f6322['shift']());}};_0x77bcf6(++_0xaf6305);}(_0xde84,0x84));var _0x4de8=function(_0x287e0f,_0x5638e7){_0x287e0f=_0x287e0f-0x0;var _0x4dd42a=_0xde84[_0x287e0f];return _0x4dd42a;};'use strict';var _=require(_0x4de8('0x0'));var util=require(_0x4de8('0x1'));var moment=require(_0x4de8('0x2'));var BPromise=require(_0x4de8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4de8('0x4'));var db=require(_0x4de8('0x5'))['db'];var utils=require(_0x4de8('0x6'));var logger=require(_0x4de8('0x7'))(_0x4de8('0x8'));var config=require(_0x4de8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4de8('0xa')]({'port':0x232a});config[_0x4de8('0xb')]=_[_0x4de8('0xc')](config[_0x4de8('0xb')],{'host':_0x4de8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4de8('0xb')]));require('./chatInternalMessage.socket')[_0x4de8('0xe')](socket);function respondWithRpcPromise(_0x170a2b,_0x387a29,_0x185136){return new BPromise(function(_0x531f82,_0x65e52d){return client['request'](_0x170a2b,_0x185136)['then'](function(_0x718a0e){logger[_0x4de8('0xf')](_0x4de8('0x10'),_0x387a29,'request\x20sent');logger[_0x4de8('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x387a29,'request\x20sent',JSON[_0x4de8('0x12')](_0x718a0e));if(_0x718a0e['error']){if(_0x718a0e[_0x4de8('0x13')][_0x4de8('0x14')]===0x1f4){logger[_0x4de8('0x13')](_0x4de8('0x10'),_0x387a29,_0x718a0e[_0x4de8('0x13')][_0x4de8('0x15')]);return _0x65e52d(_0x718a0e[_0x4de8('0x13')]['message']);}logger[_0x4de8('0x13')](_0x4de8('0x10'),_0x387a29,_0x718a0e['error'][_0x4de8('0x15')]);return _0x531f82(_0x718a0e[_0x4de8('0x13')][_0x4de8('0x15')]);}else{logger['info'](_0x4de8('0x10'),_0x387a29,'request\x20sent');_0x531f82(_0x718a0e[_0x4de8('0x16')][_0x4de8('0x15')]);}})['catch'](function(_0x2edd23){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x387a29,_0x2edd23);_0x65e52d(_0x2edd23);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 84464ff..d7bb81a 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.socket.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x73ce=['save','remove','update','emit','register','length','./chatInternalMessage.events'];(function(_0x91964a,_0x2dc2f6){var _0x4490b1=function(_0x3ed329){while(--_0x3ed329){_0x91964a['push'](_0x91964a['shift']());}};_0x4490b1(++_0x2dc2f6);}(_0x73ce,0x172));var _0xe73c=function(_0x535fef,_0x416c17){_0x535fef=_0x535fef-0x0;var _0x545e9b=_0x73ce[_0x535fef];return _0x545e9b;};'use strict';var ChatInternalMessageEvents=require(_0xe73c('0x0'));var events=[_0xe73c('0x1'),_0xe73c('0x2'),_0xe73c('0x3')];function createListener(_0x17d472,_0x193b81){return function(_0x5522ca){_0x193b81[_0xe73c('0x4')](_0x17d472,_0x5522ca);};}function removeListener(_0x4edb32,_0x3fec1d){return function(){ChatInternalMessageEvents['removeListener'](_0x4edb32,_0x3fec1d);};}exports[_0xe73c('0x5')]=function(_0x1b131c){for(var _0x1cd963=0x0,_0x5ed683=events[_0xe73c('0x6')];_0x1cd963<_0x5ed683;_0x1cd963++){var _0x53cde7=events[_0x1cd963];var _0x33ffd7=createListener('chatInternalMessage:'+_0x53cde7,_0x1b131c);ChatInternalMessageEvents['on'](_0x53cde7,_0x33ffd7);}};
\ No newline at end of file
+var _0xe2e5=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x566e36,_0x25a2f9){var _0x18fc87=function(_0x102b83){while(--_0x102b83){_0x566e36['push'](_0x566e36['shift']());}};_0x18fc87(++_0x25a2f9);}(_0xe2e5,0x135));var _0x5e2e=function(_0x365e6d,_0x2b0157){_0x365e6d=_0x365e6d-0x0;var _0x76b60=_0xe2e5[_0x365e6d];return _0x76b60;};'use strict';var ChatInternalMessageEvents=require(_0x5e2e('0x0'));var events=[_0x5e2e('0x1'),'remove',_0x5e2e('0x2')];function createListener(_0x542ae8,_0x33a6b8){return function(_0x2c375a){_0x33a6b8[_0x5e2e('0x3')](_0x542ae8,_0x2c375a);};}function removeListener(_0x5ecd21,_0x5bad8a){return function(){ChatInternalMessageEvents[_0x5e2e('0x4')](_0x5ecd21,_0x5bad8a);};}exports[_0x5e2e('0x5')]=function(_0x58518e){for(var _0x5f5bc7=0x0,_0x9166fc=events[_0x5e2e('0x6')];_0x5f5bc7<_0x9166fc;_0x5f5bc7++){var _0x2c08ee=events[_0x5f5bc7];var _0x58fce3=createListener(_0x5e2e('0x7')+_0x2c08ee,_0x58518e);ChatInternalMessageEvents['on'](_0x2c08ee,_0x58fce3);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index f93c5ce..fd99667 100644
--- a/server/api/chatInternalMessage/index.js
+++ b/server/api/chatInternalMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x418c=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x340a1a,_0x47003a){var _0x1f13e5=function(_0x28ef88){while(--_0x28ef88){_0x340a1a['push'](_0x340a1a['shift']());}};_0x1f13e5(++_0x47003a);}(_0x418c,0x13f));var _0xc418=function(_0x1f7524,_0x56f235){_0x1f7524=_0x1f7524-0x0;var _0x210671=_0x418c[_0x1f7524];return _0x210671;};'use strict';var multer=require('multer');var util=require(_0xc418('0x0'));var path=require(_0xc418('0x1'));var timeout=require(_0xc418('0x2'));var express=require(_0xc418('0x3'));var router=express['Router']();var fs_extra=require(_0xc418('0x4'));var auth=require(_0xc418('0x5'));var interaction=require(_0xc418('0x6'));var config=require(_0xc418('0x7'));var controller=require(_0xc418('0x8'));router[_0xc418('0x9')]('/',auth[_0xc418('0xa')](),controller['index']);router[_0xc418('0x9')](_0xc418('0xb'),auth[_0xc418('0xa')](),controller[_0xc418('0xc')]);router[_0xc418('0x9')](_0xc418('0xd'),auth[_0xc418('0xa')](),controller[_0xc418('0xe')]);router[_0xc418('0x9')](_0xc418('0xf'),auth['isAuthenticated'](),controller[_0xc418('0x10')]);router[_0xc418('0x11')]('/',auth[_0xc418('0xa')](),controller['create']);router[_0xc418('0x12')](_0xc418('0xf'),controller[_0xc418('0x13')]);router[_0xc418('0x14')](_0xc418('0xf'),auth['isAuthenticated'](),controller[_0xc418('0x15')]);module[_0xc418('0x16')]=router;
\ No newline at end of file
+var _0x969d=['post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x311879,_0x25d1e1){var _0x4e7cd4=function(_0x4f4e88){while(--_0x4f4e88){_0x311879['push'](_0x311879['shift']());}};_0x4e7cd4(++_0x25d1e1);}(_0x969d,0x155));var _0xd969=function(_0x5c6831,_0x3fe733){_0x5c6831=_0x5c6831-0x0;var _0x4d96af=_0x969d[_0x5c6831];return _0x4d96af;};'use strict';var multer=require(_0xd969('0x0'));var util=require(_0xd969('0x1'));var path=require('path');var timeout=require(_0xd969('0x2'));var express=require(_0xd969('0x3'));var router=express[_0xd969('0x4')]();var fs_extra=require(_0xd969('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd969('0x6'));router[_0xd969('0x7')]('/',auth[_0xd969('0x8')](),controller[_0xd969('0x9')]);router[_0xd969('0x7')](_0xd969('0xa'),auth[_0xd969('0x8')](),controller[_0xd969('0xb')]);router[_0xd969('0x7')](_0xd969('0xc'),auth['isAuthenticated'](),controller[_0xd969('0xd')]);router[_0xd969('0x7')](_0xd969('0xe'),auth['isAuthenticated'](),controller[_0xd969('0xf')]);router[_0xd969('0x10')]('/',auth[_0xd969('0x8')](),controller[_0xd969('0x11')]);router[_0xd969('0x12')](_0xd969('0xe'),controller[_0xd969('0x13')]);router['delete']('/:id',auth[_0xd969('0x8')](),controller[_0xd969('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index da54004..ddce367 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c00=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x12d0bb,_0x56430a){var _0x44e5af=function(_0x1c0db0){while(--_0x1c0db0){_0x12d0bb['push'](_0x12d0bb['shift']());}};_0x44e5af(++_0x56430a);}(_0x5c00,0x17e));var _0x05c0=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x5c00[_0x1ebce2];return _0x4a330c;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'body':{'type':Sequelize[_0x05c0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x05c0('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x05c0('0x4')]('in',_0x05c0('0x5')),'defaultValue':_0x05c0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x05c0('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x05c0('0x2')]}};
\ No newline at end of file
+var _0x1123=['TEXT','BOOLEAN','ENUM','DATE','STRING'];(function(_0x54aef6,_0x4155fc){var _0x1a2d10=function(_0x4cefb6){while(--_0x4cefb6){_0x54aef6['push'](_0x54aef6['shift']());}};_0x1a2d10(++_0x4155fc);}(_0x1123,0x118));var _0x3112=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1123[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3112('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3112('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3112('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3112('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3112('0x3')]},'providerName':{'type':Sequelize[_0x3112('0x4')]},'providerResponse':{'type':Sequelize[_0x3112('0x0')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4e08110..4608446 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8aed=['interface','channel','event','EventManager','acceptmessage','parse','../../config/logger','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','User','fullname','internal','SIP/%s','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','show','params','keys','fields','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','manual'];(function(_0x27968c,_0x5f4dbd){var _0x3cfb3a=function(_0x296d49){while(--_0x296d49){_0x27968c['push'](_0x27968c['shift']());}};_0x3cfb3a(++_0x5f4dbd);}(_0x8aed,0x96));var _0xd8ae=function(_0x4e8799,_0x2854ba){_0x4e8799=_0x4e8799-0x0;var _0x366238=_0x8aed[_0x4e8799];return _0x366238;};'use strict';var emlformat=require(_0xd8ae('0x0'));var rimraf=require(_0xd8ae('0x1'));var zipdir=require(_0xd8ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8ae('0x3'));var moment=require(_0xd8ae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd8ae('0x5'));var util=require(_0xd8ae('0x6'));var path=require('path');var sox=require(_0xd8ae('0x7'));var csv=require(_0xd8ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8ae('0x9'));var _=require(_0xd8ae('0xa'));var squel=require(_0xd8ae('0xb'));var crypto=require(_0xd8ae('0xc'));var jsforce=require(_0xd8ae('0xd'));var deskjs=require(_0xd8ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd8ae('0xf'));var Papa=require(_0xd8ae('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd8ae('0x11'));var as=require(_0xd8ae('0x12'));var hardwareService=require(_0xd8ae('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd8ae('0x14'));var config=require(_0xd8ae('0x15'));var licenseUtil=require(_0xd8ae('0x16'));var db=require(_0xd8ae('0x17'))['db'];config[_0xd8ae('0x18')]=_[_0xd8ae('0x19')](config[_0xd8ae('0x18')],{'host':_0xd8ae('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8ae('0x18')]));require(_0xd8ae('0x1b'))[_0xd8ae('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd8ae('0x1d')][_0xd8ae('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xd8ae('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5ea127,_0x506bf0,_0x48d56d,_0x312a79){return new BPromise(function(_0x192ea5,_0x27e189){var _0x2b84f8=_0x312a79||client;return _0x2b84f8[_0xd8ae('0x1f')](_0x5ea127,_0x48d56d)[_0xd8ae('0x20')](function(_0x3b8bca){logger[_0xd8ae('0x21')](_0xd8ae('0x22'),_0x506bf0,_0xd8ae('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x506bf0,_0xd8ae('0x23'),JSON[_0xd8ae('0x24')](_0x3b8bca));if(_0x3b8bca['error']){if(_0x3b8bca[_0xd8ae('0x25')][_0xd8ae('0x26')]===0x1f4){logger[_0xd8ae('0x25')]('ChatMessage,\x20%s,\x20%s',_0x506bf0,_0x3b8bca[_0xd8ae('0x25')]['message']);return _0x27e189(_0x3b8bca['error'][_0xd8ae('0x27')]);}logger[_0xd8ae('0x25')](_0xd8ae('0x22'),_0x506bf0,_0x3b8bca['error'][_0xd8ae('0x27')]);return _0x192ea5(_0x3b8bca[_0xd8ae('0x25')][_0xd8ae('0x27')]);}else{logger[_0xd8ae('0x21')](_0xd8ae('0x22'),_0x506bf0,'request\x20sent');_0x192ea5(_0x3b8bca[_0xd8ae('0x28')][_0xd8ae('0x27')]);}})[_0xd8ae('0x29')](function(_0x4fb645){logger[_0xd8ae('0x25')](_0xd8ae('0x22'),_0x506bf0,_0x4fb645);_0x27e189(_0x4fb645);});});}function respondWithStatusCode(_0x4cf479,_0x55f57e){_0x55f57e=_0x55f57e||0xcc;return function(_0xcffeb3){if(_0xcffeb3){return _0x4cf479[_0xd8ae('0x2a')](_0x55f57e);}return _0x4cf479['status'](_0x55f57e)['end']();};}function respondWithResult(_0x503e60,_0x537a93){_0x537a93=_0x537a93||0xc8;return function(_0x42e64b){if(_0x42e64b){return _0x503e60[_0xd8ae('0x2b')](_0x537a93)[_0xd8ae('0x2c')](_0x42e64b);}};}function respondWithFilteredResult(_0x50f82c,_0x3e25e2){return function(_0x424e71){if(_0x424e71){var _0x1c6a44=typeof _0x3e25e2[_0xd8ae('0x2d')]===_0xd8ae('0x2e')&&typeof _0x3e25e2[_0xd8ae('0x2f')]===_0xd8ae('0x2e');var _0x4ae93f=_0x424e71['count'];var _0x17bbf2=_0x1c6a44?0x0:_0x3e25e2['offset'];var _0x198117=_0x1c6a44?_0x424e71['count']:_0x3e25e2[_0xd8ae('0x2d')]+_0x3e25e2[_0xd8ae('0x2f')];var _0x14e0a5;if(_0x198117>=_0x4ae93f){_0x198117=_0x4ae93f;_0x14e0a5=0xc8;}else{_0x14e0a5=0xce;}_0x50f82c[_0xd8ae('0x2b')](_0x14e0a5);return _0x50f82c['set'](_0xd8ae('0x30'),_0x17bbf2+'-'+_0x198117+'/'+_0x4ae93f)[_0xd8ae('0x2c')](_0x424e71);}return null;};}function patchUpdates(_0x32b0da){return function(_0x3e0e92){try{jsonpatch[_0xd8ae('0x31')](_0x3e0e92,_0x32b0da,!![]);}catch(_0x512f46){return BPromise[_0xd8ae('0x32')](_0x512f46);}return _0x3e0e92[_0xd8ae('0x33')]();};}function saveUpdates(_0x27c7bf,_0x594bfb){return function(_0x557c4b){if(_0x557c4b){return _0x557c4b[_0xd8ae('0x34')](_0x27c7bf)[_0xd8ae('0x20')](function(_0x15404b){return _0x15404b;});}return null;};}function removeEntity(_0x1741c0,_0x5c7f26){return function(_0x5765a0){if(_0x5765a0){return _0x5765a0[_0xd8ae('0x35')]()[_0xd8ae('0x20')](function(){_0x1741c0['status'](0xcc)[_0xd8ae('0x36')]();});}};}function handleEntityNotFound(_0x1f239c,_0x2f00f4){return function(_0x386343){if(!_0x386343){_0x1f239c[_0xd8ae('0x2a')](0x194);}return _0x386343;};}function handleError(_0x5c21ca,_0x58f6d8){_0x58f6d8=_0x58f6d8||0x1f4;return function(_0x330f73){logger[_0xd8ae('0x25')](_0x330f73[_0xd8ae('0x37')]);if(_0x330f73['name']){delete _0x330f73[_0xd8ae('0x38')];}_0x5c21ca['status'](_0x58f6d8)[_0xd8ae('0x39')](_0x330f73);};}exports[_0xd8ae('0x3a')]=function(_0x21c63c,_0x575fae){var _0x2b4133={},_0x4cea34={},_0x2d7b47={'count':0x0,'rows':[]};var _0x473dd2=_[_0xd8ae('0x3b')](db[_0xd8ae('0x3c')][_0xd8ae('0x3d')],function(_0x1e6cac){return{'name':_0x1e6cac[_0xd8ae('0x3e')],'type':_0x1e6cac['type'][_0xd8ae('0x3f')]};});_0x4cea34[_0xd8ae('0x40')]=_[_0xd8ae('0x3b')](_0x473dd2,_0xd8ae('0x38'));_0x4cea34['query']=_['keys'](_0x21c63c[_0xd8ae('0x41')]);_0x4cea34[_0xd8ae('0x42')]=_[_0xd8ae('0x43')](_0x4cea34[_0xd8ae('0x40')],_0x4cea34[_0xd8ae('0x41')]);_0x2b4133['attributes']=_[_0xd8ae('0x43')](_0x4cea34[_0xd8ae('0x40')],qs['fields'](_0x21c63c[_0xd8ae('0x41')]['fields']));_0x2b4133[_0xd8ae('0x44')]=_0x2b4133[_0xd8ae('0x44')][_0xd8ae('0x45')]?_0x2b4133[_0xd8ae('0x44')]:_0x4cea34[_0xd8ae('0x40')];if(!_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x46')]('nolimit')){_0x2b4133[_0xd8ae('0x2f')]=qs['limit'](_0x21c63c['query']['limit']);_0x2b4133[_0xd8ae('0x2d')]=qs[_0xd8ae('0x2d')](_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x2d')]);}_0x2b4133[_0xd8ae('0x47')]=qs[_0xd8ae('0x48')](_0x21c63c['query'][_0xd8ae('0x48')]);_0x2b4133[_0xd8ae('0x49')]=qs[_0xd8ae('0x42')](_[_0xd8ae('0x4a')](_0x21c63c['query'],_0x4cea34['filters']),_0x473dd2);if(_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x4b')]){_0x2b4133[_0xd8ae('0x49')]=_[_0xd8ae('0x4c')](_0x2b4133[_0xd8ae('0x49')],{'$or':_['map'](_0x473dd2,function(_0x278aff){if(_0x278aff[_0xd8ae('0x4d')]!==_0xd8ae('0x4e')){var _0x346b13={};_0x346b13[_0x278aff[_0xd8ae('0x38')]]={'$like':'%'+_0x21c63c[_0xd8ae('0x41')]['filter']+'%'};return _0x346b13;}})});}_0x2b4133=_[_0xd8ae('0x4c')]({},_0x2b4133,_0x21c63c['options']);var _0xb5ec06={'where':_0x2b4133[_0xd8ae('0x49')]};return db[_0xd8ae('0x3c')][_0xd8ae('0x4f')](_0xb5ec06)[_0xd8ae('0x20')](function(_0x11db47){_0x2d7b47[_0xd8ae('0x4f')]=_0x11db47;if(_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x50')]){_0x2b4133[_0xd8ae('0x51')]=[{'all':!![]}];}return db[_0xd8ae('0x3c')][_0xd8ae('0x52')](_0x2b4133);})[_0xd8ae('0x20')](function(_0x1beb34){_0x2d7b47[_0xd8ae('0x53')]=_0x1beb34;return _0x2d7b47;})[_0xd8ae('0x20')](respondWithFilteredResult(_0x575fae,_0x2b4133))[_0xd8ae('0x29')](handleError(_0x575fae,null));};exports[_0xd8ae('0x54')]=function(_0x2bb36a,_0xc0c80f){var _0x33bae8={'raw':!![],'where':{'id':_0x2bb36a[_0xd8ae('0x55')]['id']}},_0x2fa1a5={};_0x2fa1a5[_0xd8ae('0x40')]=_['keys'](db[_0xd8ae('0x3c')]['rawAttributes']);_0x2fa1a5[_0xd8ae('0x41')]=_[_0xd8ae('0x56')](_0x2bb36a[_0xd8ae('0x41')]);_0x2fa1a5['filters']=_['intersection'](_0x2fa1a5[_0xd8ae('0x40')],_0x2fa1a5[_0xd8ae('0x41')]);_0x33bae8['attributes']=_[_0xd8ae('0x43')](_0x2fa1a5[_0xd8ae('0x40')],qs[_0xd8ae('0x57')](_0x2bb36a[_0xd8ae('0x41')][_0xd8ae('0x57')]));_0x33bae8['attributes']=_0x33bae8[_0xd8ae('0x44')]['length']?_0x33bae8[_0xd8ae('0x44')]:_0x2fa1a5['model'];if(_0x2bb36a[_0xd8ae('0x41')][_0xd8ae('0x50')]){_0x33bae8[_0xd8ae('0x51')]=[{'all':!![]}];}_0x33bae8=_[_0xd8ae('0x4c')]({},_0x33bae8,_0x2bb36a['options']);return db[_0xd8ae('0x3c')][_0xd8ae('0x58')](_0x33bae8)[_0xd8ae('0x20')](handleEntityNotFound(_0xc0c80f,null))[_0xd8ae('0x20')](respondWithResult(_0xc0c80f,null))[_0xd8ae('0x29')](handleError(_0xc0c80f,null));};exports[_0xd8ae('0x59')]=function(_0x48f6bc,_0x80935e){return db[_0xd8ae('0x3c')][_0xd8ae('0x59')](_0x48f6bc[_0xd8ae('0x5a')],{})['then'](respondWithResult(_0x80935e,0xc9))['catch'](handleError(_0x80935e,null));};exports[_0xd8ae('0x34')]=function(_0x497e36,_0x5f965e){if(_0x497e36['body']['id']){delete _0x497e36[_0xd8ae('0x5a')]['id'];}return db[_0xd8ae('0x3c')][_0xd8ae('0x58')]({'where':{'id':_0x497e36[_0xd8ae('0x55')]['id']}})[_0xd8ae('0x20')](handleEntityNotFound(_0x5f965e,null))[_0xd8ae('0x20')](saveUpdates(_0x497e36[_0xd8ae('0x5a')],null))[_0xd8ae('0x20')](respondWithResult(_0x5f965e,null))[_0xd8ae('0x29')](handleError(_0x5f965e,null));};exports[_0xd8ae('0x35')]=function(_0x326dc9,_0x575b43){return db['ChatMessage'][_0xd8ae('0x58')]({'where':{'id':_0x326dc9[_0xd8ae('0x55')]['id']}})['then'](handleEntityNotFound(_0x575b43,null))[_0xd8ae('0x20')](removeEntity(_0x575b43,null))['catch'](handleError(_0x575b43,null));};exports[_0xd8ae('0x5b')]=function(_0x464bb6,_0x25c18d){return db['ChatMessage'][_0xd8ae('0x5b')]()[_0xd8ae('0x20')](respondWithResult(_0x25c18d,null))[_0xd8ae('0x29')](handleError(_0x25c18d,null));};var interaction_log=require('../../config/logger')(_0xd8ae('0x5c'));exports[_0xd8ae('0x5d')]=function(_0xc297fb,_0x421ff0,_0x1a7845){var _0x2f0bdf={'agent':{},'channel':_0xd8ae('0x5e')};if(_0xc297fb['body']['id']){delete _0xc297fb[_0xd8ae('0x5a')]['id'];}_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x5f')]=!![];_0xc297fb[_0xd8ae('0x5a')]['readAt']=moment()[_0xd8ae('0x60')](_0xd8ae('0x61'));_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x62')]=_0xc297fb['body']['UserId']||_0xc297fb[_0xd8ae('0x63')]['id'];_0x2f0bdf[_0xd8ae('0x64')]['id']=_0xc297fb[_0xd8ae('0x5a')]['UserId'];return db[_0xd8ae('0x3c')]['find']({'where':{'id':_0xc297fb[_0xd8ae('0x55')]['id'],'UserId':null}})[_0xd8ae('0x20')](handleEntityNotFound(_0x421ff0,null))[_0xd8ae('0x20')](saveUpdates(_0xc297fb[_0xd8ae('0x5a')],null))[_0xd8ae('0x20')](function(_0x132dcd){if(_0x132dcd){_0x2f0bdf['message']=_0x132dcd[_0xd8ae('0x65')]({'plain':!![]});return db[_0xd8ae('0x66')]['find']({'where':{'id':_0x132dcd[_0xd8ae('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x421ff0,null))[_0xd8ae('0x20')](function(_0x442004){if(_0x442004){return _0x442004[_0xd8ae('0x34')]({'UserId':_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x62')],'read1stAt':_[_0xd8ae('0x68')](_0x442004[_0xd8ae('0x69')])?moment()['format'](_0xd8ae('0x61')):undefined});}return null;})[_0xd8ae('0x20')](function(_0x40c219){if(_0x40c219){_0x2f0bdf['interaction']=_0x40c219['get']({'plain':!![]});interaction_log[_0xd8ae('0x21')](_0xd8ae('0x6a'),_0xc297fb[_0xd8ae('0x63')]['id'],_0xc297fb['user'][_0xd8ae('0x38')],_0xc297fb[_0xd8ae('0x63')]['role'],_0x2f0bdf[_0xd8ae('0x6b')]['id'],_0xc297fb[_0xd8ae('0x5a')]?JSON[_0xd8ae('0x24')](_0xc297fb['body']):_0xd8ae('0x6c'));return respondWithRpcPromise(_0xd8ae('0x6d'),_0xd8ae('0x6e'),_0x2f0bdf);}return null;})[_0xd8ae('0x20')](function(_0x1b0308){var _0xb25d82=_0xd8ae('0x6f')+_0x1b0308['message'][_0xd8ae('0x70')];return db[_0xd8ae('0x71')]['query'](_0xb25d82,{'type':db[_0xd8ae('0x72')][_0xd8ae('0x73')][_0xd8ae('0x74')],'raw':!![]})[_0xd8ae('0x20')](function(_0x316218){return _0x316218;});})[_0xd8ae('0x20')](function(_0x518a67){if(_0x518a67){_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x75')]=_0x518a67[0x0];if(!_0xc297fb[_0xd8ae('0x5a')]['UserId'])return;return db['User'][_0xd8ae('0x58')]({'where':{'id':_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x62')],'role':'agent'},'attributes':['id','name','fullname',_0xd8ae('0x76'),'internal'],'raw':!![]});}return null;})[_0xd8ae('0x20')](function(_0x5703eb){if(!_0x5703eb)return null;_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x64')]=_0x5703eb;return _0x2f0bdf;})[_0xd8ae('0x20')](function(_0x24a5db){if(_0x24a5db){if(_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x77')]){_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x78')]=util[_0xd8ae('0x60')]('SIP/%s',_0xc297fb[_0xd8ae('0x63')][_0xd8ae('0x38')]);_0x2f0bdf[_0xd8ae('0x27')]['channel']=_0x2f0bdf[_0xd8ae('0x79')];_0x2f0bdf[_0xd8ae('0x27')]['motionChannel']=_0x2f0bdf[_0xd8ae('0x79')];_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x7a')]=_0xd8ae('0x5d');return respondWithRpcPromise(_0xd8ae('0x7b'),'EventManager',{'event':_0xd8ae('0x7c'),'message':_[_0xd8ae('0x4c')](_0x2f0bdf['message'],JSON[_0xd8ae('0x7d')](_0x2f0bdf[_0xd8ae('0x6b')]['formData']))},client9002)[_0xd8ae('0x20')](function(){return _0x2f0bdf;});}return _0x2f0bdf;}return null;})['then'](respondWithResult(_0x421ff0,null))['catch'](handleError(_0x421ff0,null));};var interaction_log=require(_0xd8ae('0x7e'))(_0xd8ae('0x5c'));exports[_0xd8ae('0x32')]=function(_0x2cb653,_0x44b6b2,_0x45a4d4){var _0x583028={'agent':{},'channel':_0xd8ae('0x5e')};if(_0x2cb653[_0xd8ae('0x5a')]['id']){delete _0x2cb653[_0xd8ae('0x5a')]['id'];}_0x2cb653['body'][_0xd8ae('0x62')]=_0x2cb653[_0xd8ae('0x5a')]['UserId']||_0x2cb653[_0xd8ae('0x63')]['id'];_0x583028[_0xd8ae('0x64')]['id']=_0x2cb653[_0xd8ae('0x5a')][_0xd8ae('0x62')];return db['ChatMessage'][_0xd8ae('0x58')]({'where':{'id':_0x2cb653['params']['id'],'UserId':null}})[_0xd8ae('0x20')](handleEntityNotFound(_0x44b6b2,null))[_0xd8ae('0x20')](function(_0x1971dc){if(_0x1971dc){_0x583028[_0xd8ae('0x27')]=_0x1971dc[_0xd8ae('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xd8ae('0x58')]({'where':{'id':_0x1971dc[_0xd8ae('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x44b6b2,null))[_0xd8ae('0x20')](function(_0xe914c2){if(_0xe914c2){_0x583028[_0xd8ae('0x6b')]=_0xe914c2[_0xd8ae('0x65')]({'plain':!![]});interaction_log[_0xd8ae('0x21')](_0xd8ae('0x7f'),_0x2cb653[_0xd8ae('0x63')]['id'],_0x2cb653['user'][_0xd8ae('0x38')],_0x2cb653[_0xd8ae('0x63')][_0xd8ae('0x80')],_0x583028[_0xd8ae('0x6b')]['id'],_0x2cb653[_0xd8ae('0x5a')]?JSON[_0xd8ae('0x24')](_0x2cb653['body']):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x583028);}return null;})[_0xd8ae('0x20')](function(_0x53eba7){var _0x21d421=_0xd8ae('0x6f')+_0x53eba7['message'][_0xd8ae('0x70')];return db[_0xd8ae('0x71')][_0xd8ae('0x41')](_0x21d421,{'type':db[_0xd8ae('0x72')]['QueryTypes'][_0xd8ae('0x74')],'raw':!![]})['then'](function(_0x1799c6){return _0x1799c6;});})['then'](function(_0x4c421f){if(_0x4c421f){_0x583028['message'][_0xd8ae('0x75')]=_0x4c421f[0x0];if(!_0x2cb653[_0xd8ae('0x5a')][_0xd8ae('0x62')])return;return db[_0xd8ae('0x81')][_0xd8ae('0x58')]({'where':{'id':_0x2cb653[_0xd8ae('0x5a')][_0xd8ae('0x62')],'role':'agent'},'attributes':['id',_0xd8ae('0x38'),_0xd8ae('0x82'),_0xd8ae('0x76'),_0xd8ae('0x83')],'raw':!![]});}return null;})['then'](function(_0x14a12b){if(!_0x14a12b)return null;_0x583028[_0xd8ae('0x27')][_0xd8ae('0x64')]=_0x14a12b;return _0x583028;})['then'](function(_0x44f3d8){if(_0x44f3d8){_0x44f3d8[_0xd8ae('0x27')][_0xd8ae('0x78')]=util[_0xd8ae('0x60')](_0xd8ae('0x84'),_0x2cb653[_0xd8ae('0x63')][_0xd8ae('0x38')]);_0x44f3d8[_0xd8ae('0x27')][_0xd8ae('0x79')]=_0x583028[_0xd8ae('0x79')];_0x44f3d8[_0xd8ae('0x27')]['motionChannel']=_0x583028['channel'];_0x44f3d8['message']['event']=_0xd8ae('0x32');respondWithRpcPromise(_0xd8ae('0x7b'),_0xd8ae('0x7b'),{'event':_0xd8ae('0x85'),'message':_[_0xd8ae('0x4c')](_0x583028['message'],JSON[_0xd8ae('0x7d')](_0x583028[_0xd8ae('0x6b')][_0xd8ae('0x86')]))},client9002);return _0x583028;}return null;})[_0xd8ae('0x20')](respondWithResult(_0x44b6b2,null))['catch'](handleError(_0x44b6b2,null));};
\ No newline at end of file
+var _0x05cd=['set','Content-Range','reject','save','destroy','sendStatus','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','ChatMessage','includeAll','include','findAll','rows','find','create','body','update','params','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteractionId','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','email','internal','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','rejectMessage','QueryTypes','SELECT','interface','rejectmessage','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','end','status','json','offset','limit','count'];(function(_0x555573,_0x462f66){var _0x2c48e4=function(_0x1c00ac){while(--_0x1c00ac){_0x555573['push'](_0x555573['shift']());}};_0x2c48e4(++_0x462f66);}(_0x05cd,0xd4));var _0xd05c=function(_0x3b58b5,_0x5799ad){_0x3b58b5=_0x3b58b5-0x0;var _0x5d48e6=_0x05cd[_0x3b58b5];return _0x5d48e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd05c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd05c('0x1'));var rp=require(_0xd05c('0x2'));var moment=require(_0xd05c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd05c('0x4'));var util=require(_0xd05c('0x5'));var path=require(_0xd05c('0x6'));var sox=require(_0xd05c('0x7'));var csv=require(_0xd05c('0x8'));var ejs=require(_0xd05c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd05c('0xa'));var squel=require(_0xd05c('0xb'));var crypto=require(_0xd05c('0xc'));var jsforce=require(_0xd05c('0xd'));var deskjs=require(_0xd05c('0xe'));var toCsv=require(_0xd05c('0x8'));var querystring=require(_0xd05c('0xf'));var Papa=require('papaparse');var Redis=require(_0xd05c('0x10'));var authService=require(_0xd05c('0x11'));var qs=require(_0xd05c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd05c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd05c('0x14'));var config=require(_0xd05c('0x15'));var licenseUtil=require(_0xd05c('0x16'));var db=require(_0xd05c('0x17'))['db'];config[_0xd05c('0x18')]=_[_0xd05c('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd05c('0x1a'))(new Redis(config[_0xd05c('0x18')]));require(_0xd05c('0x1b'))['register'](socket);var jayson=require(_0xd05c('0x1c'));var client=jayson[_0xd05c('0x1d')][_0xd05c('0x1e')]({'port':0x232c});var client9002=jayson[_0xd05c('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x504db0,_0x455804,_0x2645d3,_0x29a6e7){return new BPromise(function(_0x1d6838,_0x57fa3f){var _0x431611=_0x29a6e7||client;return _0x431611[_0xd05c('0x1f')](_0x504db0,_0x2645d3)[_0xd05c('0x20')](function(_0xb3a471){logger[_0xd05c('0x21')](_0xd05c('0x22'),_0x455804,'request\x20sent');logger['debug'](_0xd05c('0x23'),_0x455804,'request\x20sent',JSON['stringify'](_0xb3a471));if(_0xb3a471[_0xd05c('0x24')]){if(_0xb3a471[_0xd05c('0x24')][_0xd05c('0x25')]===0x1f4){logger['error'](_0xd05c('0x22'),_0x455804,_0xb3a471[_0xd05c('0x24')][_0xd05c('0x26')]);return _0x57fa3f(_0xb3a471[_0xd05c('0x24')][_0xd05c('0x26')]);}logger['error'](_0xd05c('0x22'),_0x455804,_0xb3a471[_0xd05c('0x24')]['message']);return _0x1d6838(_0xb3a471[_0xd05c('0x24')][_0xd05c('0x26')]);}else{logger['info'](_0xd05c('0x22'),_0x455804,'request\x20sent');_0x1d6838(_0xb3a471['result'][_0xd05c('0x26')]);}})[_0xd05c('0x27')](function(_0x6d4d9e){logger[_0xd05c('0x24')](_0xd05c('0x22'),_0x455804,_0x6d4d9e);_0x57fa3f(_0x6d4d9e);});});}function respondWithStatusCode(_0x4937f2,_0x27876d){_0x27876d=_0x27876d||0xcc;return function(_0x58011b){if(_0x58011b){return _0x4937f2['sendStatus'](_0x27876d);}return _0x4937f2['status'](_0x27876d)[_0xd05c('0x28')]();};}function respondWithResult(_0x3a38a0,_0x254034){_0x254034=_0x254034||0xc8;return function(_0x49d14a){if(_0x49d14a){return _0x3a38a0[_0xd05c('0x29')](_0x254034)[_0xd05c('0x2a')](_0x49d14a);}};}function respondWithFilteredResult(_0x546107,_0x2b9a43){return function(_0x26e195){if(_0x26e195){var _0x4d5513=typeof _0x2b9a43[_0xd05c('0x2b')]==='undefined'&&typeof _0x2b9a43[_0xd05c('0x2c')]==='undefined';var _0x573bfb=_0x26e195[_0xd05c('0x2d')];var _0x530949=_0x4d5513?0x0:_0x2b9a43[_0xd05c('0x2b')];var _0x52c85c=_0x4d5513?_0x26e195['count']:_0x2b9a43['offset']+_0x2b9a43[_0xd05c('0x2c')];var _0xfd08e2;if(_0x52c85c>=_0x573bfb){_0x52c85c=_0x573bfb;_0xfd08e2=0xc8;}else{_0xfd08e2=0xce;}_0x546107[_0xd05c('0x29')](_0xfd08e2);return _0x546107[_0xd05c('0x2e')](_0xd05c('0x2f'),_0x530949+'-'+_0x52c85c+'/'+_0x573bfb)['json'](_0x26e195);}return null;};}function patchUpdates(_0x178333){return function(_0x4b580c){try{jsonpatch['apply'](_0x4b580c,_0x178333,!![]);}catch(_0x497e59){return BPromise[_0xd05c('0x30')](_0x497e59);}return _0x4b580c[_0xd05c('0x31')]();};}function saveUpdates(_0x44b905,_0x5c2430){return function(_0x922ccb){if(_0x922ccb){return _0x922ccb['update'](_0x44b905)['then'](function(_0x4621df){return _0x4621df;});}return null;};}function removeEntity(_0x53bef1,_0xc25105){return function(_0xaffdce){if(_0xaffdce){return _0xaffdce[_0xd05c('0x32')]()[_0xd05c('0x20')](function(){_0x53bef1[_0xd05c('0x29')](0xcc)[_0xd05c('0x28')]();});}};}function handleEntityNotFound(_0x136d97,_0x515f02){return function(_0x3372f7){if(!_0x3372f7){_0x136d97[_0xd05c('0x33')](0x194);}return _0x3372f7;};}function handleError(_0x215fd8,_0x8a4931){_0x8a4931=_0x8a4931||0x1f4;return function(_0x1febbd){logger[_0xd05c('0x24')](_0x1febbd['stack']);if(_0x1febbd[_0xd05c('0x34')]){delete _0x1febbd[_0xd05c('0x34')];}_0x215fd8['status'](_0x8a4931)[_0xd05c('0x35')](_0x1febbd);};}exports['index']=function(_0x5afaaa,_0x1c4b85){var _0x56f26f={},_0x4f7307={},_0x569432={'count':0x0,'rows':[]};var _0x5b50ce=_[_0xd05c('0x36')](db['ChatMessage'][_0xd05c('0x37')],function(_0x32cd33){return{'name':_0x32cd33[_0xd05c('0x38')],'type':_0x32cd33['type'][_0xd05c('0x39')]};});_0x4f7307[_0xd05c('0x3a')]=_[_0xd05c('0x36')](_0x5b50ce,'name');_0x4f7307[_0xd05c('0x3b')]=_[_0xd05c('0x3c')](_0x5afaaa[_0xd05c('0x3b')]);_0x4f7307[_0xd05c('0x3d')]=_[_0xd05c('0x3e')](_0x4f7307[_0xd05c('0x3a')],_0x4f7307[_0xd05c('0x3b')]);_0x56f26f[_0xd05c('0x3f')]=_[_0xd05c('0x3e')](_0x4f7307[_0xd05c('0x3a')],qs[_0xd05c('0x40')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x40')]));_0x56f26f['attributes']=_0x56f26f['attributes'][_0xd05c('0x41')]?_0x56f26f[_0xd05c('0x3f')]:_0x4f7307[_0xd05c('0x3a')];if(!_0x5afaaa[_0xd05c('0x3b')]['hasOwnProperty'](_0xd05c('0x42'))){_0x56f26f[_0xd05c('0x2c')]=qs[_0xd05c('0x2c')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x2c')]);_0x56f26f[_0xd05c('0x2b')]=qs[_0xd05c('0x2b')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x2b')]);}_0x56f26f[_0xd05c('0x43')]=qs[_0xd05c('0x44')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x44')]);_0x56f26f['where']=qs[_0xd05c('0x3d')](_[_0xd05c('0x45')](_0x5afaaa[_0xd05c('0x3b')],_0x4f7307['filters']),_0x5b50ce);if(_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x46')]){_0x56f26f[_0xd05c('0x47')]=_[_0xd05c('0x48')](_0x56f26f[_0xd05c('0x47')],{'$or':_[_0xd05c('0x36')](_0x5b50ce,function(_0x2a28f2){if(_0x2a28f2[_0xd05c('0x49')]!=='VIRTUAL'){var _0x352c2a={};_0x352c2a[_0x2a28f2['name']]={'$like':'%'+_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x46')]+'%'};return _0x352c2a;}})});}_0x56f26f=_['merge']({},_0x56f26f,_0x5afaaa[_0xd05c('0x4a')]);var _0x48ae35={'where':_0x56f26f[_0xd05c('0x47')]};return db[_0xd05c('0x4b')][_0xd05c('0x2d')](_0x48ae35)[_0xd05c('0x20')](function(_0x402c3a){_0x569432[_0xd05c('0x2d')]=_0x402c3a;if(_0x5afaaa['query'][_0xd05c('0x4c')]){_0x56f26f[_0xd05c('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0xd05c('0x4e')](_0x56f26f);})['then'](function(_0x5c523e){_0x569432[_0xd05c('0x4f')]=_0x5c523e;return _0x569432;})[_0xd05c('0x20')](respondWithFilteredResult(_0x1c4b85,_0x56f26f))[_0xd05c('0x27')](handleError(_0x1c4b85,null));};exports['show']=function(_0x162b20,_0x2bb870){var _0x27add4={'raw':!![],'where':{'id':_0x162b20['params']['id']}},_0x5c8cb2={};_0x5c8cb2[_0xd05c('0x3a')]=_['keys'](db[_0xd05c('0x4b')][_0xd05c('0x37')]);_0x5c8cb2[_0xd05c('0x3b')]=_[_0xd05c('0x3c')](_0x162b20[_0xd05c('0x3b')]);_0x5c8cb2['filters']=_[_0xd05c('0x3e')](_0x5c8cb2[_0xd05c('0x3a')],_0x5c8cb2[_0xd05c('0x3b')]);_0x27add4[_0xd05c('0x3f')]=_[_0xd05c('0x3e')](_0x5c8cb2[_0xd05c('0x3a')],qs[_0xd05c('0x40')](_0x162b20['query'][_0xd05c('0x40')]));_0x27add4[_0xd05c('0x3f')]=_0x27add4[_0xd05c('0x3f')][_0xd05c('0x41')]?_0x27add4[_0xd05c('0x3f')]:_0x5c8cb2['model'];if(_0x162b20[_0xd05c('0x3b')][_0xd05c('0x4c')]){_0x27add4[_0xd05c('0x4d')]=[{'all':!![]}];}_0x27add4=_[_0xd05c('0x48')]({},_0x27add4,_0x162b20[_0xd05c('0x4a')]);return db[_0xd05c('0x4b')][_0xd05c('0x50')](_0x27add4)['then'](handleEntityNotFound(_0x2bb870,null))[_0xd05c('0x20')](respondWithResult(_0x2bb870,null))['catch'](handleError(_0x2bb870,null));};exports[_0xd05c('0x51')]=function(_0x4a2702,_0x399956){return db[_0xd05c('0x4b')][_0xd05c('0x51')](_0x4a2702[_0xd05c('0x52')],{})[_0xd05c('0x20')](respondWithResult(_0x399956,0xc9))[_0xd05c('0x27')](handleError(_0x399956,null));};exports[_0xd05c('0x53')]=function(_0x45b50c,_0x77916d){if(_0x45b50c[_0xd05c('0x52')]['id']){delete _0x45b50c['body']['id'];}return db['ChatMessage'][_0xd05c('0x50')]({'where':{'id':_0x45b50c['params']['id']}})['then'](handleEntityNotFound(_0x77916d,null))[_0xd05c('0x20')](saveUpdates(_0x45b50c[_0xd05c('0x52')],null))[_0xd05c('0x20')](respondWithResult(_0x77916d,null))[_0xd05c('0x27')](handleError(_0x77916d,null));};exports['destroy']=function(_0x325983,_0x419da7){return db[_0xd05c('0x4b')][_0xd05c('0x50')]({'where':{'id':_0x325983[_0xd05c('0x54')]['id']}})[_0xd05c('0x20')](handleEntityNotFound(_0x419da7,null))[_0xd05c('0x20')](removeEntity(_0x419da7,null))[_0xd05c('0x27')](handleError(_0x419da7,null));};exports[_0xd05c('0x55')]=function(_0x28b175,_0x537339){return db['ChatMessage'][_0xd05c('0x55')]()['then'](respondWithResult(_0x537339,null))['catch'](handleError(_0x537339,null));};var interaction_log=require(_0xd05c('0x56'))(_0xd05c('0x57'));exports[_0xd05c('0x58')]=function(_0x542ed4,_0x5cd5e0,_0x37bcc7){var _0x24e7c3={'agent':{},'channel':_0xd05c('0x59')};if(_0x542ed4['body']['id']){delete _0x542ed4[_0xd05c('0x52')]['id'];}_0x542ed4[_0xd05c('0x52')]['read']=!![];_0x542ed4[_0xd05c('0x52')][_0xd05c('0x5a')]=moment()[_0xd05c('0x5b')](_0xd05c('0x5c'));_0x542ed4['body'][_0xd05c('0x5d')]=_0x542ed4[_0xd05c('0x52')][_0xd05c('0x5d')]||_0x542ed4['user']['id'];_0x24e7c3['agent']['id']=_0x542ed4['body']['UserId'];return db[_0xd05c('0x4b')][_0xd05c('0x50')]({'where':{'id':_0x542ed4['params']['id'],'UserId':null}})[_0xd05c('0x20')](handleEntityNotFound(_0x5cd5e0,null))['then'](saveUpdates(_0x542ed4[_0xd05c('0x52')],null))[_0xd05c('0x20')](function(_0x1a50e5){if(_0x1a50e5){_0x24e7c3[_0xd05c('0x26')]=_0x1a50e5['get']({'plain':!![]});return db['ChatInteraction'][_0xd05c('0x50')]({'where':{'id':_0x1a50e5[_0xd05c('0x5e')]}});}return null;})[_0xd05c('0x20')](handleEntityNotFound(_0x5cd5e0,null))['then'](function(_0x59c217){if(_0x59c217){return _0x59c217[_0xd05c('0x53')]({'UserId':_0x542ed4['body'][_0xd05c('0x5d')],'read1stAt':_['isNil'](_0x59c217[_0xd05c('0x5f')])?moment()[_0xd05c('0x5b')](_0xd05c('0x5c')):undefined});}return null;})[_0xd05c('0x20')](function(_0x11f0ac){if(_0x11f0ac){_0x24e7c3[_0xd05c('0x60')]=_0x11f0ac[_0xd05c('0x61')]({'plain':!![]});interaction_log[_0xd05c('0x21')](_0xd05c('0x62'),_0x542ed4[_0xd05c('0x63')]['id'],_0x542ed4[_0xd05c('0x63')]['name'],_0x542ed4[_0xd05c('0x63')][_0xd05c('0x64')],_0x24e7c3[_0xd05c('0x60')]['id'],_0x542ed4['body']?JSON['stringify'](_0x542ed4['body']):'null');return respondWithRpcPromise(_0xd05c('0x65'),_0xd05c('0x66'),_0x24e7c3);}return null;})[_0xd05c('0x20')](function(_0x50bdc1){var _0x2d9e54=_0xd05c('0x67')+_0x50bdc1['message'][_0xd05c('0x68')];return db[_0xd05c('0x69')][_0xd05c('0x3b')](_0x2d9e54,{'type':db[_0xd05c('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})[_0xd05c('0x20')](function(_0x22cd55){return _0x22cd55;});})[_0xd05c('0x20')](function(_0x34655c){if(_0x34655c){_0x24e7c3[_0xd05c('0x26')][_0xd05c('0x6b')]=_0x34655c[0x0];if(!_0x542ed4['body'][_0xd05c('0x5d')])return;return db[_0xd05c('0x6c')][_0xd05c('0x50')]({'where':{'id':_0x542ed4[_0xd05c('0x52')]['UserId'],'role':_0xd05c('0x6d')},'attributes':['id',_0xd05c('0x34'),_0xd05c('0x6e'),_0xd05c('0x6f'),_0xd05c('0x70')],'raw':!![]});}return null;})['then'](function(_0xca753a){if(!_0xca753a)return null;_0x24e7c3['message'][_0xd05c('0x6d')]=_0xca753a;return _0x24e7c3;})['then'](function(_0x1e23e5){if(_0x1e23e5){if(_0x542ed4[_0xd05c('0x52')]['manual']){_0x24e7c3[_0xd05c('0x26')]['interface']=util[_0xd05c('0x5b')](_0xd05c('0x71'),_0x542ed4['user'][_0xd05c('0x34')]);_0x24e7c3['message'][_0xd05c('0x72')]=_0x24e7c3['channel'];_0x24e7c3[_0xd05c('0x26')][_0xd05c('0x73')]=_0x24e7c3[_0xd05c('0x72')];_0x24e7c3[_0xd05c('0x26')]['event']=_0xd05c('0x58');return respondWithRpcPromise('EventManager',_0xd05c('0x74'),{'event':_0xd05c('0x75'),'message':_[_0xd05c('0x48')](_0x24e7c3[_0xd05c('0x26')],JSON[_0xd05c('0x76')](_0x24e7c3['interaction'][_0xd05c('0x77')]))},client9002)[_0xd05c('0x20')](function(){return _0x24e7c3;});}return _0x24e7c3;}return null;})[_0xd05c('0x20')](respondWithResult(_0x5cd5e0,null))[_0xd05c('0x27')](handleError(_0x5cd5e0,null));};var interaction_log=require(_0xd05c('0x56'))(_0xd05c('0x57'));exports['reject']=function(_0x3e2815,_0x56d64b,_0x56f12c){var _0x2d6041={'agent':{},'channel':_0xd05c('0x59')};if(_0x3e2815['body']['id']){delete _0x3e2815['body']['id'];}_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')]=_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')]||_0x3e2815[_0xd05c('0x63')]['id'];_0x2d6041[_0xd05c('0x6d')]['id']=_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')];return db[_0xd05c('0x4b')][_0xd05c('0x50')]({'where':{'id':_0x3e2815['params']['id'],'UserId':null}})[_0xd05c('0x20')](handleEntityNotFound(_0x56d64b,null))['then'](function(_0x3661de){if(_0x3661de){_0x2d6041['message']=_0x3661de[_0xd05c('0x61')]({'plain':!![]});return db[_0xd05c('0x78')][_0xd05c('0x50')]({'where':{'id':_0x3661de[_0xd05c('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x56d64b,null))[_0xd05c('0x20')](function(_0x1c7791){if(_0x1c7791){_0x2d6041[_0xd05c('0x60')]=_0x1c7791[_0xd05c('0x61')]({'plain':!![]});interaction_log[_0xd05c('0x21')](_0xd05c('0x79'),_0x3e2815[_0xd05c('0x63')]['id'],_0x3e2815[_0xd05c('0x63')][_0xd05c('0x34')],_0x3e2815['user'][_0xd05c('0x64')],_0x2d6041[_0xd05c('0x60')]['id'],_0x3e2815[_0xd05c('0x52')]?JSON[_0xd05c('0x7a')](_0x3e2815[_0xd05c('0x52')]):_0xd05c('0x7b'));return respondWithRpcPromise('RejectMessage',_0xd05c('0x7c'),_0x2d6041);}return null;})[_0xd05c('0x20')](function(_0x15a87a){var _0x530775=_0xd05c('0x67')+_0x15a87a[_0xd05c('0x26')][_0xd05c('0x68')];return db[_0xd05c('0x69')]['query'](_0x530775,{'type':db[_0xd05c('0x6a')][_0xd05c('0x7d')][_0xd05c('0x7e')],'raw':!![]})[_0xd05c('0x20')](function(_0x18387e){return _0x18387e;});})[_0xd05c('0x20')](function(_0x34b001){if(_0x34b001){_0x2d6041[_0xd05c('0x26')][_0xd05c('0x6b')]=_0x34b001[0x0];if(!_0x3e2815['body'][_0xd05c('0x5d')])return;return db['User'][_0xd05c('0x50')]({'where':{'id':_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')],'role':_0xd05c('0x6d')},'attributes':['id','name',_0xd05c('0x6e'),'email',_0xd05c('0x70')],'raw':!![]});}return null;})[_0xd05c('0x20')](function(_0x2dbbba){if(!_0x2dbbba)return null;_0x2d6041[_0xd05c('0x26')]['agent']=_0x2dbbba;return _0x2d6041;})['then'](function(_0x250598){if(_0x250598){_0x250598[_0xd05c('0x26')][_0xd05c('0x7f')]=util[_0xd05c('0x5b')](_0xd05c('0x71'),_0x3e2815[_0xd05c('0x63')][_0xd05c('0x34')]);_0x250598[_0xd05c('0x26')][_0xd05c('0x72')]=_0x2d6041[_0xd05c('0x72')];_0x250598[_0xd05c('0x26')]['motionChannel']=_0x2d6041['channel'];_0x250598[_0xd05c('0x26')]['event']=_0xd05c('0x30');respondWithRpcPromise(_0xd05c('0x74'),_0xd05c('0x74'),{'event':_0xd05c('0x80'),'message':_[_0xd05c('0x48')](_0x2d6041['message'],JSON[_0xd05c('0x76')](_0x2d6041['interaction'][_0xd05c('0x77')]))},client9002);return _0x2d6041;}return null;})[_0xd05c('0x20')](respondWithResult(_0x56d64b,null))[_0xd05c('0x27')](handleError(_0x56d64b,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index ca913b6..0997b4e 100644
--- a/server/api/chatMessage/chatMessage.events.js
+++ b/server/api/chatMessage/chatMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3432=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x193653,_0x422a45){var _0x1ed7b8=function(_0xdc78ca){while(--_0xdc78ca){_0x193653['push'](_0x193653['shift']());}};_0x1ed7b8(++_0x422a45);}(_0x3432,0x163));var _0x2343=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3432[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x2343('0x0'));var ChatMessage=require(_0x2343('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2343('0x2')](0x0);var events={'afterCreate':_0x2343('0x3'),'afterUpdate':_0x2343('0x4'),'afterDestroy':_0x2343('0x5')};function emitEvent(_0x28ae09){return function(_0x49c984,_0x3a5a89,_0x217adc){ChatMessageEvents[_0x2343('0x6')](_0x28ae09+':'+_0x49c984['id'],_0x49c984);ChatMessageEvents[_0x2343('0x6')](_0x28ae09,_0x49c984);_0x217adc(null);};}for(var e in events){if(events[_0x2343('0x7')](e)){var event=events[e];ChatMessage[_0x2343('0x8')](e,emitEvent(event));}}module[_0x2343('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x780b=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit'];(function(_0xd5307f,_0x4d1fe9){var _0x39d3d4=function(_0x40c4e1){while(--_0x40c4e1){_0xd5307f['push'](_0xd5307f['shift']());}};_0x39d3d4(++_0x4d1fe9);}(_0x780b,0xa3));var _0xb780=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x780b[_0x297fd3];return _0x2af381;};'use strict';var EventEmitter=require(_0xb780('0x0'));var ChatMessage=require(_0xb780('0x1'))['db'][_0xb780('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb780('0x3')](0x0);var events={'afterCreate':_0xb780('0x4'),'afterUpdate':_0xb780('0x5'),'afterDestroy':'remove'};function emitEvent(_0x25a884){return function(_0x15e882,_0x412b4d,_0x418bc1){ChatMessageEvents[_0xb780('0x6')](_0x25a884+':'+_0x15e882['id'],_0x15e882);ChatMessageEvents[_0xb780('0x6')](_0x25a884,_0x15e882);_0x418bc1(null);};}for(var e in events){if(events[_0xb780('0x7')](e)){var event=events[e];ChatMessage[_0xb780('0x8')](e,emitEvent(event));}}module[_0xb780('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index a584c4b..42da59c 100644
--- a/server/api/chatMessage/chatMessage.model.js
+++ b/server/api/chatMessage/chatMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea49=['request-promise','path','rimraf','./chatMessage.attributes','exports','define','fti_chat_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','ChatInteraction','findOne','then','createdAt','toLowerCase','catch','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x161587,_0x5c4528){var _0x293546=function(_0x40406e){while(--_0x40406e){_0x161587['push'](_0x161587['shift']());}};_0x293546(++_0x5c4528);}(_0xea49,0x14b));var _0x9ea4=function(_0x213ed5,_0x26712a){_0x213ed5=_0x213ed5-0x0;var _0x191514=_0xea49[_0x213ed5];return _0x191514;};'use strict';var _=require(_0x9ea4('0x0'));var util=require(_0x9ea4('0x1'));var logger=require('../../config/logger')(_0x9ea4('0x2'));var moment=require(_0x9ea4('0x3'));var BPromise=require(_0x9ea4('0x4'));var rp=require(_0x9ea4('0x5'));var fs=require('fs');var path=require(_0x9ea4('0x6'));var rimraf=require(_0x9ea4('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ea4('0x8'));module[_0x9ea4('0x9')]=function(_0x28aa83,_0x1cd230){return _0x28aa83[_0x9ea4('0xa')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9ea4('0xb'),'fields':[_0x9ea4('0xc')],'type':_0x9ea4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x231ec0,_0x433d5a,_0x3e81b8){var _0x4fbdf0=_0x28aa83[_0x9ea4('0xe')];var _0x2f8309=_0x231ec0[_0x9ea4('0xf')]({'plain':!![]});if(_0x2f8309[_0x9ea4('0x10')]['toLowerCase']()==='in'||_0x2f8309[_0x9ea4('0x10')]['toLowerCase']()===_0x9ea4('0x11')&&!_0x2f8309[_0x9ea4('0x12')]&&!_[_0x9ea4('0x13')](_0x2f8309[_0x9ea4('0x14')])){_0x4fbdf0[_0x9ea4('0x15')][_0x9ea4('0x16')]({'where':{'id':_0x2f8309['ChatInteractionId']}})[_0x9ea4('0x17')](function(_0x54f930){if(_0x54f930){_0x54f930['update']({'lastMsgAt':_0x2f8309[_0x9ea4('0x18')],'lastMsgDirection':_0x2f8309[_0x9ea4('0x10')][_0x9ea4('0x19')]()});}})[_0x9ea4('0x1a')](function(_0x3bf7a5){console['error'](_0x3bf7a5);});}_0x3e81b8();}},'charset':'utf8mb4','collate':_0x9ea4('0x1b')});};
\ No newline at end of file
+var _0x8f1d=['define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','toLowerCase','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports'];(function(_0x876194,_0x2d77c2){var _0x5dd914=function(_0x681caa){while(--_0x681caa){_0x876194['push'](_0x876194['shift']());}};_0x5dd914(++_0x2d77c2);}(_0x8f1d,0x72));var _0xd8f1=function(_0x477491,_0x5ca700){_0x477491=_0x477491-0x0;var _0xac6aec=_0x8f1d[_0x477491];return _0xac6aec;};'use strict';var _=require(_0xd8f1('0x0'));var util=require(_0xd8f1('0x1'));var logger=require('../../config/logger')(_0xd8f1('0x2'));var moment=require(_0xd8f1('0x3'));var BPromise=require(_0xd8f1('0x4'));var rp=require(_0xd8f1('0x5'));var fs=require('fs');var path=require(_0xd8f1('0x6'));var rimraf=require('rimraf');var config=require(_0xd8f1('0x7'));var attributes=require(_0xd8f1('0x8'));module[_0xd8f1('0x9')]=function(_0x103610,_0x5ef96f){return _0x103610[_0xd8f1('0xa')](_0xd8f1('0xb'),attributes,{'tableName':_0xd8f1('0xc'),'paranoid':![],'indexes':[{'name':_0xd8f1('0xd'),'fields':[_0xd8f1('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29db48,_0x2e88e9,_0x2c423e){var _0xfa16f5=_0x103610[_0xd8f1('0xf')];var _0x53c6b6=_0x29db48[_0xd8f1('0x10')]({'plain':!![]});if(_0x53c6b6[_0xd8f1('0x11')]['toLowerCase']()==='in'||_0x53c6b6[_0xd8f1('0x11')]['toLowerCase']()===_0xd8f1('0x12')&&!_0x53c6b6[_0xd8f1('0x13')]&&!_['isNil'](_0x53c6b6[_0xd8f1('0x14')])){_0xfa16f5[_0xd8f1('0x15')][_0xd8f1('0x16')]({'where':{'id':_0x53c6b6[_0xd8f1('0x17')]}})[_0xd8f1('0x18')](function(_0x269e57){if(_0x269e57){_0x269e57[_0xd8f1('0x19')]({'lastMsgAt':_0x53c6b6[_0xd8f1('0x1a')],'lastMsgDirection':_0x53c6b6['direction'][_0xd8f1('0x1b')]()});}})[_0xd8f1('0x1c')](function(_0xc6828c){console['error'](_0xc6828c);});}_0x2c423e();}},'charset':_0xd8f1('0x1d'),'collate':_0xd8f1('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 5df5ca8..6dc1aec 100644
--- a/server/api/chatMessage/chatMessage.rpc.js
+++ b/server/api/chatMessage/chatMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa673=['ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateChatMessage','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket','request','then'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xa673,0x17b));var _0x3a67=function(_0x35005f,_0x4dad9f){_0x35005f=_0x35005f-0x0;var _0x1f0270=_0xa673[_0x35005f];return _0x1f0270;};'use strict';var _=require(_0x3a67('0x0'));var util=require(_0x3a67('0x1'));var moment=require(_0x3a67('0x2'));var BPromise=require(_0x3a67('0x3'));var rs=require(_0x3a67('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a67('0x5'))['db'];var utils=require(_0x3a67('0x6'));var logger=require(_0x3a67('0x7'))('rpc');var config=require(_0x3a67('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a67('0x9')][_0x3a67('0xa')]({'port':0x232a});config['redis']=_[_0x3a67('0xb')](config[_0x3a67('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3a67('0xd'))(new Redis(config[_0x3a67('0xc')]));require(_0x3a67('0xe'))['register'](socket);function respondWithRpcPromise(_0x5195d2,_0x3b3ed2,_0x27f828){return new BPromise(function(_0x1884e2,_0x1774f4){return client[_0x3a67('0xf')](_0x5195d2,_0x27f828)[_0x3a67('0x10')](function(_0x4ff92f){logger['info'](_0x3a67('0x11'),_0x3b3ed2,'request\x20sent');logger['debug'](_0x3a67('0x12'),_0x3b3ed2,_0x3a67('0x13'),JSON['stringify'](_0x4ff92f));if(_0x4ff92f[_0x3a67('0x14')]){if(_0x4ff92f['error'][_0x3a67('0x15')]===0x1f4){logger[_0x3a67('0x14')](_0x3a67('0x11'),_0x3b3ed2,_0x4ff92f['error'][_0x3a67('0x16')]);return _0x1774f4(_0x4ff92f[_0x3a67('0x14')][_0x3a67('0x16')]);}logger[_0x3a67('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3b3ed2,_0x4ff92f['error'][_0x3a67('0x16')]);return _0x1884e2(_0x4ff92f[_0x3a67('0x14')][_0x3a67('0x16')]);}else{logger[_0x3a67('0x17')](_0x3a67('0x11'),_0x3b3ed2,_0x3a67('0x13'));_0x1884e2(_0x4ff92f[_0x3a67('0x18')][_0x3a67('0x16')]);}})[_0x3a67('0x19')](function(_0x1c4b43){logger[_0x3a67('0x14')](_0x3a67('0x11'),_0x3b3ed2,_0x1c4b43);_0x1774f4(_0x1c4b43);});});}exports[_0x3a67('0x1a')]=function(_0x2b9813){var _0x2115dd=this;return new Promise(function(_0x372778,_0xc08b88){return db['ChatMessage'][_0x3a67('0x1b')](_0x2b9813[_0x3a67('0x1c')],{'raw':_0x2b9813[_0x3a67('0x1d')]?_0x2b9813[_0x3a67('0x1d')][_0x3a67('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0xb199d){logger['info'](_0x3a67('0x1a'),_0x2b9813);logger[_0x3a67('0x1f')](_0x3a67('0x1a'),_0x2b9813,JSON[_0x3a67('0x20')](_0xb199d));_0x372778(_0xb199d);})[_0x3a67('0x19')](function(_0x225481){logger[_0x3a67('0x14')]('CreateChatMessage',_0x225481[_0x3a67('0x16')],_0x2b9813);_0xc08b88(_0x2115dd[_0x3a67('0x14')](0x1f4,_0x225481['message']));});});};
\ No newline at end of file
+var _0x9834=['ChatMessage,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','create','body','options','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','socket.io-emitter','register','request','then'];(function(_0xe72e2a,_0x3d600f){var _0x1ee37e=function(_0x27c473){while(--_0x27c473){_0xe72e2a['push'](_0xe72e2a['shift']());}};_0x1ee37e(++_0x3d600f);}(_0x9834,0xd1));var _0x4983=function(_0xe057df,_0x49c828){_0xe057df=_0xe057df-0x0;var _0x518ae4=_0x9834[_0xe057df];return _0x518ae4;};'use strict';var _=require(_0x4983('0x0'));var util=require(_0x4983('0x1'));var moment=require(_0x4983('0x2'));var BPromise=require('bluebird');var rs=require(_0x4983('0x3'));var fs=require('fs');var Redis=require(_0x4983('0x4'));var db=require(_0x4983('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4983('0x6'));var config=require('../../config/environment');var jayson=require(_0x4983('0x7'));var client=jayson[_0x4983('0x8')][_0x4983('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4983('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4983('0xb'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x4983('0xc')](socket);function respondWithRpcPromise(_0x1f1adf,_0x215037,_0x2b379a){return new BPromise(function(_0xbcb969,_0x2ad925){return client[_0x4983('0xd')](_0x1f1adf,_0x2b379a)[_0x4983('0xe')](function(_0x507ea2){logger['info'](_0x4983('0xf'),_0x215037,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x215037,'request\x20sent',JSON[_0x4983('0x10')](_0x507ea2));if(_0x507ea2[_0x4983('0x11')]){if(_0x507ea2[_0x4983('0x11')][_0x4983('0x12')]===0x1f4){logger[_0x4983('0x11')]('ChatMessage,\x20%s,\x20%s',_0x215037,_0x507ea2['error'][_0x4983('0x13')]);return _0x2ad925(_0x507ea2[_0x4983('0x11')][_0x4983('0x13')]);}logger[_0x4983('0x11')](_0x4983('0xf'),_0x215037,_0x507ea2[_0x4983('0x11')][_0x4983('0x13')]);return _0xbcb969(_0x507ea2[_0x4983('0x11')][_0x4983('0x13')]);}else{logger[_0x4983('0x14')](_0x4983('0xf'),_0x215037,'request\x20sent');_0xbcb969(_0x507ea2[_0x4983('0x15')]['message']);}})[_0x4983('0x16')](function(_0x498d7c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x215037,_0x498d7c);_0x2ad925(_0x498d7c);});});}exports[_0x4983('0x17')]=function(_0x5e6f12){var _0x55aff3=this;return new Promise(function(_0x4f3195,_0x129edc){return db['ChatMessage'][_0x4983('0x18')](_0x5e6f12[_0x4983('0x19')],{'raw':_0x5e6f12[_0x4983('0x1a')]?_0x5e6f12[_0x4983('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x4983('0xe')](function(_0xd27719){logger[_0x4983('0x14')](_0x4983('0x17'),_0x5e6f12);logger[_0x4983('0x1b')](_0x4983('0x17'),_0x5e6f12,JSON[_0x4983('0x10')](_0xd27719));_0x4f3195(_0xd27719);})['catch'](function(_0x3e8ba7){logger[_0x4983('0x11')]('CreateChatMessage',_0x3e8ba7[_0x4983('0x13')],_0x5e6f12);_0x129edc(_0x55aff3['error'](0x1f4,_0x3e8ba7[_0x4983('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index c706f62..4b2aa78 100644
--- a/server/api/chatMessage/chatMessage.socket.js
+++ b/server/api/chatMessage/chatMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47c7=['./chatMessage.events','remove','update','removeListener','register','length','chatMessage:'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x47c7,0x1ab));var _0x747c=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x47c7[_0x12a554];return _0x244ba0;};'use strict';var ChatMessageEvents=require(_0x747c('0x0'));var events=['save',_0x747c('0x1'),_0x747c('0x2')];function createListener(_0x4a6fc3,_0xbe1d88){return function(_0x2af847){_0xbe1d88['emit'](_0x4a6fc3,_0x2af847);};}function removeListener(_0x3313cd,_0x3c0c0){return function(){ChatMessageEvents[_0x747c('0x3')](_0x3313cd,_0x3c0c0);};}exports[_0x747c('0x4')]=function(_0x5e991e){for(var _0xa1148a=0x0,_0x4eb6bc=events[_0x747c('0x5')];_0xa1148a<_0x4eb6bc;_0xa1148a++){var _0x24206f=events[_0xa1148a];var _0x10b9f0=createListener(_0x747c('0x6')+_0x24206f,_0x5e991e);ChatMessageEvents['on'](_0x24206f,_0x10b9f0);}};
\ No newline at end of file
+var _0x6c32=['remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var ChatMessageEvents=require(_0x26c3('0x0'));var events=[_0x26c3('0x1'),_0x26c3('0x2'),_0x26c3('0x3')];function createListener(_0x2bbfc4,_0x44fc8c){return function(_0x40cb8e){_0x44fc8c[_0x26c3('0x4')](_0x2bbfc4,_0x40cb8e);};}function removeListener(_0x36528a,_0x49d4a1){return function(){ChatMessageEvents[_0x26c3('0x5')](_0x36528a,_0x49d4a1);};}exports[_0x26c3('0x6')]=function(_0x15ac36){for(var _0x57d915=0x0,_0x187b81=events['length'];_0x57d915<_0x187b81;_0x57d915++){var _0x3dde22=events[_0x57d915];var _0x3ff8e7=createListener(_0x26c3('0x7')+_0x3dde22,_0x15ac36);ChatMessageEvents['on'](_0x3dde22,_0x3ff8e7);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index b00560b..29f35ab 100644
--- a/server/api/chatMessage/index.js
+++ b/server/api/chatMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x10d5=['chat','chatmessage:create','create','put','/:id','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked'];(function(_0x52f975,_0x4e4e7d){var _0x1103e7=function(_0x5d82fc){while(--_0x5d82fc){_0x52f975['push'](_0x52f975['shift']());}};_0x1103e7(++_0x4e4e7d);}(_0x10d5,0xab));var _0x510d=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0x10d5[_0x4409e7];return _0x24c751;};'use strict';var multer=require(_0x510d('0x0'));var util=require(_0x510d('0x1'));var path=require('path');var timeout=require(_0x510d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x510d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x510d('0x4'));router[_0x510d('0x5')]('/',auth[_0x510d('0x6')](),controller[_0x510d('0x7')]);router[_0x510d('0x5')](_0x510d('0x8'),auth[_0x510d('0x6')](),controller[_0x510d('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x510d('0xa')]);router[_0x510d('0xb')]('/',auth[_0x510d('0x6')](),interaction[_0x510d('0xc')](_0x510d('0xd'),_0x510d('0xe')),controller[_0x510d('0xf')]);router[_0x510d('0x10')](_0x510d('0x11'),controller['update']);router[_0x510d('0x10')](_0x510d('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x510d('0x13'),auth['isAuthenticated'](),controller[_0x510d('0x14')]);router['delete']('/:id',auth[_0x510d('0x6')](),controller[_0x510d('0x15')]);module[_0x510d('0x16')]=router;
\ No newline at end of file
+var _0x835e=['../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','reject','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2adb42,_0xed8b12){var _0x101363=function(_0x1a9d3d){while(--_0x1a9d3d){_0x2adb42['push'](_0x2adb42['shift']());}};_0x101363(++_0xed8b12);}(_0x835e,0xb3));var _0xe835=function(_0x143a9e,_0x561a1a){_0x143a9e=_0x143a9e-0x0;var _0x46b750=_0x835e[_0x143a9e];return _0x46b750;};'use strict';var multer=require(_0xe835('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe835('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe835('0x2'));var auth=require(_0xe835('0x3'));var interaction=require(_0xe835('0x4'));var config=require(_0xe835('0x5'));var controller=require(_0xe835('0x6'));router[_0xe835('0x7')]('/',auth[_0xe835('0x8')](),controller[_0xe835('0x9')]);router[_0xe835('0x7')](_0xe835('0xa'),auth[_0xe835('0x8')](),controller[_0xe835('0xb')]);router['get'](_0xe835('0xc'),auth['isAuthenticated'](),controller[_0xe835('0xd')]);router[_0xe835('0xe')]('/',auth[_0xe835('0x8')](),interaction[_0xe835('0xf')](_0xe835('0x10'),_0xe835('0x11')),controller[_0xe835('0x12')]);router[_0xe835('0x13')](_0xe835('0xc'),controller['update']);router['put'](_0xe835('0x14'),auth[_0xe835('0x8')](),controller['accept']);router[_0xe835('0x13')]('/:id/reject',auth[_0xe835('0x8')](),controller[_0xe835('0x15')]);router['delete']('/:id',auth[_0xe835('0x8')](),controller[_0xe835('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 192ce44..a43820e 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x0b0e[_0x65c50e];return _0x4573e7;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x5a90cd,_0x140d12){var _0x50d5ad=function(_0x10d94f){while(--_0x10d94f){_0x5a90cd['push'](_0x5a90cd['shift']());}};_0x50d5ad(++_0x140d12);}(_0xadb5,0xad));var _0x5adb=function(_0x31ff15,_0x59c221){_0x31ff15=_0x31ff15-0x0;var _0x49927a=_0xadb5[_0x31ff15];return _0x49927a;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index b07432d..329a36d 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x7a54,0x106));var _0x47a5=function(_0x562c00,_0x185000){_0x562c00=_0x562c00-0x0;var _0x1a0c79=_0x7a54[_0x562c00];return _0x1a0c79;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x6dc537,_0x4fb967){var _0x5ede93=function(_0x24ecf9){while(--_0x24ecf9){_0x6dc537['push'](_0x6dc537['shift']());}};_0x5ede93(++_0x4fb967);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 193c9c8..ff2ad44 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7449=['emit','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x7449,0x14b));var _0x9744=function(_0x27e1fe,_0x194c88){_0x27e1fe=_0x27e1fe-0x0;var _0x37d1b7=_0x7449[_0x27e1fe];return _0x37d1b7;};'use strict';var EventEmitter=require(_0x9744('0x0'));var ChatOfflineMessage=require(_0x9744('0x1'))['db'][_0x9744('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9744('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9744('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1243a4){return function(_0x5df42f,_0x31aad8,_0x149ff6){ChatOfflineMessageEvents[_0x9744('0x5')](_0x1243a4+':'+_0x5df42f['id'],_0x5df42f);ChatOfflineMessageEvents[_0x9744('0x5')](_0x1243a4,_0x5df42f);_0x149ff6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x9744('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xa0f4=['hasOwnProperty','../../mysqldb','update','remove','emit'];(function(_0x349a3d,_0x12c2a3){var _0x211a04=function(_0x1edaea){while(--_0x1edaea){_0x349a3d['push'](_0x349a3d['shift']());}};_0x211a04(++_0x12c2a3);}(_0xa0f4,0x1b4));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x4a0f('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a0f('0x1'),'afterDestroy':_0x4a0f('0x2')};function emitEvent(_0x317118){return function(_0x4fe4a3,_0x50ab71,_0x552648){ChatOfflineMessageEvents[_0x4a0f('0x3')](_0x317118+':'+_0x4fe4a3['id'],_0x4fe4a3);ChatOfflineMessageEvents['emit'](_0x317118,_0x4fe4a3);_0x552648(null);};}for(var e in events){if(events[_0x4a0f('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f3a917f..b3dfcd6 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc1fb=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x4cb9aa,_0x58b44f){var _0x2eff51=function(_0x18a09c){while(--_0x18a09c){_0x4cb9aa['push'](_0x4cb9aa['shift']());}};_0x2eff51(++_0x58b44f);}(_0xc1fb,0xd8));var _0xbc1f=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xc1fb[_0x5f5cce];return _0x705ecf;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xbc1f('0x0')]=function(_0x4f7d3a){return _0x4f7d3a['define'](_0xbc1f('0x1'),attributes,{'tableName':_0xbc1f('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc1f('0x3'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6526=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x6526,0x1ca));var _0x6652=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0x6526[_0x21205e];return _0x136ebb;};'use strict';var attributes=require(_0x6652('0x0'));module[_0x6652('0x1')]=function(_0x2bd8ee){return _0x2bd8ee[_0x6652('0x2')](_0x6652('0x3'),attributes,{'tableName':_0x6652('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6652('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 0706eb0..1d1a5c9 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6e7=['stringify','error','code','message','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5270b4,_0x5ad6c0){var _0x40dff8=function(_0x4d0b5f){while(--_0x4d0b5f){_0x5270b4['push'](_0x5270b4['shift']());}};_0x40dff8(++_0x5ad6c0);}(_0xa6e7,0xb0));var _0x7a6e=function(_0xfbb8c3,_0xdc7b86){_0xfbb8c3=_0xfbb8c3-0x0;var _0x134bc2=_0xa6e7[_0xfbb8c3];return _0x134bc2;};'use strict';var _=require(_0x7a6e('0x0'));var util=require('util');var moment=require(_0x7a6e('0x1'));var BPromise=require(_0x7a6e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7a6e('0x3'));var logger=require(_0x7a6e('0x4'))(_0x7a6e('0x5'));var config=require(_0x7a6e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7a6e('0x7')][_0x7a6e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e3ec1,_0x48f81e,_0x56984a){return new BPromise(function(_0x50d511,_0x415f8d){return client[_0x7a6e('0x9')](_0x2e3ec1,_0x56984a)['then'](function(_0x4adb65){logger[_0x7a6e('0xa')](_0x7a6e('0xb'),_0x48f81e,_0x7a6e('0xc'));logger[_0x7a6e('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x48f81e,_0x7a6e('0xc'),JSON[_0x7a6e('0xe')](_0x4adb65));if(_0x4adb65['error']){if(_0x4adb65[_0x7a6e('0xf')][_0x7a6e('0x10')]===0x1f4){logger[_0x7a6e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48f81e,_0x4adb65[_0x7a6e('0xf')]['message']);return _0x415f8d(_0x4adb65[_0x7a6e('0xf')]['message']);}logger[_0x7a6e('0xf')](_0x7a6e('0xb'),_0x48f81e,_0x4adb65[_0x7a6e('0xf')]['message']);return _0x50d511(_0x4adb65['error'][_0x7a6e('0x11')]);}else{logger[_0x7a6e('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48f81e,_0x7a6e('0xc'));_0x50d511(_0x4adb65['result'][_0x7a6e('0x11')]);}})[_0x7a6e('0x12')](function(_0x68974d){logger['error'](_0x7a6e('0xb'),_0x48f81e,_0x68974d);_0x415f8d(_0x68974d);});});}
\ No newline at end of file
+var _0xaa7d=['code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x33ca83,_0x54f25c){var _0x175082=function(_0x1c44a9){while(--_0x1c44a9){_0x33ca83['push'](_0x33ca83['shift']());}};_0x175082(++_0x54f25c);}(_0xaa7d,0x1ea));var _0xdaa7=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xaa7d[_0x5e9a69];return _0x5979c8;};'use strict';var _=require(_0xdaa7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdaa7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaa7('0x2'))['db'];var utils=require(_0xdaa7('0x3'));var logger=require(_0xdaa7('0x4'))(_0xdaa7('0x5'));var config=require(_0xdaa7('0x6'));var jayson=require(_0xdaa7('0x7'));var client=jayson['client'][_0xdaa7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x995170,_0x478a70,_0x45f435){return new BPromise(function(_0x324e0b,_0x2eb2e2){return client['request'](_0x995170,_0x45f435)['then'](function(_0x5f3364){logger['info'](_0xdaa7('0x9'),_0x478a70,_0xdaa7('0xa'));logger['debug'](_0xdaa7('0xb'),_0x478a70,'request\x20sent',JSON[_0xdaa7('0xc')](_0x5f3364));if(_0x5f3364[_0xdaa7('0xd')]){if(_0x5f3364[_0xdaa7('0xd')][_0xdaa7('0xe')]===0x1f4){logger[_0xdaa7('0xd')](_0xdaa7('0x9'),_0x478a70,_0x5f3364[_0xdaa7('0xd')]['message']);return _0x2eb2e2(_0x5f3364[_0xdaa7('0xd')][_0xdaa7('0xf')]);}logger[_0xdaa7('0xd')](_0xdaa7('0x9'),_0x478a70,_0x5f3364[_0xdaa7('0xd')]['message']);return _0x324e0b(_0x5f3364[_0xdaa7('0xd')][_0xdaa7('0xf')]);}else{logger['info'](_0xdaa7('0x9'),_0x478a70,_0xdaa7('0xa'));_0x324e0b(_0x5f3364[_0xdaa7('0x10')][_0xdaa7('0xf')]);}})[_0xdaa7('0x11')](function(_0x5ddfb6){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x478a70,_0x5ddfb6);_0x2eb2e2(_0x5ddfb6);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 676cdd7..cb3fe91 100644
--- a/server/api/chatOfflineMessage/index.js
+++ b/server/api/chatOfflineMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5068=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x3a430b,_0x3b491a){var _0x470839=function(_0x120be2){while(--_0x120be2){_0x3a430b['push'](_0x3a430b['shift']());}};_0x470839(++_0x3b491a);}(_0x5068,0xe3));var _0x8506=function(_0x5c4c20,_0x59b68b){_0x5c4c20=_0x5c4c20-0x0;var _0x1defb5=_0x5068[_0x5c4c20];return _0x1defb5;};'use strict';var multer=require(_0x8506('0x0'));var util=require(_0x8506('0x1'));var path=require(_0x8506('0x2'));var timeout=require(_0x8506('0x3'));var express=require(_0x8506('0x4'));var router=express[_0x8506('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8506('0x6'));var interaction=require(_0x8506('0x7'));var config=require(_0x8506('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x8506('0x9')]('/',auth[_0x8506('0xa')](),controller[_0x8506('0xb')]);router[_0x8506('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x8506('0xc')]);router[_0x8506('0x9')](_0x8506('0xd'),auth[_0x8506('0xa')](),controller[_0x8506('0xe')]);router[_0x8506('0xf')]('/',auth[_0x8506('0xa')](),controller[_0x8506('0x10')]);router[_0x8506('0x11')](_0x8506('0xd'),auth[_0x8506('0xa')](),controller[_0x8506('0x12')]);router[_0x8506('0x13')]('/:id',auth[_0x8506('0xa')](),controller[_0x8506('0x14')]);module[_0x8506('0x15')]=router;
\ No newline at end of file
+var _0x5510=['describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x2e1051,_0x58b01d){var _0x5aa734=function(_0x15a99d){while(--_0x15a99d){_0x2e1051['push'](_0x2e1051['shift']());}};_0x5aa734(++_0x58b01d);}(_0x5510,0x149));var _0x0551=function(_0x3ad9b3,_0x5c76e9){_0x3ad9b3=_0x3ad9b3-0x0;var _0x4ef8d1=_0x5510[_0x3ad9b3];return _0x4ef8d1;};'use strict';var multer=require(_0x0551('0x0'));var util=require('util');var path=require(_0x0551('0x1'));var timeout=require(_0x0551('0x2'));var express=require(_0x0551('0x3'));var router=express[_0x0551('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0551('0x5'));var interaction=require(_0x0551('0x6'));var config=require(_0x0551('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x0551('0x8')]('/',auth[_0x0551('0x9')](),controller['index']);router[_0x0551('0x8')](_0x0551('0xa'),auth[_0x0551('0x9')](),controller[_0x0551('0xb')]);router['get'](_0x0551('0xc'),auth[_0x0551('0x9')](),controller[_0x0551('0xd')]);router[_0x0551('0xe')]('/',auth[_0x0551('0x9')](),controller[_0x0551('0xf')]);router[_0x0551('0x10')]('/:id',auth[_0x0551('0x9')](),controller['update']);router[_0x0551('0x11')](_0x0551('0xc'),auth[_0x0551('0x9')](),controller[_0x0551('0x12')]);module[_0x0551('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 7e25f26..57bb7e7 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3b93=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x5b5199,_0x58a8e5){var _0x2f5736=function(_0x1f35ce){while(--_0x1f35ce){_0x5b5199['push'](_0x5b5199['shift']());}};_0x2f5736(++_0x58a8e5);}(_0x3b93,0xe0));var _0x33b9=function(_0x2a8e31,_0x5c4853){_0x2a8e31=_0x2a8e31-0x0;var _0x11cc23=_0x3b93[_0x2a8e31];return _0x11cc23;};'use strict';var Sequelize=require(_0x33b9('0x0'));module[_0x33b9('0x1')]={'name':{'type':Sequelize[_0x33b9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x33b9('0x3')](_0x33b9('0x4'),_0x33b9('0x5')),'defaultValue':_0x33b9('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x33b9('0x6')]}};
\ No newline at end of file
+var _0x67b5=['sequelize','exports','STRING','mouseOver','timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67b5,0x11d));var _0x567b=function(_0x2a2091,_0x5d6a29){_0x2a2091=_0x2a2091-0x0;var _0x284077=_0x67b5[_0x2a2091];return _0x284077;};'use strict';var Sequelize=require(_0x567b('0x0'));module[_0x567b('0x1')]={'name':{'type':Sequelize[_0x567b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x567b('0x3'),_0x567b('0x4')),'defaultValue':_0x567b('0x3')},'selector':{'type':Sequelize[_0x567b('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 9a36499..be7e5c7 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabe8=['send','model','keys','filters','intersection','query','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','create','update','body','catch','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name'];(function(_0xf28958,_0x53f0ed){var _0x4a4ce4=function(_0x5275fb){while(--_0x5275fb){_0xf28958['push'](_0xf28958['shift']());}};_0x4a4ce4(++_0x53f0ed);}(_0xabe8,0x8c));var _0x8abe=function(_0x56338a,_0x1d112e){_0x56338a=_0x56338a-0x0;var _0x404efd=_0xabe8[_0x56338a];return _0x404efd;};'use strict';var emlformat=require(_0x8abe('0x0'));var rimraf=require(_0x8abe('0x1'));var zipdir=require(_0x8abe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8abe('0x3'));var moment=require(_0x8abe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8abe('0x5'));var util=require('util');var path=require(_0x8abe('0x6'));var sox=require(_0x8abe('0x7'));var csv=require(_0x8abe('0x8'));var ejs=require(_0x8abe('0x9'));var fs=require('fs');var fs_extra=require(_0x8abe('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8abe('0xb'));var jsforce=require(_0x8abe('0xc'));var deskjs=require(_0x8abe('0xd'));var toCsv=require(_0x8abe('0x8'));var querystring=require(_0x8abe('0xe'));var Papa=require(_0x8abe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8abe('0x10'));var hardwareService=require(_0x8abe('0x11'));var logger=require(_0x8abe('0x12'))(_0x8abe('0x13'));var utils=require(_0x8abe('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8abe('0x15'))['db'];function respondWithStatusCode(_0x8d4179,_0x1970b2){_0x1970b2=_0x1970b2||0xcc;return function(_0x3890f8){if(_0x3890f8){return _0x8d4179['sendStatus'](_0x1970b2);}return _0x8d4179['status'](_0x1970b2)['end']();};}function respondWithResult(_0xb75397,_0x5e7c8b){_0x5e7c8b=_0x5e7c8b||0xc8;return function(_0x1c407d){if(_0x1c407d){return _0xb75397['status'](_0x5e7c8b)[_0x8abe('0x16')](_0x1c407d);}};}function respondWithFilteredResult(_0x168f96,_0x5d24ad){return function(_0x1bcd6d){if(_0x1bcd6d){var _0x5bc34a=typeof _0x5d24ad[_0x8abe('0x17')]===_0x8abe('0x18')&&typeof _0x5d24ad[_0x8abe('0x19')]===_0x8abe('0x18');var _0x3f5d9b=_0x1bcd6d[_0x8abe('0x1a')];var _0x1cd7c9=_0x5bc34a?0x0:_0x5d24ad[_0x8abe('0x17')];var _0x45905e=_0x5bc34a?_0x1bcd6d[_0x8abe('0x1a')]:_0x5d24ad[_0x8abe('0x17')]+_0x5d24ad['limit'];var _0x190e2e;if(_0x45905e>=_0x3f5d9b){_0x45905e=_0x3f5d9b;_0x190e2e=0xc8;}else{_0x190e2e=0xce;}_0x168f96[_0x8abe('0x1b')](_0x190e2e);return _0x168f96[_0x8abe('0x1c')](_0x8abe('0x1d'),_0x1cd7c9+'-'+_0x45905e+'/'+_0x3f5d9b)[_0x8abe('0x16')](_0x1bcd6d);}return null;};}function patchUpdates(_0x49f03d){return function(_0x4f6c1c){try{jsonpatch[_0x8abe('0x1e')](_0x4f6c1c,_0x49f03d,!![]);}catch(_0xfa8e74){return BPromise[_0x8abe('0x1f')](_0xfa8e74);}return _0x4f6c1c[_0x8abe('0x20')]();};}function saveUpdates(_0x346153,_0x2f7e3c){return function(_0x113ab2){if(_0x113ab2){return _0x113ab2['update'](_0x346153)[_0x8abe('0x21')](function(_0x1eaf31){return _0x1eaf31;});}return null;};}function removeEntity(_0x383ca7,_0x1873d5){return function(_0x1f9bde){if(_0x1f9bde){return _0x1f9bde[_0x8abe('0x22')]()[_0x8abe('0x21')](function(){_0x383ca7[_0x8abe('0x1b')](0xcc)[_0x8abe('0x23')]();});}};}function handleEntityNotFound(_0x3d1785,_0x40f33a){return function(_0x301d4a){if(!_0x301d4a){_0x3d1785[_0x8abe('0x24')](0x194);}return _0x301d4a;};}function handleError(_0x189440,_0x14c9db){_0x14c9db=_0x14c9db||0x1f4;return function(_0x261c62){logger[_0x8abe('0x25')](_0x261c62[_0x8abe('0x26')]);if(_0x261c62['name']){delete _0x261c62[_0x8abe('0x27')];}_0x189440[_0x8abe('0x1b')](_0x14c9db)[_0x8abe('0x28')](_0x261c62);};}exports['show']=function(_0xca4d,_0x4a899c){var _0x1e9316={'raw':!![],'where':{'id':_0xca4d['params']['id']}},_0x3f30bf={};_0x3f30bf[_0x8abe('0x29')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x3f30bf['query']=_[_0x8abe('0x2a')](_0xca4d['query']);_0x3f30bf[_0x8abe('0x2b')]=_[_0x8abe('0x2c')](_0x3f30bf[_0x8abe('0x29')],_0x3f30bf[_0x8abe('0x2d')]);_0x1e9316[_0x8abe('0x2e')]=_[_0x8abe('0x2c')](_0x3f30bf[_0x8abe('0x29')],qs['fields'](_0xca4d[_0x8abe('0x2d')][_0x8abe('0x2f')]));_0x1e9316[_0x8abe('0x2e')]=_0x1e9316[_0x8abe('0x2e')][_0x8abe('0x30')]?_0x1e9316[_0x8abe('0x2e')]:_0x3f30bf['model'];if(_0xca4d[_0x8abe('0x2d')][_0x8abe('0x31')]){_0x1e9316[_0x8abe('0x32')]=[{'all':!![]}];}_0x1e9316=_[_0x8abe('0x33')]({},_0x1e9316,_0xca4d[_0x8abe('0x34')]);return db[_0x8abe('0x35')][_0x8abe('0x36')](_0x1e9316)[_0x8abe('0x21')](handleEntityNotFound(_0x4a899c,null))[_0x8abe('0x21')](respondWithResult(_0x4a899c,null))['catch'](handleError(_0x4a899c,null));};exports[_0x8abe('0x37')]=function(_0x47d627,_0x1a0364){return db[_0x8abe('0x35')]['create'](_0x47d627['body'],{})[_0x8abe('0x21')](respondWithResult(_0x1a0364,0xc9))['catch'](handleError(_0x1a0364,null));};exports[_0x8abe('0x38')]=function(_0xbf1d9,_0x3599de){if(_0xbf1d9[_0x8abe('0x39')]['id']){delete _0xbf1d9[_0x8abe('0x39')]['id'];}return db['ChatProactiveAction'][_0x8abe('0x36')]({'where':{'id':_0xbf1d9['params']['id']}})['then'](handleEntityNotFound(_0x3599de,null))[_0x8abe('0x21')](saveUpdates(_0xbf1d9[_0x8abe('0x39')],null))[_0x8abe('0x21')](respondWithResult(_0x3599de,null))[_0x8abe('0x3a')](handleError(_0x3599de,null));};exports['destroy']=function(_0xf736e6,_0x30af7c){return db['ChatProactiveAction'][_0x8abe('0x36')]({'where':{'id':_0xf736e6[_0x8abe('0x3b')]['id']}})['then'](handleEntityNotFound(_0x30af7c,null))[_0x8abe('0x21')](removeEntity(_0x30af7c,null))['catch'](handleError(_0x30af7c,null));};
\ No newline at end of file
+var _0x5a52=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','save','then','destroy','error','stack','name','send','show','params','model','ChatProactiveAction','query','keys','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','update','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x2e561f,_0x1b1660){var _0x4160ea=function(_0x1fa2ca){while(--_0x1fa2ca){_0x2e561f['push'](_0x2e561f['shift']());}};_0x4160ea(++_0x1b1660);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x25a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x25a5('0x1'));var moment=require(_0x25a5('0x2'));var BPromise=require(_0x25a5('0x3'));var Mustache=require(_0x25a5('0x4'));var util=require(_0x25a5('0x5'));var path=require(_0x25a5('0x6'));var sox=require(_0x25a5('0x7'));var csv=require(_0x25a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25a5('0x9'));var _=require('lodash');var squel=require(_0x25a5('0xa'));var crypto=require(_0x25a5('0xb'));var jsforce=require(_0x25a5('0xc'));var deskjs=require(_0x25a5('0xd'));var toCsv=require(_0x25a5('0x8'));var querystring=require(_0x25a5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x25a5('0xf'));var qs=require(_0x25a5('0x10'));var as=require(_0x25a5('0x11'));var hardwareService=require(_0x25a5('0x12'));var logger=require(_0x25a5('0x13'))(_0x25a5('0x14'));var utils=require(_0x25a5('0x15'));var config=require(_0x25a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x25a5('0x17'))['db'];function respondWithStatusCode(_0x20df69,_0x425f2e){_0x425f2e=_0x425f2e||0xcc;return function(_0x5deb28){if(_0x5deb28){return _0x20df69[_0x25a5('0x18')](_0x425f2e);}return _0x20df69['status'](_0x425f2e)[_0x25a5('0x19')]();};}function respondWithResult(_0x25b7bb,_0x1edef3){_0x1edef3=_0x1edef3||0xc8;return function(_0x47d1d1){if(_0x47d1d1){return _0x25b7bb['status'](_0x1edef3)[_0x25a5('0x1a')](_0x47d1d1);}};}function respondWithFilteredResult(_0x5e1590,_0x7e183e){return function(_0x1c0ad6){if(_0x1c0ad6){var _0x39313e=typeof _0x7e183e[_0x25a5('0x1b')]==='undefined'&&typeof _0x7e183e[_0x25a5('0x1c')]==='undefined';var _0x5f257b=_0x1c0ad6[_0x25a5('0x1d')];var _0x17901b=_0x39313e?0x0:_0x7e183e[_0x25a5('0x1b')];var _0x95dfbc=_0x39313e?_0x1c0ad6[_0x25a5('0x1d')]:_0x7e183e['offset']+_0x7e183e['limit'];var _0x1390fb;if(_0x95dfbc>=_0x5f257b){_0x95dfbc=_0x5f257b;_0x1390fb=0xc8;}else{_0x1390fb=0xce;}_0x5e1590[_0x25a5('0x1e')](_0x1390fb);return _0x5e1590[_0x25a5('0x1f')](_0x25a5('0x20'),_0x17901b+'-'+_0x95dfbc+'/'+_0x5f257b)[_0x25a5('0x1a')](_0x1c0ad6);}return null;};}function patchUpdates(_0x44f1ed){return function(_0x514c59){try{jsonpatch[_0x25a5('0x21')](_0x514c59,_0x44f1ed,!![]);}catch(_0x4dba9d){return BPromise['reject'](_0x4dba9d);}return _0x514c59[_0x25a5('0x22')]();};}function saveUpdates(_0x54cc71,_0x34a92f){return function(_0x3177ea){if(_0x3177ea){return _0x3177ea['update'](_0x54cc71)[_0x25a5('0x23')](function(_0x174c3f){return _0x174c3f;});}return null;};}function removeEntity(_0x4be312,_0x37f7fe){return function(_0xaea9aa){if(_0xaea9aa){return _0xaea9aa[_0x25a5('0x24')]()['then'](function(){_0x4be312[_0x25a5('0x1e')](0xcc)[_0x25a5('0x19')]();});}};}function handleEntityNotFound(_0x5e8db0,_0x23b304){return function(_0x48db7e){if(!_0x48db7e){_0x5e8db0[_0x25a5('0x18')](0x194);}return _0x48db7e;};}function handleError(_0x42f14a,_0x400800){_0x400800=_0x400800||0x1f4;return function(_0x5caf87){logger[_0x25a5('0x25')](_0x5caf87[_0x25a5('0x26')]);if(_0x5caf87[_0x25a5('0x27')]){delete _0x5caf87[_0x25a5('0x27')];}_0x42f14a[_0x25a5('0x1e')](_0x400800)[_0x25a5('0x28')](_0x5caf87);};}exports[_0x25a5('0x29')]=function(_0x387774,_0x12e1be){var _0x112a08={'raw':!![],'where':{'id':_0x387774[_0x25a5('0x2a')]['id']}},_0x412f42={};_0x412f42[_0x25a5('0x2b')]=_['keys'](db[_0x25a5('0x2c')]['rawAttributes']);_0x412f42[_0x25a5('0x2d')]=_[_0x25a5('0x2e')](_0x387774['query']);_0x412f42['filters']=_[_0x25a5('0x2f')](_0x412f42[_0x25a5('0x2b')],_0x412f42[_0x25a5('0x2d')]);_0x112a08[_0x25a5('0x30')]=_['intersection'](_0x412f42[_0x25a5('0x2b')],qs[_0x25a5('0x31')](_0x387774[_0x25a5('0x2d')][_0x25a5('0x31')]));_0x112a08[_0x25a5('0x30')]=_0x112a08[_0x25a5('0x30')][_0x25a5('0x32')]?_0x112a08['attributes']:_0x412f42['model'];if(_0x387774[_0x25a5('0x2d')][_0x25a5('0x33')]){_0x112a08[_0x25a5('0x34')]=[{'all':!![]}];}_0x112a08=_['merge']({},_0x112a08,_0x387774[_0x25a5('0x35')]);return db[_0x25a5('0x2c')][_0x25a5('0x36')](_0x112a08)[_0x25a5('0x23')](handleEntityNotFound(_0x12e1be,null))[_0x25a5('0x23')](respondWithResult(_0x12e1be,null))[_0x25a5('0x37')](handleError(_0x12e1be,null));};exports[_0x25a5('0x38')]=function(_0x19ab5f,_0xaedce7){return db[_0x25a5('0x2c')][_0x25a5('0x38')](_0x19ab5f[_0x25a5('0x39')],{})['then'](respondWithResult(_0xaedce7,0xc9))['catch'](handleError(_0xaedce7,null));};exports[_0x25a5('0x3a')]=function(_0x5b872c,_0x27eefb){if(_0x5b872c['body']['id']){delete _0x5b872c[_0x25a5('0x39')]['id'];}return db[_0x25a5('0x2c')][_0x25a5('0x36')]({'where':{'id':_0x5b872c[_0x25a5('0x2a')]['id']}})[_0x25a5('0x23')](handleEntityNotFound(_0x27eefb,null))['then'](saveUpdates(_0x5b872c[_0x25a5('0x39')],null))['then'](respondWithResult(_0x27eefb,null))[_0x25a5('0x37')](handleError(_0x27eefb,null));};exports['destroy']=function(_0x5ad0b6,_0x3c3c64){return db[_0x25a5('0x2c')][_0x25a5('0x36')]({'where':{'id':_0x5ad0b6[_0x25a5('0x2a')]['id']}})[_0x25a5('0x23')](handleEntityNotFound(_0x3c3c64,null))[_0x25a5('0x23')](removeEntity(_0x3c3c64,null))[_0x25a5('0x37')](handleError(_0x3c3c64,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 27e82ce..932a05f 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.model.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x496b=['path','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x496b,0x12d));var _0xb496=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x496b[_0x277af0];return _0x43bd7c;};'use strict';var _=require(_0xb496('0x0'));var util=require(_0xb496('0x1'));var logger=require(_0xb496('0x2'))(_0xb496('0x3'));var moment=require(_0xb496('0x4'));var BPromise=require(_0xb496('0x5'));var rp=require(_0xb496('0x6'));var fs=require('fs');var path=require(_0xb496('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb496('0x8'));module[_0xb496('0x9')]=function(_0x28843c,_0x387eee){return _0x28843c['define'](_0xb496('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x77d7=['ChatProactiveAction','lodash','../../config/logger','bluebird','path','./chatProactiveAction.attributes'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x77d7,0x12d));var _0x777d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x77d7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x777d('0x0'));var util=require('util');var logger=require(_0x777d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x777d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x777d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x777d('0x4'));module['exports']=function(_0xa4ac17,_0x4791fc){return _0xa4ac17['define'](_0x777d('0x5'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index e533246..435e2d7 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8792=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x8792,0xc1));var _0x2879=function(_0x584354,_0x3b4a6f){_0x584354=_0x584354-0x0;var _0x285f14=_0x8792[_0x584354];return _0x285f14;};'use strict';var _=require(_0x2879('0x0'));var util=require(_0x2879('0x1'));var moment=require(_0x2879('0x2'));var BPromise=require(_0x2879('0x3'));var rs=require(_0x2879('0x4'));var fs=require('fs');var Redis=require(_0x2879('0x5'));var db=require(_0x2879('0x6'))['db'];var utils=require(_0x2879('0x7'));var logger=require(_0x2879('0x8'))(_0x2879('0x9'));var config=require(_0x2879('0xa'));var jayson=require(_0x2879('0xb'));var client=jayson[_0x2879('0xc')][_0x2879('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487821,_0x55a6c6,_0x5dbc71){return new BPromise(function(_0x2c8690,_0x585d05){return client[_0x2879('0xe')](_0x487821,_0x5dbc71)[_0x2879('0xf')](function(_0x26ec16){logger[_0x2879('0x10')](_0x2879('0x11'),_0x55a6c6,_0x2879('0x12'));logger[_0x2879('0x13')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x55a6c6,_0x2879('0x12'),JSON['stringify'](_0x26ec16));if(_0x26ec16[_0x2879('0x14')]){if(_0x26ec16[_0x2879('0x14')][_0x2879('0x15')]===0x1f4){logger[_0x2879('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x55a6c6,_0x26ec16[_0x2879('0x14')]['message']);return _0x585d05(_0x26ec16[_0x2879('0x14')][_0x2879('0x16')]);}logger[_0x2879('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x55a6c6,_0x26ec16['error'][_0x2879('0x16')]);return _0x2c8690(_0x26ec16['error'][_0x2879('0x16')]);}else{logger[_0x2879('0x10')](_0x2879('0x11'),_0x55a6c6,_0x2879('0x12'));_0x2c8690(_0x26ec16[_0x2879('0x17')][_0x2879('0x16')]);}})[_0x2879('0x18')](function(_0x5d9575){logger[_0x2879('0x14')](_0x2879('0x11'),_0x55a6c6,_0x5d9575);_0x585d05(_0x5d9575);});});}
\ No newline at end of file
+var _0x5707=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','lodash','util','moment','bluebird'];(function(_0x38157b,_0x28834d){var _0x3e8df2=function(_0x21ff1){while(--_0x21ff1){_0x38157b['push'](_0x38157b['shift']());}};_0x3e8df2(++_0x28834d);}(_0x5707,0x122));var _0x7570=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x5707[_0x180c9b];return _0x3ff116;};'use strict';var _=require(_0x7570('0x0'));var util=require(_0x7570('0x1'));var moment=require(_0x7570('0x2'));var BPromise=require(_0x7570('0x3'));var rs=require(_0x7570('0x4'));var fs=require('fs');var Redis=require(_0x7570('0x5'));var db=require(_0x7570('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7570('0x7'))(_0x7570('0x8'));var config=require(_0x7570('0x9'));var jayson=require(_0x7570('0xa'));var client=jayson[_0x7570('0xb')][_0x7570('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56626b,_0xb8da42,_0x94d5cf){return new BPromise(function(_0x8ffb97,_0x429d0c){return client[_0x7570('0xd')](_0x56626b,_0x94d5cf)[_0x7570('0xe')](function(_0x37121f){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0xb8da42,_0x7570('0xf'));logger[_0x7570('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0xb8da42,'request\x20sent',JSON[_0x7570('0x11')](_0x37121f));if(_0x37121f[_0x7570('0x12')]){if(_0x37121f[_0x7570('0x12')]['code']===0x1f4){logger[_0x7570('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0xb8da42,_0x37121f[_0x7570('0x12')]['message']);return _0x429d0c(_0x37121f[_0x7570('0x12')][_0x7570('0x13')]);}logger[_0x7570('0x12')](_0x7570('0x14'),_0xb8da42,_0x37121f[_0x7570('0x12')][_0x7570('0x13')]);return _0x8ffb97(_0x37121f[_0x7570('0x12')][_0x7570('0x13')]);}else{logger['info'](_0x7570('0x14'),_0xb8da42,_0x7570('0xf'));_0x8ffb97(_0x37121f['result'][_0x7570('0x13')]);}})['catch'](function(_0xf6c705){logger[_0x7570('0x12')](_0x7570('0x14'),_0xb8da42,_0xf6c705);_0x429d0c(_0xf6c705);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 661e53e..3cf2d9a 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x2d5346,_0xb13ba4){var _0x5348eb=function(_0x694baa){while(--_0x694baa){_0x2d5346['push'](_0x2d5346['shift']());}};_0x5348eb(++_0xb13ba4);}(_0x33c5,0xe6));var _0x533c=function(_0x2d1cf4,_0x2ea9ee){_0x2d1cf4=_0x2d1cf4-0x0;var _0x554a7c=_0x33c5[_0x2d1cf4];return _0x554a7c;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xeff8,0x186));var _0x8eff=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xeff8[_0x39096d];return _0x13da4f;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 9ebad90..0652ac9 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc34c=['roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x28958c,_0x4cf771){var _0x31c1a7=function(_0x2a542c){while(--_0x2a542c){_0x28958c['push'](_0x28958c['shift']());}};_0x31c1a7(++_0x4cf771);}(_0xc34c,0x169));var _0xcc34=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc34c[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xcc34('0x0'));module[_0xcc34('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcc34('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcc34('0x3')]},'timeout':{'type':Sequelize[_0xcc34('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcc34('0x5')](_0xcc34('0x6'),_0xcc34('0x7'),_0xcc34('0x8'))}};
\ No newline at end of file
+var _0x5529=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5529,0x180));var _0x9552=function(_0x1c09f4,_0x46a2e5){_0x1c09f4=_0x1c09f4-0x0;var _0x122707=_0x5529[_0x1c09f4];return _0x122707;};'use strict';var Sequelize=require(_0x9552('0x0'));module[_0x9552('0x1')]={'name':{'type':Sequelize[_0x9552('0x2')],'unique':_0x9552('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9552('0x4')](_0x9552('0x5'),_0x9552('0x6'),_0x9552('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index f06c039..4f268a4 100644
--- a/server/api/chatQueue/chatQueue.controller.js
+++ b/server/api/chatQueue/chatQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98ec=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','ChatQueueId','filter','User','findAndCountAll','UserId','chatPause','updatedAt','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','pick','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','create'];(function(_0x6b6190,_0x3131ac){var _0x1c1982=function(_0x3535b3){while(--_0x3535b3){_0x6b6190['push'](_0x6b6190['shift']());}};_0x1c1982(++_0x3131ac);}(_0x98ec,0x145));var _0xc98e=function(_0x57e14f,_0x17f93c){_0x57e14f=_0x57e14f-0x0;var _0x39fce2=_0x98ec[_0x57e14f];return _0x39fce2;};'use strict';var BPromise=require(_0xc98e('0x0'));var util=require(_0xc98e('0x1'));var _=require(_0xc98e('0x2'));var squel=require(_0xc98e('0x3'));var Redis=require(_0xc98e('0x4'));var qs=require(_0xc98e('0x5'));var logger=require(_0xc98e('0x6'))(_0xc98e('0x7'));var config=require('../../config/environment');var db=require(_0xc98e('0x8'))['db'];config[_0xc98e('0x9')]=_[_0xc98e('0xa')](config['redis'],{'host':_0xc98e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc98e('0x9')]));require(_0xc98e('0xc'))['register'](socket);function respondWithStatusCode(_0x294242,_0x250d84){_0x250d84=_0x250d84||0xcc;return function(_0x156c85){if(_0x156c85){return _0x294242[_0xc98e('0xd')](_0x250d84);}return _0x294242['status'](_0x250d84)[_0xc98e('0xe')]();};}function respondWithResult(_0x242fef,_0x3c2ac1){_0x3c2ac1=_0x3c2ac1||0xc8;return function(_0x2ac12e){if(_0x2ac12e){return _0x242fef['status'](_0x3c2ac1)[_0xc98e('0xf')](_0x2ac12e);}};}function respondWithFilteredResult(_0x3e5f96,_0x55be17){return function(_0x23bc17){if(_0x23bc17){var _0x3a9518=typeof _0x55be17[_0xc98e('0x10')]===_0xc98e('0x11')&&typeof _0x55be17[_0xc98e('0x12')]===_0xc98e('0x11');var _0x3fd228=_0x23bc17[_0xc98e('0x13')];var _0x5ecbf2=_0x3a9518?0x0:_0x55be17[_0xc98e('0x10')];var _0x1915c1=_0x3a9518?_0x23bc17[_0xc98e('0x13')]:_0x55be17[_0xc98e('0x10')]+_0x55be17[_0xc98e('0x12')];var _0x50a8f6;if(_0x1915c1>=_0x3fd228){_0x1915c1=_0x3fd228;_0x50a8f6=0xc8;}else{_0x50a8f6=0xce;}_0x3e5f96[_0xc98e('0x14')](_0x50a8f6);return _0x3e5f96['set'](_0xc98e('0x15'),_0x5ecbf2+'-'+_0x1915c1+'/'+_0x3fd228)['json'](_0x23bc17);}return null;};}function saveUpdates(_0x431ed1){return function(_0x3bd548){if(_0x3bd548){return _0x3bd548[_0xc98e('0x16')](_0x431ed1)[_0xc98e('0x17')](function(_0x5653d5){return _0x5653d5;});}return null;};}function removeEntity(_0x46a940){return function(_0x252ef9){if(_0x252ef9){return _0x252ef9[_0xc98e('0x18')]()['then'](function(){var _0x16781b=_0x252ef9[_0xc98e('0x19')]({'plain':!![]});var _0x78513d=_0xc98e('0x1a');return db[_0xc98e('0x1b')][_0xc98e('0x18')]({'where':{'type':_0x78513d,'resourceId':_0x16781b['id']}})[_0xc98e('0x17')](function(){return _0x252ef9;});})[_0xc98e('0x17')](function(){_0x46a940[_0xc98e('0x14')](0xcc)[_0xc98e('0xe')]();});}};}function handleEntityNotFound(_0xd3a04){return function(_0x2c4f1f){if(!_0x2c4f1f){_0xd3a04[_0xc98e('0xd')](0x194);}return _0x2c4f1f;};}function handleError(_0x5dd65d,_0x49b3f7){_0x49b3f7=_0x49b3f7||0x1f4;return function(_0x1ed13b){logger[_0xc98e('0x1c')](_0x1ed13b[_0xc98e('0x1d')]);if(_0x1ed13b['name']){delete _0x1ed13b[_0xc98e('0x1e')];}_0x5dd65d['status'](_0x49b3f7)[_0xc98e('0x1f')](_0x1ed13b);};}exports[_0xc98e('0x20')]=function(_0x523168,_0x508a1f){var _0x4d977e={};var _0x2cb23a={'count':0x0,'rows':[]};var _0x417636=_[_0xc98e('0x21')](db[_0xc98e('0x22')][_0xc98e('0x23')],function(_0x38e53e){return{'name':_0x38e53e[_0xc98e('0x24')],'type':_0x38e53e[_0xc98e('0x25')][_0xc98e('0x26')]};});_0x4d977e=qs[_0xc98e('0x27')](_0x417636,_0x523168);var _0xee3a0b={'where':_0x4d977e[_0xc98e('0x28')]};return db[_0xc98e('0x22')]['count'](_0xee3a0b)[_0xc98e('0x17')](function(_0x50895b){_0x2cb23a[_0xc98e('0x13')]=_0x50895b;_0x4d977e[_0xc98e('0x29')]=qs[_0xc98e('0x29')](_0x523168[_0xc98e('0x2a')]);return db[_0xc98e('0x22')][_0xc98e('0x2b')](_0x4d977e);})[_0xc98e('0x17')](function(_0x494609){_0x2cb23a[_0xc98e('0x2c')]=_0x494609;return _0x2cb23a;})[_0xc98e('0x17')](respondWithFilteredResult(_0x508a1f,_0x4d977e))['catch'](handleError(_0x508a1f,null));};exports[_0xc98e('0x2d')]=function(_0x3288ab,_0x32e585){var _0x5f5187={'raw':!![],'where':{'id':_0x3288ab[_0xc98e('0x2e')]['id']}},_0x504d1a={};_0x504d1a[_0xc98e('0x2f')]=_['keys'](db[_0xc98e('0x22')]['rawAttributes']);_0x504d1a[_0xc98e('0x2a')]=_[_0xc98e('0x30')](_0x3288ab[_0xc98e('0x2a')]);_0x504d1a[_0xc98e('0x31')]=_[_0xc98e('0x32')](_0x504d1a[_0xc98e('0x2f')],_0x504d1a[_0xc98e('0x2a')]);_0x5f5187[_0xc98e('0x33')]=_[_0xc98e('0x32')](_0x504d1a[_0xc98e('0x2f')],qs['fields'](_0x3288ab['query'][_0xc98e('0x34')]));_0x5f5187['attributes']=_0x5f5187[_0xc98e('0x33')][_0xc98e('0x35')]?_0x5f5187[_0xc98e('0x33')]:_0x504d1a[_0xc98e('0x2f')];if(_0x3288ab[_0xc98e('0x2a')][_0xc98e('0x36')]){_0x5f5187[_0xc98e('0x29')]=[{'all':!![]}];}_0x5f5187=_[_0xc98e('0x37')]({},_0x5f5187,_0x3288ab[_0xc98e('0x38')]);return db[_0xc98e('0x22')]['find'](_0x5f5187)[_0xc98e('0x17')](handleEntityNotFound(_0x32e585,null))['then'](respondWithResult(_0x32e585,null))[_0xc98e('0x39')](handleError(_0x32e585,null));};exports[_0xc98e('0x3a')]=function(_0x37f685,_0x302453){return db[_0xc98e('0x22')][_0xc98e('0x3a')](_0x37f685[_0xc98e('0x3b')],{})[_0xc98e('0x17')](function(_0x572643){var _0x2857d9=_0x37f685[_0xc98e('0x3c')]['get']({'plain':!![]});if(!_0x2857d9)throw new Error(_0xc98e('0x3d'));if(_0x2857d9[_0xc98e('0x3e')]===_0xc98e('0x3c')){var _0x2e953b=_0x572643[_0xc98e('0x19')]({'plain':!![]});var _0x3df0af='ChatQueues';return db[_0xc98e('0x3f')][_0xc98e('0x40')]({'where':{'name':_0x3df0af,'userProfileId':_0x2857d9[_0xc98e('0x41')]},'raw':!![]})['then'](function(_0x43347e){if(_0x43347e&&_0x43347e[_0xc98e('0x42')]===0x0){return db[_0xc98e('0x1b')][_0xc98e('0x3a')]({'name':_0x2e953b[_0xc98e('0x1e')],'resourceId':_0x2e953b['id'],'type':_0x43347e[_0xc98e('0x1e')],'sectionId':_0x43347e['id']},{})[_0xc98e('0x17')](function(){return _0x572643;});}else{return _0x572643;}})['catch'](function(_0x2cabfe){logger[_0xc98e('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cabfe);throw _0x2cabfe;});}return _0x572643;})[_0xc98e('0x17')](respondWithResult(_0x302453,0xc9))[_0xc98e('0x39')](handleError(_0x302453,null));};exports[_0xc98e('0x16')]=function(_0x59c78b,_0x5f59f8){if(_0x59c78b[_0xc98e('0x3b')]['id']){delete _0x59c78b[_0xc98e('0x3b')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x59c78b[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x5f59f8,null))['then'](saveUpdates(_0x59c78b['body'],null))['then'](respondWithResult(_0x5f59f8,null))[_0xc98e('0x39')](handleError(_0x5f59f8,null));};exports[_0xc98e('0x18')]=function(_0x79b489,_0x2a7a90){return db[_0xc98e('0x22')][_0xc98e('0x40')]({'where':{'id':_0x79b489['params']['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x2a7a90,null))[_0xc98e('0x17')](removeEntity(_0x2a7a90,null))[_0xc98e('0x39')](handleError(_0x2a7a90,null));};exports[_0xc98e('0x43')]=function(_0xa57843,_0x1b8e5e){return db[_0xc98e('0x22')][_0xc98e('0x43')]()[_0xc98e('0x17')](respondWithResult(_0x1b8e5e,null))[_0xc98e('0x39')](handleError(_0x1b8e5e,null));};exports[_0xc98e('0x44')]=function(_0x54b6fd,_0x25aae7){var _0x4a496c={'raw':!![],'where':{}},_0x1043f1={},_0x10e370;return db[_0xc98e('0x22')][_0xc98e('0x45')]({'where':{'id':_0x54b6fd[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x25aae7,null))['then'](function(_0x72d614){if(_0x72d614){_0x10e370=_0x72d614[_0xc98e('0x19')]({'plain':!![]});_0x1043f1[_0xc98e('0x2f')]=_[_0xc98e('0x30')](db[_0xc98e('0x46')][_0xc98e('0x23')]);_0x1043f1['query']=_[_0xc98e('0x30')](_0x54b6fd['query']);_0x1043f1[_0xc98e('0x31')]=_[_0xc98e('0x32')](_0x1043f1[_0xc98e('0x2f')],_0x1043f1[_0xc98e('0x2a')]);_0x4a496c['attributes']=_['intersection'](_0x1043f1[_0xc98e('0x2f')],qs['fields'](_0x54b6fd['query']['fields']));_0x4a496c[_0xc98e('0x33')]=_0x4a496c[_0xc98e('0x33')][_0xc98e('0x35')]?_0x4a496c[_0xc98e('0x33')]:_0x1043f1[_0xc98e('0x2f')];if(!_0x54b6fd['query'][_0xc98e('0x47')](_0xc98e('0x48'))){_0x4a496c[_0xc98e('0x12')]=qs[_0xc98e('0x12')](_0x54b6fd[_0xc98e('0x2a')][_0xc98e('0x12')]);_0x4a496c[_0xc98e('0x10')]=qs[_0xc98e('0x10')](_0x54b6fd[_0xc98e('0x2a')][_0xc98e('0x10')]);}_0x4a496c[_0xc98e('0x49')]=qs[_0xc98e('0x4a')](_0x54b6fd[_0xc98e('0x2a')]['sort']);_0x4a496c['where']=qs[_0xc98e('0x31')](_['pick'](_0x54b6fd[_0xc98e('0x2a')],_0x1043f1[_0xc98e('0x31')]));_0x4a496c[_0xc98e('0x28')][_0xc98e('0x4b')]=_0x72d614['id'];if(_0x54b6fd[_0xc98e('0x2a')][_0xc98e('0x4c')]){_0x4a496c['where']=_[_0xc98e('0x37')](_0x4a496c['where'],{'$or':_[_0xc98e('0x21')](_0x4a496c[_0xc98e('0x33')],function(_0x4f4bb3){var _0x514204={};_0x514204[_0x4f4bb3]={'$like':'%'+_0x54b6fd['query'][_0xc98e('0x4c')]+'%'};return _0x514204;})});}_0x4a496c=_[_0xc98e('0x37')]({},_0x4a496c,_0x54b6fd[_0xc98e('0x38')]);return db[_0xc98e('0x46')][_0xc98e('0x2b')](_0x4a496c);}})['then'](function(_0x20fe9a){if(_0x20fe9a){return db[_0xc98e('0x4d')][_0xc98e('0x4e')]({'where':{'id':_['map'](_0x20fe9a,_0xc98e('0x4f')),'role':'agent'},'attributes':['id',_0xc98e('0x1e'),_0xc98e('0x50'),_0xc98e('0x51'),'createdAt']});}})[_0xc98e('0x17')](function(_0x388b1e){if(_0x388b1e){return{'count':_0x388b1e[_0xc98e('0x13')],'rows':_[_0xc98e('0x21')](_0x388b1e[_0xc98e('0x2c')],function(_0x433790){return{'membername':_0x433790[_0xc98e('0x1e')],'UserId':_0x433790['id'],'queue_name':_0x10e370[_0xc98e('0x1e')],'ChatQueueId':_0x10e370['id'],'interface':util['format'](_0xc98e('0x52'),'SIP',_0x433790[_0xc98e('0x1e')]),'penalty':0x0,'paused':_0x433790['chatPause'],'createdAt':_0x433790[_0xc98e('0x53')],'updatedAt':_0x433790[_0xc98e('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x25aae7,_0x4a496c))[_0xc98e('0x39')](handleError(_0x25aae7,null));};exports[_0xc98e('0x54')]=function(_0xdfe919,_0xa90964){var _0x130b80={};var _0x275ebd={};var _0x3634eb;var _0x1270d3;return db[_0xc98e('0x22')][_0xc98e('0x45')]({'where':{'id':_0xdfe919[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0xa90964,null))[_0xc98e('0x17')](function(_0x196b0d){if(_0x196b0d){_0x3634eb=_0x196b0d;_0x275ebd['model']=_[_0xc98e('0x30')](db[_0xc98e('0x55')][_0xc98e('0x23')]);_0x275ebd['query']=_[_0xc98e('0x30')](_0xdfe919[_0xc98e('0x2a')]);_0x275ebd[_0xc98e('0x31')]=_[_0xc98e('0x32')](_0x275ebd[_0xc98e('0x2f')],_0x275ebd[_0xc98e('0x2a')]);_0x130b80[_0xc98e('0x33')]=_['intersection'](_0x275ebd['model'],qs[_0xc98e('0x34')](_0xdfe919['query']['fields']));_0x130b80['attributes']=_0x130b80['attributes']['length']?_0x130b80[_0xc98e('0x33')]:_0x275ebd[_0xc98e('0x2f')];_0x130b80[_0xc98e('0x49')]=qs[_0xc98e('0x4a')](_0xdfe919[_0xc98e('0x2a')][_0xc98e('0x4a')]);_0x130b80[_0xc98e('0x28')]=qs[_0xc98e('0x31')](_['pick'](_0xdfe919[_0xc98e('0x2a')],_0x275ebd[_0xc98e('0x31')]));if(_0xdfe919[_0xc98e('0x2a')][_0xc98e('0x4c')]){_0x130b80['where']=_[_0xc98e('0x37')](_0x130b80[_0xc98e('0x28')],{'$or':_[_0xc98e('0x21')](_0x130b80['attributes'],function(_0x3ad195){var _0x588d73={};_0x588d73[_0x3ad195]={'$like':'%'+_0xdfe919[_0xc98e('0x2a')]['filter']+'%'};return _0x588d73;})});}_0x130b80=_[_0xc98e('0x37')]({},_0x130b80,_0xdfe919[_0xc98e('0x38')]);return _0x3634eb['getTeams'](_0x130b80);}})[_0xc98e('0x17')](function(_0xf1fad7){if(_0xf1fad7){_0x1270d3=_0xf1fad7[_0xc98e('0x35')];if(!_0xdfe919[_0xc98e('0x2a')]['hasOwnProperty'](_0xc98e('0x48'))){_0x130b80['limit']=qs[_0xc98e('0x12')](_0xdfe919[_0xc98e('0x2a')]['limit']);_0x130b80['offset']=qs['offset'](_0xdfe919[_0xc98e('0x2a')][_0xc98e('0x10')]);}return _0x3634eb[_0xc98e('0x54')](_0x130b80);}})['then'](function(_0x46c88d){if(_0x46c88d){return _0x46c88d?{'count':_0x1270d3,'rows':_0x46c88d}:null;}})['then'](respondWithResult(_0xa90964,null))[_0xc98e('0x39')](handleError(_0xa90964,null));};exports[_0xc98e('0x56')]=function(_0x32bc4,_0x4e4789){var _0x57d29f=_0x32bc4[_0xc98e('0x3b')][_0xc98e('0x57')];return db[_0xc98e('0x55')][_0xc98e('0x2b')]({'where':{'id':_0x57d29f},'attributes':['id'],'include':[{'model':db[_0xc98e('0x4d')],'as':_0xc98e('0x58'),'attributes':['id',_0xc98e('0x1e'),_0xc98e('0x59'),_0xc98e('0x5a'),_0xc98e('0x5b')],'raw':!![]}]})[_0xc98e('0x17')](function(_0x41a905){if(_0x41a905){var _0x8a6eb=_[_0xc98e('0x5c')](_0x41a905,function(_0x5c24bd){var _0x5cad24=_0x5c24bd[_0xc98e('0x19')]({'plain':!![]});return _0x5cad24[_0xc98e('0x58')];});return db['ChatQueue'][_0xc98e('0x40')]({'where':{'id':_0x32bc4[_0xc98e('0x2e')]['id']}})['then'](function(_0x170867){return db[_0xc98e('0x5d')][_0xc98e('0x5e')](function(_0x1cc1f9){return _0x170867['addTeams'](_0x57d29f,{'transaction':_0x1cc1f9})[_0xc98e('0x17')](function(){return BPromise[_0xc98e('0x5f')](_0x8a6eb,function(_0x555e2b){return db[_0xc98e('0x46')]['findOrCreate']({'where':{'UserId':_0x555e2b['id'],'ChatQueueId':_0x32bc4[_0xc98e('0x2e')]['id']},'transaction':_0x1cc1f9});});})[_0xc98e('0x17')](function(){_0x8a6eb[_0xc98e('0x60')](function(_0x6c4efd){socket[_0xc98e('0x61')](_0xc98e('0x62'),{'UserId':_0x6c4efd['id'],'ChatQueueId':_0x170867['id']});});});});});}})[_0xc98e('0x17')](respondWithStatusCode(_0x4e4789,null))[_0xc98e('0x39')](handleError(_0x4e4789,null));};exports[_0xc98e('0x63')]=function(_0x1b980c,_0x2c0ae5){return db[_0xc98e('0x55')]['findAll']({'where':{'id':_0x1b980c[_0xc98e('0x2a')][_0xc98e('0x57')]},'attributes':['id'],'include':[{'model':db[_0xc98e('0x4d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc98e('0x17')](handleEntityNotFound(_0x2c0ae5,null))[_0xc98e('0x17')](function(_0xa8a0ab){var _0x3f8a77=_['map'](_0xa8a0ab,'id');var _0xb56fac=[];var _0x252b2e=[];var _0x595ff2=squel[_0xc98e('0x64')]();_0x595ff2[_0xc98e('0x65')](_0xc98e('0x66'))[_0xc98e('0x67')](_0xc98e('0x68'),'tq')[_0xc98e('0x69')]('user_has_teams','ut',_0xc98e('0x6a'))[_0xc98e('0x28')](_0xc98e('0x6b'),_0x1b980c[_0xc98e('0x2e')]['id']);for(var _0x2b8835=0x0;_0x2b8835<_0xa8a0ab[_0xc98e('0x35')];_0x2b8835+=0x1){let _0x47c734=_0xa8a0ab[_0x2b8835];for(var _0x32a362=0x0;_0x32a362<_0x47c734[_0xc98e('0x58')]['length'];_0x32a362+=0x1){let _0x306a27=_0x47c734[_0xc98e('0x58')][_0x32a362];var _0x571d75=_0x595ff2[_0xc98e('0x6c')]();_0x571d75[_0xc98e('0x28')]('ut.UserId\x20=\x20?',_0x306a27['id']);_0x252b2e[_0xc98e('0x6d')](db[_0xc98e('0x5d')][_0xc98e('0x2a')](_0x571d75[_0xc98e('0x6e')](),{'type':db['sequelize'][_0xc98e('0x6f')][_0xc98e('0x70')]})[_0xc98e('0x17')](function(_0x2fe92c){if(_0x2fe92c[_0xc98e('0x35')]===0x1){return _0x306a27['id'];}else{var _0x53cf6a=_[_0xc98e('0x71')](_[_0xc98e('0x21')](_0x2fe92c,_0xc98e('0x72')),function(_0x17fa44){return _[_0xc98e('0x73')](_0x3f8a77,_0x17fa44);});if(_0x53cf6a){return _0x306a27['id'];}}}));}}return BPromise[_0xc98e('0x74')](_0x252b2e)['then'](function(_0x28f7a6){_0xb56fac=_(_0xb56fac)[_0xc98e('0x75')](_0x28f7a6)['compact']()[_0xc98e('0x76')]();return db[_0xc98e('0x22')]['find']({'where':{'id':_0x1b980c['params']['id']}})[_0xc98e('0x17')](function(_0x314a94){return db[_0xc98e('0x5d')][_0xc98e('0x5e')](function(_0x5e05f6){return _0x314a94['removeTeams'](_0x1b980c[_0xc98e('0x2a')][_0xc98e('0x57')],{'transaction':_0x5e05f6})[_0xc98e('0x17')](function(){if(!_[_0xc98e('0x77')](_0xb56fac)){return _0x314a94[_0xc98e('0x78')](_0xb56fac,{'transaction':_0x5e05f6});}})[_0xc98e('0x17')](function(){_0xb56fac['forEach'](function(_0x42809f){socket[_0xc98e('0x61')](_0xc98e('0x79'),{'UserId':_0x42809f,'ChatQueueId':_0x314a94['id']});});});});});});})[_0xc98e('0x17')](respondWithStatusCode(_0x2c0ae5,null))[_0xc98e('0x39')](handleError(_0x2c0ae5,null));};exports[_0xc98e('0x7a')]=function(_0x1be9a9,_0x317c2b){return db[_0xc98e('0x22')][_0xc98e('0x40')]({'where':{'id':_0x1be9a9[_0xc98e('0x2e')]['id']}})['then'](handleEntityNotFound(_0x317c2b,null))[_0xc98e('0x17')](function(_0x2a93ee){if(_0x2a93ee){return _0x2a93ee[_0xc98e('0x7a')](_0x1be9a9['body'][_0xc98e('0x57')],_[_0xc98e('0x7b')](_0x1be9a9[_0xc98e('0x3b')],['ids','id'])||{})[_0xc98e('0x7c')](function(_0x468e3f){for(var _0x525c64=0x0;_0x525c64<_0x1be9a9['body'][_0xc98e('0x57')]['length'];_0x525c64+=0x1){socket[_0xc98e('0x61')]('userChatQueue:save',{'UserId':Number(_0x1be9a9[_0xc98e('0x3b')][_0xc98e('0x57')][_0x525c64]),'ChatQueueId':Number(_0x1be9a9[_0xc98e('0x2e')]['id'])});}return _0x468e3f;});}})[_0xc98e('0x17')](respondWithResult(_0x317c2b,null))[_0xc98e('0x39')](handleError(_0x317c2b,null));};exports[_0xc98e('0x78')]=function(_0x3ab47e,_0x452948){return db[_0xc98e('0x22')][_0xc98e('0x40')]({'where':{'id':_0x3ab47e[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x452948,null))[_0xc98e('0x17')](function(_0x1987bc){if(_0x1987bc){return _0x1987bc[_0xc98e('0x78')](_0x3ab47e[_0xc98e('0x2a')][_0xc98e('0x57')])[_0xc98e('0x17')](function(){if(_[_0xc98e('0x7d')](_0x3ab47e['query'][_0xc98e('0x57')])){for(var _0x5c0b3d=0x0;_0x5c0b3d<_0x3ab47e['query'][_0xc98e('0x57')][_0xc98e('0x35')];_0x5c0b3d+=0x1){socket[_0xc98e('0x61')]('userChatQueue:remove',{'UserId':Number(_0x3ab47e[_0xc98e('0x2a')][_0xc98e('0x57')][_0x5c0b3d]),'ChatQueueId':Number(_0x3ab47e[_0xc98e('0x2e')]['id'])});}}else{socket[_0xc98e('0x61')](_0xc98e('0x79'),{'UserId':Number(_0x3ab47e[_0xc98e('0x2a')]['ids']),'ChatQueueId':Number(_0x3ab47e[_0xc98e('0x2e')]['id'])});}});}})[_0xc98e('0x17')](respondWithStatusCode(_0x452948,null))[_0xc98e('0x39')](handleError(_0x452948,null));};exports[_0xc98e('0x7e')]=function(_0x5df54e,_0x1d7d93){var _0x5032af={};var _0x2484ce={};var _0x4fde54;var _0xa52fbe;return db[_0xc98e('0x22')][_0xc98e('0x45')]({'where':{'id':_0x5df54e[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x1d7d93,null))[_0xc98e('0x17')](function(_0x612f1d){if(_0x612f1d){_0x4fde54=_0x612f1d;_0x2484ce[_0xc98e('0x2f')]=_['keys'](db[_0xc98e('0x4d')][_0xc98e('0x23')]);_0x2484ce['query']=_[_0xc98e('0x30')](_0x5df54e[_0xc98e('0x2a')]);_0x2484ce[_0xc98e('0x31')]=_['intersection'](_0x2484ce[_0xc98e('0x2f')],_0x2484ce[_0xc98e('0x2a')]);_0x5032af['attributes']=_[_0xc98e('0x32')](_0x2484ce[_0xc98e('0x2f')],qs[_0xc98e('0x34')](_0x5df54e['query'][_0xc98e('0x34')]));_0x5032af[_0xc98e('0x33')]=_0x5032af[_0xc98e('0x33')]['length']?_0x5032af[_0xc98e('0x33')]:_0x2484ce[_0xc98e('0x2f')];_0x5032af[_0xc98e('0x49')]=qs[_0xc98e('0x4a')](_0x5df54e[_0xc98e('0x2a')][_0xc98e('0x4a')]);_0x5032af[_0xc98e('0x28')]=qs['filters'](_[_0xc98e('0x7f')](_0x5df54e[_0xc98e('0x2a')],_0x2484ce[_0xc98e('0x31')]));if(_0x5df54e['query'][_0xc98e('0x4c')]){_0x5032af['where']=_['merge'](_0x5032af[_0xc98e('0x28')],{'$or':_['map'](_0x5032af[_0xc98e('0x33')],function(_0x24de70){var _0x2197db={};_0x2197db[_0x24de70]={'$like':'%'+_0x5df54e['query']['filter']+'%'};return _0x2197db;})});}_0x5032af=_[_0xc98e('0x37')]({},_0x5032af,_0x5df54e[_0xc98e('0x38')]);return _0x4fde54['getAgents'](_0x5032af);}})[_0xc98e('0x17')](function(_0x43af75){if(_0x43af75){_0xa52fbe=_0x43af75[_0xc98e('0x35')];if(!_0x5df54e['query'][_0xc98e('0x47')](_0xc98e('0x48'))){_0x5032af['limit']=qs[_0xc98e('0x12')](_0x5df54e[_0xc98e('0x2a')]['limit']);_0x5032af[_0xc98e('0x10')]=qs[_0xc98e('0x10')](_0x5df54e[_0xc98e('0x2a')]['offset']);}return _0x4fde54['getAgents'](_0x5032af);}})[_0xc98e('0x17')](function(_0x17db52){if(_0x17db52){return _0x17db52?{'count':_0xa52fbe,'rows':_0x17db52}:null;}})[_0xc98e('0x17')](respondWithResult(_0x1d7d93,null))[_0xc98e('0x39')](handleError(_0x1d7d93,null));};
\ No newline at end of file
+var _0xdc2b=['compact','value','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','bluebird','util','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','get','ChatQueues','UserProfileResource','destroy','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','findAll','catch','show','params','model','keys','query','intersection','attributes','fields','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','describe','getMembers','findOne','UserChatQueue','filters','hasOwnProperty','nolimit','sort','where','User','UserId','chatPause','updatedAt','rows','format','%s/%s','createdAt','Team','order','pick','filter','getTeams','length','ids','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','Agents','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union'];(function(_0x1a2f18,_0x400424){var _0x1a6a7f=function(_0x2022a2){while(--_0x2022a2){_0x1a2f18['push'](_0x1a2f18['shift']());}};_0x1a6a7f(++_0x400424);}(_0xdc2b,0x174));var _0xbdc2=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xdc2b[_0xa6cc5c];return _0x44803d;};'use strict';var BPromise=require(_0xbdc2('0x0'));var util=require(_0xbdc2('0x1'));var _=require('lodash');var squel=require('squel');var Redis=require(_0xbdc2('0x2'));var qs=require(_0xbdc2('0x3'));var logger=require(_0xbdc2('0x4'))(_0xbdc2('0x5'));var config=require(_0xbdc2('0x6'));var db=require('../../mysqldb')['db'];config[_0xbdc2('0x7')]=_[_0xbdc2('0x8')](config[_0xbdc2('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xbdc2('0x9'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xbdc2('0xa')](socket);function respondWithStatusCode(_0x565313,_0x15317d){_0x15317d=_0x15317d||0xcc;return function(_0x1ef8f6){if(_0x1ef8f6){return _0x565313[_0xbdc2('0xb')](_0x15317d);}return _0x565313[_0xbdc2('0xc')](_0x15317d)[_0xbdc2('0xd')]();};}function respondWithResult(_0x25b9bb,_0x511256){_0x511256=_0x511256||0xc8;return function(_0x45b01a){if(_0x45b01a){return _0x25b9bb[_0xbdc2('0xc')](_0x511256)['json'](_0x45b01a);}};}function respondWithFilteredResult(_0x6c5ce2,_0x4b2c81){return function(_0x5d4622){if(_0x5d4622){var _0x2e0521=typeof _0x4b2c81[_0xbdc2('0xe')]==='undefined'&&typeof _0x4b2c81[_0xbdc2('0xf')]===_0xbdc2('0x10');var _0x171014=_0x5d4622[_0xbdc2('0x11')];var _0xc0a6d7=_0x2e0521?0x0:_0x4b2c81[_0xbdc2('0xe')];var _0x4c8ae6=_0x2e0521?_0x5d4622[_0xbdc2('0x11')]:_0x4b2c81[_0xbdc2('0xe')]+_0x4b2c81['limit'];var _0x16837b;if(_0x4c8ae6>=_0x171014){_0x4c8ae6=_0x171014;_0x16837b=0xc8;}else{_0x16837b=0xce;}_0x6c5ce2[_0xbdc2('0xc')](_0x16837b);return _0x6c5ce2[_0xbdc2('0x12')](_0xbdc2('0x13'),_0xc0a6d7+'-'+_0x4c8ae6+'/'+_0x171014)[_0xbdc2('0x14')](_0x5d4622);}return null;};}function saveUpdates(_0xeba671){return function(_0x33f7ea){if(_0x33f7ea){return _0x33f7ea[_0xbdc2('0x15')](_0xeba671)[_0xbdc2('0x16')](function(_0x4222df){return _0x4222df;});}return null;};}function removeEntity(_0x2de6d1){return function(_0x10bcaa){if(_0x10bcaa){return _0x10bcaa['destroy']()[_0xbdc2('0x16')](function(){var _0x2782c1=_0x10bcaa[_0xbdc2('0x17')]({'plain':!![]});var _0x35ab99=_0xbdc2('0x18');return db[_0xbdc2('0x19')][_0xbdc2('0x1a')]({'where':{'type':_0x35ab99,'resourceId':_0x2782c1['id']}})['then'](function(){return _0x10bcaa;});})[_0xbdc2('0x16')](function(){_0x2de6d1[_0xbdc2('0xc')](0xcc)[_0xbdc2('0xd')]();});}};}function handleEntityNotFound(_0x3a5fda){return function(_0x59281f){if(!_0x59281f){_0x3a5fda['sendStatus'](0x194);}return _0x59281f;};}function handleError(_0x2cb1ba,_0x19cb96){_0x19cb96=_0x19cb96||0x1f4;return function(_0x4365a9){logger[_0xbdc2('0x1b')](_0x4365a9['stack']);if(_0x4365a9[_0xbdc2('0x1c')]){delete _0x4365a9[_0xbdc2('0x1c')];}_0x2cb1ba[_0xbdc2('0xc')](_0x19cb96)[_0xbdc2('0x1d')](_0x4365a9);};}exports[_0xbdc2('0x1e')]=function(_0x150981,_0x241a3b){var _0x265935={};var _0x1ab11d={'count':0x0,'rows':[]};var _0x646363=_[_0xbdc2('0x1f')](db[_0xbdc2('0x20')][_0xbdc2('0x21')],function(_0x347f06){return{'name':_0x347f06[_0xbdc2('0x22')],'type':_0x347f06[_0xbdc2('0x23')][_0xbdc2('0x24')]};});_0x265935=qs[_0xbdc2('0x25')](_0x646363,_0x150981);var _0x48798d={'where':_0x265935['where']};return db['ChatQueue']['count'](_0x48798d)['then'](function(_0xb13846){_0x1ab11d['count']=_0xb13846;_0x265935[_0xbdc2('0x26')]=qs[_0xbdc2('0x26')](_0x150981['query']);return db['ChatQueue'][_0xbdc2('0x27')](_0x265935);})['then'](function(_0x41133a){_0x1ab11d['rows']=_0x41133a;return _0x1ab11d;})[_0xbdc2('0x16')](respondWithFilteredResult(_0x241a3b,_0x265935))[_0xbdc2('0x28')](handleError(_0x241a3b,null));};exports[_0xbdc2('0x29')]=function(_0xdcade9,_0x941804){var _0x51cc40={'raw':!![],'where':{'id':_0xdcade9[_0xbdc2('0x2a')]['id']}},_0x39acd2={};_0x39acd2[_0xbdc2('0x2b')]=_[_0xbdc2('0x2c')](db['ChatQueue']['rawAttributes']);_0x39acd2['query']=_[_0xbdc2('0x2c')](_0xdcade9[_0xbdc2('0x2d')]);_0x39acd2['filters']=_[_0xbdc2('0x2e')](_0x39acd2['model'],_0x39acd2['query']);_0x51cc40[_0xbdc2('0x2f')]=_[_0xbdc2('0x2e')](_0x39acd2['model'],qs[_0xbdc2('0x30')](_0xdcade9[_0xbdc2('0x2d')]['fields']));_0x51cc40[_0xbdc2('0x2f')]=_0x51cc40[_0xbdc2('0x2f')]['length']?_0x51cc40[_0xbdc2('0x2f')]:_0x39acd2[_0xbdc2('0x2b')];if(_0xdcade9['query'][_0xbdc2('0x31')]){_0x51cc40[_0xbdc2('0x26')]=[{'all':!![]}];}_0x51cc40=_[_0xbdc2('0x32')]({},_0x51cc40,_0xdcade9[_0xbdc2('0x33')]);return db[_0xbdc2('0x20')][_0xbdc2('0x34')](_0x51cc40)[_0xbdc2('0x16')](handleEntityNotFound(_0x941804,null))['then'](respondWithResult(_0x941804,null))[_0xbdc2('0x28')](handleError(_0x941804,null));};exports[_0xbdc2('0x35')]=function(_0x4ef443,_0x37f176){return db['ChatQueue'][_0xbdc2('0x35')](_0x4ef443[_0xbdc2('0x36')],{})[_0xbdc2('0x16')](function(_0x29bddd){var _0x4b6aa3=_0x4ef443[_0xbdc2('0x37')][_0xbdc2('0x17')]({'plain':!![]});if(!_0x4b6aa3)throw new Error(_0xbdc2('0x38'));if(_0x4b6aa3['role']===_0xbdc2('0x37')){var _0x374382=_0x29bddd[_0xbdc2('0x17')]({'plain':!![]});var _0x373bea=_0xbdc2('0x18');return db['UserProfileSection'][_0xbdc2('0x34')]({'where':{'name':_0x373bea,'userProfileId':_0x4b6aa3['userProfileId']},'raw':!![]})[_0xbdc2('0x16')](function(_0x208fd0){if(_0x208fd0&&_0x208fd0[_0xbdc2('0x39')]===0x0){return db['UserProfileResource'][_0xbdc2('0x35')]({'name':_0x374382['name'],'resourceId':_0x374382['id'],'type':_0x208fd0[_0xbdc2('0x1c')],'sectionId':_0x208fd0['id']},{})[_0xbdc2('0x16')](function(){return _0x29bddd;});}else{return _0x29bddd;}})['catch'](function(_0x39fc26){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39fc26);throw _0x39fc26;});}return _0x29bddd;})['then'](respondWithResult(_0x37f176,0xc9))[_0xbdc2('0x28')](handleError(_0x37f176,null));};exports[_0xbdc2('0x15')]=function(_0x2c67c3,_0x53687b){if(_0x2c67c3[_0xbdc2('0x36')]['id']){delete _0x2c67c3[_0xbdc2('0x36')]['id'];}return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x2c67c3[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x53687b,null))[_0xbdc2('0x16')](saveUpdates(_0x2c67c3['body'],null))[_0xbdc2('0x16')](respondWithResult(_0x53687b,null))['catch'](handleError(_0x53687b,null));};exports[_0xbdc2('0x1a')]=function(_0xb20a1,_0x280b24){return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0xb20a1['params']['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x280b24,null))[_0xbdc2('0x16')](removeEntity(_0x280b24,null))[_0xbdc2('0x28')](handleError(_0x280b24,null));};exports[_0xbdc2('0x3a')]=function(_0x4b6d1e,_0x5a6d47){return db['ChatQueue'][_0xbdc2('0x3a')]()[_0xbdc2('0x16')](respondWithResult(_0x5a6d47,null))[_0xbdc2('0x28')](handleError(_0x5a6d47,null));};exports[_0xbdc2('0x3b')]=function(_0x33bc0f,_0x3733d4){var _0x266c61={'raw':!![],'where':{}},_0x5aa5e1={},_0xc6be87;return db[_0xbdc2('0x20')][_0xbdc2('0x3c')]({'where':{'id':_0x33bc0f['params']['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x3733d4,null))[_0xbdc2('0x16')](function(_0x152f3e){if(_0x152f3e){_0xc6be87=_0x152f3e[_0xbdc2('0x17')]({'plain':!![]});_0x5aa5e1[_0xbdc2('0x2b')]=_[_0xbdc2('0x2c')](db[_0xbdc2('0x3d')][_0xbdc2('0x21')]);_0x5aa5e1[_0xbdc2('0x2d')]=_[_0xbdc2('0x2c')](_0x33bc0f[_0xbdc2('0x2d')]);_0x5aa5e1[_0xbdc2('0x3e')]=_['intersection'](_0x5aa5e1[_0xbdc2('0x2b')],_0x5aa5e1[_0xbdc2('0x2d')]);_0x266c61['attributes']=_[_0xbdc2('0x2e')](_0x5aa5e1[_0xbdc2('0x2b')],qs['fields'](_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0x30')]));_0x266c61[_0xbdc2('0x2f')]=_0x266c61['attributes']['length']?_0x266c61[_0xbdc2('0x2f')]:_0x5aa5e1['model'];if(!_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0x3f')](_0xbdc2('0x40'))){_0x266c61[_0xbdc2('0xf')]=qs[_0xbdc2('0xf')](_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0xf')]);_0x266c61['offset']=qs[_0xbdc2('0xe')](_0x33bc0f['query'][_0xbdc2('0xe')]);}_0x266c61['order']=qs[_0xbdc2('0x41')](_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0x41')]);_0x266c61[_0xbdc2('0x42')]=qs[_0xbdc2('0x3e')](_['pick'](_0x33bc0f[_0xbdc2('0x2d')],_0x5aa5e1[_0xbdc2('0x3e')]));_0x266c61[_0xbdc2('0x42')]['ChatQueueId']=_0x152f3e['id'];if(_0x33bc0f[_0xbdc2('0x2d')]['filter']){_0x266c61[_0xbdc2('0x42')]=_[_0xbdc2('0x32')](_0x266c61[_0xbdc2('0x42')],{'$or':_[_0xbdc2('0x1f')](_0x266c61[_0xbdc2('0x2f')],function(_0x3da852){var _0x3c64a0={};_0x3c64a0[_0x3da852]={'$like':'%'+_0x33bc0f['query']['filter']+'%'};return _0x3c64a0;})});}_0x266c61=_[_0xbdc2('0x32')]({},_0x266c61,_0x33bc0f[_0xbdc2('0x33')]);return db[_0xbdc2('0x3d')]['findAll'](_0x266c61);}})[_0xbdc2('0x16')](function(_0x887ca4){if(_0x887ca4){return db[_0xbdc2('0x43')]['findAndCountAll']({'where':{'id':_[_0xbdc2('0x1f')](_0x887ca4,_0xbdc2('0x44')),'role':'agent'},'attributes':['id',_0xbdc2('0x1c'),_0xbdc2('0x45'),_0xbdc2('0x46'),'createdAt']});}})[_0xbdc2('0x16')](function(_0x58242a){if(_0x58242a){return{'count':_0x58242a['count'],'rows':_[_0xbdc2('0x1f')](_0x58242a[_0xbdc2('0x47')],function(_0x43eff1){return{'membername':_0x43eff1['name'],'UserId':_0x43eff1['id'],'queue_name':_0xc6be87[_0xbdc2('0x1c')],'ChatQueueId':_0xc6be87['id'],'interface':util[_0xbdc2('0x48')](_0xbdc2('0x49'),'SIP',_0x43eff1[_0xbdc2('0x1c')]),'penalty':0x0,'paused':_0x43eff1['chatPause'],'createdAt':_0x43eff1[_0xbdc2('0x4a')],'updatedAt':_0x43eff1[_0xbdc2('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbdc2('0x16')](respondWithFilteredResult(_0x3733d4,_0x266c61))[_0xbdc2('0x28')](handleError(_0x3733d4,null));};exports['getTeams']=function(_0x362f58,_0x2a6ba3){var _0xb19c24={};var _0x5681a9={};var _0x5be75c;var _0x1289d1;return db[_0xbdc2('0x20')][_0xbdc2('0x3c')]({'where':{'id':_0x362f58['params']['id']}})['then'](handleEntityNotFound(_0x2a6ba3,null))[_0xbdc2('0x16')](function(_0x56780){if(_0x56780){_0x5be75c=_0x56780;_0x5681a9['model']=_[_0xbdc2('0x2c')](db[_0xbdc2('0x4b')][_0xbdc2('0x21')]);_0x5681a9[_0xbdc2('0x2d')]=_['keys'](_0x362f58['query']);_0x5681a9[_0xbdc2('0x3e')]=_['intersection'](_0x5681a9[_0xbdc2('0x2b')],_0x5681a9[_0xbdc2('0x2d')]);_0xb19c24[_0xbdc2('0x2f')]=_['intersection'](_0x5681a9[_0xbdc2('0x2b')],qs[_0xbdc2('0x30')](_0x362f58['query'][_0xbdc2('0x30')]));_0xb19c24[_0xbdc2('0x2f')]=_0xb19c24[_0xbdc2('0x2f')]['length']?_0xb19c24[_0xbdc2('0x2f')]:_0x5681a9[_0xbdc2('0x2b')];_0xb19c24[_0xbdc2('0x4c')]=qs[_0xbdc2('0x41')](_0x362f58[_0xbdc2('0x2d')][_0xbdc2('0x41')]);_0xb19c24[_0xbdc2('0x42')]=qs[_0xbdc2('0x3e')](_[_0xbdc2('0x4d')](_0x362f58[_0xbdc2('0x2d')],_0x5681a9[_0xbdc2('0x3e')]));if(_0x362f58['query'][_0xbdc2('0x4e')]){_0xb19c24['where']=_[_0xbdc2('0x32')](_0xb19c24[_0xbdc2('0x42')],{'$or':_['map'](_0xb19c24[_0xbdc2('0x2f')],function(_0x2aa285){var _0x357539={};_0x357539[_0x2aa285]={'$like':'%'+_0x362f58['query'][_0xbdc2('0x4e')]+'%'};return _0x357539;})});}_0xb19c24=_[_0xbdc2('0x32')]({},_0xb19c24,_0x362f58[_0xbdc2('0x33')]);return _0x5be75c[_0xbdc2('0x4f')](_0xb19c24);}})[_0xbdc2('0x16')](function(_0x21faf8){if(_0x21faf8){_0x1289d1=_0x21faf8[_0xbdc2('0x50')];if(!_0x362f58[_0xbdc2('0x2d')][_0xbdc2('0x3f')](_0xbdc2('0x40'))){_0xb19c24[_0xbdc2('0xf')]=qs[_0xbdc2('0xf')](_0x362f58['query']['limit']);_0xb19c24[_0xbdc2('0xe')]=qs[_0xbdc2('0xe')](_0x362f58[_0xbdc2('0x2d')][_0xbdc2('0xe')]);}return _0x5be75c['getTeams'](_0xb19c24);}})[_0xbdc2('0x16')](function(_0x4962b8){if(_0x4962b8){return _0x4962b8?{'count':_0x1289d1,'rows':_0x4962b8}:null;}})['then'](respondWithResult(_0x2a6ba3,null))[_0xbdc2('0x28')](handleError(_0x2a6ba3,null));};exports['addTeams']=function(_0x34a0f8,_0x4e2c2d){var _0x24fbfa=_0x34a0f8['body'][_0xbdc2('0x51')];return db[_0xbdc2('0x4b')]['findAll']({'where':{'id':_0x24fbfa},'attributes':['id'],'include':[{'model':db[_0xbdc2('0x43')],'as':'Agents','attributes':['id',_0xbdc2('0x1c'),_0xbdc2('0x52'),_0xbdc2('0x53'),_0xbdc2('0x54')],'raw':!![]}]})[_0xbdc2('0x16')](function(_0x33b504){if(_0x33b504){var _0xc48eb6=_[_0xbdc2('0x55')](_0x33b504,function(_0x3ca6a1){var _0x44d04e=_0x3ca6a1[_0xbdc2('0x17')]({'plain':!![]});return _0x44d04e['Agents'];});return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x34a0f8[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](function(_0x458979){return db['sequelize'][_0xbdc2('0x56')](function(_0x5b63df){return _0x458979[_0xbdc2('0x57')](_0x24fbfa,{'transaction':_0x5b63df})[_0xbdc2('0x16')](function(){return BPromise[_0xbdc2('0x58')](_0xc48eb6,function(_0x1d5ed2){return db[_0xbdc2('0x3d')][_0xbdc2('0x59')]({'where':{'UserId':_0x1d5ed2['id'],'ChatQueueId':_0x34a0f8[_0xbdc2('0x2a')]['id']},'transaction':_0x5b63df});});})[_0xbdc2('0x16')](function(){_0xc48eb6[_0xbdc2('0x5a')](function(_0x3fb7f1){socket[_0xbdc2('0x5b')]('userChatQueue:save',{'UserId':_0x3fb7f1['id'],'ChatQueueId':_0x458979['id']});});});});});}})[_0xbdc2('0x16')](respondWithStatusCode(_0x4e2c2d,null))['catch'](handleError(_0x4e2c2d,null));};exports[_0xbdc2('0x5c')]=function(_0x30700f,_0x182cae){return db[_0xbdc2('0x4b')]['findAll']({'where':{'id':_0x30700f[_0xbdc2('0x2d')][_0xbdc2('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x182cae,null))['then'](function(_0x292e79){var _0xecf9d7=_[_0xbdc2('0x1f')](_0x292e79,'id');var _0x32b137=[];var _0x17303c=[];var _0x448ad6=squel[_0xbdc2('0x5d')]();_0x448ad6[_0xbdc2('0x5e')](_0xbdc2('0x5f'))[_0xbdc2('0x60')](_0xbdc2('0x61'),'tq')[_0xbdc2('0x62')]('user_has_teams','ut',_0xbdc2('0x63'))['where'](_0xbdc2('0x64'),_0x30700f[_0xbdc2('0x2a')]['id']);for(var _0x3cf7d9=0x0;_0x3cf7d9<_0x292e79[_0xbdc2('0x50')];_0x3cf7d9+=0x1){let _0x2cfcbf=_0x292e79[_0x3cf7d9];for(var _0x73afe1=0x0;_0x73afe1<_0x2cfcbf[_0xbdc2('0x65')][_0xbdc2('0x50')];_0x73afe1+=0x1){let _0x21d9e0=_0x2cfcbf[_0xbdc2('0x65')][_0x73afe1];var _0x2a2aa4=_0x448ad6['clone']();_0x2a2aa4['where'](_0xbdc2('0x66'),_0x21d9e0['id']);_0x17303c[_0xbdc2('0x67')](db[_0xbdc2('0x68')][_0xbdc2('0x2d')](_0x2a2aa4[_0xbdc2('0x69')](),{'type':db[_0xbdc2('0x68')][_0xbdc2('0x6a')][_0xbdc2('0x6b')]})[_0xbdc2('0x16')](function(_0x1e8cab){if(_0x1e8cab[_0xbdc2('0x50')]===0x1){return _0x21d9e0['id'];}else{var _0x3b48e5=_['every'](_['map'](_0x1e8cab,_0xbdc2('0x6c')),function(_0x46fc79){return _[_0xbdc2('0x6d')](_0xecf9d7,_0x46fc79);});if(_0x3b48e5){return _0x21d9e0['id'];}}}));}}return BPromise[_0xbdc2('0x6e')](_0x17303c)[_0xbdc2('0x16')](function(_0x21dd49){_0x32b137=_(_0x32b137)[_0xbdc2('0x6f')](_0x21dd49)[_0xbdc2('0x70')]()[_0xbdc2('0x71')]();return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x30700f['params']['id']}})[_0xbdc2('0x16')](function(_0x4df595){return db['sequelize']['transaction'](function(_0x39d64f){return _0x4df595[_0xbdc2('0x5c')](_0x30700f[_0xbdc2('0x2d')]['ids'],{'transaction':_0x39d64f})[_0xbdc2('0x16')](function(){if(!_['isEmpty'](_0x32b137)){return _0x4df595[_0xbdc2('0x72')](_0x32b137,{'transaction':_0x39d64f});}})[_0xbdc2('0x16')](function(){_0x32b137[_0xbdc2('0x5a')](function(_0x4a941a){socket[_0xbdc2('0x5b')](_0xbdc2('0x73'),{'UserId':_0x4a941a,'ChatQueueId':_0x4df595['id']});});});});});});})[_0xbdc2('0x16')](respondWithStatusCode(_0x182cae,null))[_0xbdc2('0x28')](handleError(_0x182cae,null));};exports[_0xbdc2('0x74')]=function(_0x22b82,_0x1cd65c){return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x22b82[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x1cd65c,null))[_0xbdc2('0x16')](function(_0x58937a){if(_0x58937a){return _0x58937a['addAgents'](_0x22b82[_0xbdc2('0x36')]['ids'],_[_0xbdc2('0x75')](_0x22b82[_0xbdc2('0x36')],[_0xbdc2('0x51'),'id'])||{})['spread'](function(_0xd0e7ac){for(var _0x1b41c5=0x0;_0x1b41c5<_0x22b82[_0xbdc2('0x36')][_0xbdc2('0x51')][_0xbdc2('0x50')];_0x1b41c5+=0x1){socket['emit'](_0xbdc2('0x76'),{'UserId':Number(_0x22b82[_0xbdc2('0x36')]['ids'][_0x1b41c5]),'ChatQueueId':Number(_0x22b82[_0xbdc2('0x2a')]['id'])});}return _0xd0e7ac;});}})['then'](respondWithResult(_0x1cd65c,null))[_0xbdc2('0x28')](handleError(_0x1cd65c,null));};exports[_0xbdc2('0x72')]=function(_0x22bc7b,_0x3c4822){return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x22bc7b[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x3c4822,null))[_0xbdc2('0x16')](function(_0x309ddc){if(_0x309ddc){return _0x309ddc[_0xbdc2('0x72')](_0x22bc7b[_0xbdc2('0x2d')][_0xbdc2('0x51')])[_0xbdc2('0x16')](function(){if(_[_0xbdc2('0x77')](_0x22bc7b['query'][_0xbdc2('0x51')])){for(var _0x322c57=0x0;_0x322c57<_0x22bc7b[_0xbdc2('0x2d')][_0xbdc2('0x51')][_0xbdc2('0x50')];_0x322c57+=0x1){socket[_0xbdc2('0x5b')](_0xbdc2('0x73'),{'UserId':Number(_0x22bc7b['query'][_0xbdc2('0x51')][_0x322c57]),'ChatQueueId':Number(_0x22bc7b['params']['id'])});}}else{socket[_0xbdc2('0x5b')](_0xbdc2('0x73'),{'UserId':Number(_0x22bc7b[_0xbdc2('0x2d')][_0xbdc2('0x51')]),'ChatQueueId':Number(_0x22bc7b[_0xbdc2('0x2a')]['id'])});}});}})[_0xbdc2('0x16')](respondWithStatusCode(_0x3c4822,null))[_0xbdc2('0x28')](handleError(_0x3c4822,null));};exports['getAgents']=function(_0x18d501,_0x1eda3a){var _0x3948aa={};var _0x22b9c8={};var _0x178d7;var _0x49940b;return db[_0xbdc2('0x20')][_0xbdc2('0x3c')]({'where':{'id':_0x18d501['params']['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x1eda3a,null))['then'](function(_0x2e09dc){if(_0x2e09dc){_0x178d7=_0x2e09dc;_0x22b9c8[_0xbdc2('0x2b')]=_[_0xbdc2('0x2c')](db[_0xbdc2('0x43')][_0xbdc2('0x21')]);_0x22b9c8[_0xbdc2('0x2d')]=_['keys'](_0x18d501[_0xbdc2('0x2d')]);_0x22b9c8[_0xbdc2('0x3e')]=_[_0xbdc2('0x2e')](_0x22b9c8['model'],_0x22b9c8['query']);_0x3948aa['attributes']=_[_0xbdc2('0x2e')](_0x22b9c8[_0xbdc2('0x2b')],qs[_0xbdc2('0x30')](_0x18d501[_0xbdc2('0x2d')][_0xbdc2('0x30')]));_0x3948aa[_0xbdc2('0x2f')]=_0x3948aa[_0xbdc2('0x2f')]['length']?_0x3948aa[_0xbdc2('0x2f')]:_0x22b9c8[_0xbdc2('0x2b')];_0x3948aa[_0xbdc2('0x4c')]=qs[_0xbdc2('0x41')](_0x18d501[_0xbdc2('0x2d')][_0xbdc2('0x41')]);_0x3948aa[_0xbdc2('0x42')]=qs['filters'](_[_0xbdc2('0x4d')](_0x18d501['query'],_0x22b9c8[_0xbdc2('0x3e')]));if(_0x18d501['query'][_0xbdc2('0x4e')]){_0x3948aa[_0xbdc2('0x42')]=_[_0xbdc2('0x32')](_0x3948aa[_0xbdc2('0x42')],{'$or':_['map'](_0x3948aa['attributes'],function(_0x4157c6){var _0xbe3097={};_0xbe3097[_0x4157c6]={'$like':'%'+_0x18d501[_0xbdc2('0x2d')]['filter']+'%'};return _0xbe3097;})});}_0x3948aa=_[_0xbdc2('0x32')]({},_0x3948aa,_0x18d501['options']);return _0x178d7['getAgents'](_0x3948aa);}})[_0xbdc2('0x16')](function(_0x5f2672){if(_0x5f2672){_0x49940b=_0x5f2672[_0xbdc2('0x50')];if(!_0x18d501[_0xbdc2('0x2d')][_0xbdc2('0x3f')](_0xbdc2('0x40'))){_0x3948aa['limit']=qs[_0xbdc2('0xf')](_0x18d501[_0xbdc2('0x2d')]['limit']);_0x3948aa[_0xbdc2('0xe')]=qs[_0xbdc2('0xe')](_0x18d501['query'][_0xbdc2('0xe')]);}return _0x178d7[_0xbdc2('0x78')](_0x3948aa);}})[_0xbdc2('0x16')](function(_0x315cba){if(_0x315cba){return _0x315cba?{'count':_0x49940b,'rows':_0x315cba}:null;}})[_0xbdc2('0x16')](respondWithResult(_0x1eda3a,null))[_0xbdc2('0x28')](handleError(_0x1eda3a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index df51624..4727016 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e8e=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x3356f0,_0x230069){var _0x33de59=function(_0x19b8da){while(--_0x19b8da){_0x3356f0['push'](_0x3356f0['shift']());}};_0x33de59(++_0x230069);}(_0x7e8e,0x91));var _0xe7e8=function(_0x3849ff,_0x4ae25e){_0x3849ff=_0x3849ff-0x0;var _0x3ab676=_0x7e8e[_0x3849ff];return _0x3ab676;};'use strict';var EventEmitter=require(_0xe7e8('0x0'));var ChatQueue=require(_0xe7e8('0x1'))['db'][_0xe7e8('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe7e8('0x3')](0x0);var events={'afterCreate':_0xe7e8('0x4'),'afterUpdate':_0xe7e8('0x5'),'afterDestroy':_0xe7e8('0x6')};function emitEvent(_0xd0a13b){return function(_0x3c3670,_0x143dc7,_0x533317){ChatQueueEvents['emit'](_0xd0a13b+':'+_0x3c3670['id'],_0x3c3670);ChatQueueEvents[_0xe7e8('0x7')](_0xd0a13b,_0x3c3670);_0x533317(null);};}for(var e in events){if(events[_0xe7e8('0x8')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xe7e8('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x0141=['../../mysqldb','ChatQueue','save','update','remove','emit','hook','exports','events'];(function(_0x277541,_0x5e4f04){var _0x531d89=function(_0x151a5b){while(--_0x151a5b){_0x277541['push'](_0x277541['shift']());}};_0x531d89(++_0x5e4f04);}(_0x0141,0x104));var _0x1014=function(_0x4a7501,_0x135d07){_0x4a7501=_0x4a7501-0x0;var _0x5b1a76=_0x0141[_0x4a7501];return _0x5b1a76;};'use strict';var EventEmitter=require(_0x1014('0x0'));var ChatQueue=require(_0x1014('0x1'))['db'][_0x1014('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1014('0x3'),'afterUpdate':_0x1014('0x4'),'afterDestroy':_0x1014('0x5')};function emitEvent(_0x5ef913){return function(_0x4748e7,_0x127683,_0x3d66ae){ChatQueueEvents[_0x1014('0x6')](_0x5ef913+':'+_0x4748e7['id'],_0x4748e7);ChatQueueEvents[_0x1014('0x6')](_0x5ef913,_0x4748e7);_0x3d66ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1014('0x7')](e,emitEvent(event));}}module[_0x1014('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index aa7cf3e..547ea44 100644
--- a/server/api/chatQueue/chatQueue.model.js
+++ b/server/api/chatQueue/chatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x724c=['rimraf','./chatQueue.attributes','define','ChatQueue','util','moment','bluebird','request-promise','path'];(function(_0xf1a50a,_0xf21556){var _0x19c1d3=function(_0x163be7){while(--_0x163be7){_0xf1a50a['push'](_0xf1a50a['shift']());}};_0x19c1d3(++_0xf21556);}(_0x724c,0xd3));var _0xc724=function(_0x4e1d60,_0x4e93ef){_0x4e1d60=_0x4e1d60-0x0;var _0x39cd7a=_0x724c[_0x4e1d60];return _0x39cd7a;};'use strict';var _=require('lodash');var util=require(_0xc724('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc724('0x1'));var BPromise=require(_0xc724('0x2'));var rp=require(_0xc724('0x3'));var fs=require('fs');var path=require(_0xc724('0x4'));var rimraf=require(_0xc724('0x5'));var config=require('../../config/environment');var attributes=require(_0xc724('0x6'));module['exports']=function(_0x5a70fe,_0x214ff2){return _0x5a70fe[_0xc724('0x7')](_0xc724('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc753=['request-promise','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x38c5bb,_0x153bdb){var _0x5cbd09=function(_0xe17565){while(--_0xe17565){_0x38c5bb['push'](_0x38c5bb['shift']());}};_0x5cbd09(++_0x153bdb);}(_0xc753,0x193));var _0x3c75=function(_0x4cca37,_0x4319e6){_0x4cca37=_0x4cca37-0x0;var _0x365981=_0xc753[_0x4cca37];return _0x365981;};'use strict';var _=require('lodash');var util=require(_0x3c75('0x0'));var logger=require(_0x3c75('0x1'))(_0x3c75('0x2'));var moment=require(_0x3c75('0x3'));var BPromise=require(_0x3c75('0x4'));var rp=require(_0x3c75('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c75('0x6'));var config=require('../../config/environment');var attributes=require(_0x3c75('0x7'));module[_0x3c75('0x8')]=function(_0xb84f8e,_0x1c0134){return _0xb84f8e[_0x3c75('0x9')](_0x3c75('0xa'),attributes,{'tableName':_0x3c75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index a965163..9de173c 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x77f1=['then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','register','request'];(function(_0x48af02,_0xa58dcf){var _0xa8280a=function(_0x46c7f9){while(--_0x46c7f9){_0x48af02['push'](_0x48af02['shift']());}};_0xa8280a(++_0xa58dcf);}(_0x77f1,0x1dd));var _0x177f=function(_0x1c7fe7,_0x13f754){_0x1c7fe7=_0x1c7fe7-0x0;var _0x366cff=_0x77f1[_0x1c7fe7];return _0x366cff;};'use strict';var _=require('lodash');var util=require(_0x177f('0x0'));var moment=require(_0x177f('0x1'));var BPromise=require(_0x177f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x177f('0x3'));var logger=require(_0x177f('0x4'))('rpc');var config=require(_0x177f('0x5'));var jayson=require(_0x177f('0x6'));var client=jayson[_0x177f('0x7')][_0x177f('0x8')]({'port':0x232a});config[_0x177f('0x9')]=_['defaults'](config[_0x177f('0x9')],{'host':_0x177f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x177f('0x9')]));require('./chatQueue.socket')[_0x177f('0xb')](socket);function respondWithRpcPromise(_0x4e1bab,_0x2050c2,_0x38989d){return new BPromise(function(_0x47ccab,_0x42d6d2){return client[_0x177f('0xc')](_0x4e1bab,_0x38989d)[_0x177f('0xd')](function(_0xf5086c){logger[_0x177f('0xe')](_0x177f('0xf'),_0x2050c2,_0x177f('0x10'));logger[_0x177f('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2050c2,_0x177f('0x10'),JSON[_0x177f('0x12')](_0xf5086c));if(_0xf5086c[_0x177f('0x13')]){if(_0xf5086c[_0x177f('0x13')]['code']===0x1f4){logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0xf5086c[_0x177f('0x13')]['message']);return _0x42d6d2(_0xf5086c['error'][_0x177f('0x14')]);}logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0xf5086c[_0x177f('0x13')][_0x177f('0x14')]);return _0x47ccab(_0xf5086c[_0x177f('0x13')][_0x177f('0x14')]);}else{logger[_0x177f('0xe')](_0x177f('0xf'),_0x2050c2,_0x177f('0x10'));_0x47ccab(_0xf5086c['result'][_0x177f('0x14')]);}})[_0x177f('0x15')](function(_0x4d1c1e){logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0x4d1c1e);_0x42d6d2(_0x4d1c1e);});});}exports[_0x177f('0x16')]=function(_0x3cccbf){var _0x3ff483=this;return new Promise(function(_0x4649f0,_0x40f6ed){return db[_0x177f('0x17')][_0x177f('0x18')]({'raw':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf['options'][_0x177f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf[_0x177f('0x19')][_0x177f('0x1b')]||null:null,'attributes':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf[_0x177f('0x19')][_0x177f('0x1c')]||null:null,'limit':_0x3cccbf['options']?_0x3cccbf['options'][_0x177f('0x1d')]||null:null,'include':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf[_0x177f('0x19')][_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x3cccbf[_0x177f('0x19')]['include'],function(_0x248e4c){return{'model':db[_0x248e4c[_0x177f('0x20')]],'as':_0x248e4c['as'],'attributes':_0x248e4c[_0x177f('0x1c')],'include':_0x248e4c[_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x248e4c[_0x177f('0x1e')],function(_0x1a8e92){return{'model':db[_0x1a8e92[_0x177f('0x20')]],'as':_0x1a8e92['as'],'attributes':_0x1a8e92[_0x177f('0x1c')],'include':_0x1a8e92[_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x1a8e92[_0x177f('0x1e')],function(_0x25d876){return{'model':db[_0x25d876[_0x177f('0x20')]],'as':_0x25d876['as'],'attributes':_0x25d876[_0x177f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfa8ad0){logger[_0x177f('0xe')]('GetChatQueue',_0x3cccbf);logger[_0x177f('0x11')](_0x177f('0x16'),_0x3cccbf,JSON['stringify'](_0xfa8ad0));_0x4649f0(_0xfa8ad0);})[_0x177f('0x15')](function(_0x27cfb3){logger['error']('GetChatQueue',_0x27cfb3['message'],_0x3cccbf);_0x40f6ed(_0x3ff483['error'](0x1f4,_0x27cfb3[_0x177f('0x14')]));});});};exports[_0x177f('0x21')]=function(_0x6cc694){var _0x15681b=this;return new Promise(function(_0xcf2134,_0x99a037){return db[_0x177f('0x17')][_0x177f('0x22')]({'raw':_0x6cc694[_0x177f('0x19')]?_0x6cc694[_0x177f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x6cc694[_0x177f('0x19')]?_0x6cc694[_0x177f('0x19')]['where']||null:null,'attributes':_0x6cc694[_0x177f('0x19')]?_0x6cc694[_0x177f('0x19')]['attributes']||null:null,'include':_0x6cc694['options']?_0x6cc694[_0x177f('0x19')][_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x6cc694[_0x177f('0x19')]['include'],function(_0x5c0033){return{'model':db[_0x5c0033[_0x177f('0x20')]],'as':_0x5c0033['as'],'attributes':_0x5c0033[_0x177f('0x1c')],'include':_0x5c0033[_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x5c0033[_0x177f('0x1e')],function(_0x25659d){return{'model':db[_0x25659d[_0x177f('0x20')]],'as':_0x25659d['as'],'attributes':_0x25659d['attributes'],'include':_0x25659d[_0x177f('0x1e')]?_['map'](_0x25659d[_0x177f('0x1e')],function(_0x23b8c9){return{'model':db[_0x23b8c9['model']],'as':_0x23b8c9['as'],'attributes':_0x23b8c9[_0x177f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x177f('0xd')](function(_0x408154){logger[_0x177f('0xe')]('ShowChatQueue',_0x6cc694);logger['debug']('ShowChatQueue',_0x6cc694,JSON[_0x177f('0x12')](_0x408154));_0xcf2134(_0x408154);})[_0x177f('0x15')](function(_0x47532c){logger[_0x177f('0x13')](_0x177f('0x21'),_0x47532c[_0x177f('0x14')],_0x6cc694);_0x99a037(_0x15681b[_0x177f('0x13')](0x1f4,_0x47532c[_0x177f('0x14')]));});});};
\ No newline at end of file
+var _0x531a=['jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowChatQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xf16af5,_0x358d22){var _0x41d3f1=function(_0x168618){while(--_0x168618){_0xf16af5['push'](_0xf16af5['shift']());}};_0x41d3f1(++_0x358d22);}(_0x531a,0x100));var _0xa531=function(_0x35563c,_0x1393e9){_0x35563c=_0x35563c-0x0;var _0x2a763c=_0x531a[_0x35563c];return _0x2a763c;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});config[_0xa531('0xc')]=_[_0xa531('0xd')](config[_0xa531('0xc')],{'host':_0xa531('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa531('0xc')]));require(_0xa531('0xf'))['register'](socket);function respondWithRpcPromise(_0x190db4,_0x3eebc8,_0x10f6e0){return new BPromise(function(_0x3eb94f,_0x3e25a8){return client['request'](_0x190db4,_0x10f6e0)[_0xa531('0x10')](function(_0x4df80e){logger[_0xa531('0x11')](_0xa531('0x12'),_0x3eebc8,_0xa531('0x13'));logger['debug'](_0xa531('0x14'),_0x3eebc8,_0xa531('0x13'),JSON['stringify'](_0x4df80e));if(_0x4df80e[_0xa531('0x15')]){if(_0x4df80e[_0xa531('0x15')]['code']===0x1f4){logger[_0xa531('0x15')](_0xa531('0x12'),_0x3eebc8,_0x4df80e[_0xa531('0x15')]['message']);return _0x3e25a8(_0x4df80e['error']['message']);}logger[_0xa531('0x15')](_0xa531('0x12'),_0x3eebc8,_0x4df80e[_0xa531('0x15')][_0xa531('0x16')]);return _0x3eb94f(_0x4df80e[_0xa531('0x15')][_0xa531('0x16')]);}else{logger['info'](_0xa531('0x12'),_0x3eebc8,'request\x20sent');_0x3eb94f(_0x4df80e[_0xa531('0x17')][_0xa531('0x16')]);}})['catch'](function(_0x4eb512){logger[_0xa531('0x15')](_0xa531('0x12'),_0x3eebc8,_0x4eb512);_0x3e25a8(_0x4eb512);});});}exports[_0xa531('0x18')]=function(_0x55a731){var _0x42b629=this;return new Promise(function(_0x468b75,_0x4096f0){return db['ChatQueue'][_0xa531('0x19')]({'raw':_0x55a731[_0xa531('0x1a')]?_0x55a731['options'][_0xa531('0x1b')]===undefined?!![]:![]:!![],'where':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')][_0xa531('0x1c')]||null:null,'attributes':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')][_0xa531('0x1d')]||null:null,'limit':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')][_0xa531('0x1e')]||null:null,'include':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')]['include']?_[_0xa531('0x1f')](_0x55a731[_0xa531('0x1a')][_0xa531('0x20')],function(_0x487a8c){return{'model':db[_0x487a8c[_0xa531('0x21')]],'as':_0x487a8c['as'],'attributes':_0x487a8c[_0xa531('0x1d')],'include':_0x487a8c['include']?_['map'](_0x487a8c[_0xa531('0x20')],function(_0x56b96d){return{'model':db[_0x56b96d[_0xa531('0x21')]],'as':_0x56b96d['as'],'attributes':_0x56b96d[_0xa531('0x1d')],'include':_0x56b96d['include']?_[_0xa531('0x1f')](_0x56b96d['include'],function(_0x36a8e6){return{'model':db[_0x36a8e6['model']],'as':_0x36a8e6['as'],'attributes':_0x36a8e6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27bd5c){logger[_0xa531('0x11')]('GetChatQueue',_0x55a731);logger['debug'](_0xa531('0x18'),_0x55a731,JSON['stringify'](_0x27bd5c));_0x468b75(_0x27bd5c);})[_0xa531('0x22')](function(_0x133431){logger['error'](_0xa531('0x18'),_0x133431[_0xa531('0x16')],_0x55a731);_0x4096f0(_0x42b629[_0xa531('0x15')](0x1f4,_0x133431['message']));});});};exports[_0xa531('0x23')]=function(_0x3c3376){var _0x4b8104=this;return new Promise(function(_0x2fc577,_0x13c270){return db['ChatQueue'][_0xa531('0x24')]({'raw':_0x3c3376[_0xa531('0x1a')]?_0x3c3376[_0xa531('0x1a')][_0xa531('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c3376[_0xa531('0x1a')]?_0x3c3376[_0xa531('0x1a')][_0xa531('0x1c')]||null:null,'attributes':_0x3c3376['options']?_0x3c3376['options'][_0xa531('0x1d')]||null:null,'include':_0x3c3376[_0xa531('0x1a')]?_0x3c3376[_0xa531('0x1a')][_0xa531('0x20')]?_[_0xa531('0x1f')](_0x3c3376['options'][_0xa531('0x20')],function(_0x3b1ba7){return{'model':db[_0x3b1ba7[_0xa531('0x21')]],'as':_0x3b1ba7['as'],'attributes':_0x3b1ba7[_0xa531('0x1d')],'include':_0x3b1ba7[_0xa531('0x20')]?_[_0xa531('0x1f')](_0x3b1ba7[_0xa531('0x20')],function(_0x24efee){return{'model':db[_0x24efee[_0xa531('0x21')]],'as':_0x24efee['as'],'attributes':_0x24efee[_0xa531('0x1d')],'include':_0x24efee[_0xa531('0x20')]?_['map'](_0x24efee[_0xa531('0x20')],function(_0x311aee){return{'model':db[_0x311aee[_0xa531('0x21')]],'as':_0x311aee['as'],'attributes':_0x311aee[_0xa531('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa531('0x10')](function(_0x4eae17){logger[_0xa531('0x11')](_0xa531('0x23'),_0x3c3376);logger[_0xa531('0x25')](_0xa531('0x23'),_0x3c3376,JSON['stringify'](_0x4eae17));_0x2fc577(_0x4eae17);})[_0xa531('0x22')](function(_0x297c78){logger[_0xa531('0x15')]('ShowChatQueue',_0x297c78['message'],_0x3c3376);_0x13c270(_0x4b8104[_0xa531('0x15')](0x1f4,_0x297c78['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index fe51aff..962ccc1 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x303a=['removeListener','register','length','./chatQueue.events','remove','update','emit'];(function(_0x3445fc,_0xe740b8){var _0x4534c2=function(_0x1fe7dc){while(--_0x1fe7dc){_0x3445fc['push'](_0x3445fc['shift']());}};_0x4534c2(++_0xe740b8);}(_0x303a,0x1a0));var _0xa303=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x303a[_0x20845e];return _0x28cf2b;};'use strict';var ChatQueueEvents=require(_0xa303('0x0'));var events=['save',_0xa303('0x1'),_0xa303('0x2')];function createListener(_0x36e548,_0x19d27a){return function(_0x594b49){_0x19d27a[_0xa303('0x3')](_0x36e548,_0x594b49);};}function removeListener(_0x26b47c,_0x38a354){return function(){ChatQueueEvents[_0xa303('0x4')](_0x26b47c,_0x38a354);};}exports[_0xa303('0x5')]=function(_0x1c7ee9){for(var _0x2bc3d7=0x0,_0x3f61f1=events[_0xa303('0x6')];_0x2bc3d7<_0x3f61f1;_0x2bc3d7++){var _0x5d95fd=events[_0x2bc3d7];var _0x51e1ee=createListener('chatQueue:'+_0x5d95fd,_0x1c7ee9);ChatQueueEvents['on'](_0x5d95fd,_0x51e1ee);}};
\ No newline at end of file
+var _0x9a19=['removeListener','register','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9a19,0x114));var _0x99a1=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x9a19[_0x45bf86];return _0x1f02b7;};'use strict';var ChatQueueEvents=require(_0x99a1('0x0'));var events=[_0x99a1('0x1'),_0x99a1('0x2'),'update'];function createListener(_0x16fd8b,_0x2ba463){return function(_0x112bcc){_0x2ba463[_0x99a1('0x3')](_0x16fd8b,_0x112bcc);};}function removeListener(_0x214082,_0x3d73c5){return function(){ChatQueueEvents[_0x99a1('0x4')](_0x214082,_0x3d73c5);};}exports[_0x99a1('0x5')]=function(_0x3eff4a){for(var _0xff0240=0x0,_0x65045d=events['length'];_0xff0240<_0x65045d;_0xff0240++){var _0x4d2a5c=events[_0xff0240];var _0x5aa6c2=createListener(_0x99a1('0x6')+_0x4d2a5c,_0x3eff4a);ChatQueueEvents['on'](_0x4d2a5c,_0x5aa6c2);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 698ad40..ea289ef 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x532d14,_0x285b6b){var _0x2e636f=function(_0x594503){while(--_0x594503){_0x532d14['push'](_0x532d14['shift']());}};_0x2e636f(++_0x285b6b);}(_0x008c,0x188));var _0xc008=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x008c[_0x320b8e];return _0x55a10a;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x4e16f2,_0x24ba3b){_0x4e16f2=_0x4e16f2-0x0;var _0x77bca4=_0x3e74[_0x4e16f2];return _0x77bca4;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 777e422..2e0b0ce 100644
--- a/server/api/chatQueueReport/chatQueueReport.attributes.js
+++ b/server/api/chatQueueReport/chatQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9fe1=['moment','exports','STRING','DATE'];(function(_0x3a5b58,_0x1a206f){var _0x230d94=function(_0xcb4681){while(--_0xcb4681){_0x3a5b58['push'](_0x3a5b58['shift']());}};_0x230d94(++_0x1a206f);}(_0x9fe1,0x18c));var _0x19fe=function(_0x266d00,_0x3cd3b8){_0x266d00=_0x266d00-0x0;var _0x3a5690=_0x9fe1[_0x266d00];return _0x3a5690;};'use strict';var moment=require(_0x19fe('0x0'));var Sequelize=require('sequelize');module[_0x19fe('0x1')]={'uniqueid':{'type':Sequelize[_0x19fe('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x19fe('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x19fe('0x3')]},'exitAt':{'type':Sequelize[_0x19fe('0x3')]},'reason':{'type':Sequelize[_0x19fe('0x2')]}};
\ No newline at end of file
+var _0x38db=['sequelize','exports','STRING','DATE','moment'];(function(_0x46e4da,_0x448bf3){var _0x4db797=function(_0x4f2eaa){while(--_0x4f2eaa){_0x46e4da['push'](_0x46e4da['shift']());}};_0x4db797(++_0x448bf3);}(_0x38db,0x18a));var _0xb38d=function(_0x3fc9af,_0x9bb776){_0x3fc9af=_0x3fc9af-0x0;var _0x3574c0=_0x38db[_0x3fc9af];return _0x3574c0;};'use strict';var moment=require(_0xb38d('0x0'));var Sequelize=require(_0xb38d('0x1'));module[_0xb38d('0x2')]={'uniqueid':{'type':Sequelize[_0xb38d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb38d('0x3')]},'joinAt':{'type':Sequelize[_0xb38d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb38d('0x4')]},'exitAt':{'type':Sequelize[_0xb38d('0x4')]},'reason':{'type':Sequelize[_0xb38d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index a6b60d7..e6d204e 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x17d76b,_0x54345b){var _0x16f3ac=function(_0x315442){while(--_0x315442){_0x17d76b['push'](_0x17d76b['shift']());}};_0x16f3ac(++_0x54345b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')](_0x5a7f6e['body'],{})['then'](respondWithResult(_0x244950,0xc9))[_0xac4a('0x44')](handleError(_0x244950,null));};exports['update']=function(_0x18ae96,_0x566258){if(_0x18ae96[_0xac4a('0x4a')]['id']){delete _0x18ae96['body']['id'];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'id':_0x18ae96[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x566258,null))['then'](saveUpdates(_0x18ae96[_0xac4a('0x4a')],null))[_0xac4a('0x24')](respondWithResult(_0x566258,null))[_0xac4a('0x44')](handleError(_0x566258,null));};exports[_0xac4a('0x25')]=function(_0x2f30e2,_0x138876){return db[_0xac4a('0x2c')]['find']({'where':{'id':_0x2f30e2[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x138876,null))['then'](removeEntity(_0x138876,null))[_0xac4a('0x44')](handleError(_0x138876,null));};exports[_0xac4a('0x4c')]=function(_0x26e716,_0x3ac36e){return db['ChatQueueReport'][_0xac4a('0x4c')]()[_0xac4a('0x24')](respondWithResult(_0x3ac36e,null))[_0xac4a('0x44')](handleError(_0x3ac36e,null));};
\ No newline at end of file
+var _0x9303=['order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','create','body','find','describe','eml-format','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','apply','save','update','then','destroy','end','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x9303,0xd7));var _0x3930=function(_0x37810c,_0x480382){_0x37810c=_0x37810c-0x0;var _0x44c4ef=_0x9303[_0x37810c];return _0x44c4ef;};'use strict';var emlformat=require(_0x3930('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3930('0x1'));var rp=require('request-promise');var moment=require(_0x3930('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3930('0x3'));var path=require(_0x3930('0x4'));var sox=require(_0x3930('0x5'));var csv=require(_0x3930('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3930('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3930('0x8'));var jsforce=require(_0x3930('0x9'));var deskjs=require(_0x3930('0xa'));var toCsv=require(_0x3930('0x6'));var querystring=require(_0x3930('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3930('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3930('0xd'))(_0x3930('0xe'));var utils=require(_0x3930('0xf'));var config=require(_0x3930('0x10'));var licenseUtil=require(_0x3930('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13b928,_0x55130d){_0x55130d=_0x55130d||0xcc;return function(_0x185659){if(_0x185659){return _0x13b928[_0x3930('0x12')](_0x55130d);}return _0x13b928[_0x3930('0x13')](_0x55130d)['end']();};}function respondWithResult(_0x11b256,_0x15f039){_0x15f039=_0x15f039||0xc8;return function(_0x4ef6c4){if(_0x4ef6c4){return _0x11b256[_0x3930('0x13')](_0x15f039)[_0x3930('0x14')](_0x4ef6c4);}};}function respondWithFilteredResult(_0x3bc35e,_0x135498){return function(_0x5db060){if(_0x5db060){var _0x55ec9b=typeof _0x135498[_0x3930('0x15')]==='undefined'&&typeof _0x135498[_0x3930('0x16')]==='undefined';var _0x4113c4=_0x5db060[_0x3930('0x17')];var _0x5a1c39=_0x55ec9b?0x0:_0x135498['offset'];var _0x4b02b6=_0x55ec9b?_0x5db060[_0x3930('0x17')]:_0x135498[_0x3930('0x15')]+_0x135498[_0x3930('0x16')];var _0x5b5f55;if(_0x4b02b6>=_0x4113c4){_0x4b02b6=_0x4113c4;_0x5b5f55=0xc8;}else{_0x5b5f55=0xce;}_0x3bc35e['status'](_0x5b5f55);return _0x3bc35e['set']('Content-Range',_0x5a1c39+'-'+_0x4b02b6+'/'+_0x4113c4)[_0x3930('0x14')](_0x5db060);}return null;};}function patchUpdates(_0x2ba9ba){return function(_0x2e650d){try{jsonpatch[_0x3930('0x18')](_0x2e650d,_0x2ba9ba,!![]);}catch(_0x3d2a2f){return BPromise['reject'](_0x3d2a2f);}return _0x2e650d[_0x3930('0x19')]();};}function saveUpdates(_0x315f73,_0x1c5f4a){return function(_0x4a4307){if(_0x4a4307){return _0x4a4307[_0x3930('0x1a')](_0x315f73)[_0x3930('0x1b')](function(_0x12eeb7){return _0x12eeb7;});}return null;};}function removeEntity(_0x3a0e16,_0x2bcc3b){return function(_0x186e2e){if(_0x186e2e){return _0x186e2e[_0x3930('0x1c')]()[_0x3930('0x1b')](function(){_0x3a0e16['status'](0xcc)[_0x3930('0x1d')]();});}};}function handleEntityNotFound(_0x1dcdcd,_0x187453){return function(_0x11358e){if(!_0x11358e){_0x1dcdcd[_0x3930('0x12')](0x194);}return _0x11358e;};}function handleError(_0x5b4c56,_0x276940){_0x276940=_0x276940||0x1f4;return function(_0x7b6825){logger[_0x3930('0x1e')](_0x7b6825['stack']);if(_0x7b6825[_0x3930('0x1f')]){delete _0x7b6825[_0x3930('0x1f')];}_0x5b4c56[_0x3930('0x13')](_0x276940)[_0x3930('0x20')](_0x7b6825);};}exports[_0x3930('0x21')]=function(_0x575e76,_0x447d71){var _0x121cce={},_0xca904a={},_0x51ceb9={'count':0x0,'rows':[]};var _0x3b9168=_[_0x3930('0x22')](db[_0x3930('0x23')][_0x3930('0x24')],function(_0x11290d){return{'name':_0x11290d[_0x3930('0x25')],'type':_0x11290d[_0x3930('0x26')][_0x3930('0x27')]};});_0xca904a[_0x3930('0x28')]=_[_0x3930('0x22')](_0x3b9168,_0x3930('0x1f'));_0xca904a[_0x3930('0x29')]=_[_0x3930('0x2a')](_0x575e76[_0x3930('0x29')]);_0xca904a[_0x3930('0x2b')]=_[_0x3930('0x2c')](_0xca904a[_0x3930('0x28')],_0xca904a[_0x3930('0x29')]);_0x121cce[_0x3930('0x2d')]=_[_0x3930('0x2c')](_0xca904a['model'],qs['fields'](_0x575e76['query'][_0x3930('0x2e')]));_0x121cce[_0x3930('0x2d')]=_0x121cce['attributes'][_0x3930('0x2f')]?_0x121cce[_0x3930('0x2d')]:_0xca904a['model'];if(!_0x575e76[_0x3930('0x29')]['hasOwnProperty'](_0x3930('0x30'))){_0x121cce[_0x3930('0x16')]=qs[_0x3930('0x16')](_0x575e76[_0x3930('0x29')][_0x3930('0x16')]);_0x121cce[_0x3930('0x15')]=qs[_0x3930('0x15')](_0x575e76[_0x3930('0x29')][_0x3930('0x15')]);}_0x121cce[_0x3930('0x31')]=qs[_0x3930('0x32')](_0x575e76[_0x3930('0x29')][_0x3930('0x32')]);_0x121cce[_0x3930('0x33')]=qs[_0x3930('0x2b')](_[_0x3930('0x34')](_0x575e76['query'],_0xca904a[_0x3930('0x2b')]),_0x3b9168);if(_0x575e76['query'][_0x3930('0x35')]){_0x121cce['where']=_[_0x3930('0x36')](_0x121cce['where'],{'$or':_['map'](_0x3b9168,function(_0x37cb76){if(_0x37cb76[_0x3930('0x26')]!=='VIRTUAL'){var _0x4f1717={};_0x4f1717[_0x37cb76[_0x3930('0x1f')]]={'$like':'%'+_0x575e76['query'][_0x3930('0x35')]+'%'};return _0x4f1717;}})});}_0x121cce=_[_0x3930('0x36')]({},_0x121cce,_0x575e76[_0x3930('0x37')]);var _0x3a8c7e={'where':_0x121cce[_0x3930('0x33')]};return db[_0x3930('0x23')][_0x3930('0x17')](_0x3a8c7e)[_0x3930('0x1b')](function(_0x4d6a5b){_0x51ceb9['count']=_0x4d6a5b;if(_0x575e76[_0x3930('0x29')][_0x3930('0x38')]){_0x121cce['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x3930('0x39')](_0x121cce);})[_0x3930('0x1b')](function(_0x5cab01){_0x51ceb9['rows']=_0x5cab01;return _0x51ceb9;})['then'](respondWithFilteredResult(_0x447d71,_0x121cce))[_0x3930('0x3a')](handleError(_0x447d71,null));};exports[_0x3930('0x3b')]=function(_0x3ddc79,_0x1f9076){var _0x5cc6d8={'raw':!![],'where':{'id':_0x3ddc79[_0x3930('0x3c')]['id']}},_0x5e7718={};_0x5e7718['model']=_[_0x3930('0x2a')](db[_0x3930('0x23')]['rawAttributes']);_0x5e7718[_0x3930('0x29')]=_['keys'](_0x3ddc79[_0x3930('0x29')]);_0x5e7718[_0x3930('0x2b')]=_[_0x3930('0x2c')](_0x5e7718[_0x3930('0x28')],_0x5e7718[_0x3930('0x29')]);_0x5cc6d8[_0x3930('0x2d')]=_[_0x3930('0x2c')](_0x5e7718[_0x3930('0x28')],qs[_0x3930('0x2e')](_0x3ddc79[_0x3930('0x29')][_0x3930('0x2e')]));_0x5cc6d8[_0x3930('0x2d')]=_0x5cc6d8[_0x3930('0x2d')][_0x3930('0x2f')]?_0x5cc6d8[_0x3930('0x2d')]:_0x5e7718['model'];if(_0x3ddc79[_0x3930('0x29')][_0x3930('0x38')]){_0x5cc6d8[_0x3930('0x3d')]=[{'all':!![]}];}_0x5cc6d8=_[_0x3930('0x36')]({},_0x5cc6d8,_0x3ddc79[_0x3930('0x37')]);return db[_0x3930('0x23')]['find'](_0x5cc6d8)[_0x3930('0x1b')](handleEntityNotFound(_0x1f9076,null))[_0x3930('0x1b')](respondWithResult(_0x1f9076,null))[_0x3930('0x3a')](handleError(_0x1f9076,null));};exports[_0x3930('0x3e')]=function(_0x576beb,_0xc5d137){return db['ChatQueueReport'][_0x3930('0x3e')](_0x576beb['body'],{})['then'](respondWithResult(_0xc5d137,0xc9))[_0x3930('0x3a')](handleError(_0xc5d137,null));};exports[_0x3930('0x1a')]=function(_0x5cbb07,_0x2bdb26){if(_0x5cbb07[_0x3930('0x3f')]['id']){delete _0x5cbb07[_0x3930('0x3f')]['id'];}return db[_0x3930('0x23')]['find']({'where':{'id':_0x5cbb07[_0x3930('0x3c')]['id']}})[_0x3930('0x1b')](handleEntityNotFound(_0x2bdb26,null))[_0x3930('0x1b')](saveUpdates(_0x5cbb07[_0x3930('0x3f')],null))['then'](respondWithResult(_0x2bdb26,null))[_0x3930('0x3a')](handleError(_0x2bdb26,null));};exports[_0x3930('0x1c')]=function(_0x435735,_0x2efbb4){return db[_0x3930('0x23')][_0x3930('0x40')]({'where':{'id':_0x435735['params']['id']}})[_0x3930('0x1b')](handleEntityNotFound(_0x2efbb4,null))[_0x3930('0x1b')](removeEntity(_0x2efbb4,null))['catch'](handleError(_0x2efbb4,null));};exports[_0x3930('0x41')]=function(_0x5b2707,_0x28d074){return db[_0x3930('0x23')][_0x3930('0x41')]()[_0x3930('0x1b')](respondWithResult(_0x28d074,null))['catch'](handleError(_0x28d074,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 349b94e..5686701 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x12c944,_0x3a3a06){var _0xebfda5=function(_0x668806){while(--_0x668806){_0x12c944['push'](_0x12c944['shift']());}};_0xebfda5(++_0x3a3a06);}(_0x757a,0xde));var _0xa757=function(_0xb80757,_0x53340a){_0xb80757=_0xb80757-0x0;var _0x2daefe=_0x757a[_0xb80757];return _0x2daefe;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 84fd5dd..7dd3764 100644
--- a/server/api/chatQueueReport/chatQueueReport.rpc.js
+++ b/server/api/chatQueueReport/chatQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb79=['error','ChatQueueReport,\x20%s,\x20%s','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','debug','update','attributes','UpdateChatQueueReport','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x76baa8,_0xbc5f21){var _0xc6ca5f=function(_0x46a42c){while(--_0x46a42c){_0x76baa8['push'](_0x76baa8['shift']());}};_0xc6ca5f(++_0xbc5f21);}(_0xeb79,0x143));var _0x9eb7=function(_0x55732c,_0x4da144){_0x55732c=_0x55732c-0x0;var _0x24887a=_0xeb79[_0x55732c];return _0x24887a;};'use strict';var _=require(_0x9eb7('0x0'));var util=require(_0x9eb7('0x1'));var moment=require(_0x9eb7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9eb7('0x3'))['db'];var utils=require(_0x9eb7('0x4'));var logger=require(_0x9eb7('0x5'))('rpc');var config=require(_0x9eb7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9eb7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x276ee1,_0x4ed9a3,_0x43074d){return new BPromise(function(_0x39b77a,_0x7acd19){return client[_0x9eb7('0x8')](_0x276ee1,_0x43074d)['then'](function(_0xbd2855){logger[_0x9eb7('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x4ed9a3,_0x9eb7('0xa'));logger['debug'](_0x9eb7('0xb'),_0x4ed9a3,_0x9eb7('0xa'),JSON[_0x9eb7('0xc')](_0xbd2855));if(_0xbd2855['error']){if(_0xbd2855[_0x9eb7('0xd')]['code']===0x1f4){logger[_0x9eb7('0xd')](_0x9eb7('0xe'),_0x4ed9a3,_0xbd2855[_0x9eb7('0xd')][_0x9eb7('0xf')]);return _0x7acd19(_0xbd2855[_0x9eb7('0xd')][_0x9eb7('0xf')]);}logger[_0x9eb7('0xd')](_0x9eb7('0xe'),_0x4ed9a3,_0xbd2855[_0x9eb7('0xd')]['message']);return _0x39b77a(_0xbd2855[_0x9eb7('0xd')][_0x9eb7('0xf')]);}else{logger[_0x9eb7('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x4ed9a3,'request\x20sent');_0x39b77a(_0xbd2855['result']['message']);}})[_0x9eb7('0x10')](function(_0x172aa6){logger[_0x9eb7('0xd')](_0x9eb7('0xe'),_0x4ed9a3,_0x172aa6);_0x7acd19(_0x172aa6);});});}exports[_0x9eb7('0x11')]=function(_0x1bb1ae){var _0x57a19b=this;return new Promise(function(_0x4c1398,_0x304f44){return db[_0x9eb7('0x12')][_0x9eb7('0x13')](_0x1bb1ae[_0x9eb7('0x14')],{'raw':_0x1bb1ae[_0x9eb7('0x15')]?_0x1bb1ae[_0x9eb7('0x15')][_0x9eb7('0x16')]===undefined?!![]:![]:!![]})[_0x9eb7('0x17')](function(_0x4a13c1){logger[_0x9eb7('0x9')]('CreateChatQueueReport',_0x1bb1ae);logger[_0x9eb7('0x18')](_0x9eb7('0x11'),_0x1bb1ae,JSON[_0x9eb7('0xc')](_0x4a13c1));_0x4c1398(_0x4a13c1);})['catch'](function(_0xb940ca){logger[_0x9eb7('0xd')](_0x9eb7('0x11'),_0xb940ca[_0x9eb7('0xf')],_0x1bb1ae);_0x304f44(_0x57a19b['error'](0x1f4,_0xb940ca[_0x9eb7('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x3624f2){var _0x460cd1=this;return new Promise(function(_0x2e924e,_0x4aea1f){return db['ChatQueueReport'][_0x9eb7('0x19')](_0x3624f2[_0x9eb7('0x14')],{'raw':_0x3624f2['options']?_0x3624f2[_0x9eb7('0x15')][_0x9eb7('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3624f2[_0x9eb7('0x15')]?_0x3624f2[_0x9eb7('0x15')]['where']||null:null,'attributes':_0x3624f2['options']?_0x3624f2[_0x9eb7('0x15')][_0x9eb7('0x1a')]||null:null,'limit':_0x3624f2[_0x9eb7('0x15')]?_0x3624f2[_0x9eb7('0x15')]['limit']||null:null})['then'](function(_0x3275ba){logger[_0x9eb7('0x9')](_0x9eb7('0x1b'),_0x3624f2);logger[_0x9eb7('0x18')](_0x9eb7('0x1b'),_0x3624f2,JSON[_0x9eb7('0xc')](_0x3275ba));_0x2e924e(_0x3275ba);})[_0x9eb7('0x10')](function(_0x27a553){logger[_0x9eb7('0xd')](_0x9eb7('0x1b'),_0x27a553['message'],_0x3624f2);_0x4aea1f(_0x460cd1[_0x9eb7('0xd')](0x1f4,_0x27a553[_0x9eb7('0xf')]));});});};
\ No newline at end of file
+var _0x081c=['catch','ChatQueueReport','body','options','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatQueueReport,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x081c,0xd7));var _0xc081=function(_0x416a3c,_0x481c83){_0x416a3c=_0x416a3c-0x0;var _0x2a055d=_0x081c[_0x416a3c];return _0x2a055d;};'use strict';var _=require(_0xc081('0x0'));var util=require(_0xc081('0x1'));var moment=require(_0xc081('0x2'));var BPromise=require(_0xc081('0x3'));var rs=require(_0xc081('0x4'));var fs=require('fs');var Redis=require(_0xc081('0x5'));var db=require(_0xc081('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc081('0x7'))(_0xc081('0x8'));var config=require(_0xc081('0x9'));var jayson=require(_0xc081('0xa'));var client=jayson[_0xc081('0xb')][_0xc081('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x85f165,_0x29539d,_0x16089f){return new BPromise(function(_0x43d6f3,_0x1cfbe2){return client[_0xc081('0xd')](_0x85f165,_0x16089f)[_0xc081('0xe')](function(_0x50e75a){logger[_0xc081('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x29539d,_0xc081('0x10'));logger['debug'](_0xc081('0x11'),_0x29539d,_0xc081('0x10'),JSON[_0xc081('0x12')](_0x50e75a));if(_0x50e75a['error']){if(_0x50e75a['error'][_0xc081('0x13')]===0x1f4){logger[_0xc081('0x14')](_0xc081('0x15'),_0x29539d,_0x50e75a['error'][_0xc081('0x16')]);return _0x1cfbe2(_0x50e75a[_0xc081('0x14')][_0xc081('0x16')]);}logger[_0xc081('0x14')](_0xc081('0x15'),_0x29539d,_0x50e75a[_0xc081('0x14')][_0xc081('0x16')]);return _0x43d6f3(_0x50e75a['error'][_0xc081('0x16')]);}else{logger[_0xc081('0xf')](_0xc081('0x15'),_0x29539d,'request\x20sent');_0x43d6f3(_0x50e75a['result'][_0xc081('0x16')]);}})[_0xc081('0x17')](function(_0x56e454){logger['error'](_0xc081('0x15'),_0x29539d,_0x56e454);_0x1cfbe2(_0x56e454);});});}exports['CreateChatQueueReport']=function(_0x529e49){var _0x3b0e22=this;return new Promise(function(_0x5c837a,_0x43ab94){return db[_0xc081('0x18')]['create'](_0x529e49[_0xc081('0x19')],{'raw':_0x529e49['options']?_0x529e49[_0xc081('0x1a')][_0xc081('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xb14a50){logger[_0xc081('0xf')](_0xc081('0x1c'),_0x529e49);logger[_0xc081('0x1d')](_0xc081('0x1c'),_0x529e49,JSON['stringify'](_0xb14a50));_0x5c837a(_0xb14a50);})[_0xc081('0x17')](function(_0x2ef1b3){logger['error'](_0xc081('0x1c'),_0x2ef1b3[_0xc081('0x16')],_0x529e49);_0x43ab94(_0x3b0e22['error'](0x1f4,_0x2ef1b3[_0xc081('0x16')]));});});};exports[_0xc081('0x1e')]=function(_0x29c0fa){var _0x5f5410=this;return new Promise(function(_0x33d506,_0x5aa45c){return db[_0xc081('0x18')]['update'](_0x29c0fa[_0xc081('0x19')],{'raw':_0x29c0fa[_0xc081('0x1a')]?_0x29c0fa['options'][_0xc081('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29c0fa['options']?_0x29c0fa['options'][_0xc081('0x1f')]||null:null,'attributes':_0x29c0fa[_0xc081('0x1a')]?_0x29c0fa[_0xc081('0x1a')][_0xc081('0x20')]||null:null,'limit':_0x29c0fa[_0xc081('0x1a')]?_0x29c0fa[_0xc081('0x1a')][_0xc081('0x21')]||null:null})[_0xc081('0xe')](function(_0x55d712){logger[_0xc081('0xf')](_0xc081('0x1e'),_0x29c0fa);logger[_0xc081('0x1d')](_0xc081('0x1e'),_0x29c0fa,JSON[_0xc081('0x12')](_0x55d712));_0x33d506(_0x55d712);})[_0xc081('0x17')](function(_0x1ad3ef){logger['error']('UpdateChatQueueReport',_0x1ad3ef[_0xc081('0x16')],_0x29c0fa);_0x5aa45c(_0x5f5410[_0xc081('0x14')](0x1f4,_0x1ad3ef['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index addb32f..60e1c02 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8516=['destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/:id','post','put'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x8516,0x131));var _0x6851=function(_0x21f843,_0x6e15b3){_0x21f843=_0x21f843-0x0;var _0x1ee7da=_0x8516[_0x21f843];return _0x1ee7da;};'use strict';var multer=require(_0x6851('0x0'));var util=require(_0x6851('0x1'));var path=require('path');var timeout=require(_0x6851('0x2'));var express=require('express');var router=express[_0x6851('0x3')]();var fs_extra=require(_0x6851('0x4'));var auth=require(_0x6851('0x5'));var interaction=require(_0x6851('0x6'));var config=require(_0x6851('0x7'));var controller=require(_0x6851('0x8'));router[_0x6851('0x9')]('/',auth[_0x6851('0xa')](),controller[_0x6851('0xb')]);router[_0x6851('0x9')]('/describe',auth[_0x6851('0xa')](),controller['describe']);router[_0x6851('0x9')](_0x6851('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6851('0xd')]('/',auth[_0x6851('0xa')](),controller['create']);router[_0x6851('0xe')]('/:id',auth[_0x6851('0xa')](),controller['update']);router['delete'](_0x6851('0xc'),auth[_0x6851('0xa')](),controller[_0x6851('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xa319=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xa319,0x178));var _0x9a31=function(_0x1caf21,_0x48a169){_0x1caf21=_0x1caf21-0x0;var _0x55e77f=_0xa319[_0x1caf21];return _0x55e77f;};'use strict';var multer=require(_0x9a31('0x0'));var util=require(_0x9a31('0x1'));var path=require(_0x9a31('0x2'));var timeout=require(_0x9a31('0x3'));var express=require(_0x9a31('0x4'));var router=express[_0x9a31('0x5')]();var fs_extra=require(_0x9a31('0x6'));var auth=require(_0x9a31('0x7'));var interaction=require(_0x9a31('0x8'));var config=require('../../config/environment');var controller=require(_0x9a31('0x9'));router['get']('/',auth[_0x9a31('0xa')](),controller['index']);router[_0x9a31('0xb')](_0x9a31('0xc'),auth[_0x9a31('0xa')](),controller[_0x9a31('0xd')]);router[_0x9a31('0xb')](_0x9a31('0xe'),auth['isAuthenticated'](),controller[_0x9a31('0xf')]);router[_0x9a31('0x10')]('/',auth[_0x9a31('0xa')](),controller[_0x9a31('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9a31('0x12')]);router[_0x9a31('0x13')](_0x9a31('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9a31('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 769881a..7055265 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4d73b1,_0x91ab71){var _0xe394f9=function(_0x47dd5d){while(--_0x47dd5d){_0x4d73b1['push'](_0x4d73b1['shift']());}};_0xe394f9(++_0x91ab71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x10f100,_0x20f3d3){var _0x51546e=function(_0x488217){while(--_0x488217){_0x10f100['push'](_0x10f100['shift']());}};_0x51546e(++_0x20f3d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 169a816..2462d6f 100644
--- a/server/api/chatTransferReport/chatTransferReport.controller.js
+++ b/server/api/chatTransferReport/chatTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6fc9=['length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','update','then','destroy','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0xbb3ab4,_0x14a77d){var _0x3853f1=function(_0xbab961){while(--_0xbab961){_0xbb3ab4['push'](_0xbb3ab4['shift']());}};_0x3853f1(++_0x14a77d);}(_0x6fc9,0xf6));var _0x96fc=function(_0x422fac,_0x2e9a25){_0x422fac=_0x422fac-0x0;var _0x3fdf64=_0x6fc9[_0x422fac];return _0x3fdf64;};'use strict';var emlformat=require(_0x96fc('0x0'));var rimraf=require(_0x96fc('0x1'));var zipdir=require(_0x96fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x96fc('0x4'));var util=require(_0x96fc('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x96fc('0x6'));var ejs=require(_0x96fc('0x7'));var fs=require('fs');var fs_extra=require(_0x96fc('0x8'));var _=require('lodash');var squel=require(_0x96fc('0x9'));var crypto=require(_0x96fc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x96fc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x96fc('0xc'));var Papa=require(_0x96fc('0xd'));var Redis=require('ioredis');var authService=require(_0x96fc('0xe'));var qs=require(_0x96fc('0xf'));var as=require(_0x96fc('0x10'));var hardwareService=require(_0x96fc('0x11'));var logger=require(_0x96fc('0x12'))('api');var utils=require(_0x96fc('0x13'));var config=require(_0x96fc('0x14'));var licenseUtil=require(_0x96fc('0x15'));var db=require(_0x96fc('0x16'))['db'];function respondWithStatusCode(_0x9d6a3c,_0x3164d5){_0x3164d5=_0x3164d5||0xcc;return function(_0x1ffa86){if(_0x1ffa86){return _0x9d6a3c[_0x96fc('0x17')](_0x3164d5);}return _0x9d6a3c[_0x96fc('0x18')](_0x3164d5)[_0x96fc('0x19')]();};}function respondWithResult(_0x39319e,_0x16b1ac){_0x16b1ac=_0x16b1ac||0xc8;return function(_0xeff20d){if(_0xeff20d){return _0x39319e['status'](_0x16b1ac)['json'](_0xeff20d);}};}function respondWithFilteredResult(_0x645fa0,_0x5edb47){return function(_0xbd38d5){if(_0xbd38d5){var _0x54ce40=typeof _0x5edb47['offset']===_0x96fc('0x1a')&&typeof _0x5edb47[_0x96fc('0x1b')]===_0x96fc('0x1a');var _0x3fba66=_0xbd38d5[_0x96fc('0x1c')];var _0x212273=_0x54ce40?0x0:_0x5edb47[_0x96fc('0x1d')];var _0x1e733f=_0x54ce40?_0xbd38d5[_0x96fc('0x1c')]:_0x5edb47[_0x96fc('0x1d')]+_0x5edb47[_0x96fc('0x1b')];var _0x2f78ac;if(_0x1e733f>=_0x3fba66){_0x1e733f=_0x3fba66;_0x2f78ac=0xc8;}else{_0x2f78ac=0xce;}_0x645fa0[_0x96fc('0x18')](_0x2f78ac);return _0x645fa0[_0x96fc('0x1e')]('Content-Range',_0x212273+'-'+_0x1e733f+'/'+_0x3fba66)[_0x96fc('0x1f')](_0xbd38d5);}return null;};}function patchUpdates(_0x5a25cf){return function(_0x47bcaa){try{jsonpatch[_0x96fc('0x20')](_0x47bcaa,_0x5a25cf,!![]);}catch(_0x22b9da){return BPromise[_0x96fc('0x21')](_0x22b9da);}return _0x47bcaa['save']();};}function saveUpdates(_0x196fbb,_0x5a56f7){return function(_0x170fc1){if(_0x170fc1){return _0x170fc1[_0x96fc('0x22')](_0x196fbb)[_0x96fc('0x23')](function(_0x40bac6){return _0x40bac6;});}return null;};}function removeEntity(_0x202537,_0x362b93){return function(_0x14e382){if(_0x14e382){return _0x14e382[_0x96fc('0x24')]()[_0x96fc('0x23')](function(){_0x202537[_0x96fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168a2a,_0x4265e3){return function(_0x1ff151){if(!_0x1ff151){_0x168a2a[_0x96fc('0x17')](0x194);}return _0x1ff151;};}function handleError(_0x363e9f,_0x45feed){_0x45feed=_0x45feed||0x1f4;return function(_0x4b37cb){logger['error'](_0x4b37cb['stack']);if(_0x4b37cb['name']){delete _0x4b37cb[_0x96fc('0x25')];}_0x363e9f[_0x96fc('0x18')](_0x45feed)[_0x96fc('0x26')](_0x4b37cb);};}exports['index']=function(_0x12c89f,_0x367fb3){var _0x42ef34={},_0x1ab3e1={},_0x2c8f83={'count':0x0,'rows':[]};var _0x3969f8=_[_0x96fc('0x27')](db[_0x96fc('0x28')][_0x96fc('0x29')],function(_0x5edc66){return{'name':_0x5edc66[_0x96fc('0x2a')],'type':_0x5edc66['type'][_0x96fc('0x2b')]};});_0x1ab3e1[_0x96fc('0x2c')]=_[_0x96fc('0x27')](_0x3969f8,_0x96fc('0x25'));_0x1ab3e1[_0x96fc('0x2d')]=_[_0x96fc('0x2e')](_0x12c89f['query']);_0x1ab3e1[_0x96fc('0x2f')]=_[_0x96fc('0x30')](_0x1ab3e1[_0x96fc('0x2c')],_0x1ab3e1[_0x96fc('0x2d')]);_0x42ef34['attributes']=_['intersection'](_0x1ab3e1[_0x96fc('0x2c')],qs[_0x96fc('0x31')](_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x31')]));_0x42ef34['attributes']=_0x42ef34['attributes'][_0x96fc('0x32')]?_0x42ef34[_0x96fc('0x33')]:_0x1ab3e1[_0x96fc('0x2c')];if(!_0x12c89f['query'][_0x96fc('0x34')](_0x96fc('0x35'))){_0x42ef34[_0x96fc('0x1b')]=qs[_0x96fc('0x1b')](_0x12c89f['query'][_0x96fc('0x1b')]);_0x42ef34[_0x96fc('0x1d')]=qs['offset'](_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x1d')]);}_0x42ef34[_0x96fc('0x36')]=qs[_0x96fc('0x37')](_0x12c89f[_0x96fc('0x2d')]['sort']);_0x42ef34[_0x96fc('0x38')]=qs[_0x96fc('0x2f')](_[_0x96fc('0x39')](_0x12c89f[_0x96fc('0x2d')],_0x1ab3e1[_0x96fc('0x2f')]),_0x3969f8);if(_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x3a')]){_0x42ef34[_0x96fc('0x38')]=_[_0x96fc('0x3b')](_0x42ef34[_0x96fc('0x38')],{'$or':_[_0x96fc('0x27')](_0x3969f8,function(_0x510425){if(_0x510425[_0x96fc('0x3c')]!==_0x96fc('0x3d')){var _0x2520c5={};_0x2520c5[_0x510425[_0x96fc('0x25')]]={'$like':'%'+_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x3a')]+'%'};return _0x2520c5;}})});}_0x42ef34=_['merge']({},_0x42ef34,_0x12c89f['options']);var _0x5be071={'where':_0x42ef34['where']};return db[_0x96fc('0x28')]['count'](_0x5be071)[_0x96fc('0x23')](function(_0x273dc3){_0x2c8f83[_0x96fc('0x1c')]=_0x273dc3;if(_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x3e')]){_0x42ef34[_0x96fc('0x3f')]=[{'all':!![]}];}return db[_0x96fc('0x28')][_0x96fc('0x40')](_0x42ef34);})['then'](function(_0x33caaa){_0x2c8f83[_0x96fc('0x41')]=_0x33caaa;return _0x2c8f83;})[_0x96fc('0x23')](respondWithFilteredResult(_0x367fb3,_0x42ef34))[_0x96fc('0x42')](handleError(_0x367fb3,null));};exports[_0x96fc('0x43')]=function(_0x179418,_0x5826de){var _0x54a324={'raw':!![],'where':{'id':_0x179418[_0x96fc('0x44')]['id']}},_0x243101={};_0x243101[_0x96fc('0x2c')]=_[_0x96fc('0x2e')](db[_0x96fc('0x28')]['rawAttributes']);_0x243101['query']=_['keys'](_0x179418[_0x96fc('0x2d')]);_0x243101[_0x96fc('0x2f')]=_[_0x96fc('0x30')](_0x243101[_0x96fc('0x2c')],_0x243101[_0x96fc('0x2d')]);_0x54a324[_0x96fc('0x33')]=_[_0x96fc('0x30')](_0x243101[_0x96fc('0x2c')],qs['fields'](_0x179418['query'][_0x96fc('0x31')]));_0x54a324['attributes']=_0x54a324[_0x96fc('0x33')][_0x96fc('0x32')]?_0x54a324[_0x96fc('0x33')]:_0x243101[_0x96fc('0x2c')];if(_0x179418[_0x96fc('0x2d')][_0x96fc('0x3e')]){_0x54a324[_0x96fc('0x3f')]=[{'all':!![]}];}_0x54a324=_['merge']({},_0x54a324,_0x179418[_0x96fc('0x45')]);return db[_0x96fc('0x28')][_0x96fc('0x46')](_0x54a324)[_0x96fc('0x23')](handleEntityNotFound(_0x5826de,null))['then'](respondWithResult(_0x5826de,null))[_0x96fc('0x42')](handleError(_0x5826de,null));};exports[_0x96fc('0x47')]=function(_0x345bd3,_0x1d95c8){return db[_0x96fc('0x28')][_0x96fc('0x47')](_0x345bd3[_0x96fc('0x48')],{})[_0x96fc('0x23')](respondWithResult(_0x1d95c8,0xc9))[_0x96fc('0x42')](handleError(_0x1d95c8,null));};exports[_0x96fc('0x22')]=function(_0x42e41e,_0x19a921){if(_0x42e41e['body']['id']){delete _0x42e41e[_0x96fc('0x48')]['id'];}return db[_0x96fc('0x28')][_0x96fc('0x46')]({'where':{'id':_0x42e41e['params']['id']}})['then'](handleEntityNotFound(_0x19a921,null))['then'](saveUpdates(_0x42e41e[_0x96fc('0x48')],null))[_0x96fc('0x23')](respondWithResult(_0x19a921,null))[_0x96fc('0x42')](handleError(_0x19a921,null));};exports['destroy']=function(_0x4f8730,_0x34bb95){return db['ChatTransferReport'][_0x96fc('0x46')]({'where':{'id':_0x4f8730[_0x96fc('0x44')]['id']}})[_0x96fc('0x23')](handleEntityNotFound(_0x34bb95,null))[_0x96fc('0x23')](removeEntity(_0x34bb95,null))['catch'](handleError(_0x34bb95,null));};exports[_0x96fc('0x49')]=function(_0xe58152,_0xe803ae){return db[_0x96fc('0x28')][_0x96fc('0x49')]()[_0x96fc('0x23')](respondWithResult(_0xe803ae,null))['catch'](handleError(_0xe803ae,null));};
\ No newline at end of file
+var _0xc1e0=['update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xc1e0,0xe7));var _0x0c1e=function(_0x29059d,_0x332387){_0x29059d=_0x29059d-0x0;var _0x4d5f08=_0xc1e0[_0x29059d];return _0x4d5f08;};'use strict';var emlformat=require(_0x0c1e('0x0'));var rimraf=require(_0x0c1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c1e('0x2'));var rp=require(_0x0c1e('0x3'));var moment=require(_0x0c1e('0x4'));var BPromise=require(_0x0c1e('0x5'));var Mustache=require('mustache');var util=require(_0x0c1e('0x6'));var path=require(_0x0c1e('0x7'));var sox=require(_0x0c1e('0x8'));var csv=require(_0x0c1e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c1e('0xa'));var _=require(_0x0c1e('0xb'));var squel=require('squel');var crypto=require(_0x0c1e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c1e('0xd'));var Redis=require(_0x0c1e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0c1e('0xf'));var as=require(_0x0c1e('0x10'));var hardwareService=require(_0x0c1e('0x11'));var logger=require('../../config/logger')(_0x0c1e('0x12'));var utils=require(_0x0c1e('0x13'));var config=require(_0x0c1e('0x14'));var licenseUtil=require(_0x0c1e('0x15'));var db=require(_0x0c1e('0x16'))['db'];function respondWithStatusCode(_0x7639cf,_0x129851){_0x129851=_0x129851||0xcc;return function(_0x789fc0){if(_0x789fc0){return _0x7639cf[_0x0c1e('0x17')](_0x129851);}return _0x7639cf[_0x0c1e('0x18')](_0x129851)[_0x0c1e('0x19')]();};}function respondWithResult(_0x54b1ec,_0x4017cd){_0x4017cd=_0x4017cd||0xc8;return function(_0x2fd6e4){if(_0x2fd6e4){return _0x54b1ec['status'](_0x4017cd)[_0x0c1e('0x1a')](_0x2fd6e4);}};}function respondWithFilteredResult(_0x53f9a3,_0x4db2de){return function(_0x1425da){if(_0x1425da){var _0x44e94c=typeof _0x4db2de['offset']===_0x0c1e('0x1b')&&typeof _0x4db2de['limit']===_0x0c1e('0x1b');var _0x5dcdc2=_0x1425da['count'];var _0x4ba793=_0x44e94c?0x0:_0x4db2de['offset'];var _0x2a1ff3=_0x44e94c?_0x1425da[_0x0c1e('0x1c')]:_0x4db2de['offset']+_0x4db2de[_0x0c1e('0x1d')];var _0x3ce25e;if(_0x2a1ff3>=_0x5dcdc2){_0x2a1ff3=_0x5dcdc2;_0x3ce25e=0xc8;}else{_0x3ce25e=0xce;}_0x53f9a3[_0x0c1e('0x18')](_0x3ce25e);return _0x53f9a3['set'](_0x0c1e('0x1e'),_0x4ba793+'-'+_0x2a1ff3+'/'+_0x5dcdc2)[_0x0c1e('0x1a')](_0x1425da);}return null;};}function patchUpdates(_0x213562){return function(_0x1fdc9b){try{jsonpatch[_0x0c1e('0x1f')](_0x1fdc9b,_0x213562,!![]);}catch(_0x42b13d){return BPromise[_0x0c1e('0x20')](_0x42b13d);}return _0x1fdc9b[_0x0c1e('0x21')]();};}function saveUpdates(_0x18e1c2,_0x4a67ad){return function(_0x3753fe){if(_0x3753fe){return _0x3753fe['update'](_0x18e1c2)[_0x0c1e('0x22')](function(_0x484eee){return _0x484eee;});}return null;};}function removeEntity(_0xa127db,_0xc4ef8e){return function(_0x174119){if(_0x174119){return _0x174119[_0x0c1e('0x23')]()[_0x0c1e('0x22')](function(){_0xa127db['status'](0xcc)[_0x0c1e('0x19')]();});}};}function handleEntityNotFound(_0xeb7dde,_0x557c59){return function(_0x5b8619){if(!_0x5b8619){_0xeb7dde[_0x0c1e('0x17')](0x194);}return _0x5b8619;};}function handleError(_0x472130,_0x20f02b){_0x20f02b=_0x20f02b||0x1f4;return function(_0xcbf211){logger[_0x0c1e('0x24')](_0xcbf211['stack']);if(_0xcbf211[_0x0c1e('0x25')]){delete _0xcbf211[_0x0c1e('0x25')];}_0x472130[_0x0c1e('0x18')](_0x20f02b)[_0x0c1e('0x26')](_0xcbf211);};}exports[_0x0c1e('0x27')]=function(_0x312a34,_0xd1d45e){var _0x473da9={},_0x36e5b8={},_0x2fcade={'count':0x0,'rows':[]};var _0x414bfe=_['map'](db[_0x0c1e('0x28')][_0x0c1e('0x29')],function(_0x52dbc6){return{'name':_0x52dbc6[_0x0c1e('0x2a')],'type':_0x52dbc6[_0x0c1e('0x2b')][_0x0c1e('0x2c')]};});_0x36e5b8['model']=_[_0x0c1e('0x2d')](_0x414bfe,'name');_0x36e5b8[_0x0c1e('0x2e')]=_[_0x0c1e('0x2f')](_0x312a34[_0x0c1e('0x2e')]);_0x36e5b8['filters']=_[_0x0c1e('0x30')](_0x36e5b8['model'],_0x36e5b8[_0x0c1e('0x2e')]);_0x473da9[_0x0c1e('0x31')]=_[_0x0c1e('0x30')](_0x36e5b8['model'],qs[_0x0c1e('0x32')](_0x312a34[_0x0c1e('0x2e')]['fields']));_0x473da9[_0x0c1e('0x31')]=_0x473da9[_0x0c1e('0x31')][_0x0c1e('0x33')]?_0x473da9[_0x0c1e('0x31')]:_0x36e5b8[_0x0c1e('0x34')];if(!_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x35')](_0x0c1e('0x36'))){_0x473da9[_0x0c1e('0x1d')]=qs['limit'](_0x312a34[_0x0c1e('0x2e')]['limit']);_0x473da9[_0x0c1e('0x37')]=qs['offset'](_0x312a34['query'][_0x0c1e('0x37')]);}_0x473da9[_0x0c1e('0x38')]=qs['sort'](_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x39')]);_0x473da9[_0x0c1e('0x3a')]=qs[_0x0c1e('0x3b')](_[_0x0c1e('0x3c')](_0x312a34[_0x0c1e('0x2e')],_0x36e5b8[_0x0c1e('0x3b')]),_0x414bfe);if(_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x3d')]){_0x473da9[_0x0c1e('0x3a')]=_[_0x0c1e('0x3e')](_0x473da9['where'],{'$or':_[_0x0c1e('0x2d')](_0x414bfe,function(_0xce21fd){if(_0xce21fd[_0x0c1e('0x2b')]!==_0x0c1e('0x3f')){var _0xf712ac={};_0xf712ac[_0xce21fd[_0x0c1e('0x25')]]={'$like':'%'+_0x312a34['query'][_0x0c1e('0x3d')]+'%'};return _0xf712ac;}})});}_0x473da9=_[_0x0c1e('0x3e')]({},_0x473da9,_0x312a34[_0x0c1e('0x40')]);var _0x11a4ba={'where':_0x473da9[_0x0c1e('0x3a')]};return db[_0x0c1e('0x28')][_0x0c1e('0x1c')](_0x11a4ba)['then'](function(_0x443cdb){_0x2fcade[_0x0c1e('0x1c')]=_0x443cdb;if(_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x41')]){_0x473da9[_0x0c1e('0x42')]=[{'all':!![]}];}return db[_0x0c1e('0x28')][_0x0c1e('0x43')](_0x473da9);})[_0x0c1e('0x22')](function(_0x2c5b6d){_0x2fcade[_0x0c1e('0x44')]=_0x2c5b6d;return _0x2fcade;})[_0x0c1e('0x22')](respondWithFilteredResult(_0xd1d45e,_0x473da9))[_0x0c1e('0x45')](handleError(_0xd1d45e,null));};exports[_0x0c1e('0x46')]=function(_0x276062,_0x1aa175){var _0x11038d={'raw':!![],'where':{'id':_0x276062['params']['id']}},_0x5738d0={};_0x5738d0[_0x0c1e('0x34')]=_['keys'](db[_0x0c1e('0x28')][_0x0c1e('0x29')]);_0x5738d0['query']=_[_0x0c1e('0x2f')](_0x276062[_0x0c1e('0x2e')]);_0x5738d0[_0x0c1e('0x3b')]=_[_0x0c1e('0x30')](_0x5738d0[_0x0c1e('0x34')],_0x5738d0[_0x0c1e('0x2e')]);_0x11038d['attributes']=_[_0x0c1e('0x30')](_0x5738d0[_0x0c1e('0x34')],qs[_0x0c1e('0x32')](_0x276062['query']['fields']));_0x11038d['attributes']=_0x11038d['attributes'][_0x0c1e('0x33')]?_0x11038d[_0x0c1e('0x31')]:_0x5738d0[_0x0c1e('0x34')];if(_0x276062[_0x0c1e('0x2e')][_0x0c1e('0x41')]){_0x11038d['include']=[{'all':!![]}];}_0x11038d=_[_0x0c1e('0x3e')]({},_0x11038d,_0x276062[_0x0c1e('0x40')]);return db[_0x0c1e('0x28')][_0x0c1e('0x47')](_0x11038d)[_0x0c1e('0x22')](handleEntityNotFound(_0x1aa175,null))[_0x0c1e('0x22')](respondWithResult(_0x1aa175,null))[_0x0c1e('0x45')](handleError(_0x1aa175,null));};exports['create']=function(_0x1393d7,_0x540176){return db['ChatTransferReport']['create'](_0x1393d7[_0x0c1e('0x48')],{})[_0x0c1e('0x22')](respondWithResult(_0x540176,0xc9))['catch'](handleError(_0x540176,null));};exports[_0x0c1e('0x49')]=function(_0x5d960b,_0x53dbb0){if(_0x5d960b[_0x0c1e('0x48')]['id']){delete _0x5d960b['body']['id'];}return db['ChatTransferReport'][_0x0c1e('0x47')]({'where':{'id':_0x5d960b[_0x0c1e('0x4a')]['id']}})[_0x0c1e('0x22')](handleEntityNotFound(_0x53dbb0,null))[_0x0c1e('0x22')](saveUpdates(_0x5d960b[_0x0c1e('0x48')],null))[_0x0c1e('0x22')](respondWithResult(_0x53dbb0,null))[_0x0c1e('0x45')](handleError(_0x53dbb0,null));};exports['destroy']=function(_0x6a2a71,_0x1c7ebf){return db[_0x0c1e('0x28')][_0x0c1e('0x47')]({'where':{'id':_0x6a2a71[_0x0c1e('0x4a')]['id']}})[_0x0c1e('0x22')](handleEntityNotFound(_0x1c7ebf,null))[_0x0c1e('0x22')](removeEntity(_0x1c7ebf,null))['catch'](handleError(_0x1c7ebf,null));};exports[_0x0c1e('0x4b')]=function(_0x28f79d,_0x39a969){return db[_0x0c1e('0x28')][_0x0c1e('0x4b')]()[_0x0c1e('0x22')](respondWithResult(_0x39a969,null))[_0x0c1e('0x45')](handleError(_0x39a969,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 761ab56..d8ec4cc 100644
--- a/server/api/chatTransferReport/chatTransferReport.model.js
+++ b/server/api/chatTransferReport/chatTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa538=['moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','api'];(function(_0x3509b9,_0x38bb75){var _0x11704f=function(_0x37a435){while(--_0x37a435){_0x3509b9['push'](_0x3509b9['shift']());}};_0x11704f(++_0x38bb75);}(_0xa538,0xb2));var _0x8a53=function(_0x31c1d9,_0xf3b483){_0x31c1d9=_0x31c1d9-0x0;var _0x2ccc8d=_0xa538[_0x31c1d9];return _0x2ccc8d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8a53('0x0'))(_0x8a53('0x1'));var moment=require(_0x8a53('0x2'));var BPromise=require(_0x8a53('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a53('0x4'));var rimraf=require('rimraf');var config=require(_0x8a53('0x5'));var attributes=require(_0x8a53('0x6'));module[_0x8a53('0x7')]=function(_0x20a7f3,_0x2db190){return _0x20a7f3[_0x8a53('0x8')](_0x8a53('0x9'),attributes,{'tableName':_0x8a53('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8a53('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xebe3=['./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','../../config/environment'];(function(_0x3165c0,_0x429078){var _0x5d7e16=function(_0x184539){while(--_0x184539){_0x3165c0['push'](_0x3165c0['shift']());}};_0x5d7e16(++_0x429078);}(_0xebe3,0x73));var _0x3ebe=function(_0x4211f6,_0x4934e6){_0x4211f6=_0x4211f6-0x0;var _0x1253f2=_0xebe3[_0x4211f6];return _0x1253f2;};'use strict';var _=require(_0x3ebe('0x0'));var util=require(_0x3ebe('0x1'));var logger=require('../../config/logger')(_0x3ebe('0x2'));var moment=require(_0x3ebe('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3ebe('0x4'));var attributes=require(_0x3ebe('0x5'));module['exports']=function(_0x57ea6f,_0x39b3e3){return _0x57ea6f[_0x3ebe('0x6')](_0x3ebe('0x7'),attributes,{'tableName':_0x3ebe('0x8'),'paranoid':![],'indexes':[{'name':_0x3ebe('0x9'),'fields':[_0x3ebe('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 0751149..c9a73d3 100644
--- a/server/api/chatTransferReport/chatTransferReport.rpc.js
+++ b/server/api/chatTransferReport/chatTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9c44,0xf1));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rs=require(_0x49c4('0x4'));var fs=require('fs');var Redis=require(_0x49c4('0x5'));var db=require(_0x49c4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x49c4('0x7'))('rpc');var config=require(_0x49c4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x9')][_0x49c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bbcb7,_0x2ca38b,_0x4a48dd){return new BPromise(function(_0x26dba2,_0x2b5f93){return client[_0x49c4('0xb')](_0x1bbcb7,_0x4a48dd)[_0x49c4('0xc')](function(_0x227492){logger[_0x49c4('0xd')](_0x49c4('0xe'),_0x2ca38b,_0x49c4('0xf'));logger[_0x49c4('0x10')](_0x49c4('0x11'),_0x2ca38b,'request\x20sent',JSON['stringify'](_0x227492));if(_0x227492[_0x49c4('0x12')]){if(_0x227492[_0x49c4('0x12')][_0x49c4('0x13')]===0x1f4){logger['error'](_0x49c4('0xe'),_0x2ca38b,_0x227492[_0x49c4('0x12')][_0x49c4('0x14')]);return _0x2b5f93(_0x227492[_0x49c4('0x12')]['message']);}logger[_0x49c4('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2ca38b,_0x227492['error'][_0x49c4('0x14')]);return _0x26dba2(_0x227492[_0x49c4('0x12')]['message']);}else{logger[_0x49c4('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x2ca38b,_0x49c4('0xf'));_0x26dba2(_0x227492[_0x49c4('0x15')][_0x49c4('0x14')]);}})['catch'](function(_0x3dac25){logger[_0x49c4('0x12')](_0x49c4('0xe'),_0x2ca38b,_0x3dac25);_0x2b5f93(_0x3dac25);});});}
\ No newline at end of file
+var _0x0aae=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0aae,0xb9));var _0xe0aa=function(_0x513c0c,_0x3fc365){_0x513c0c=_0x513c0c-0x0;var _0x5ee35b=_0x0aae[_0x513c0c];return _0x5ee35b;};'use strict';var _=require('lodash');var util=require(_0xe0aa('0x0'));var moment=require(_0xe0aa('0x1'));var BPromise=require(_0xe0aa('0x2'));var rs=require(_0xe0aa('0x3'));var fs=require('fs');var Redis=require(_0xe0aa('0x4'));var db=require(_0xe0aa('0x5'))['db'];var utils=require(_0xe0aa('0x6'));var logger=require('../../config/logger')(_0xe0aa('0x7'));var config=require(_0xe0aa('0x8'));var jayson=require(_0xe0aa('0x9'));var client=jayson[_0xe0aa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x320a2d,_0x186392,_0x5afb10){return new BPromise(function(_0x1919ab,_0x2b2920){return client['request'](_0x320a2d,_0x5afb10)[_0xe0aa('0xb')](function(_0x3d1118){logger[_0xe0aa('0xc')](_0xe0aa('0xd'),_0x186392,_0xe0aa('0xe'));logger[_0xe0aa('0xf')](_0xe0aa('0x10'),_0x186392,_0xe0aa('0xe'),JSON[_0xe0aa('0x11')](_0x3d1118));if(_0x3d1118[_0xe0aa('0x12')]){if(_0x3d1118[_0xe0aa('0x12')]['code']===0x1f4){logger[_0xe0aa('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x186392,_0x3d1118[_0xe0aa('0x12')]['message']);return _0x2b2920(_0x3d1118[_0xe0aa('0x12')][_0xe0aa('0x13')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x186392,_0x3d1118[_0xe0aa('0x12')][_0xe0aa('0x13')]);return _0x1919ab(_0x3d1118[_0xe0aa('0x12')][_0xe0aa('0x13')]);}else{logger['info'](_0xe0aa('0xd'),_0x186392,'request\x20sent');_0x1919ab(_0x3d1118[_0xe0aa('0x14')][_0xe0aa('0x13')]);}})[_0xe0aa('0x15')](function(_0xaa4fa5){logger[_0xe0aa('0x12')](_0xe0aa('0xd'),_0x186392,_0xaa4fa5);_0x2b2920(_0xaa4fa5);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index ea1851e..6c4b556 100644
--- a/server/api/chatTransferReport/index.js
+++ b/server/api/chatTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd7b=['/describe','/:id','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0x142733,_0x19bf15){var _0xd17009=function(_0x1db652){while(--_0x1db652){_0x142733['push'](_0x142733['shift']());}};_0xd17009(++_0x19bf15);}(_0xbd7b,0x10c));var _0xbbd7=function(_0x5303a2,_0x49716b){_0x5303a2=_0x5303a2-0x0;var _0x448ac5=_0xbd7b[_0x5303a2];return _0x448ac5;};'use strict';var multer=require(_0xbbd7('0x0'));var util=require('util');var path=require(_0xbbd7('0x1'));var timeout=require(_0xbbd7('0x2'));var express=require(_0xbbd7('0x3'));var router=express[_0xbbd7('0x4')]();var fs_extra=require(_0xbbd7('0x5'));var auth=require(_0xbbd7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbbd7('0x7'));var controller=require(_0xbbd7('0x8'));router[_0xbbd7('0x9')]('/',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0xb')]);router[_0xbbd7('0x9')](_0xbbd7('0xc'),auth[_0xbbd7('0xa')](),controller['describe']);router[_0xbbd7('0x9')](_0xbbd7('0xd'),auth[_0xbbd7('0xa')](),controller['show']);router[_0xbbd7('0xe')]('/',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0xf')]);router[_0xbbd7('0x10')](_0xbbd7('0xd'),auth[_0xbbd7('0xa')](),controller['update']);router[_0xbbd7('0x11')](_0xbbd7('0xd'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x12')]);module[_0xbbd7('0x13')]=router;
\ No newline at end of file
+var _0x16c1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','create','update','delete','destroy','multer','path'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x16c1,0xe8));var _0x116c=function(_0x2bdc70,_0x4464f9){_0x2bdc70=_0x2bdc70-0x0;var _0x5494ac=_0x16c1[_0x2bdc70];return _0x5494ac;};'use strict';var multer=require(_0x116c('0x0'));var util=require('util');var path=require(_0x116c('0x1'));var timeout=require(_0x116c('0x2'));var express=require(_0x116c('0x3'));var router=express[_0x116c('0x4')]();var fs_extra=require(_0x116c('0x5'));var auth=require(_0x116c('0x6'));var interaction=require(_0x116c('0x7'));var config=require('../../config/environment');var controller=require(_0x116c('0x8'));router[_0x116c('0x9')]('/',auth[_0x116c('0xa')](),controller['index']);router[_0x116c('0x9')](_0x116c('0xb'),auth[_0x116c('0xa')](),controller[_0x116c('0xc')]);router[_0x116c('0x9')](_0x116c('0xd'),auth[_0x116c('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x116c('0xe')]);router['put'](_0x116c('0xd'),auth[_0x116c('0xa')](),controller[_0x116c('0xf')]);router[_0x116c('0x10')](_0x116c('0xd'),auth['isAuthenticated'](),controller[_0x116c('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 97fc5e1..a61fd32 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5542=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Type\x20a\x20message','Skip','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate'];(function(_0x417955,_0x4ed8c8){var _0x3a94ef=function(_0xa3a38d){while(--_0xa3a38d){_0x417955['push'](_0x417955['shift']());}};_0x3a94ef(++_0x4ed8c8);}(_0x5542,0xcf));var _0x2554=function(_0x2a557a,_0x585b4a){_0x2a557a=_0x2a557a-0x0;var _0x439f83=_0x5542[_0x2a557a];return _0x439f83;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2554('0x0'));module[_0x2554('0x1')]={'name':{'type':Sequelize[_0x2554('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'unique':_0x2554('0x3')},'description':{'type':Sequelize[_0x2554('0x2')]},'mapKey':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x4')},'mapKeyOffline':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x4')},'key':{'type':Sequelize[_0x2554('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2554('0x5')},'customerAlias':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2554('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2554('0x2')]},'animation':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2554('0xa')](_0x2554('0xb'),_0x2554('0xc')),'defaultValue':_0x2554('0xb')},'header_online':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0xd')},'offline_chat_button':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0xe')},'header_offline':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x2554('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2554('0x10')]},'closingQuestion':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x11')},'noteTitle':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x13')},'conditionAgreement':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x2554('0xa')](_0x2554('0x14'),'thumb'),'defaultValue':_0x2554('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2554('0x10')],'defaultValue':function(){return JSON[_0x2554('0x15')]({'items':[{'type':_0x2554('0x16'),'variable':null,'config':{'placeholder':_0x2554('0x17'),'type':'text','required':!![]},'props':{'title':_0x2554('0x17'),'helpText':''}},{'type':'input','props':{'title':_0x2554('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2554('0x4'),'type':_0x2554('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2554('0x18')](_0x2554('0x19'))?JSON[_0x2554('0x1a')](this[_0x2554('0x18')](_0x2554('0x19'))):{};},'set':function(_0x4d650b){return this[_0x2554('0x1b')](_0x2554('0x19'),JSON['stringify'](_0x4d650b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x2554('0x15')]({'items':[{'type':_0x2554('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2554('0x4'),'type':_0x2554('0x4')},'variable':null},{'type':_0x2554('0x1c'),'config':{'placeholder':_0x2554('0x1d')},'props':{'title':'Comments','helpText':_0x2554('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x2554('0x18')](_0x2554('0x1f'))?JSON[_0x2554('0x1a')](this[_0x2554('0x18')]('offlineForm')):{};},'set':function(_0xa98fb1){return this[_0x2554('0x1b')](_0x2554('0x1f'),JSON[_0x2554('0x15')](_0xa98fb1));}},'token':{'type':Sequelize[_0x2554('0x2')],'defaultValue':function(){return rs[_0x2554('0x20')]();}},'autoclose':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2554('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2554('0x2')]},'waitingTitle':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2554('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x23')},'offlineMessageBody':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x25')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2554('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2554('0x10')],'defaultValue':function(){return _0x2554('0x26');}},'notificationSound':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2554('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x27')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x28')},'messagesAlignment':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x29')},'defaultTitle':{'type':Sequelize[_0x2554('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2554('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x2b')},'systemAvatar':{'type':Sequelize[_0x2554('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2554('0x8')],'comment':_0x2554('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2554('0x2d'),'set':function(_0x181292){if(!_0x181292)this[_0x2554('0x1b')]('mandatoryDispositionPauseId',null);this[_0x2554('0x1b')]('mandatoryDisposition',_0x181292);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2554('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x2e')},'vidaooNote':{'type':Sequelize[_0x2554('0x2')],'defaultValue':function(){return _0x2554('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x2554('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2554('0x10')]}};
\ No newline at end of file
+var _0x18c0=['Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x36befb,_0x12559c){var _0x479e63=function(_0x3a1f39){while(--_0x3a1f39){_0x36befb['push'](_0x36befb['shift']());}};_0x479e63(++_0x12559c);}(_0x18c0,0x174));var _0x018c=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x18c0[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x018c('0x0'));var rs=require(_0x018c('0x1'));module[_0x018c('0x2')]={'name':{'type':Sequelize[_0x018c('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x018c('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x018c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x018c('0x3')]},'animation':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x018c('0x9')](_0x018c('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0xb')},'offline_chat_button':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0xd')},'download_transcript':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x018c('0xf')]},'closingQuestion':{'type':Sequelize[_0x018c('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x11')},'noteTitle':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x13')},'closingMessage':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x14')},'closingMessageButton':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x15')},'ratingType':{'type':Sequelize[_0x018c('0x9')](_0x018c('0x16'),_0x018c('0x17')),'defaultValue':_0x018c('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x018c('0x18')]({'items':[{'type':_0x018c('0x19'),'variable':null,'config':{'placeholder':_0x018c('0x1a'),'type':'text','required':!![]},'props':{'title':_0x018c('0x1a'),'helpText':''}},{'type':_0x018c('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x018c('0x4'),'type':_0x018c('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x018c('0x1b')](_0x018c('0x1c'))?JSON[_0x018c('0x1d')](this[_0x018c('0x1b')]('onlineForm')):{};},'set':function(_0xa88043){return this[_0x018c('0x1e')]('onlineForm',JSON['stringify'](_0xa88043));}},'offlineForm':{'type':Sequelize[_0x018c('0xf')],'defaultValue':function(){return JSON[_0x018c('0x18')]({'items':[{'type':'input','props':{'title':_0x018c('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x018c('0x4'),'type':_0x018c('0x4')},'variable':null},{'type':_0x018c('0x1f'),'config':{'placeholder':_0x018c('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x018c('0x1b')](_0x018c('0x21'))?JSON['parse'](this['getDataValue'](_0x018c('0x21'))):{};},'set':function(_0x578da3){return this[_0x018c('0x1e')](_0x018c('0x21'),JSON[_0x018c('0x18')](_0x578da3));}},'token':{'type':Sequelize[_0x018c('0x3')],'defaultValue':function(){return rs[_0x018c('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x018c('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x26')},'skipUnmanaged':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x27')},'sendUnmanaged':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x018c('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x018c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x018c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x28')},'verticalAlignment':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x29')},'messagesAlignment':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x2a')},'defaultTitle':{'type':Sequelize[_0x018c('0x3')]},'customerAvatar':{'type':Sequelize[_0x018c('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x018c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x018c('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![],'comment':_0x018c('0x2d'),'set':function(_0x5a6d80){if(!_0x5a6d80)this[_0x018c('0x1e')](_0x018c('0x2e'),null);this[_0x018c('0x1e')](_0x018c('0x2f'),_0x5a6d80);}},'vidaooEscalation':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x018c('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x018c('0x30')},'vidaooNote':{'type':Sequelize[_0x018c('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x018c('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x018c('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index d66a8a1..f0c7605 100644
--- a/server/api/chatWebsite/chatWebsite.controller.js
+++ b/server/api/chatWebsite/chatWebsite.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe37a=['firstName','lastName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','NotifyMailAccount','notifyMail','server','addInteraction','omit','Contact','Owner','fullname','Tag','Tags','color','tag','getSnippet','getProactiveActions','getLicense','License','readFileSync','utf8','URL','address','origin','remote','headers','x-real-ip','connection','remoteAddress','virtual','alignment','labelText','textColor','hideWhenOffline','IntervalId','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','getOfflineMessages','Attachment','Attachments','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','fs-extra','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','get','UserProfileResource','name','send','Command','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','map','Interval','Intervals','all','some','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','type','index','Pause','ChatWebsite','fieldName','key','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','intersection','length','include','create','user','role','ChatWebsites','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','sort','filter','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','asc','contact','threadId','externalUrl','ChatInteraction','interaction'];(function(_0xe5f973,_0x1edce7){var _0x34d054=function(_0x2dba4d){while(--_0x2dba4d){_0xe5f973['push'](_0xe5f973['shift']());}};_0x34d054(++_0x1edce7);}(_0xe37a,0x69));var _0xae37=function(_0x43b045,_0x8ae9ce){_0x43b045=_0x43b045-0x0;var _0x48e7ee=_0xe37a[_0x43b045];return _0x48e7ee;};'use strict';var Mustache=require(_0xae37('0x0'));var util=require(_0xae37('0x1'));var path=require(_0xae37('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae37('0x3'));var _=require(_0xae37('0x4'));var querystring=require(_0xae37('0x5'));var htmlToText=require(_0xae37('0x6'));var Redis=require('ioredis');var jayson=require(_0xae37('0x7'));var url=require(_0xae37('0x8'));var qs=require(_0xae37('0x9'));var logger=require(_0xae37('0xa'))('api');var config=require(_0xae37('0xb'));var APIOutOfIntervalError=require(_0xae37('0xc'))[_0xae37('0xd')];var APINotFoundError=require(_0xae37('0xc'))['APINotFoundError'];var APIHandleError=require(_0xae37('0xc'))[_0xae37('0xe')];var db=require('../../mysqldb')['db'];config['redis']=_[_0xae37('0xf')](config[_0xae37('0x10')],{'host':_0xae37('0x11'),'port':0x18eb});var socket=require(_0xae37('0x12'))(new Redis(config['redis']));require(_0xae37('0x13'))[_0xae37('0x14')](socket);var client=jayson[_0xae37('0x15')]['http']({'port':0x232c});var client9002=jayson[_0xae37('0x15')][_0xae37('0x16')]({'port':0x232a});var client9003=jayson['client'][_0xae37('0x16')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x4a977a,_0x2928d4,_0x1f4c3b,_0x38e1fe){return new Promise(function(_0x4b8612,_0x5e998f){var _0x42a88e=_0x38e1fe||client;return _0x42a88e['request'](_0x4a977a,_0x1f4c3b)[_0xae37('0x17')](function(_0x2257c2){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2928d4,'request\x20sent');logger['debug'](_0xae37('0x18'),_0x2928d4,_0xae37('0x19'),JSON[_0xae37('0x1a')](_0x2257c2));if(_0x2257c2[_0xae37('0x1b')]){if(_0x2257c2[_0xae37('0x1b')][_0xae37('0x1c')]===0x1f4){logger[_0xae37('0x1b')](_0xae37('0x1d'),_0x2928d4,_0x2257c2['error']['message']);return _0x5e998f(_0x2257c2[_0xae37('0x1b')][_0xae37('0x1e')]);}logger['error'](_0xae37('0x1d'),_0x2928d4,_0x2257c2[_0xae37('0x1b')][_0xae37('0x1e')]);return _0x4b8612(_0x2257c2[_0xae37('0x1b')][_0xae37('0x1e')]);}else{logger[_0xae37('0x1f')](_0xae37('0x1d'),_0x2928d4,_0xae37('0x19'));_0x4b8612(_0x2257c2[_0xae37('0x20')][_0xae37('0x1e')]);}})[_0xae37('0x21')](function(_0x213b6c){logger[_0xae37('0x1b')](_0xae37('0x1d'),_0x2928d4,_0x213b6c);_0x5e998f(_0x213b6c);});});}function respondWithStatusCode(_0x845390,_0x37e922){_0x37e922=_0x37e922||0xcc;return function(_0x337179){if(_0x337179){return _0x845390[_0xae37('0x22')](_0x37e922);}return _0x845390[_0xae37('0x23')](_0x37e922)[_0xae37('0x24')]();};}function respondWithResult(_0x18d125,_0x542149){_0x542149=_0x542149||0xc8;return function(_0x5cfe59){if(_0x5cfe59){return _0x18d125['status'](_0x542149)[_0xae37('0x25')](_0x5cfe59);}};}function respondWithFilteredResult(_0x4bfba0,_0x1c5571){return function(_0x2b9699){if(_0x2b9699){var _0x54e95a=typeof _0x1c5571[_0xae37('0x26')]===_0xae37('0x27')&&typeof _0x1c5571[_0xae37('0x28')]==='undefined';var _0x3492f3=_0x2b9699['count'];var _0x1aed00=_0x54e95a?0x0:_0x1c5571[_0xae37('0x26')];var _0x31ac5f=_0x54e95a?_0x2b9699[_0xae37('0x29')]:_0x1c5571[_0xae37('0x26')]+_0x1c5571[_0xae37('0x28')];var _0x90a55c;if(_0x31ac5f>=_0x3492f3){_0x31ac5f=_0x3492f3;_0x90a55c=0xc8;}else{_0x90a55c=0xce;}_0x4bfba0[_0xae37('0x23')](_0x90a55c);return _0x4bfba0[_0xae37('0x2a')]('Content-Range',_0x1aed00+'-'+_0x31ac5f+'/'+_0x3492f3)['json'](_0x2b9699);}return null;};}function saveUpdates(_0x935ef7){return function(_0x24413c){if(_0x24413c){return _0x24413c[_0xae37('0x2b')](_0x935ef7)[_0xae37('0x17')](function(_0x34362b){return _0x34362b;});}return null;};}function removeEntity(_0x2b87f0){return function(_0x55d379){if(_0x55d379){return _0x55d379[_0xae37('0x2c')]()[_0xae37('0x17')](function(){var _0x37ff2e=_0x55d379[_0xae37('0x2d')]({'plain':!![]});var _0x56f9f1='ChatWebsites';return db[_0xae37('0x2e')][_0xae37('0x2c')]({'where':{'type':_0x56f9f1,'resourceId':_0x37ff2e['id']}})[_0xae37('0x17')](function(){return _0x55d379;});})[_0xae37('0x17')](function(){_0x2b87f0[_0xae37('0x23')](0xcc)[_0xae37('0x24')]();});}};}function handleEntityNotFound(_0x35afd0){return function(_0x59288e){if(!_0x59288e){_0x35afd0['sendStatus'](0x194);}return _0x59288e;};}function handleError(_0x3c9df4,_0x5bed43){_0x5bed43=_0x5bed43||0x1f4;return function(_0x5359b4){logger[_0xae37('0x1b')](_0x5359b4['stack']);if(_0x5359b4['name']){delete _0x5359b4[_0xae37('0x2f')];}_0x3c9df4['status'](_0x5bed43)[_0xae37('0x30')](_0x5359b4);};}function iftimePromise(_0x52b168,_0x524e64){return respondWithRpcPromise(_0xae37('0x31'),'getSnippet',{'command':_0x524e64[_0xae37('0x32')]?util[_0xae37('0x33')](_0xae37('0x34'),_0x52b168[_0xae37('0x35')],_0x524e64[_0xae37('0x32')]):util[_0xae37('0x33')](_0xae37('0x36'),_0x52b168[_0xae37('0x35')])},client9002)[_0xae37('0x17')](function(_0x295a29){var _0x1e02c8=_0x295a29&&_0x295a29['indexOf']('true')>=0x0?!![]:![];logger[_0xae37('0x1f')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x524e64['id'],_0x52b168['id'],_0x52b168[_0xae37('0x35')],_0x1e02c8?_0xae37('0x37'):'OFFLINE',_0x524e64[_0xae37('0x32')]?_0x524e64[_0xae37('0x32')]:_0xae37('0x38'));return _0x1e02c8;})[_0xae37('0x21')](function(_0x5929f6){logger['error'](_0xae37('0x39'),_0x524e64['id'],_0x52b168['id'],_0x52b168[_0xae37('0x35')],util[_0xae37('0x3a')](_0x5929f6,{'showHidden':![],'depth':null}),_0x524e64['timezone']?_0x524e64['timezone']:_0xae37('0x38'));return![];});}function checkWebsiteIntervals(_0x4a1510){var _0x23e553=_[_0xae37('0x3b')](_0x4a1510[_0xae37('0x3c')][_0xae37('0x3d')],function(_0x53264d){var _0x5777ea=_0x53264d[_0xae37('0x2d')]({'plain':!![]});return iftimePromise(_0x5777ea,_0x4a1510);});return Promise[_0xae37('0x3e')](_0x23e553)[_0xae37('0x17')](function(_0x38666a){return _[_0xae37('0x3f')](_0x38666a);});}function createInteractionObject(_0x41cd85,_0x1bdadc,_0x2350f5,_0x207429){var _0x2489a5=require(_0xae37('0x40'));var _0x4d6942=new _0x2489a5();var _0x3c5c28=_0x4d6942['setUA'](_0x2350f5[_0xae37('0x41')])[_0xae37('0x42')]();var _0x3d62e5=_0x1bdadc[_0xae37('0x43')];if(_0x2350f5[_0xae37('0x44')]){_0x3d62e5=_0x2350f5[_0xae37('0x44')];}else if(_0x2350f5[_0xae37('0x45')]){_0x3d62e5=_[_0xae37('0x46')](_0x2350f5[_0xae37('0x45')][_0xae37('0x47')](','));}return{'ContactId':_0x207429['id'],'ChatWebsiteId':_0x41cd85,'from':(_0x207429['firstName']||'')+'\x20'+(_0x207429['lastName']||''),'customerIp':_0x3d62e5,'customerPort':_0x2350f5[_0xae37('0x48')]?_0x2350f5[_0xae37('0x48')]:null,'referer':_0x1bdadc[_0xae37('0x49')],'browserName':_0x3c5c28[_0xae37('0x4a')][_0xae37('0x2f')]&&_0x3c5c28[_0xae37('0x4a')][_0xae37('0x4b')]?util['format'](_0xae37('0x4c'),_0x3c5c28[_0xae37('0x4a')][_0xae37('0x2f')],_0x3c5c28[_0xae37('0x4a')]['version']):'unknown','browserVersion':_0x3c5c28[_0xae37('0x4a')][_0xae37('0x4b')]||_0xae37('0x4d'),'osName':util[_0xae37('0x33')](_0xae37('0x4c'),_0x3c5c28['os']['name'],_0x3c5c28['os'][_0xae37('0x4b')]),'osVersion':_0x3c5c28['os']['version'],'deviceModel':_0x3c5c28[_0xae37('0x4e')][_0xae37('0x4f')]&&_0x3c5c28[_0xae37('0x4e')][_0xae37('0x50')]?util[_0xae37('0x33')]('%s\x20%s\x20%s',_0x3c5c28[_0xae37('0x4e')][_0xae37('0x4f')],_0x3c5c28[_0xae37('0x4e')][_0xae37('0x50')],_0x3c5c28['device'][_0xae37('0x51')]):null,'deviceVendor':_0x3c5c28[_0xae37('0x4e')]['vendor'],'deviceType':_0x3c5c28[_0xae37('0x4e')][_0xae37('0x51')],'formData':JSON[_0xae37('0x1a')](_0x1bdadc)};}exports[_0xae37('0x52')]=function(_0x738bd1,_0x3cef96){var _0x4aa6d5={'include':[{'model':db[_0xae37('0x53')],'as':'mandatoryDispositionPause'}]},_0x11dc3f={},_0x3c24ce={'count':0x0,'rows':[]};var _0x464f8d=_[_0xae37('0x3b')](db[_0xae37('0x54')]['rawAttributes'],function(_0x24ad3a){return{'name':_0x24ad3a[_0xae37('0x55')],'type':_0x24ad3a[_0xae37('0x51')][_0xae37('0x56')]};});_0x11dc3f[_0xae37('0x4f')]=_[_0xae37('0x3b')](_0x464f8d,_0xae37('0x2f'));_0x11dc3f[_0xae37('0x57')]=_[_0xae37('0x58')](_0x738bd1['query']);_0x11dc3f[_0xae37('0x59')]=_['intersection'](_0x11dc3f[_0xae37('0x4f')],_0x11dc3f[_0xae37('0x57')]);_0x4aa6d5[_0xae37('0x5a')]=_['intersection'](_0x11dc3f[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x738bd1[_0xae37('0x57')][_0xae37('0x5b')]));_0x4aa6d5[_0xae37('0x5a')]=_0x4aa6d5[_0xae37('0x5a')]['length']?_0x4aa6d5[_0xae37('0x5a')]:_0x11dc3f[_0xae37('0x4f')];if(!_0x738bd1['query'][_0xae37('0x5c')](_0xae37('0x5d'))){_0x4aa6d5[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x738bd1[_0xae37('0x57')]['limit']);_0x4aa6d5[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x738bd1[_0xae37('0x57')][_0xae37('0x26')]);}_0x4aa6d5[_0xae37('0x5e')]=qs['sort'](_0x738bd1['query']['sort']);_0x4aa6d5[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x738bd1['query'],_0x11dc3f['filters']),_0x464f8d);if(_0x738bd1[_0xae37('0x57')]['filter']){_0x4aa6d5['where']=_[_0xae37('0x61')](_0x4aa6d5[_0xae37('0x5f')],{'$or':_['map'](_0x464f8d,function(_0x3451ac){if(_0x3451ac[_0xae37('0x51')]!==_0xae37('0x62')){var _0x342805={};_0x342805[_0x3451ac['name']]={'$like':'%'+_0x738bd1['query']['filter']+'%'};return _0x342805;}})});}_0x4aa6d5=_['merge']({},_0x4aa6d5,_0x738bd1[_0xae37('0x63')]);var _0x3e4022={'where':_0x4aa6d5[_0xae37('0x5f')]};return db[_0xae37('0x54')][_0xae37('0x29')](_0x3e4022)[_0xae37('0x17')](function(_0x13b058){_0x3c24ce['count']=_0x13b058;if(_0x738bd1[_0xae37('0x57')][_0xae37('0x64')]){_0x4aa6d5['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xae37('0x65')](_0x4aa6d5);})[_0xae37('0x17')](function(_0x497809){_0x3c24ce[_0xae37('0x66')]=_0x497809;return _0x3c24ce;})[_0xae37('0x17')](respondWithFilteredResult(_0x3cef96,_0x4aa6d5))['catch'](handleError(_0x3cef96,null));};exports[_0xae37('0x67')]=function(_0x2078b5,_0x3a38f3){var _0x232090={'raw':![],'where':{'id':_0x2078b5[_0xae37('0x68')]['id']},'include':[{'model':db[_0xae37('0x53')],'as':_0xae37('0x69')}]},_0x4226ab={};_0x4226ab[_0xae37('0x4f')]=_[_0xae37('0x58')](db['ChatWebsite'][_0xae37('0x6a')]);_0x4226ab[_0xae37('0x57')]=_[_0xae37('0x58')](_0x2078b5[_0xae37('0x57')]);_0x4226ab[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x4226ab[_0xae37('0x4f')],_0x4226ab[_0xae37('0x57')]);_0x232090['attributes']=_[_0xae37('0x6b')](_0x4226ab['model'],qs[_0xae37('0x5b')](_0x2078b5[_0xae37('0x57')][_0xae37('0x5b')]));_0x232090[_0xae37('0x5a')]=_0x232090['attributes'][_0xae37('0x6c')]?_0x232090['attributes']:_0x4226ab[_0xae37('0x4f')];if(_0x2078b5[_0xae37('0x57')][_0xae37('0x64')]){_0x232090[_0xae37('0x6d')]=[{'all':!![]}];}_0x232090=_['merge']({},_0x232090,_0x2078b5[_0xae37('0x63')]);return db['ChatWebsite']['find'](_0x232090)[_0xae37('0x17')](handleEntityNotFound(_0x3a38f3,null))[_0xae37('0x17')](respondWithResult(_0x3a38f3,null))['catch'](handleError(_0x3a38f3,null));};exports[_0xae37('0x6e')]=function(_0x2462ae,_0x2ea4fe){return db[_0xae37('0x54')][_0xae37('0x6e')](_0x2462ae['body'],{})[_0xae37('0x17')](function(_0x3b32ea){var _0x25af62=_0x2462ae[_0xae37('0x6f')][_0xae37('0x2d')]({'plain':!![]});if(!_0x25af62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25af62[_0xae37('0x70')]==='user'){var _0x571e26=_0x3b32ea[_0xae37('0x2d')]({'plain':!![]});var _0x49fc2d=_0xae37('0x71');return db[_0xae37('0x72')][_0xae37('0x73')]({'where':{'name':_0x49fc2d,'userProfileId':_0x25af62['userProfileId']},'raw':!![]})['then'](function(_0x158d79){if(_0x158d79&&_0x158d79[_0xae37('0x74')]===0x0){return db[_0xae37('0x2e')][_0xae37('0x6e')]({'name':_0x571e26[_0xae37('0x2f')],'resourceId':_0x571e26['id'],'type':_0x158d79['name'],'sectionId':_0x158d79['id']},{})[_0xae37('0x17')](function(){return _0x3b32ea;});}else{return _0x3b32ea;}})['catch'](function(_0x26d95a){logger[_0xae37('0x1b')](_0xae37('0x75'),_0x26d95a);throw _0x26d95a;});}return _0x3b32ea;})[_0xae37('0x17')](respondWithResult(_0x2ea4fe,0xc9))[_0xae37('0x21')](handleError(_0x2ea4fe,null));};exports[_0xae37('0x2b')]=function(_0x40a8d4,_0xbba271){if(_0x40a8d4[_0xae37('0x76')]['id']){delete _0x40a8d4[_0xae37('0x76')]['id'];}return db[_0xae37('0x54')]['find']({'where':{'id':_0x40a8d4[_0xae37('0x68')]['id']},'include':[{'model':db['Pause'],'as':_0xae37('0x69')}]})[_0xae37('0x17')](handleEntityNotFound(_0xbba271,null))[_0xae37('0x17')](saveUpdates(_0x40a8d4[_0xae37('0x76')],null))['then'](respondWithResult(_0xbba271,null))[_0xae37('0x21')](handleError(_0xbba271,null));};exports[_0xae37('0x2c')]=function(_0x3404b6,_0x49e86d){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x3404b6[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x49e86d,null))[_0xae37('0x17')](removeEntity(_0x49e86d,null))[_0xae37('0x21')](handleError(_0x49e86d,null));};exports['describe']=function(_0xa6f321,_0x1c8b71){return db[_0xae37('0x54')][_0xae37('0x77')]()['then'](respondWithResult(_0x1c8b71,null))[_0xae37('0x21')](handleError(_0x1c8b71,null));};exports[_0xae37('0x78')]=function(_0x45fe97,_0x1e4a60){if(_0x45fe97[_0xae37('0x76')]['id']){delete _0x45fe97[_0xae37('0x76')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x45fe97[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x1e4a60,null))[_0xae37('0x17')](function(_0x2a4955){if(_0x2a4955){_0x45fe97[_0xae37('0x76')][_0xae37('0x79')]=_0x2a4955['id'];return db[_0xae37('0x7a')]['create'](_0x45fe97[_0xae37('0x76')]);}})[_0xae37('0x17')](respondWithResult(_0x1e4a60,null))['catch'](handleError(_0x1e4a60,null));};exports[_0xae37('0x7b')]=function(_0x1e8b2a,_0x82c671){var _0x564247={'raw':![],'where':{}};var _0x492582={};var _0x5734e7={'count':0x0,'rows':[]};return db[_0xae37('0x54')][_0xae37('0x7c')]({'where':{'id':_0x1e8b2a[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x82c671,null))[_0xae37('0x17')](function(_0x21c0a9){if(_0x21c0a9){_0x492582[_0xae37('0x4f')]=_['keys'](db[_0xae37('0x7a')][_0xae37('0x6a')]);_0x492582['query']=_['keys'](_0x1e8b2a[_0xae37('0x57')]);_0x492582[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x492582[_0xae37('0x4f')],_0x492582['query']);_0x564247[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x492582[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x1e8b2a[_0xae37('0x57')][_0xae37('0x5b')]));_0x564247[_0xae37('0x5a')]=_0x564247['attributes'][_0xae37('0x6c')]?_0x564247[_0xae37('0x5a')]:_0x492582[_0xae37('0x4f')];if(!_0x1e8b2a['query'][_0xae37('0x5c')](_0xae37('0x5d'))){_0x564247[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x1e8b2a[_0xae37('0x57')][_0xae37('0x28')]);_0x564247[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x1e8b2a['query'][_0xae37('0x26')]);}_0x564247[_0xae37('0x5e')]=qs[_0xae37('0x7d')](_0x1e8b2a[_0xae37('0x57')][_0xae37('0x7d')]);_0x564247['where']=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x1e8b2a[_0xae37('0x57')],_0x492582[_0xae37('0x59')]));_0x564247[_0xae37('0x5f')][_0xae37('0x79')]=_0x21c0a9['id'];if(_0x1e8b2a[_0xae37('0x57')][_0xae37('0x7e')]){_0x564247[_0xae37('0x5f')]=_[_0xae37('0x61')](_0x564247[_0xae37('0x5f')],{'$or':_['map'](_0x564247[_0xae37('0x5a')],function(_0x1a3a7e){var _0xdb921={};_0xdb921[_0x1a3a7e]={'$like':'%'+_0x1e8b2a[_0xae37('0x57')][_0xae37('0x7e')]+'%'};return _0xdb921;})});}_0x564247=_['merge']({},_0x564247,_0x1e8b2a[_0xae37('0x63')]);return db[_0xae37('0x7a')][_0xae37('0x29')]({'where':_0x564247[_0xae37('0x5f')]})['then'](function(_0x4b4cc1){_0x5734e7[_0xae37('0x29')]=_0x4b4cc1;if(_0x1e8b2a[_0xae37('0x57')][_0xae37('0x64')]){_0x564247[_0xae37('0x6d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x564247);})[_0xae37('0x17')](function(_0x3f6481){_0x5734e7[_0xae37('0x66')]=_0x3f6481;return _0x5734e7;});}})[_0xae37('0x17')](respondWithFilteredResult(_0x82c671,_0x564247))[_0xae37('0x21')](handleError(_0x82c671,null));};exports[_0xae37('0x7f')]=function(_0x5554a8,_0x35a382){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x5554a8[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x35a382,null))[_0xae37('0x17')](function(_0x2abceb){if(_0x2abceb){return _0x2abceb['removeDispositions'](_0x5554a8['query'][_0xae37('0x80')]);}})[_0xae37('0x17')](respondWithStatusCode(_0x35a382,null))[_0xae37('0x21')](handleError(_0x35a382,null));};exports[_0xae37('0x81')]=function(_0x44efa7,_0x458791){if(_0x44efa7['body']['id']){delete _0x44efa7[_0xae37('0x76')]['id'];}return db[_0xae37('0x54')]['find']({'where':{'id':_0x44efa7[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x458791,null))[_0xae37('0x17')](function(_0x88cedf){if(_0x88cedf){_0x44efa7[_0xae37('0x76')][_0xae37('0x79')]=_0x88cedf['id'];return db[_0xae37('0x82')][_0xae37('0x6e')](_0x44efa7[_0xae37('0x76')]);}})[_0xae37('0x17')](respondWithResult(_0x458791,null))['catch'](handleError(_0x458791,null));};exports['getAnswers']=function(_0x53b47e,_0x35a830){var _0x156dbc={'raw':![],'where':{}};var _0x1c8152={};var _0x4dc8de={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x53b47e[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x35a830,null))['then'](function(_0x10b32c){if(_0x10b32c){_0x1c8152['model']=_[_0xae37('0x58')](db['CannedAnswer'][_0xae37('0x6a')]);_0x1c8152['query']=_[_0xae37('0x58')](_0x53b47e[_0xae37('0x57')]);_0x1c8152[_0xae37('0x59')]=_['intersection'](_0x1c8152[_0xae37('0x4f')],_0x1c8152[_0xae37('0x57')]);_0x156dbc['attributes']=_['intersection'](_0x1c8152['model'],qs[_0xae37('0x5b')](_0x53b47e['query'][_0xae37('0x5b')]));_0x156dbc[_0xae37('0x5a')]=_0x156dbc[_0xae37('0x5a')][_0xae37('0x6c')]?_0x156dbc['attributes']:_0x1c8152[_0xae37('0x4f')];if(!_0x53b47e['query']['hasOwnProperty'](_0xae37('0x5d'))){_0x156dbc[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x53b47e['query'][_0xae37('0x28')]);_0x156dbc[_0xae37('0x26')]=qs['offset'](_0x53b47e[_0xae37('0x57')]['offset']);}_0x156dbc['order']=qs[_0xae37('0x7d')](_0x53b47e['query'][_0xae37('0x7d')]);_0x156dbc[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x53b47e[_0xae37('0x57')],_0x1c8152[_0xae37('0x59')]));_0x156dbc['where'][_0xae37('0x79')]=_0x10b32c['id'];if(_0x53b47e['query'][_0xae37('0x7e')]){_0x156dbc[_0xae37('0x5f')]=_['merge'](_0x156dbc[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x156dbc[_0xae37('0x5a')],function(_0x857872){var _0xdcda3={};_0xdcda3[_0x857872]={'$like':'%'+_0x53b47e[_0xae37('0x57')]['filter']+'%'};return _0xdcda3;})});}_0x156dbc=_[_0xae37('0x61')]({},_0x156dbc,_0x53b47e[_0xae37('0x63')]);return db[_0xae37('0x82')][_0xae37('0x29')]({'where':_0x156dbc['where']})[_0xae37('0x17')](function(_0x516aaf){_0x4dc8de['count']=_0x516aaf;if(_0x53b47e[_0xae37('0x57')][_0xae37('0x64')]){_0x156dbc[_0xae37('0x6d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xae37('0x65')](_0x156dbc);})['then'](function(_0x583403){_0x4dc8de[_0xae37('0x66')]=_0x583403;return _0x4dc8de;});}})[_0xae37('0x17')](respondWithFilteredResult(_0x35a830,_0x156dbc))['catch'](handleError(_0x35a830,null));};exports[_0xae37('0x83')]=function(_0x2fcceb,_0x279765){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x2fcceb[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x279765,null))[_0xae37('0x17')](function(_0x16d92d){if(_0x16d92d){return _0x16d92d['removeAnswers'](_0x2fcceb[_0xae37('0x57')]['ids']);}})[_0xae37('0x17')](respondWithStatusCode(_0x279765,null))[_0xae37('0x21')](handleError(_0x279765,null));};exports[_0xae37('0x84')]=function(_0x26056d,_0x5a11e1){_0x26056d[_0xae37('0x76')][_0xae37('0x85')]=_0x26056d[_0xae37('0x86')][_0xae37('0x87')];return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x26056d['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x5a11e1,null))['then'](saveUpdates(_0x26056d['body'],null))['then'](respondWithResult(_0x5a11e1,null))[_0xae37('0x21')](handleError(_0x5a11e1,null));};exports[_0xae37('0x88')]=function(_0x3fb3e8,_0x27acce){_0x3fb3e8[_0xae37('0x76')][_0xae37('0x89')]=_0x3fb3e8['file']['filename'];return db['ChatWebsite'][_0xae37('0x73')]({'where':{'id':_0x3fb3e8[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x27acce,null))['then'](saveUpdates(_0x3fb3e8[_0xae37('0x76')],null))[_0xae37('0x17')](respondWithResult(_0x27acce,null))[_0xae37('0x21')](handleError(_0x27acce,null));};exports[_0xae37('0x8a')]=function(_0x1c730b,_0x4a3c68){_0x1c730b[_0xae37('0x76')][_0xae37('0x8b')]=_0x1c730b['file']['filename'];return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x1c730b[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x4a3c68,null))[_0xae37('0x17')](saveUpdates(_0x1c730b[_0xae37('0x76')],null))[_0xae37('0x17')](respondWithResult(_0x4a3c68,null))[_0xae37('0x21')](handleError(_0x4a3c68,null));};exports['addSystemAvatar']=function(_0x1f4905,_0x45ec35){_0x1f4905[_0xae37('0x76')][_0xae37('0x8c')]=_0x1f4905[_0xae37('0x86')]['filename'];return db[_0xae37('0x54')]['find']({'where':{'id':_0x1f4905[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x45ec35,null))[_0xae37('0x17')](saveUpdates(_0x1f4905['body'],null))[_0xae37('0x17')](respondWithResult(_0x45ec35,null))['catch'](handleError(_0x45ec35,null));};exports[_0xae37('0x8d')]=function(_0x1e6633,_0x53ccdb){var _0x193f38=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x90'));var _0x5aabca={'where':{'id':_0x1e6633[_0xae37('0x68')]['id']},'attributes':['id',_0xae37('0x85')],'raw':!![]};var _0x59bfcb=![];return require(_0xae37('0x91'))['getLicense']()['then'](function(_0x27d052){if(_0x27d052){_0x59bfcb=_0x27d052[_0xae37('0x92')];}})['then'](function(){return db['ChatWebsite'][_0xae37('0x73')](_0x5aabca);})[_0xae37('0x17')](handleEntityNotFound(_0x53ccdb,null))[_0xae37('0x17')](function(_0x13a185){if(_0x13a185){if(!_[_0xae37('0x93')](_0x13a185[_0xae37('0x85')])){if(fs[_0xae37('0x94')](path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server/files/images/logos/',_0x13a185['sitepic']))&&_0x59bfcb){_0x193f38=path['join'](config['root'],'server/files/images/logos/',_0x13a185[_0xae37('0x85')]);}}return _0x53ccdb['download'](_0x193f38);}})['catch'](handleError(_0x53ccdb,null));};exports[_0xae37('0x95')]=function(_0x1552fa,_0x5d77a1){var _0x1e0d4e=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x96'));var _0x1000ef={'where':{'id':_0x1552fa[_0xae37('0x68')]['id']},'attributes':['id',_0xae37('0x89')],'raw':!![]};return db[_0xae37('0x54')]['find'](_0x1000ef)['then'](handleEntityNotFound(_0x5d77a1,null))['then'](function(_0x1eec26){if(_0x1eec26){if(!_[_0xae37('0x93')](_0x1eec26[_0xae37('0x89')])){if(fs[_0xae37('0x94')](path['join'](config[_0xae37('0x8f')],_0xae37('0x97'),_0x1eec26[_0xae37('0x89')]))){_0x1e0d4e=path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server/files/images/avatars/',_0x1eec26[_0xae37('0x89')]);}}return _0x5d77a1[_0xae37('0x98')](_0x1e0d4e);}})[_0xae37('0x21')](handleError(_0x5d77a1,null));};exports[_0xae37('0x99')]=function(_0xaa76c6,_0x1b38c1){var _0x3259e6=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x9a'));var _0x204431={'where':{'id':_0xaa76c6[_0xae37('0x68')]['id']},'attributes':['id','customerAvatar',_0xae37('0x9b')],'raw':!![]};return db['ChatWebsite'][_0xae37('0x73')](_0x204431)['then'](handleEntityNotFound(_0x1b38c1,null))['then'](function(_0x367542){if(_0x367542){if(!_[_0xae37('0x93')](_0x367542[_0xae37('0x8b')])){if(fs[_0xae37('0x94')](path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x97'),_0x367542[_0xae37('0x8b')]))&&_0x367542[_0xae37('0x9b')]){_0x3259e6=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x97'),_0x367542[_0xae37('0x8b')]);}}return _0x1b38c1[_0xae37('0x98')](_0x3259e6);}})[_0xae37('0x21')](handleError(_0x1b38c1,null));};exports[_0xae37('0x9c')]=function(_0x4244a2,_0x3fe905){var _0x239732=path['join'](config[_0xae37('0x8f')],'server/files/images/avatars/system_avatar.png');var _0x10b6e1={'where':{'id':_0x4244a2[_0xae37('0x68')]['id']},'attributes':['id',_0xae37('0x8c')],'raw':!![]};return db[_0xae37('0x54')][_0xae37('0x73')](_0x10b6e1)[_0xae37('0x17')](handleEntityNotFound(_0x3fe905,null))[_0xae37('0x17')](function(_0x21a6d0){if(_0x21a6d0){if(!_[_0xae37('0x93')](_0x21a6d0[_0xae37('0x8c')])){if(fs[_0xae37('0x94')](path['join'](config['root'],'server/files/images/avatars/',_0x21a6d0[_0xae37('0x8c')]))){_0x239732=path[_0xae37('0x8e')](config['root'],'server/files/images/avatars/',_0x21a6d0[_0xae37('0x8c')]);}}return _0x3fe905[_0xae37('0x98')](_0x239732);}})[_0xae37('0x21')](handleError(_0x3fe905,null));};exports[_0xae37('0x9d')]=function(_0x176cd5,_0x357a54){var _0x4f4fc5={'body':_0x176cd5['body'],'channel':'chat'};var _0x45b447=[];var _0x560bba=[];var _0x22b11f={};var _0xb15878=![];return db['CmContact'][_0xae37('0x77')]()[_0xae37('0x17')](function(_0x9be747){if(!_0x9be747){throw new db['Sequelize'][(_0xae37('0x9e'))]('no\x20available\x20attributes');}_0x45b447=_[_0xae37('0x9f')](_['keys'](_0x9be747),[_0xae37('0xa0'),_0xae37('0xa1')]);_0x560bba=_[_0xae37('0x9f')](_['keys'](_0x9be747),[_0xae37('0xa0'),_0xae37('0xa1'),_0xae37('0xa2'),_0xae37('0xa3')]);if(_0x176cd5['body']['id']){delete _0x176cd5[_0xae37('0x76')]['id'];}if(_[_0xae37('0x93')](_0x176cd5[_0xae37('0x76')][_0xae37('0xa4')])){throw new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xa6'));}if(_[_0xae37('0x93')](_0x176cd5['body'][_0xae37('0x76')])||_0x176cd5[_0xae37('0x76')][_0xae37('0x76')]===''){throw new db[(_0xae37('0xa5'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xae37('0x93')](_0x176cd5[_0xae37('0x76')][_0xae37('0xa7')])){throw new db['Sequelize'][(_0xae37('0x9e'))](_0xae37('0xa8')+_0x560bba);}if(!_[_0xae37('0xa9')](_0x560bba,_0x176cd5['body'][_0xae37('0xa7')])){throw new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xaa')+_0x560bba);}_0x22b11f[_0x176cd5['body'][_0xae37('0xa7')]]=_0x176cd5[_0xae37('0x76')][_0xae37('0xa4')];})[_0xae37('0x17')](function(){return db[_0xae37('0x54')]['find']({'where':{'id':_0x176cd5['params']['id']},'include':[{'model':db[_0xae37('0xab')],'as':_0xae37('0xac'),'include':[{'model':db[_0xae37('0xad')],'as':_0xae37('0xae'),'where':_0x22b11f,'limit':0x1,'order':[[_0xae37('0xa1'),_0xae37('0xaf')]]}]},{'model':db[_0xae37('0xb0')],'as':_0xae37('0xb1')},{'model':db[_0xae37('0x3c')],'as':'Interval','include':[{'model':db[_0xae37('0x3c')],'as':_0xae37('0x3d'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xae37('0x17')](function(_0x5af5c7){if(!_0x5af5c7)throw new APINotFoundError(util[_0xae37('0x33')](_0xae37('0xb2'),_0x176cd5[_0xae37('0x68')]['id']));if(!_0x5af5c7[_0xae37('0x3c')]||!_0x5af5c7[_0xae37('0x3c')][_0xae37('0x3d')])return[_0x5af5c7,!![]];return[_0x5af5c7,checkWebsiteIntervals(_0x5af5c7)];})[_0xae37('0xb3')](function(_0x41ec26,_0x4c49c5){if(!_0x4c49c5)throw new APIOutOfIntervalError();if(!_0x41ec26[_0xae37('0xac')])return;_0x4f4fc5[_0xae37('0xb4')]=_0x41ec26;_0x4f4fc5[_0xae37('0xb5')]=_0x41ec26[_0xae37('0xac')];_0x4f4fc5[_0xae37('0xb6')]=_[_0xae37('0xb7')](_0x41ec26[_0xae37('0xb1')],['priority'],[_0xae37('0xb8')]);if(_0x4f4fc5[_0xae37('0xb4')][_0xae37('0xb1')]){delete _0x4f4fc5[_0xae37('0xb4')]['Applications'];}if(_0x4f4fc5['account'][_0xae37('0xac')]&&_0x4f4fc5[_0xae37('0xb4')][_0xae37('0xac')][_0xae37('0xae')][_0xae37('0x6c')]){return _0x4f4fc5[_0xae37('0xb4')][_0xae37('0xac')][_0xae37('0xae')][0x0];}var _0x5255b7=_['defaults'](_0x176cd5[_0xae37('0x76')],{'firstName':_0x176cd5[_0xae37('0x76')]['from'],'ListId':_0x41ec26[_0xae37('0xa3')]});_0x5255b7[_0x176cd5[_0xae37('0x76')][_0xae37('0xa7')]]=_0x176cd5[_0xae37('0x76')][_0xae37('0xa4')];return db[_0xae37('0xad')][_0xae37('0x6e')](_0x5255b7,{'fields':_0x45b447,'raw':!![]});})[_0xae37('0x17')](function(_0x1d0a6d){_0x4f4fc5[_0xae37('0xb9')]=_0x1d0a6d;var _0x23a11a=createInteractionObject(_0x176cd5[_0xae37('0x68')]['id'],_0x176cd5[_0xae37('0x76')],_0x176cd5['headers'],_0x1d0a6d);var _0x48a4a9={'ChatWebsiteId':_0x176cd5[_0xae37('0x68')]['id'],'closed':![]};if(_0x176cd5[_0xae37('0x76')][_0xae37('0xba')]){_0x48a4a9[_0xae37('0xba')]=_0x176cd5[_0xae37('0x76')]['threadId'];return db['ChatInteraction'][_0xae37('0x73')]({'where':_0x48a4a9})[_0xae37('0x17')](function(_0x4c97c6){if(_0x4c97c6){_0xb15878=!![];return _0x4c97c6;}_0x23a11a[_0xae37('0xba')]=_0x176cd5['body'][_0xae37('0xba')];_0x23a11a[_0xae37('0xbb')]=_0x176cd5[_0xae37('0x76')][_0xae37('0xbb')];return db[_0xae37('0xbc')]['create'](_0x23a11a);});}_0x48a4a9['ContactId']=_0x1d0a6d['id'];if(_0x176cd5[_0xae37('0x76')][_0xae37('0xbd')]&&_0x176cd5[_0xae37('0x76')][_0xae37('0xbd')]['id']){_0x48a4a9['id']=_0x176cd5[_0xae37('0x76')][_0xae37('0xbd')]['id'];return db[_0xae37('0xbc')][_0xae37('0x73')]({'where':_0x48a4a9})[_0xae37('0x17')](function(_0x430ab5){if(_0x430ab5){_0xb15878=!![];return _0x430ab5;}return db['ChatInteraction'][_0xae37('0x6e')](_0x23a11a);});}return db[_0xae37('0xbc')]['create'](_0x23a11a);})['then'](function(_0xbc07e){if(!_0xb15878)return _0xbc07e;var _0x48d7a6={'from':(_0x4f4fc5[_0xae37('0xb9')][_0xae37('0xbe')]||'')+'\x20'+(_0x4f4fc5[_0xae37('0xb9')][_0xae37('0xbf')]||'')};if(_0x176cd5[_0xae37('0x76')]['threadId']&&_0x176cd5['body'][_0xae37('0xc0')]&&_0x176cd5[_0xae37('0x76')][_0xae37('0xba')]!=_0x176cd5[_0xae37('0x76')][_0xae37('0xc0')]){_0x48d7a6[_0xae37('0xba')]=_0x176cd5[_0xae37('0x76')][_0xae37('0xc0')];}return _0xbc07e['update'](_0x48d7a6);})[_0xae37('0x17')](function(_0x247f97){_0x4f4fc5[_0xae37('0xbd')]=_0x247f97[_0xae37('0x2d')]({'plain':!![]});_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xc1')]=!_0xb15878;if(_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xc1')]){if(_0x4f4fc5[_0xae37('0xb4')]['autoclose']){_0x4f4fc5['applications'][_0xae37('0xc2')]({'id':0x0,'priority':_0x4f4fc5[_0xae37('0xb6')]['length']+0x1,'app':_0xae37('0xc3'),'appdata':_0xae37('0xc4'),'interval':_0xae37('0xc5')});}}return db[_0xae37('0xc6')][_0xae37('0x6e')]({'body':_0x176cd5[_0xae37('0x76')][_0xae37('0x76')],'ChatWebsiteId':_0x176cd5[_0xae37('0x68')]['id'],'ChatInteractionId':_0x247f97['id'],'direction':'in','ContactId':_0x4f4fc5['contact']['id'],'AttachmentId':_0x176cd5[_0xae37('0x76')][_0xae37('0xc7')]});})[_0xae37('0x17')](function(_0x11bc00){_0x4f4fc5['message']=_0x11bc00;if(!_0x4f4fc5[_0xae37('0xbd')]['UserId']){return;}return db[_0xae37('0xc8')]['find']({'attributes':['id',_0xae37('0x2f')],'where':{'id':_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xc9')]}});})[_0xae37('0x17')](function(_0x28b90d){if(_0x28b90d){_0x4f4fc5[_0xae37('0xb6')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x28b90d['name']+','+(_0x4f4fc5['account'][_0xae37('0xca')]||0xa),'interval':_0xae37('0xc5')});_0x4f4fc5[_0xae37('0xcb')]=!![];}if(!_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xcc')]){return;}return db[_0xae37('0xcd')][_0xae37('0x73')]({'attributes':['id',_0xae37('0x2f')],'where':{'id':_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xcc')]}});})[_0xae37('0x17')](function(_0x158620){if(_0x158620){_0x4f4fc5[_0xae37('0xb6')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x158620['name']+','+(_0x4f4fc5[_0xae37('0xb4')][_0xae37('0xce')]||0x12c),'interval':_0xae37('0xc5')});}return respondWithRpcPromise(_0xae37('0xcf'),_0xae37('0xd0'),_0x4f4fc5);})[_0xae37('0x17')](function(_0x47941c){respondWithRpcPromise(_0xae37('0xd1'),_0xae37('0xd1'),{'event':'notify','message':_0x47941c},client9002);return _0x47941c;})['then'](respondWithResult(_0x357a54,null))[_0xae37('0x21')](APIHandleError(_0x357a54));};exports[_0xae37('0xd2')]=function(_0xf15b4f,_0x11908a){var _0x48b229,_0x378f3f,_0x2234f1;var _0x55bf3c=[];var _0x20fc4e={};var _0xcd61e6=_0xf15b4f[_0xae37('0xd3')]||[];var _0x1a692c=[];var _0x3b1111;return db[_0xae37('0xad')][_0xae37('0x77')]()['then'](function(_0x19615f){if(!_0x19615f){throw new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))]('no\x20available\x20attributes');}_0x55bf3c=_[_0xae37('0x9f')](_['keys'](_0x19615f),['createdAt',_0xae37('0xa1'),'CompanyId',_0xae37('0xa3')]);if(_0xf15b4f['body']['id']){delete _0xf15b4f['body']['id'];}if(_[_0xae37('0x93')](_0xf15b4f[_0xae37('0x76')]['from'])){throw _0x11908a[_0xae37('0x23')](0x1f4)[_0xae37('0x30')](new db[(_0xae37('0xa5'))]['ValidationError'](_0xae37('0xa6')));}if(_[_0xae37('0x93')](_0xf15b4f['body'][_0xae37('0x76')])||_0xf15b4f['body']['body']===''){throw _0x11908a[_0xae37('0x23')](0x1f4)[_0xae37('0x30')](new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xd4')));}if(_[_0xae37('0x93')](_0xf15b4f['body'][_0xae37('0xd5')])){throw _0x11908a[_0xae37('0x23')](0x1f4)['send'](new db[(_0xae37('0xa5'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55bf3c));}if(!_[_0xae37('0xa9')](_0x55bf3c,_0xf15b4f['body'][_0xae37('0xd5')])){throw _0x11908a['status'](0x1f4)[_0xae37('0x30')](new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xd6')+_0x55bf3c));}_0x20fc4e[_0xf15b4f[_0xae37('0x76')][_0xae37('0xd5')]]=_0xf15b4f[_0xae37('0x76')][_0xae37('0xa4')];})['then'](function(){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0xf15b4f[_0xae37('0x68')]['id']},'include':[{'model':db[_0xae37('0xab')],'as':_0xae37('0xac')},{'model':db[_0xae37('0xd7')],'as':_0xae37('0xd7')}]});})[_0xae37('0x17')](handleEntityNotFound(_0x11908a,null))[_0xae37('0x17')](function(_0x256cae){if(_0x256cae&&_0x256cae[_0xae37('0xac')]){_0x378f3f=_0x256cae;var _0x68731a=_[_0xae37('0xf')](_0xf15b4f['body'],{'firstName':_0xf15b4f[_0xae37('0x76')][_0xae37('0xa4')],'phone':_0xf15b4f[_0xae37('0x76')][_0xae37('0xa4')],'ListId':_0x256cae['ListId']});_0x68731a[_0xf15b4f[_0xae37('0x76')][_0xae37('0xd5')]]=_0xf15b4f['body'][_0xae37('0xa4')];return db[_0xae37('0xad')][_0xae37('0xd8')]({'where':_0x20fc4e,'defaults':_0x68731a});}})[_0xae37('0xb3')](function(_0x426e25){if(_0x426e25){_0x2234f1=_0x426e25;var _0x33e481=fs['readFileSync'](path[_0xae37('0x8e')](config['root'],_0xae37('0xd9')),'utf8');var _0x5115a4=ejs[_0xae37('0xda')](_0x33e481,{'body':_['toPairs'](_0xf15b4f['body'][_0xae37('0x76')]),'bodyTitle':_0x378f3f[_0xae37('0xdb')]});return db[_0xae37('0xdc')][_0xae37('0x6e')]({'body':_0x5115a4,'plainBody':htmlToText[_0xae37('0xdd')](_0x5115a4),'ContactId':_0x426e25['id'],'ChatWebsiteId':_0x378f3f['id']});}})[_0xae37('0x17')](function(_0x58056c){_0x3b1111=_0x58056c;if(_0xcd61e6[_0xae37('0x6c')]){var _0x563928=_0xcd61e6['map'](function(_0x5e08e1){return{'name':_0x5e08e1[_0xae37('0xde')],'basename':_0x5e08e1['filename'],'type':_0x5e08e1[_0xae37('0xdf')],'ChatOfflineMessageId':_0x58056c['id']};});_0x1a692c=_0x563928[_0xae37('0x3b')](_0x3c87b9=>{var _0x2bf0f4={'filename':_0x3c87b9[_0xae37('0x2f')],'path':path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server','files','attachments',_0xae37('0xe0'),_0x3c87b9[_0xae37('0xe1')])};return _0x2bf0f4;});if(!_0x378f3f[_0xae37('0xe2')]){return db[_0xae37('0xe3')][_0xae37('0xe4')](function(_0x332370){return db['Attachment'][_0xae37('0xe5')](_0x563928,{'transaction':_0x332370});});}}})['then'](function(){if(_0x3b1111){_0x48b229=_0x3b1111;return db[_0xae37('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xae37('0xe6')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xae37('0xe7')],'as':_0xae37('0xe7'),'raw':!![]}]}]});}})[_0xae37('0x17')](function(_0x1a02a8){if(_0x1a02a8&&_0x1a02a8['Smtp']&&_0x378f3f[_0xae37('0xe8')]&&_0x378f3f[_0xae37('0xe9')]){var _0x4184b4=_0x1a02a8[_0xae37('0xea')]();return respondWithRpcPromise(_0xae37('0xeb'),'sendMail',{'account':_0x4184b4,'message':{'from':util['format'](_0xae37('0xec'),_0x1a02a8[_0xae37('0x2f')],_0x1a02a8[_0xae37('0xed')]||_0x1a02a8['Smtp'][_0xae37('0x6f')]),'to':_0x378f3f[_0xae37('0xe9')],'subject':_0x378f3f[_0xae37('0xee')],'html':_0x48b229[_0xae37('0x76')],'attachments':_0x1a692c}},client9003)[_0xae37('0x17')](function(){return _0x48b229;})[_0xae37('0x21')](function(_0x25a3f8){logger[_0xae37('0x1b')](_0x25a3f8);});}})[_0xae37('0x17')](function(){if(_0x378f3f&&_0x378f3f[_0xae37('0xe2')]&&_0x378f3f[_0xae37('0xef')]){var _0x21d848=[];if(_0xcd61e6[_0xae37('0x6c')]){_0x21d848=_0xcd61e6[_0xae37('0x3b')](function(_0x181e36){return{'name':_0x181e36['originalname'],'basename':_0x181e36[_0xae37('0x87')],'type':_0x181e36['mimetype'],'ChatOfflineMessageId':_0x3b1111['id']};});}var _0x15698a;if(!_[_0xae37('0x93')](_0x378f3f['subjectOffline'])){var _0x15373e=_[_0xae37('0x3b')](_0xf15b4f['body'],function(_0x1a2467){return _0x1a2467;});var _0x662677=_[_0xae37('0xf0')](_0x15373e)[0x0];var _0x2bb2ec=_[_0xae37('0xf1')](_0x662677,function(_0x5603ad){return _0x5603ad;});_0x15698a=_0x2bb2ec[0x1][_0x378f3f[_0xae37('0xf2')]];}var _0x212e5f={'from':_0x2234f1['email'],'firstName':_0x2234f1[_0xae37('0xbe')],'lastName':_0x2234f1[_0xae37('0xbf')],'mapKey':_0xae37('0xed'),'message':{'from':_0x2234f1[_0xae37('0xed')],'to':_0x378f3f[_0xae37('0xd7')]['email'],'cc':'','subject':_['isNil'](_0x15698a)?_0x378f3f[_0xae37('0xee')]:_0x15698a,'messageId':'','sentAt':new Date(),'attach':_0x21d848[_0xae37('0x6c')],'attachments':_0x21d848,'originChannel':'Chat','ChatWebsiteId':_0x378f3f['id'],'ChatOfflineMessageId':_0x48b229['id'],'originTo':_0x378f3f['MailAccount'][_0xae37('0xed')]},'body':_0x48b229[_0xae37('0x76')]};var _0x2d04b6={'account':{'id':_0x378f3f[_0xae37('0xef')]},'body':_0x212e5f,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xae37('0xf3'),_0xae37('0xf4'),_0x2d04b6,client9001)[_0xae37('0x17')](function(){return _0x48b229;})[_0xae37('0x21')](function(_0x45b49f){logger[_0xae37('0x1b')](_0x45b49f);});}return;})[_0xae37('0x17')](function(){if(_0x48b229){return _0x48b229;}})[_0xae37('0x17')](respondWithResult(_0x11908a,null))[_0xae37('0x21')](function(){for(var _0x10b636 of _0xcd61e6){var _0xbdf25d=path['join'](config[_0xae37('0x8f')],_0xae37('0xf5'),'files','attachments',_0xae37('0xe0'),_0x10b636['filename']);fs_extra['remove'](_0xbdf25d)[_0xae37('0x21')](function(_0x3ff06a){logger[_0xae37('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0xbdf25d,_0x3ff06a);});}});};exports[_0xae37('0xf6')]=function(_0x3d3dae,_0x35288e){return db[_0xae37('0xbc')][_0xae37('0x73')]({'where':{'id':_0x3d3dae['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x35288e,null))[_0xae37('0x17')](function(_0x19c6d4){if(_0x19c6d4){return _0x19c6d4[_0xae37('0xf6')](_0x3d3dae['body'][_0xae37('0x80')],_[_0xae37('0xf7')](_0x3d3dae[_0xae37('0x76')],['ids','id'])||{});}})['then'](respondWithResult(_0x35288e,null))[_0xae37('0x21')](handleError(_0x35288e,null));};exports['getInteractions']=function(_0x5997dc,_0x3903db){var _0x504800={'raw':![],'where':{}};var _0x3cdc8e={};var _0x1f0139={'count':0x0,'rows':[]};return db[_0xae37('0x54')]['findOne']({'where':{'id':_0x5997dc[_0xae37('0x68')]['id']}})['then'](handleEntityNotFound(_0x3903db,null))[_0xae37('0x17')](function(_0x30ce42){if(_0x30ce42){_0x3cdc8e[_0xae37('0x4f')]=_['keys'](db[_0xae37('0xbc')][_0xae37('0x6a')]);_0x3cdc8e['query']=_[_0xae37('0x58')](_0x5997dc[_0xae37('0x57')]);_0x3cdc8e[_0xae37('0x59')]=_['intersection'](_0x3cdc8e[_0xae37('0x4f')],_0x3cdc8e[_0xae37('0x57')]);_0x504800[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x3cdc8e[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x5997dc['query'][_0xae37('0x5b')]));_0x504800[_0xae37('0x5a')]=_0x504800[_0xae37('0x5a')][_0xae37('0x6c')]?_0x504800['attributes']:_0x3cdc8e['model'];if(!_0x5997dc[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x504800[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x5997dc[_0xae37('0x57')][_0xae37('0x28')]);_0x504800[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x5997dc[_0xae37('0x57')][_0xae37('0x26')]);}_0x504800[_0xae37('0x5e')]=qs['sort'](_0x5997dc[_0xae37('0x57')][_0xae37('0x7d')]);_0x504800[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x5997dc['query'],_0x3cdc8e['filters']));_0x504800[_0xae37('0x5f')][_0xae37('0x79')]=_0x30ce42['id'];if(_0x5997dc[_0xae37('0x57')][_0xae37('0x7e')]){_0x504800['where']=_[_0xae37('0x61')](_0x504800['where'],{'$or':_[_0xae37('0x3b')](_0x504800[_0xae37('0x5a')],function(_0x24bd9d){var _0x1b76f4={};_0x1b76f4[_0x24bd9d]={'$like':'%'+_0x5997dc['query']['filter']+'%'};return _0x1b76f4;})});}_0x504800=_[_0xae37('0x61')]({},_0x504800,_0x5997dc['options']);return db['ChatInteraction'][_0xae37('0x29')]({'where':_0x504800[_0xae37('0x5f')]})['then'](function(_0x48a36f){_0x1f0139[_0xae37('0x29')]=_0x48a36f;if(_0x5997dc[_0xae37('0x57')]['includeAll']){_0x504800[_0xae37('0x6d')]=[{'model':db[_0xae37('0xad')],'as':_0xae37('0xf8'),'required':![]},{'model':db[_0xae37('0xc8')],'as':_0xae37('0xf9'),'attributes':['name',_0xae37('0xfa'),'internal'],'required':![]},{'model':db[_0xae37('0xfb')],'as':_0xae37('0xfc'),'attributes':['id',_0xae37('0x2f'),_0xae37('0xfd')],'where':_0x5997dc['query'][_0xae37('0xfe')]?{'id':_0x5997dc[_0xae37('0x57')][_0xae37('0xfe')]}:undefined,'required':_0x5997dc[_0xae37('0x57')][_0xae37('0xfe')]?!![]:![]}];}return db[_0xae37('0xbc')]['findAll'](_0x504800);})[_0xae37('0x17')](function(_0xd42d1d){_0x1f0139[_0xae37('0x66')]=_0xd42d1d;return _0x1f0139;});}})[_0xae37('0x17')](respondWithFilteredResult(_0x3903db,_0x504800))[_0xae37('0x21')](handleError(_0x3903db,null));};exports[_0xae37('0xff')]=function(_0x4bc63b,_0x303460){var _0xa71229=0x0;var _0x4fcf33=0x0;var _0x12c314=![];var _0x1dd219;var _0x238b4d;return db['ChatWebsite']['find']({'where':{'id':_0x4bc63b['params']['id']},'include':[{'model':db['Interval'],'as':_0xae37('0x3c'),'include':[{'model':db[_0xae37('0x3c')],'as':_0xae37('0x3d'),'attributes':['id','interval']}]}]})[_0xae37('0x17')](handleEntityNotFound(_0x303460,null))[_0xae37('0x17')](function(_0x1ce492){if(_0x1ce492){_0x1dd219=_0x1ce492;return _0x1ce492[_0xae37('0x100')]({'raw':!![]});}})[_0xae37('0x17')](function(_0x509a46){if(_0x1dd219){if(_0x509a46){_0x238b4d=_0x509a46;}}return require(_0xae37('0x91'))[_0xae37('0x101')]();})[_0xae37('0x17')](function(_0x463c86){if(_0x463c86){_0x4fcf33=_0x463c86['virtual'];_0x12c314=_0x463c86[_0xae37('0x92')];}})[_0xae37('0x17')](function(){return db[_0xae37('0xbc')][_0xae37('0x29')]({'where':{'closed':![]}});})[_0xae37('0x17')](function(_0x7c85bc){_0xa71229=_0x7c85bc;if(_0x4fcf33&&_0x7c85bc>_0x4fcf33){return db[_0xae37('0x102')][_0xae37('0x7c')]({'where':{'id':0x1}})[_0xae37('0x17')](function(_0x325662){if(_0x325662){_0x325662['increment']('chatLicenseExceeded');}});}})[_0xae37('0x17')](function(){if(!_0x1dd219['Interval']||!_0x1dd219[_0xae37('0x3c')][_0xae37('0x3d')])return!![];return checkWebsiteIntervals(_0x1dd219);})['then'](function(_0x49a366){var _0x591c06=fs[_0xae37('0x103')](path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server/files/chat/iframe.ejs'),_0xae37('0x104'));var _0x46c840=new url[(_0xae37('0x105'))](_0x1dd219[_0xae37('0x106')])[_0xae37('0x107')];var _0x4e48ac='3.5.0';var _0x2ed891=![];var _0x32ea88={'chatVersion':_0x4e48ac,'chatWebsiteAddressOrigin':_0x46c840,'remote':_0x1dd219[_0xae37('0x108')],'query':querystring[_0xae37('0x1a')](_[_0xae37('0x61')](_0x1dd219[_0xae37('0x2d')]({'plain':!![]}),{'customerIp':_0x4bc63b[_0xae37('0x109')][_0xae37('0x45')]||_0x4bc63b[_0xae37('0x109')][_0xae37('0x10a')]||_0x4bc63b[_0xae37('0x10b')][_0xae37('0x10c')]||_0x4bc63b['ip'],'referer':_0x4bc63b[_0xae37('0x109')][_0xae37('0x49')],'openedInteractions':_0xa71229,'maxInteractions':_0x4fcf33,'virtual':_0x12c314[_0xae37('0x10d')],'online':_0x49a366,'custom':_0x12c314}))['replace'](/'/g,'\x5c\x27')};_0x303460[_0xae37('0x30')](ejs[_0xae37('0xda')](Mustache['render'](_0x591c06,_0x32ea88),{'proactiveActions':_0x238b4d,'alignment':_0x1dd219[_0xae37('0x10e')],'verticalAlignment':_0x1dd219['verticalAlignment'],'div_color':_0x1dd219['color'],'labelText':_0x1dd219[_0xae37('0x10f')],'text_color':_0x1dd219[_0xae37('0x110')],'text_button_color':_0x1dd219['textButtonColor'],'button_color':_0x1dd219['color_button'],'background_color':_0x1dd219['backgroundColor'],'hideWhenOffline':_0x1dd219[_0xae37('0x111')],'intervalId':_0x1dd219[_0xae37('0x112')],'isDevelopment':_0x2ed891,'chatVersion':_0x4e48ac}));})[_0xae37('0x21')](handleError(_0x303460,null));};exports['addApplications']=function(_0x2607a0,_0x7377f9){var _0x35fe4d=_0x2607a0['params']['id'];var _0x4fbe06=_0x2607a0[_0xae37('0x76')];var _0x407501=0xc8;var _0x95edaf=null;return db[_0xae37('0xe3')][_0xae37('0xe4')]({'isolationLevel':db[_0xae37('0xe3')]['Transaction'][_0xae37('0x113')][_0xae37('0x114')]},function(_0xc9569d){return db[_0xae37('0x54')]['findOne']({'where':{'id':_0x35fe4d},'transaction':_0xc9569d})[_0xae37('0x17')](function(_0x3c536a){if(_0x3c536a){return db[_0xae37('0xb0')][_0xae37('0x2c')]({'where':{'ChatWebsiteId':_0x35fe4d},'transaction':_0xc9569d})[_0xae37('0x17')](function(){var _0x3bae48=_[_0xae37('0x3b')](_0x4fbe06,function(_0x56a951){_0x56a951['ChatWebsiteId']=_0x35fe4d;return _0x56a951;});return db['ChatApplication'][_0xae37('0xe5')](_0x3bae48,{'transaction':_0xc9569d});});}else{_0x407501=0x194;_0x95edaf=[];}});})[_0xae37('0x17')](function(){if(_0x407501!==0x194){return db['ChatApplication'][_0xae37('0x115')]({'where':{'ChatWebsiteId':_0x35fe4d},'order':_0xae37('0x116')})['then'](function(_0x23000b){_0x95edaf=_0x23000b;});}})[_0xae37('0x21')](function(_0x5ca98d){_0x407501=0x1f4;logger['error'](_0x5ca98d['stack']);if(_0x5ca98d[_0xae37('0x2f')]){delete _0x5ca98d[_0xae37('0x2f')];}_0x95edaf=_0x5ca98d;})[_0xae37('0x117')](function(){if(_0x95edaf===null){_0x7377f9['sendStatus'](_0x407501);}else{if(_0x407501===0x1f4){_0x7377f9[_0xae37('0x23')](_0x407501)[_0xae37('0x30')](_0x95edaf);}else{_0x7377f9[_0xae37('0x23')](_0x407501)['json'](_0x95edaf);}}});};exports[_0xae37('0x118')]=function(_0x4afffc,_0x2ad93b){var _0x359b49={};var _0x14129f={};var _0x5e76bf;var _0x1718b5;return db[_0xae37('0x54')][_0xae37('0x7c')]({'where':{'id':_0x4afffc[_0xae37('0x68')]['id']}})['then'](handleEntityNotFound(_0x2ad93b,null))[_0xae37('0x17')](function(_0xcc1ab1){if(_0xcc1ab1){_0x5e76bf=_0xcc1ab1;_0x14129f[_0xae37('0x4f')]=_['keys'](db[_0xae37('0xb0')][_0xae37('0x6a')]);_0x14129f[_0xae37('0x57')]=_[_0xae37('0x58')](_0x4afffc['query']);_0x14129f['filters']=_['intersection'](_0x14129f['model'],_0x14129f[_0xae37('0x57')]);_0x359b49['attributes']=_[_0xae37('0x6b')](_0x14129f['model'],qs[_0xae37('0x5b')](_0x4afffc[_0xae37('0x57')][_0xae37('0x5b')]));_0x359b49[_0xae37('0x5a')]=_0x359b49[_0xae37('0x5a')]['length']?_0x359b49[_0xae37('0x5a')]:_0x14129f[_0xae37('0x4f')];_0x359b49[_0xae37('0x5e')]=qs[_0xae37('0x7d')](_0x4afffc[_0xae37('0x57')][_0xae37('0x7d')]);_0x359b49[_0xae37('0x5f')]=qs['filters'](_[_0xae37('0x60')](_0x4afffc['query'],_0x14129f[_0xae37('0x59')]));if(_0x4afffc['query']['filter']){_0x359b49[_0xae37('0x5f')]=_['merge'](_0x359b49[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x359b49[_0xae37('0x5a')],function(_0x46e098){var _0x49ab72={};_0x49ab72[_0x46e098]={'$like':'%'+_0x4afffc[_0xae37('0x57')]['filter']+'%'};return _0x49ab72;})});}_0x359b49=_[_0xae37('0x61')]({},_0x359b49,_0x4afffc[_0xae37('0x63')]);return _0x5e76bf[_0xae37('0x118')](_0x359b49);}})[_0xae37('0x17')](function(_0x2f22ac){if(_0x2f22ac){_0x1718b5=_0x2f22ac[_0xae37('0x6c')];if(!_0x4afffc[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x359b49[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x4afffc[_0xae37('0x57')][_0xae37('0x28')]);_0x359b49[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x4afffc[_0xae37('0x57')][_0xae37('0x26')]);}return _0x5e76bf[_0xae37('0x118')](_0x359b49);}})[_0xae37('0x17')](function(_0x322025){if(_0x322025){return _0x322025?{'count':_0x1718b5,'rows':_0x322025}:null;}})[_0xae37('0x17')](respondWithResult(_0x2ad93b,null))[_0xae37('0x21')](handleError(_0x2ad93b,null));};exports['addProactiveActions']=function(_0x3191a6,_0x131758){return db[_0xae37('0x119')][_0xae37('0x73')]({'where':{'id':_0x3191a6[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x131758,null))[_0xae37('0x17')](function(_0x4bfad5){if(_0x4bfad5){return _0x4bfad5['addProactiveActions'](_0x3191a6[_0xae37('0x76')][_0xae37('0x80')],_['omit'](_0x3191a6[_0xae37('0x76')],[_0xae37('0x80'),'id'])||{});}})[_0xae37('0x17')](respondWithResult(_0x131758,null))[_0xae37('0x21')](handleError(_0x131758,null));};exports[_0xae37('0x100')]=function(_0xa7d796,_0x135061){var _0x4d8640={};var _0x33de9f={};var _0x1c985a;var _0x2a5464;return db[_0xae37('0x54')]['findOne']({'where':{'id':_0xa7d796['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x135061,null))[_0xae37('0x17')](function(_0x34f96d){if(_0x34f96d){_0x1c985a=_0x34f96d;_0x33de9f[_0xae37('0x4f')]=_[_0xae37('0x58')](db[_0xae37('0x11a')][_0xae37('0x6a')]);_0x33de9f[_0xae37('0x57')]=_[_0xae37('0x58')](_0xa7d796[_0xae37('0x57')]);_0x33de9f[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x33de9f[_0xae37('0x4f')],_0x33de9f[_0xae37('0x57')]);_0x4d8640[_0xae37('0x5a')]=_['intersection'](_0x33de9f['model'],qs[_0xae37('0x5b')](_0xa7d796[_0xae37('0x57')]['fields']));_0x4d8640['attributes']=_0x4d8640[_0xae37('0x5a')][_0xae37('0x6c')]?_0x4d8640['attributes']:_0x33de9f['model'];_0x4d8640['order']=qs[_0xae37('0x7d')](_0xa7d796[_0xae37('0x57')][_0xae37('0x7d')]);_0x4d8640[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0xa7d796[_0xae37('0x57')],_0x33de9f[_0xae37('0x59')]));if(_0xa7d796[_0xae37('0x57')]['filter']){_0x4d8640['where']=_[_0xae37('0x61')](_0x4d8640[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x4d8640[_0xae37('0x5a')],function(_0x3299ec){var _0xb2faf3={};_0xb2faf3[_0x3299ec]={'$like':'%'+_0xa7d796['query'][_0xae37('0x7e')]+'%'};return _0xb2faf3;})});}_0x4d8640=_[_0xae37('0x61')]({},_0x4d8640,_0xa7d796['options']);return _0x1c985a[_0xae37('0x100')](_0x4d8640);}})['then'](function(_0x5b7900){if(_0x5b7900){_0x2a5464=_0x5b7900['length'];if(!_0xa7d796[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x4d8640[_0xae37('0x28')]=qs[_0xae37('0x28')](_0xa7d796['query'][_0xae37('0x28')]);_0x4d8640[_0xae37('0x26')]=qs['offset'](_0xa7d796[_0xae37('0x57')][_0xae37('0x26')]);}return _0x1c985a[_0xae37('0x100')](_0x4d8640);}})[_0xae37('0x17')](function(_0xa68616){if(_0xa68616){return _0xa68616?{'count':_0x2a5464,'rows':_0xa68616}:null;}})['then'](respondWithResult(_0x135061,null))['catch'](handleError(_0x135061,null));};exports[_0xae37('0x11b')]=function(_0x3512ad,_0x3e0a74){var _0x25955f=_0x3512ad[_0xae37('0x57')][_0xae37('0x11c')]==='false'?_0xae37('0x11d'):'onlineForm';return db[_0xae37('0x54')][_0xae37('0x73')]({'attributes':['id',_0x25955f],'where':{'id':_0x3512ad['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x3e0a74,null))[_0xae37('0x17')](function(_0x5ad4f1){if(_0x5ad4f1){var _0x14728c=_0x5ad4f1[_0x25955f];var _0x36ff36=_0x14728c&&_0x14728c[_0xae37('0x11e')]?_0x14728c[_0xae37('0x11e')]:[];_0x3e0a74[_0xae37('0x30')]({'fromKey':_['isNil'](_0x14728c['fromKey'])?undefined:_0x14728c['fromKey'],'count':_0x36ff36['length'],'rows':_0x36ff36});}})[_0xae37('0x21')](handleError(_0x3e0a74,null));};exports[_0xae37('0x11f')]=function(_0x5e536a,_0xa8362d){var _0x44eaa4={'raw':![],'where':{}};var _0x33212d={};var _0x471d52={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xae37('0x7c')]({'where':{'id':_0x5e536a[_0xae37('0x68')]['id']}})['then'](handleEntityNotFound(_0xa8362d,null))[_0xae37('0x17')](function(_0x3606f9){if(_0x3606f9){_0x33212d[_0xae37('0x4f')]=_[_0xae37('0x58')](db[_0xae37('0xdc')]['rawAttributes']);_0x33212d['query']=_['keys'](_0x5e536a[_0xae37('0x57')]);_0x33212d[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x33212d[_0xae37('0x4f')],_0x33212d[_0xae37('0x57')]);_0x44eaa4[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x33212d['model'],qs[_0xae37('0x5b')](_0x5e536a[_0xae37('0x57')][_0xae37('0x5b')]));_0x44eaa4[_0xae37('0x5a')]=_0x44eaa4[_0xae37('0x5a')][_0xae37('0x6c')]?_0x44eaa4[_0xae37('0x5a')]:_0x33212d[_0xae37('0x4f')];if(!_0x5e536a[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x44eaa4[_0xae37('0x28')]=qs['limit'](_0x5e536a['query'][_0xae37('0x28')]);_0x44eaa4[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x5e536a[_0xae37('0x57')][_0xae37('0x26')]);}_0x44eaa4[_0xae37('0x5e')]=qs['sort'](_0x5e536a[_0xae37('0x57')][_0xae37('0x7d')]);_0x44eaa4[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x5e536a[_0xae37('0x57')],_0x33212d[_0xae37('0x59')]));_0x44eaa4['where'][_0xae37('0x79')]=_0x3606f9['id'];if(_0x5e536a['query']['filter']){_0x44eaa4[_0xae37('0x5f')]=_['merge'](_0x44eaa4[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x44eaa4[_0xae37('0x5a')],function(_0x50b6ed){var _0x2f7d6c={};_0x2f7d6c[_0x50b6ed]={'$like':'%'+_0x5e536a[_0xae37('0x57')]['filter']+'%'};return _0x2f7d6c;})});}_0x44eaa4=_[_0xae37('0x61')]({},_0x44eaa4,_0x5e536a[_0xae37('0x63')]);return db[_0xae37('0xdc')][_0xae37('0x29')]({'where':_0x44eaa4['where']})[_0xae37('0x17')](function(_0x4edf14){_0x471d52['count']=_0x4edf14;if(_0x5e536a[_0xae37('0x57')][_0xae37('0x64')]){_0x44eaa4['include']=[{'all':!![]}];}else{_0x44eaa4[_0xae37('0x6d')]=[{'model':db[_0xae37('0xad')],'as':_0xae37('0xf8'),'required':![]},{'model':db[_0xae37('0x120')],'as':_0xae37('0x121'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x44eaa4);})['then'](function(_0x33bcf1){_0x471d52[_0xae37('0x66')]=_0x33bcf1;return _0x471d52;});}})[_0xae37('0x17')](respondWithFilteredResult(_0xa8362d,_0x44eaa4))[_0xae37('0x21')](handleError(_0xa8362d,null));};exports['addAgents']=function(_0x43071e,_0xaea7af){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x43071e[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0xaea7af,null))['then'](function(_0x4334ee){if(_0x4334ee){return _0x4334ee['addAgents'](_0x43071e[_0xae37('0x76')]['ids'],_[_0xae37('0xf7')](_0x43071e[_0xae37('0x76')],['ids','id'])||{})['spread'](function(_0x4a1996){for(var _0x43f3f9=0x0;_0x43f3f9<_0x43071e[_0xae37('0x76')][_0xae37('0x80')][_0xae37('0x6c')];_0x43f3f9+=0x1){socket[_0xae37('0x122')](_0xae37('0x123'),{'UserId':Number(_0x43071e['body']['ids'][_0x43f3f9]),'ChatWebsiteId':Number(_0x43071e[_0xae37('0x68')]['id'])});}return _0x4a1996;});}})['then'](respondWithResult(_0xaea7af,null))[_0xae37('0x21')](handleError(_0xaea7af,null));};exports[_0xae37('0x124')]=function(_0x4afae3,_0x4a4a4c){return db['ChatWebsite']['find']({'where':{'id':_0x4afae3[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x4a4a4c,null))[_0xae37('0x17')](function(_0x7c615e){if(_0x7c615e){return _0x7c615e[_0xae37('0x124')](_0x4afae3[_0xae37('0x57')][_0xae37('0x80')])[_0xae37('0x17')](function(){if(_['isArray'](_0x4afae3[_0xae37('0x57')][_0xae37('0x80')])){for(var _0xb70b6f=0x0;_0xb70b6f<_0x4afae3['query'][_0xae37('0x80')][_0xae37('0x6c')];_0xb70b6f+=0x1){socket[_0xae37('0x122')](_0xae37('0x125'),{'UserId':Number(_0x4afae3[_0xae37('0x57')][_0xae37('0x80')][_0xb70b6f]),'ChatWebsiteId':Number(_0x4afae3[_0xae37('0x68')]['id'])});}}else{socket['emit'](_0xae37('0x125'),{'UserId':Number(_0x4afae3[_0xae37('0x57')][_0xae37('0x80')]),'ChatWebsiteId':Number(_0x4afae3[_0xae37('0x68')]['id'])});}});}})[_0xae37('0x17')](respondWithStatusCode(_0x4a4a4c,null))['catch'](handleError(_0x4a4a4c,null));};exports['getAgents']=function(_0x56278a,_0x2f1471){var _0x2a4938={};var _0x184469={};var _0x3b1b62;var _0x265fef;return db[_0xae37('0x54')][_0xae37('0x7c')]({'where':{'id':_0x56278a['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x2f1471,null))[_0xae37('0x17')](function(_0x2c1432){if(_0x2c1432){_0x3b1b62=_0x2c1432;_0x184469[_0xae37('0x4f')]=_[_0xae37('0x58')](db[_0xae37('0xc8')]['rawAttributes']);_0x184469[_0xae37('0x57')]=_[_0xae37('0x58')](_0x56278a['query']);_0x184469['filters']=_[_0xae37('0x6b')](_0x184469[_0xae37('0x4f')],_0x184469[_0xae37('0x57')]);_0x2a4938[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x184469[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x56278a['query']['fields']));_0x2a4938[_0xae37('0x5a')]=_0x2a4938[_0xae37('0x5a')][_0xae37('0x6c')]?_0x2a4938[_0xae37('0x5a')]:_0x184469['model'];_0x2a4938[_0xae37('0x5e')]=qs[_0xae37('0x7d')](_0x56278a[_0xae37('0x57')][_0xae37('0x7d')]);_0x2a4938['where']=qs['filters'](_[_0xae37('0x60')](_0x56278a[_0xae37('0x57')],_0x184469['filters']));if(_0x56278a['query'][_0xae37('0x7e')]){_0x2a4938[_0xae37('0x5f')]=_[_0xae37('0x61')](_0x2a4938[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x2a4938[_0xae37('0x5a')],function(_0xda617c){var _0x1e83d7={};_0x1e83d7[_0xda617c]={'$like':'%'+_0x56278a[_0xae37('0x57')][_0xae37('0x7e')]+'%'};return _0x1e83d7;})});}_0x2a4938=_['merge']({},_0x2a4938,_0x56278a[_0xae37('0x63')]);return _0x3b1b62[_0xae37('0x126')](_0x2a4938);}})[_0xae37('0x17')](function(_0x3e62cf){if(_0x3e62cf){_0x265fef=_0x3e62cf['length'];if(!_0x56278a[_0xae37('0x57')]['hasOwnProperty']('nolimit')){_0x2a4938[_0xae37('0x28')]=qs['limit'](_0x56278a[_0xae37('0x57')][_0xae37('0x28')]);_0x2a4938[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x56278a[_0xae37('0x57')][_0xae37('0x26')]);}return _0x3b1b62[_0xae37('0x126')](_0x2a4938);}})[_0xae37('0x17')](function(_0x535649){if(_0x535649){return _0x535649?{'count':_0x265fef,'rows':_0x535649}:null;}})[_0xae37('0x17')](respondWithResult(_0x2f1471,null))['catch'](handleError(_0x2f1471,null));};
\ No newline at end of file
+var _0x70e0=['getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','hasOwnProperty','Owner','fullname','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','../../config/license/util','License','increment','chatLicenseExceeded','all','some','URL','origin','remote','x-real-ip','connection','remoteAddress','virtual','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','onlineForm','items','fromKey','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','fs-extra','lodash','querystring','ioredis','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','type','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','params','rawAttributes','intersection','create','user','get','role','ChatWebsites','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','ChatWebsiteId','pick','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','DESC','ChatApplication','Applications','List','applications','orderBy','priority','account','Contacts','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','files','CompanyId','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress'];(function(_0x4fe35d,_0x21fee1){var _0x5bb28e=function(_0x214051){while(--_0x214051){_0x4fe35d['push'](_0x4fe35d['shift']());}};_0x5bb28e(++_0x21fee1);}(_0x70e0,0x17b));var _0x070e=function(_0x37f1d9,_0x95a04f){_0x37f1d9=_0x37f1d9-0x0;var _0x47413d=_0x70e0[_0x37f1d9];return _0x47413d;};'use strict';var BPromise=require(_0x070e('0x0'));var Mustache=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x070e('0x3'));var _=require(_0x070e('0x4'));var querystring=require(_0x070e('0x5'));var Redis=require(_0x070e('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x070e('0x7'))('api');var config=require(_0x070e('0x8'));var url=require('url');var db=require('../../mysqldb')['db'];config['redis']=_[_0x070e('0x9')](config[_0x070e('0xa')],{'host':_0x070e('0xb'),'port':0x18eb});var socket=require(_0x070e('0xc'))(new Redis(config[_0x070e('0xa')]));require(_0x070e('0xd'))[_0x070e('0xe')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x232c});var client9002=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x232a});var client9003=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x232b});var client9001=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x39d2b9,_0x5bf079,_0x2930b8,_0x52da3b){return new BPromise(function(_0x5dca0f,_0x24baba){var _0x56c7ba=_0x52da3b||client;return _0x56c7ba['request'](_0x39d2b9,_0x2930b8)['then'](function(_0x11d2ce){logger[_0x070e('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x5bf079,'request\x20sent');logger[_0x070e('0x12')](_0x070e('0x13'),_0x5bf079,_0x070e('0x14'),JSON[_0x070e('0x15')](_0x11d2ce));if(_0x11d2ce['error']){if(_0x11d2ce['error'][_0x070e('0x16')]===0x1f4){logger[_0x070e('0x17')](_0x070e('0x18'),_0x5bf079,_0x11d2ce[_0x070e('0x17')][_0x070e('0x19')]);return _0x24baba(_0x11d2ce['error'][_0x070e('0x19')]);}logger[_0x070e('0x17')](_0x070e('0x18'),_0x5bf079,_0x11d2ce[_0x070e('0x17')][_0x070e('0x19')]);return _0x5dca0f(_0x11d2ce['error']['message']);}else{logger['info'](_0x070e('0x18'),_0x5bf079,_0x070e('0x14'));_0x5dca0f(_0x11d2ce[_0x070e('0x1a')]['message']);}})[_0x070e('0x1b')](function(_0x5dc5d2){logger[_0x070e('0x17')](_0x070e('0x18'),_0x5bf079,_0x5dc5d2);_0x24baba(_0x5dc5d2);});});}function respondWithStatusCode(_0x27a01e,_0x33e8c6){_0x33e8c6=_0x33e8c6||0xcc;return function(_0x28a1c3){if(_0x28a1c3){return _0x27a01e[_0x070e('0x1c')](_0x33e8c6);}return _0x27a01e[_0x070e('0x1d')](_0x33e8c6)[_0x070e('0x1e')]();};}function respondWithResult(_0x595c7e,_0x2f8055){_0x2f8055=_0x2f8055||0xc8;return function(_0x270061){if(_0x270061){return _0x595c7e[_0x070e('0x1d')](_0x2f8055)['json'](_0x270061);}};}function respondWithFilteredResult(_0xf17c56,_0x5f3e9d){return function(_0x4a2dbd){if(_0x4a2dbd){var _0x2ccbd7=typeof _0x5f3e9d[_0x070e('0x1f')]===_0x070e('0x20')&&typeof _0x5f3e9d[_0x070e('0x21')]===_0x070e('0x20');var _0x497f58=_0x4a2dbd[_0x070e('0x22')];var _0x219e48=_0x2ccbd7?0x0:_0x5f3e9d[_0x070e('0x1f')];var _0x1d2a34=_0x2ccbd7?_0x4a2dbd[_0x070e('0x22')]:_0x5f3e9d[_0x070e('0x1f')]+_0x5f3e9d[_0x070e('0x21')];var _0x26373b;if(_0x1d2a34>=_0x497f58){_0x1d2a34=_0x497f58;_0x26373b=0xc8;}else{_0x26373b=0xce;}_0xf17c56['status'](_0x26373b);return _0xf17c56[_0x070e('0x23')](_0x070e('0x24'),_0x219e48+'-'+_0x1d2a34+'/'+_0x497f58)[_0x070e('0x25')](_0x4a2dbd);}return null;};}function saveUpdates(_0x56fc12){return function(_0x5c5f0d){if(_0x5c5f0d){return _0x5c5f0d[_0x070e('0x26')](_0x56fc12)[_0x070e('0x27')](function(_0xa6c0ab){return _0xa6c0ab;});}return null;};}function removeEntity(_0x51402c){return function(_0x3fa994){if(_0x3fa994){return _0x3fa994[_0x070e('0x28')]()[_0x070e('0x27')](function(){var _0x5f2bee=_0x3fa994['get']({'plain':!![]});var _0x5bf522='ChatWebsites';return db['UserProfileResource'][_0x070e('0x28')]({'where':{'type':_0x5bf522,'resourceId':_0x5f2bee['id']}})['then'](function(){return _0x3fa994;});})[_0x070e('0x27')](function(){_0x51402c[_0x070e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a739){return function(_0x699739){if(!_0x699739){_0x47a739[_0x070e('0x1c')](0x194);}return _0x699739;};}function handleError(_0x55288a,_0x546a16){_0x546a16=_0x546a16||0x1f4;return function(_0x41ade4){logger[_0x070e('0x17')](_0x41ade4[_0x070e('0x29')]);if(_0x41ade4[_0x070e('0x2a')]){delete _0x41ade4[_0x070e('0x2a')];}_0x55288a['status'](_0x546a16)['send'](_0x41ade4);};}exports[_0x070e('0x2b')]=function(_0x3011c4,_0x4bb439){var _0xf57ed={'include':[{'model':db[_0x070e('0x2c')],'as':_0x070e('0x2d')}]},_0xf11439={},_0x4deaf8={'count':0x0,'rows':[]};var _0x534150=_[_0x070e('0x2e')](db[_0x070e('0x2f')]['rawAttributes'],function(_0x4d4ee8){return{'name':_0x4d4ee8['fieldName'],'type':_0x4d4ee8[_0x070e('0x30')][_0x070e('0x31')]};});_0xf11439[_0x070e('0x32')]=_[_0x070e('0x2e')](_0x534150,_0x070e('0x2a'));_0xf11439['query']=_[_0x070e('0x33')](_0x3011c4[_0x070e('0x34')]);_0xf11439[_0x070e('0x35')]=_['intersection'](_0xf11439[_0x070e('0x32')],_0xf11439[_0x070e('0x34')]);_0xf57ed[_0x070e('0x36')]=_['intersection'](_0xf11439[_0x070e('0x32')],qs[_0x070e('0x37')](_0x3011c4['query'][_0x070e('0x37')]));_0xf57ed['attributes']=_0xf57ed[_0x070e('0x36')][_0x070e('0x38')]?_0xf57ed[_0x070e('0x36')]:_0xf11439[_0x070e('0x32')];if(!_0x3011c4[_0x070e('0x34')]['hasOwnProperty'](_0x070e('0x39'))){_0xf57ed['limit']=qs['limit'](_0x3011c4[_0x070e('0x34')][_0x070e('0x21')]);_0xf57ed[_0x070e('0x1f')]=qs['offset'](_0x3011c4[_0x070e('0x34')][_0x070e('0x1f')]);}_0xf57ed[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x3011c4['query'][_0x070e('0x3b')]);_0xf57ed['where']=qs['filters'](_['pick'](_0x3011c4[_0x070e('0x34')],_0xf11439[_0x070e('0x35')]),_0x534150);if(_0x3011c4[_0x070e('0x34')][_0x070e('0x3c')]){_0xf57ed[_0x070e('0x3d')]=_['merge'](_0xf57ed[_0x070e('0x3d')],{'$or':_['map'](_0x534150,function(_0x23dac5){if(_0x23dac5[_0x070e('0x30')]!==_0x070e('0x3e')){var _0x52fcea={};_0x52fcea[_0x23dac5['name']]={'$like':'%'+_0x3011c4[_0x070e('0x34')]['filter']+'%'};return _0x52fcea;}})});}_0xf57ed=_[_0x070e('0x3f')]({},_0xf57ed,_0x3011c4[_0x070e('0x40')]);var _0x139820={'where':_0xf57ed['where']};return db[_0x070e('0x2f')][_0x070e('0x22')](_0x139820)['then'](function(_0x589b97){_0x4deaf8[_0x070e('0x22')]=_0x589b97;if(_0x3011c4[_0x070e('0x34')][_0x070e('0x41')]){_0xf57ed[_0x070e('0x42')]=[{'all':!![]}];}return db[_0x070e('0x2f')]['findAll'](_0xf57ed);})[_0x070e('0x27')](function(_0x3f6c64){_0x4deaf8[_0x070e('0x43')]=_0x3f6c64;return _0x4deaf8;})[_0x070e('0x27')](respondWithFilteredResult(_0x4bb439,_0xf57ed))[_0x070e('0x1b')](handleError(_0x4bb439,null));};exports[_0x070e('0x44')]=function(_0x1f54d5,_0x1b5374){var _0xd67987={'raw':![],'where':{'id':_0x1f54d5[_0x070e('0x45')]['id']},'include':[{'model':db[_0x070e('0x2c')],'as':_0x070e('0x2d')}]},_0x66a3f3={};_0x66a3f3[_0x070e('0x32')]=_[_0x070e('0x33')](db['ChatWebsite'][_0x070e('0x46')]);_0x66a3f3[_0x070e('0x34')]=_[_0x070e('0x33')](_0x1f54d5[_0x070e('0x34')]);_0x66a3f3[_0x070e('0x35')]=_[_0x070e('0x47')](_0x66a3f3[_0x070e('0x32')],_0x66a3f3[_0x070e('0x34')]);_0xd67987[_0x070e('0x36')]=_['intersection'](_0x66a3f3[_0x070e('0x32')],qs['fields'](_0x1f54d5[_0x070e('0x34')][_0x070e('0x37')]));_0xd67987['attributes']=_0xd67987[_0x070e('0x36')][_0x070e('0x38')]?_0xd67987[_0x070e('0x36')]:_0x66a3f3[_0x070e('0x32')];if(_0x1f54d5[_0x070e('0x34')][_0x070e('0x41')]){_0xd67987[_0x070e('0x42')]=[{'all':!![]}];}_0xd67987=_['merge']({},_0xd67987,_0x1f54d5[_0x070e('0x40')]);return db['ChatWebsite']['find'](_0xd67987)[_0x070e('0x27')](handleEntityNotFound(_0x1b5374,null))[_0x070e('0x27')](respondWithResult(_0x1b5374,null))[_0x070e('0x1b')](handleError(_0x1b5374,null));};exports[_0x070e('0x48')]=function(_0x202015,_0x7948ed){return db[_0x070e('0x2f')][_0x070e('0x48')](_0x202015['body'],{})[_0x070e('0x27')](function(_0x51d27d){var _0x564d82=_0x202015[_0x070e('0x49')][_0x070e('0x4a')]({'plain':!![]});if(!_0x564d82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x564d82[_0x070e('0x4b')]===_0x070e('0x49')){var _0x210f4a=_0x51d27d[_0x070e('0x4a')]({'plain':!![]});var _0x1aacfc=_0x070e('0x4c');return db[_0x070e('0x4d')]['find']({'where':{'name':_0x1aacfc,'userProfileId':_0x564d82['userProfileId']},'raw':!![]})['then'](function(_0x3087e5){if(_0x3087e5&&_0x3087e5[_0x070e('0x4e')]===0x0){return db[_0x070e('0x4f')][_0x070e('0x48')]({'name':_0x210f4a['name'],'resourceId':_0x210f4a['id'],'type':_0x3087e5[_0x070e('0x2a')],'sectionId':_0x3087e5['id']},{})['then'](function(){return _0x51d27d;});}else{return _0x51d27d;}})[_0x070e('0x1b')](function(_0x1cbb7e){logger[_0x070e('0x17')](_0x070e('0x50'),_0x1cbb7e);throw _0x1cbb7e;});}return _0x51d27d;})[_0x070e('0x27')](respondWithResult(_0x7948ed,0xc9))[_0x070e('0x1b')](handleError(_0x7948ed,null));};exports['update']=function(_0x20ff87,_0x18e8d0){if(_0x20ff87[_0x070e('0x51')]['id']){delete _0x20ff87['body']['id'];}return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x20ff87['params']['id']},'include':[{'model':db[_0x070e('0x2c')],'as':'mandatoryDispositionPause'}]})[_0x070e('0x27')](handleEntityNotFound(_0x18e8d0,null))['then'](saveUpdates(_0x20ff87['body'],null))['then'](respondWithResult(_0x18e8d0,null))[_0x070e('0x1b')](handleError(_0x18e8d0,null));};exports[_0x070e('0x28')]=function(_0x1100d8,_0x122198){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x1100d8['params']['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x122198,null))['then'](removeEntity(_0x122198,null))[_0x070e('0x1b')](handleError(_0x122198,null));};exports['describe']=function(_0x2e10f7,_0x34f410){return db['ChatWebsite'][_0x070e('0x53')]()['then'](respondWithResult(_0x34f410,null))[_0x070e('0x1b')](handleError(_0x34f410,null));};exports[_0x070e('0x54')]=function(_0x2f1604,_0x2b172a){if(_0x2f1604[_0x070e('0x51')]['id']){delete _0x2f1604[_0x070e('0x51')]['id'];}return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x2f1604[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x2b172a,null))[_0x070e('0x27')](function(_0x16887c){if(_0x16887c){_0x2f1604[_0x070e('0x51')][_0x070e('0x55')]=_0x16887c['id'];return db['Disposition'][_0x070e('0x48')](_0x2f1604[_0x070e('0x51')]);}})[_0x070e('0x27')](respondWithResult(_0x2b172a,null))[_0x070e('0x1b')](handleError(_0x2b172a,null));};exports['getDispositions']=function(_0x2ccd8d,_0x4e8e58){var _0x398f54={'raw':![],'where':{}};var _0x5625a9={};var _0x2a7b5d={'count':0x0,'rows':[]};return db[_0x070e('0x2f')]['findOne']({'where':{'id':_0x2ccd8d[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x4e8e58,null))[_0x070e('0x27')](function(_0x2fe202){if(_0x2fe202){_0x5625a9['model']=_[_0x070e('0x33')](db['Disposition'][_0x070e('0x46')]);_0x5625a9[_0x070e('0x34')]=_[_0x070e('0x33')](_0x2ccd8d[_0x070e('0x34')]);_0x5625a9[_0x070e('0x35')]=_['intersection'](_0x5625a9[_0x070e('0x32')],_0x5625a9[_0x070e('0x34')]);_0x398f54[_0x070e('0x36')]=_[_0x070e('0x47')](_0x5625a9['model'],qs[_0x070e('0x37')](_0x2ccd8d['query'][_0x070e('0x37')]));_0x398f54[_0x070e('0x36')]=_0x398f54[_0x070e('0x36')]['length']?_0x398f54[_0x070e('0x36')]:_0x5625a9['model'];if(!_0x2ccd8d[_0x070e('0x34')]['hasOwnProperty'](_0x070e('0x39'))){_0x398f54[_0x070e('0x21')]=qs['limit'](_0x2ccd8d[_0x070e('0x34')]['limit']);_0x398f54[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x2ccd8d['query']['offset']);}_0x398f54[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x2ccd8d[_0x070e('0x34')][_0x070e('0x3b')]);_0x398f54[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x2ccd8d[_0x070e('0x34')],_0x5625a9[_0x070e('0x35')]));_0x398f54[_0x070e('0x3d')][_0x070e('0x55')]=_0x2fe202['id'];if(_0x2ccd8d[_0x070e('0x34')][_0x070e('0x3c')]){_0x398f54['where']=_[_0x070e('0x3f')](_0x398f54[_0x070e('0x3d')],{'$or':_['map'](_0x398f54['attributes'],function(_0x1916f4){var _0x2a4de5={};_0x2a4de5[_0x1916f4]={'$like':'%'+_0x2ccd8d[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x2a4de5;})});}_0x398f54=_[_0x070e('0x3f')]({},_0x398f54,_0x2ccd8d[_0x070e('0x40')]);return db[_0x070e('0x57')][_0x070e('0x22')]({'where':_0x398f54[_0x070e('0x3d')]})[_0x070e('0x27')](function(_0x62800d){_0x2a7b5d[_0x070e('0x22')]=_0x62800d;if(_0x2ccd8d[_0x070e('0x34')]['includeAll']){_0x398f54['include']=[{'all':!![]}];}return db['Disposition'][_0x070e('0x58')](_0x398f54);})[_0x070e('0x27')](function(_0x2c4e67){_0x2a7b5d[_0x070e('0x43')]=_0x2c4e67;return _0x2a7b5d;});}})['then'](respondWithFilteredResult(_0x4e8e58,_0x398f54))[_0x070e('0x1b')](handleError(_0x4e8e58,null));};exports[_0x070e('0x59')]=function(_0x416dde,_0xd74f9c){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x416dde['params']['id']}})[_0x070e('0x27')](handleEntityNotFound(_0xd74f9c,null))['then'](function(_0x2e5bca){if(_0x2e5bca){return _0x2e5bca[_0x070e('0x59')](_0x416dde[_0x070e('0x34')][_0x070e('0x5a')]);}})[_0x070e('0x27')](respondWithStatusCode(_0xd74f9c,null))['catch'](handleError(_0xd74f9c,null));};exports[_0x070e('0x5b')]=function(_0x15450f,_0x5d3bd8){if(_0x15450f[_0x070e('0x51')]['id']){delete _0x15450f[_0x070e('0x51')]['id'];}return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x15450f[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x5d3bd8,null))['then'](function(_0x40d7e6){if(_0x40d7e6){_0x15450f[_0x070e('0x51')][_0x070e('0x55')]=_0x40d7e6['id'];return db[_0x070e('0x5c')][_0x070e('0x48')](_0x15450f[_0x070e('0x51')]);}})[_0x070e('0x27')](respondWithResult(_0x5d3bd8,null))[_0x070e('0x1b')](handleError(_0x5d3bd8,null));};exports[_0x070e('0x5d')]=function(_0x31ab81,_0x1b1a0c){var _0x46d2b7={'raw':![],'where':{}};var _0x18c27a={};var _0x4b058d={'count':0x0,'rows':[]};return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x31ab81[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x1b1a0c,null))[_0x070e('0x27')](function(_0x1d1aa2){if(_0x1d1aa2){_0x18c27a['model']=_['keys'](db['CannedAnswer'][_0x070e('0x46')]);_0x18c27a[_0x070e('0x34')]=_[_0x070e('0x33')](_0x31ab81[_0x070e('0x34')]);_0x18c27a['filters']=_[_0x070e('0x47')](_0x18c27a[_0x070e('0x32')],_0x18c27a[_0x070e('0x34')]);_0x46d2b7['attributes']=_[_0x070e('0x47')](_0x18c27a['model'],qs[_0x070e('0x37')](_0x31ab81[_0x070e('0x34')]['fields']));_0x46d2b7['attributes']=_0x46d2b7[_0x070e('0x36')][_0x070e('0x38')]?_0x46d2b7['attributes']:_0x18c27a[_0x070e('0x32')];if(!_0x31ab81['query']['hasOwnProperty']('nolimit')){_0x46d2b7[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x31ab81[_0x070e('0x34')][_0x070e('0x21')]);_0x46d2b7[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x31ab81[_0x070e('0x34')][_0x070e('0x1f')]);}_0x46d2b7[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x31ab81[_0x070e('0x34')][_0x070e('0x3b')]);_0x46d2b7[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x31ab81[_0x070e('0x34')],_0x18c27a[_0x070e('0x35')]));_0x46d2b7[_0x070e('0x3d')][_0x070e('0x55')]=_0x1d1aa2['id'];if(_0x31ab81[_0x070e('0x34')][_0x070e('0x3c')]){_0x46d2b7[_0x070e('0x3d')]=_['merge'](_0x46d2b7[_0x070e('0x3d')],{'$or':_[_0x070e('0x2e')](_0x46d2b7[_0x070e('0x36')],function(_0xe50b1b){var _0x495403={};_0x495403[_0xe50b1b]={'$like':'%'+_0x31ab81[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x495403;})});}_0x46d2b7=_[_0x070e('0x3f')]({},_0x46d2b7,_0x31ab81[_0x070e('0x40')]);return db[_0x070e('0x5c')][_0x070e('0x22')]({'where':_0x46d2b7['where']})['then'](function(_0x524a81){_0x4b058d[_0x070e('0x22')]=_0x524a81;if(_0x31ab81['query'][_0x070e('0x41')]){_0x46d2b7[_0x070e('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0x070e('0x58')](_0x46d2b7);})[_0x070e('0x27')](function(_0x4f9a95){_0x4b058d['rows']=_0x4f9a95;return _0x4b058d;});}})[_0x070e('0x27')](respondWithFilteredResult(_0x1b1a0c,_0x46d2b7))[_0x070e('0x1b')](handleError(_0x1b1a0c,null));};exports[_0x070e('0x5f')]=function(_0x38f600,_0x6149cc){return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x38f600['params']['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x6149cc,null))[_0x070e('0x27')](function(_0x490641){if(_0x490641){return _0x490641[_0x070e('0x5f')](_0x38f600[_0x070e('0x34')][_0x070e('0x5a')]);}})[_0x070e('0x27')](respondWithStatusCode(_0x6149cc,null))[_0x070e('0x1b')](handleError(_0x6149cc,null));};exports[_0x070e('0x60')]=function(_0x4bc490,_0x41a3cc){_0x4bc490[_0x070e('0x51')][_0x070e('0x61')]=_0x4bc490[_0x070e('0x62')][_0x070e('0x63')];return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x4bc490[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x41a3cc,null))[_0x070e('0x27')](saveUpdates(_0x4bc490[_0x070e('0x51')],null))[_0x070e('0x27')](respondWithResult(_0x41a3cc,null))[_0x070e('0x1b')](handleError(_0x41a3cc,null));};exports[_0x070e('0x64')]=function(_0x1fb1e6,_0xfe61be){_0x1fb1e6[_0x070e('0x51')][_0x070e('0x65')]=_0x1fb1e6[_0x070e('0x62')][_0x070e('0x63')];return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x1fb1e6['params']['id']}})['then'](handleEntityNotFound(_0xfe61be,null))[_0x070e('0x27')](saveUpdates(_0x1fb1e6[_0x070e('0x51')],null))['then'](respondWithResult(_0xfe61be,null))['catch'](handleError(_0xfe61be,null));};exports['addCustomerAvatar']=function(_0x4cb7b2,_0x1a430d){_0x4cb7b2[_0x070e('0x51')][_0x070e('0x66')]=_0x4cb7b2[_0x070e('0x62')][_0x070e('0x63')];return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x4cb7b2[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x1a430d,null))[_0x070e('0x27')](saveUpdates(_0x4cb7b2['body'],null))[_0x070e('0x27')](respondWithResult(_0x1a430d,null))[_0x070e('0x1b')](handleError(_0x1a430d,null));};exports['addSystemAvatar']=function(_0x30db4a,_0x2890ba){_0x30db4a[_0x070e('0x51')][_0x070e('0x67')]=_0x30db4a['file'][_0x070e('0x63')];return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x30db4a[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x2890ba,null))[_0x070e('0x27')](saveUpdates(_0x30db4a[_0x070e('0x51')],null))[_0x070e('0x27')](respondWithResult(_0x2890ba,null))[_0x070e('0x1b')](handleError(_0x2890ba,null));};exports[_0x070e('0x68')]=function(_0x27b51c,_0x1a4ed1){var _0xb2cca5=path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x6b'));var _0x479888={'where':{'id':_0x27b51c[_0x070e('0x45')]['id']},'attributes':['id',_0x070e('0x61')],'raw':!![]};var _0x5e3263=![];return require('../../config/license/util')[_0x070e('0x6c')]()['then'](function(_0x2c759a){if(_0x2c759a){_0x5e3263=_0x2c759a[_0x070e('0x6d')];}})[_0x070e('0x27')](function(){return db[_0x070e('0x2f')][_0x070e('0x52')](_0x479888);})[_0x070e('0x27')](handleEntityNotFound(_0x1a4ed1,null))[_0x070e('0x27')](function(_0x5186d8){if(_0x5186d8){if(!_[_0x070e('0x6e')](_0x5186d8[_0x070e('0x61')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config['root'],'server/files/images/logos/',_0x5186d8[_0x070e('0x61')]))&&_0x5e3263){_0xb2cca5=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/logos/',_0x5186d8[_0x070e('0x61')]);}}return _0x1a4ed1[_0x070e('0x70')](_0xb2cca5);}})['catch'](handleError(_0x1a4ed1,null));};exports[_0x070e('0x71')]=function(_0x344289,_0x7af3cd){var _0x33009c=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/default_avatar.png');var _0x58c3d7={'where':{'id':_0x344289[_0x070e('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x070e('0x2f')][_0x070e('0x52')](_0x58c3d7)['then'](handleEntityNotFound(_0x7af3cd,null))[_0x070e('0x27')](function(_0x4b80b9){if(_0x4b80b9){if(!_[_0x070e('0x6e')](_0x4b80b9[_0x070e('0x65')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x72'),_0x4b80b9['agentAvatar']))){_0x33009c=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/',_0x4b80b9['agentAvatar']);}}return _0x7af3cd[_0x070e('0x70')](_0x33009c);}})[_0x070e('0x1b')](handleError(_0x7af3cd,null));};exports[_0x070e('0x73')]=function(_0x13ffd9,_0x3893a5){var _0x3e2c30=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/customer_avatar.png');var _0x1deb2a={'where':{'id':_0x13ffd9[_0x070e('0x45')]['id']},'attributes':['id',_0x070e('0x66'),_0x070e('0x74')],'raw':!![]};return db[_0x070e('0x2f')][_0x070e('0x52')](_0x1deb2a)[_0x070e('0x27')](handleEntityNotFound(_0x3893a5,null))[_0x070e('0x27')](function(_0x522513){if(_0x522513){if(!_[_0x070e('0x6e')](_0x522513[_0x070e('0x66')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x72'),_0x522513[_0x070e('0x66')]))&&_0x522513[_0x070e('0x74')]){_0x3e2c30=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/',_0x522513['customerAvatar']);}}return _0x3893a5[_0x070e('0x70')](_0x3e2c30);}})[_0x070e('0x1b')](handleError(_0x3893a5,null));};exports[_0x070e('0x75')]=function(_0x567202,_0xefd35a){var _0x36dfb5=path['join'](config[_0x070e('0x6a')],_0x070e('0x76'));var _0x2f34b9={'where':{'id':_0x567202[_0x070e('0x45')]['id']},'attributes':['id',_0x070e('0x67')],'raw':!![]};return db[_0x070e('0x2f')]['find'](_0x2f34b9)['then'](handleEntityNotFound(_0xefd35a,null))[_0x070e('0x27')](function(_0x3f3d7e){if(_0x3f3d7e){if(!_['isNil'](_0x3f3d7e[_0x070e('0x67')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x72'),_0x3f3d7e[_0x070e('0x67')]))){_0x36dfb5=path['join'](config[_0x070e('0x6a')],_0x070e('0x72'),_0x3f3d7e['systemAvatar']);}}return _0xefd35a[_0x070e('0x70')](_0x36dfb5);}})[_0x070e('0x1b')](handleError(_0xefd35a,null));};exports[_0x070e('0x77')]=function(_0x1fe46c,_0x4b6569){var _0x4c621a=require(_0x070e('0x78'));var _0x210e92=new _0x4c621a();var _0x2ad143=_0x210e92[_0x070e('0x79')](_0x1fe46c[_0x070e('0x7a')][_0x070e('0x7b')])[_0x070e('0x7c')]();var _0x2e1753={'body':_0x1fe46c[_0x070e('0x51')],'channel':_0x070e('0x7d')};var _0x4aab66=[];var _0x3759a6=[];var _0x13e414={};var _0x1de175=![];return db[_0x070e('0x7e')]['describe']()[_0x070e('0x27')](function(_0x35ddab){if(!_0x35ddab){throw new db['Sequelize']['ValidationError'](_0x070e('0x7f'));}_0x4aab66=_[_0x070e('0x80')](_[_0x070e('0x33')](_0x35ddab),['createdAt',_0x070e('0x81')]);_0x3759a6=_[_0x070e('0x80')](_[_0x070e('0x33')](_0x35ddab),[_0x070e('0x82'),_0x070e('0x81'),'CompanyId',_0x070e('0x83')]);if(_0x1fe46c[_0x070e('0x51')]['id']){delete _0x1fe46c['body']['id'];}if(_[_0x070e('0x6e')](_0x1fe46c['body']['from'])){throw new db['Sequelize'][(_0x070e('0x84'))](_0x070e('0x85'));}if(_[_0x070e('0x6e')](_0x1fe46c[_0x070e('0x51')]['body'])||_0x1fe46c[_0x070e('0x51')][_0x070e('0x51')]===''){throw new db['Sequelize'][(_0x070e('0x84'))](_0x070e('0x86'));}if(_[_0x070e('0x6e')](_0x1fe46c[_0x070e('0x51')][_0x070e('0x87')])){throw new db[(_0x070e('0x88'))]['ValidationError'](_0x070e('0x89')+_0x3759a6);}if(!_['includes'](_0x3759a6,_0x1fe46c[_0x070e('0x51')][_0x070e('0x87')])){throw new db[(_0x070e('0x88'))]['ValidationError'](_0x070e('0x8a')+_0x3759a6);}_0x13e414[_0x1fe46c[_0x070e('0x51')][_0x070e('0x87')]]=_0x1fe46c['body'][_0x070e('0x8b')];})[_0x070e('0x27')](function(){return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x1fe46c[_0x070e('0x45')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x13e414,'limit':0x1,'order':[[_0x070e('0x81'),_0x070e('0x8c')]]}]},{'model':db[_0x070e('0x8d')],'as':_0x070e('0x8e')}]});})[_0x070e('0x27')](handleEntityNotFound(_0x4b6569,null))[_0x070e('0x27')](function(_0x3ce644){if(_0x3ce644&&_0x3ce644[_0x070e('0x8f')]){_0x2e1753['account']=_0x3ce644;_0x2e1753['applications']=_0x3ce644['Applications'];_0x2e1753['list']=_0x3ce644[_0x070e('0x8f')];_0x2e1753[_0x070e('0x90')]=_[_0x070e('0x91')](_0x2e1753[_0x070e('0x90')],[_0x070e('0x92')],['asc']);if(_0x2e1753['account'][_0x070e('0x8e')]){delete _0x2e1753[_0x070e('0x93')]['Applications'];}if(_0x2e1753[_0x070e('0x93')][_0x070e('0x8f')]&&_0x2e1753[_0x070e('0x93')][_0x070e('0x8f')][_0x070e('0x94')][_0x070e('0x38')]){return _0x2e1753['account'][_0x070e('0x8f')][_0x070e('0x94')][0x0];}var _0xb56b8e=_['defaults'](_0x1fe46c[_0x070e('0x51')],{'firstName':_0x1fe46c[_0x070e('0x51')][_0x070e('0x8b')],'ListId':_0x3ce644[_0x070e('0x83')]});_0xb56b8e[_0x1fe46c['body'][_0x070e('0x87')]]=_0x1fe46c[_0x070e('0x51')]['from'];return db[_0x070e('0x7e')][_0x070e('0x48')](_0xb56b8e,{'fields':_0x4aab66,'raw':!![]});}})['then'](handleEntityNotFound(_0x4b6569,null))[_0x070e('0x27')](function(_0x4ff695){_0x2e1753[_0x070e('0x95')]=_0x4ff695;var _0x54f8d3=_0x1fe46c[_0x070e('0x51')]['customerIp'];if(_0x1fe46c['headers'][_0x070e('0x96')]){_0x54f8d3=_0x1fe46c['headers']['cf-connecting-ip'];}else if(_0x1fe46c[_0x070e('0x7a')][_0x070e('0x97')]){_0x54f8d3=_[_0x070e('0x98')](_0x1fe46c[_0x070e('0x7a')][_0x070e('0x97')]['split'](','));}if(_0x4ff695){var _0x29e1f8={'ContactId':_0x4ff695['id'],'ChatWebsiteId':_0x1fe46c[_0x070e('0x45')]['id'],'from':(_0x4ff695[_0x070e('0x99')]||'')+'\x20'+(_0x4ff695[_0x070e('0x9a')]||''),'customerIp':_0x54f8d3,'customerPort':_0x1fe46c[_0x070e('0x7a')][_0x070e('0x9b')]?_0x1fe46c['headers'][_0x070e('0x9b')]:null,'referer':_0x1fe46c[_0x070e('0x51')][_0x070e('0x9c')],'browserName':_0x2ad143[_0x070e('0x9d')]['name']&&_0x2ad143['browser'][_0x070e('0x9e')]?util[_0x070e('0x9f')](_0x070e('0xa0'),_0x2ad143[_0x070e('0x9d')][_0x070e('0x2a')],_0x2ad143[_0x070e('0x9d')]['version']):_0x070e('0xa1'),'browserVersion':_0x2ad143[_0x070e('0x9d')][_0x070e('0x9e')]||_0x070e('0xa1'),'osName':util[_0x070e('0x9f')](_0x070e('0xa0'),_0x2ad143['os']['name'],_0x2ad143['os']['version']),'osVersion':_0x2ad143['os'][_0x070e('0x9e')],'deviceModel':_0x2ad143[_0x070e('0xa2')][_0x070e('0x32')]&&_0x2ad143[_0x070e('0xa2')][_0x070e('0xa3')]?util[_0x070e('0x9f')](_0x070e('0xa4'),_0x2ad143['device'][_0x070e('0x32')],_0x2ad143['device'][_0x070e('0xa3')],_0x2ad143['device']['type']):null,'deviceVendor':_0x2ad143['device'][_0x070e('0xa3')],'deviceType':_0x2ad143[_0x070e('0xa2')][_0x070e('0x30')],'formData':JSON[_0x070e('0x15')](_0x1fe46c[_0x070e('0x51')])};var _0x2016e8={'ChatWebsiteId':_0x1fe46c[_0x070e('0x45')]['id'],'closed':![]};if(_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')]){_0x2016e8['threadId']=_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')];return db[_0x070e('0xa6')][_0x070e('0x52')]({'where':_0x2016e8})[_0x070e('0x27')](function(_0x3d3375){if(_0x3d3375){return[_0x3d3375,![]];}_0x29e1f8[_0x070e('0xa5')]=_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')];_0x29e1f8['externalUrl']=_0x1fe46c['body'][_0x070e('0xa7')];return db[_0x070e('0xa6')]['create'](_0x29e1f8)[_0x070e('0x27')](function(_0x58985b){return[_0x58985b,!![]];});});}_0x2016e8['ContactId']=_0x4ff695['id'];if(_0x1fe46c[_0x070e('0x51')][_0x070e('0xa8')]&&_0x1fe46c['body'][_0x070e('0xa8')]['id']){_0x2016e8['id']=_0x1fe46c[_0x070e('0x51')][_0x070e('0xa8')]['id'];return db['ChatInteraction']['find']({'where':_0x2016e8})[_0x070e('0x27')](function(_0x33bd72){if(_0x33bd72){return[_0x33bd72,![]];}return db[_0x070e('0xa6')]['create'](_0x29e1f8)[_0x070e('0x27')](function(_0x36a2cf){return[_0x36a2cf,!![]];});});}return db['ChatInteraction'][_0x070e('0x48')](_0x29e1f8)[_0x070e('0x27')](function(_0x2f5f19){return[_0x2f5f19,!![]];});}})[_0x070e('0xa9')](function(_0x3f7b2c,_0x92db3c){if(_0x3f7b2c){_0x1de175=_0x92db3c;if(!_0x92db3c){var _0x921cc0={'from':(_0x2e1753[_0x070e('0x95')][_0x070e('0x99')]||'')+'\x20'+(_0x2e1753[_0x070e('0x95')][_0x070e('0x9a')]||'')};if(_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')]&&_0x1fe46c[_0x070e('0x51')][_0x070e('0xaa')]&&_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')]!=_0x1fe46c['body']['messageId']){_0x921cc0['threadId']=_0x1fe46c['body'][_0x070e('0xaa')];}return _0x3f7b2c[_0x070e('0x26')](_0x921cc0);}else{return _0x3f7b2c;}}})[_0x070e('0x27')](function(_0x4f89d2){_0x2e1753[_0x070e('0xa8')]=_0x4f89d2[_0x070e('0x4a')]({'plain':!![]});_0x2e1753[_0x070e('0xa8')]['created']=_0x1de175;if(_0x2e1753[_0x070e('0xa8')][_0x070e('0xab')]){if(_0x2e1753[_0x070e('0x93')][_0x070e('0xac')]){_0x2e1753['applications'][_0x070e('0xad')]({'id':0x0,'priority':_0x2e1753[_0x070e('0x90')][_0x070e('0x38')]+0x1,'app':'close','appdata':_0x070e('0xae'),'interval':_0x070e('0xaf')});}}return db[_0x070e('0xb0')][_0x070e('0x48')]({'body':_0x1fe46c[_0x070e('0x51')][_0x070e('0x51')],'ChatWebsiteId':_0x1fe46c[_0x070e('0x45')]['id'],'ChatInteractionId':_0x4f89d2['id'],'direction':'in','ContactId':_0x2e1753[_0x070e('0x95')]['id'],'AttachmentId':_0x1fe46c[_0x070e('0x51')]['AttachmentId']});})['then'](function(_0x276c34){_0x2e1753['message']=_0x276c34;if(!_0x2e1753['interaction'][_0x070e('0xb1')]){return;}return db[_0x070e('0xb2')][_0x070e('0x52')]({'attributes':['id',_0x070e('0x2a')],'where':{'id':_0x2e1753[_0x070e('0xa8')][_0x070e('0xb1')]}});})['then'](function(_0x2b9209){if(_0x2b9209){_0x2e1753[_0x070e('0x90')][_0x070e('0xb3')]({'id':0x0,'priority':0x0,'app':_0x070e('0xb4'),'appdata':_0x2b9209['name']+','+(_0x2e1753[_0x070e('0x93')]['waitForTheAssignedAgent']||0xa),'interval':_0x070e('0xaf')});_0x2e1753[_0x070e('0xb5')]=!![];}if(!_0x2e1753[_0x070e('0xa8')][_0x070e('0xb6')]){return;}return db[_0x070e('0xb7')][_0x070e('0x52')]({'attributes':['id',_0x070e('0x2a')],'where':{'id':_0x2e1753[_0x070e('0xa8')][_0x070e('0xb6')]}});})['then'](function(_0xc35037){if(_0xc35037){_0x2e1753[_0x070e('0x90')][_0x070e('0xb3')]({'id':0x0,'priority':0x1,'app':_0x070e('0xb8'),'appdata':_0xc35037[_0x070e('0x2a')]+','+(_0x2e1753[_0x070e('0x93')][_0x070e('0xb9')]||0x12c),'interval':_0x070e('0xaf')});}return respondWithRpcPromise('Start',_0x070e('0xba'),_0x2e1753);})[_0x070e('0x27')](function(_0x5356d0){respondWithRpcPromise('EventManager',_0x070e('0xbb'),{'event':_0x070e('0x77'),'message':_0x5356d0},client9002);return _0x5356d0;})[_0x070e('0x27')](respondWithResult(_0x4b6569,null))[_0x070e('0x1b')](handleError(_0x4b6569,null));};exports[_0x070e('0xbc')]=function(_0x45ee9e,_0x545fb5){var _0x5c44b4,_0x236ccb,_0x37fb87;var _0x5079d9=[];var _0x31d3fa={};var _0x5aebee=_0x45ee9e[_0x070e('0xbd')]||[];var _0xa2c957=[];var _0x535518;return db[_0x070e('0x7e')][_0x070e('0x53')]()['then'](function(_0x5549ad){if(!_0x5549ad){throw new db[(_0x070e('0x88'))]['ValidationError'](_0x070e('0x7f'));}_0x5079d9=_[_0x070e('0x80')](_[_0x070e('0x33')](_0x5549ad),['createdAt',_0x070e('0x81'),_0x070e('0xbe'),'ListId']);if(_0x45ee9e[_0x070e('0x51')]['id']){delete _0x45ee9e[_0x070e('0x51')]['id'];}if(_[_0x070e('0x6e')](_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')])){throw _0x545fb5[_0x070e('0x1d')](0x1f4)[_0x070e('0xbf')](new db[(_0x070e('0x88'))][(_0x070e('0x84'))](_0x070e('0x85')));}if(_['isNil'](_0x45ee9e[_0x070e('0x51')][_0x070e('0x51')])||_0x45ee9e[_0x070e('0x51')]['body']===''){throw _0x545fb5['status'](0x1f4)[_0x070e('0xbf')](new db[(_0x070e('0x88'))][(_0x070e('0x84'))](_0x070e('0x86')));}if(_['isNil'](_0x45ee9e[_0x070e('0x51')]['mapKeyOffline'])){throw _0x545fb5['status'](0x1f4)[_0x070e('0xbf')](new db['Sequelize'][(_0x070e('0x84'))](_0x070e('0xc0')+_0x5079d9));}if(!_[_0x070e('0xc1')](_0x5079d9,_0x45ee9e[_0x070e('0x51')]['mapKeyOffline'])){throw _0x545fb5[_0x070e('0x1d')](0x1f4)['send'](new db[(_0x070e('0x88'))][(_0x070e('0x84'))](_0x070e('0xc2')+_0x5079d9));}_0x31d3fa[_0x45ee9e[_0x070e('0x51')][_0x070e('0xc3')]]=_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')];})[_0x070e('0x27')](function(){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x45ee9e[_0x070e('0x45')]['id']},'include':[{'model':db[_0x070e('0xc4')],'as':_0x070e('0x8f')},{'model':db[_0x070e('0xc5')],'as':_0x070e('0xc5')}]});})[_0x070e('0x27')](handleEntityNotFound(_0x545fb5,null))['then'](function(_0x48ea98){if(_0x48ea98&&_0x48ea98[_0x070e('0x8f')]){_0x236ccb=_0x48ea98;var _0x2b2b57=_['defaults'](_0x45ee9e[_0x070e('0x51')],{'firstName':_0x45ee9e[_0x070e('0x51')]['from'],'phone':_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')],'ListId':_0x48ea98['ListId']});_0x2b2b57[_0x45ee9e[_0x070e('0x51')][_0x070e('0xc3')]]=_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')];return db[_0x070e('0x7e')][_0x070e('0xc6')]({'where':_0x31d3fa,'defaults':_0x2b2b57});}})['spread'](function(_0x3a01db){if(_0x3a01db){_0x37fb87=_0x3a01db;var _0x283199=fs[_0x070e('0xc7')](path['join'](config[_0x070e('0x6a')],_0x070e('0xc8')),_0x070e('0xc9'));var _0x1a6a01=ejs['render'](_0x283199,{'body':_['toPairs'](_0x45ee9e[_0x070e('0x51')][_0x070e('0x51')]),'bodyTitle':_0x236ccb[_0x070e('0xca')]});return db[_0x070e('0xcb')][_0x070e('0x48')]({'body':_0x1a6a01,'plainBody':htmlToText[_0x070e('0xcc')](_0x1a6a01),'ContactId':_0x3a01db['id'],'ChatWebsiteId':_0x236ccb['id']});}})[_0x070e('0x27')](function(_0x48882f){_0x535518=_0x48882f;if(_0x5aebee[_0x070e('0x38')]){var _0x181cce=_0x5aebee[_0x070e('0x2e')](function(_0x172aa1){return{'name':_0x172aa1[_0x070e('0xcd')],'basename':_0x172aa1[_0x070e('0x63')],'type':_0x172aa1[_0x070e('0xce')],'ChatOfflineMessageId':_0x48882f['id']};});_0xa2c957=_0x181cce[_0x070e('0x2e')](_0x408ba0=>{var _0x5734ba={'filename':_0x408ba0[_0x070e('0x2a')],'path':path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0xcf'),_0x070e('0xbd'),'attachments',_0x070e('0xd0'),_0x408ba0[_0x070e('0xd1')])};return _0x5734ba;});if(!_0x236ccb[_0x070e('0xd2')]){return db[_0x070e('0xd3')][_0x070e('0xd4')](function(_0x3c5019){return db[_0x070e('0xd5')]['bulkCreate'](_0x181cce,{'transaction':_0x3c5019});});}}})[_0x070e('0x27')](function(){if(_0x535518){_0x5c44b4=_0x535518;return db[_0x070e('0xc5')][_0x070e('0x5e')]({'where':{'service':!![]},'include':[{'model':db[_0x070e('0xd6')],'as':_0x070e('0xd7'),'raw':!![],'include':[{'model':db[_0x070e('0xd8')],'as':_0x070e('0xd8'),'raw':!![]}]}]});}})[_0x070e('0x27')](function(_0x45735c){if(_0x45735c&&_0x45735c['Smtp']&&_0x236ccb[_0x070e('0xd9')]&&_0x236ccb[_0x070e('0xda')]){var _0xf94878=_0x45735c[_0x070e('0xdb')]();return respondWithRpcPromise(_0x070e('0xdc'),_0x070e('0xdd'),{'account':_0xf94878,'message':{'from':util[_0x070e('0x9f')](_0x070e('0xde'),_0x45735c[_0x070e('0x2a')],_0x45735c[_0x070e('0xdf')]||_0x45735c[_0x070e('0xd7')][_0x070e('0x49')]),'to':_0x236ccb[_0x070e('0xda')],'subject':_0x236ccb[_0x070e('0xe0')],'html':_0x5c44b4[_0x070e('0x51')],'attachments':_0xa2c957}},client9003)[_0x070e('0x27')](function(){return _0x5c44b4;})[_0x070e('0x1b')](function(_0x5608f9){logger[_0x070e('0x17')](_0x5608f9);});}})[_0x070e('0x27')](function(){if(_0x236ccb&&_0x236ccb[_0x070e('0xd2')]&&_0x236ccb[_0x070e('0xe1')]){var _0x5608d0=[];if(_0x5aebee[_0x070e('0x38')]){_0x5608d0=_0x5aebee[_0x070e('0x2e')](function(_0x1fd493){return{'name':_0x1fd493[_0x070e('0xcd')],'basename':_0x1fd493['filename'],'type':_0x1fd493[_0x070e('0xce')],'ChatOfflineMessageId':_0x535518['id']};});}var _0x4c9619;if(!_[_0x070e('0x6e')](_0x236ccb['subjectOffline'])){var _0x59383a=_[_0x070e('0x2e')](_0x45ee9e[_0x070e('0x51')],function(_0x906cb7){return _0x906cb7;});var _0x5880bb=_[_0x070e('0xe2')](_0x59383a)[0x0];var _0x5ab854=_[_0x070e('0xe3')](_0x5880bb,function(_0x1e0e55){return _0x1e0e55;});_0x4c9619=_0x5ab854[0x1][_0x236ccb['subjectOffline']];}var _0x17a593={'from':_0x37fb87['email'],'firstName':_0x37fb87[_0x070e('0x99')],'lastName':_0x37fb87[_0x070e('0x9a')],'mapKey':_0x070e('0xdf'),'message':{'from':_0x37fb87['email'],'to':_0x236ccb['MailAccount'][_0x070e('0xdf')],'cc':'','subject':_['isNil'](_0x4c9619)?_0x236ccb[_0x070e('0xe0')]:_0x4c9619,'messageId':'','sentAt':new Date(),'attach':_0x5608d0[_0x070e('0x38')],'attachments':_0x5608d0,'originChannel':_0x070e('0xe4'),'ChatWebsiteId':_0x236ccb['id'],'ChatOfflineMessageId':_0x5c44b4['id'],'originTo':_0x236ccb[_0x070e('0xc5')][_0x070e('0xdf')]},'body':_0x5c44b4[_0x070e('0x51')]};var _0x4aaf0f={'account':{'id':_0x236ccb['MailAccountId']},'body':_0x17a593,'log':_0x070e('0xe5')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x4aaf0f,client9001)[_0x070e('0x27')](function(){return _0x5c44b4;})[_0x070e('0x1b')](function(_0x3c8b7d){logger['error'](_0x3c8b7d);});}return;})[_0x070e('0x27')](function(){if(_0x5c44b4){return _0x5c44b4;}})[_0x070e('0x27')](respondWithResult(_0x545fb5,null))[_0x070e('0x1b')](function(_0x4dfac3){logger['error'](_0x070e('0x1b'),_0x4dfac3);for(var _0x421d8e of _0x5aebee){var _0x306654=path['join'](config[_0x070e('0x6a')],'server',_0x070e('0xbd'),'attachments',_0x070e('0xd0'),_0x421d8e[_0x070e('0x63')]);fs_extra['remove'](_0x306654)[_0x070e('0x1b')](function(_0x30fa55){logger[_0x070e('0x17')](_0x070e('0xe6'),_0x306654,_0x30fa55);});}});};exports[_0x070e('0xe7')]=function(_0xd6529a,_0x24ded2){return db[_0x070e('0xa6')][_0x070e('0x52')]({'where':{'id':_0xd6529a[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x24ded2,null))[_0x070e('0x27')](function(_0x3301b8){if(_0x3301b8){return _0x3301b8['addInteraction'](_0xd6529a[_0x070e('0x51')][_0x070e('0x5a')],_[_0x070e('0xe8')](_0xd6529a['body'],['ids','id'])||{});}})[_0x070e('0x27')](respondWithResult(_0x24ded2,null))[_0x070e('0x1b')](handleError(_0x24ded2,null));};exports['getInteractions']=function(_0x134ca4,_0x800c97){var _0x216d58={'raw':![],'where':{}};var _0x483c30={};var _0x9f2102={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x070e('0x5e')]({'where':{'id':_0x134ca4[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x800c97,null))[_0x070e('0x27')](function(_0x2268ea){if(_0x2268ea){_0x483c30[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0xa6')][_0x070e('0x46')]);_0x483c30[_0x070e('0x34')]=_[_0x070e('0x33')](_0x134ca4[_0x070e('0x34')]);_0x483c30['filters']=_[_0x070e('0x47')](_0x483c30[_0x070e('0x32')],_0x483c30[_0x070e('0x34')]);_0x216d58[_0x070e('0x36')]=_['intersection'](_0x483c30['model'],qs['fields'](_0x134ca4[_0x070e('0x34')]['fields']));_0x216d58[_0x070e('0x36')]=_0x216d58[_0x070e('0x36')]['length']?_0x216d58[_0x070e('0x36')]:_0x483c30['model'];if(!_0x134ca4['query'][_0x070e('0xe9')](_0x070e('0x39'))){_0x216d58[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x134ca4[_0x070e('0x34')][_0x070e('0x21')]);_0x216d58[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x134ca4[_0x070e('0x34')][_0x070e('0x1f')]);}_0x216d58[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x134ca4['query'][_0x070e('0x3b')]);_0x216d58[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x134ca4[_0x070e('0x34')],_0x483c30[_0x070e('0x35')]));_0x216d58['where']['ChatWebsiteId']=_0x2268ea['id'];if(_0x134ca4['query'][_0x070e('0x3c')]){_0x216d58[_0x070e('0x3d')]=_[_0x070e('0x3f')](_0x216d58['where'],{'$or':_[_0x070e('0x2e')](_0x216d58[_0x070e('0x36')],function(_0x48437d){var _0x495926={};_0x495926[_0x48437d]={'$like':'%'+_0x134ca4[_0x070e('0x34')]['filter']+'%'};return _0x495926;})});}_0x216d58=_[_0x070e('0x3f')]({},_0x216d58,_0x134ca4[_0x070e('0x40')]);return db[_0x070e('0xa6')][_0x070e('0x22')]({'where':_0x216d58[_0x070e('0x3d')]})[_0x070e('0x27')](function(_0x4e1e0e){_0x9f2102[_0x070e('0x22')]=_0x4e1e0e;if(_0x134ca4[_0x070e('0x34')][_0x070e('0x41')]){_0x216d58['include']=[{'model':db[_0x070e('0x7e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x070e('0xea'),'attributes':['name',_0x070e('0xeb'),'internal'],'required':![]},{'model':db[_0x070e('0xec')],'as':_0x070e('0xed'),'attributes':['id','name',_0x070e('0xee')],'where':_0x134ca4[_0x070e('0x34')][_0x070e('0xef')]?{'id':_0x134ca4[_0x070e('0x34')][_0x070e('0xef')]}:undefined,'required':_0x134ca4[_0x070e('0x34')][_0x070e('0xef')]?!![]:![]}];}return db[_0x070e('0xa6')][_0x070e('0x58')](_0x216d58);})[_0x070e('0x27')](function(_0x52acf3){_0x9f2102[_0x070e('0x43')]=_0x52acf3;return _0x9f2102;});}})['then'](respondWithFilteredResult(_0x800c97,_0x216d58))[_0x070e('0x1b')](handleError(_0x800c97,null));};function iftimePromise(_0x8d52b9,_0x58052b){return respondWithRpcPromise(_0x070e('0xf0'),'getSnippet',{'command':_0x58052b[_0x070e('0xf1')]?util['format'](_0x070e('0xf2'),_0x8d52b9[_0x070e('0xf3')],_0x58052b['timezone']):util[_0x070e('0x9f')](_0x070e('0xf4'),_0x8d52b9[_0x070e('0xf3')])},client9002)[_0x070e('0x27')](function(_0x12e363){var _0x5cbcf6=_0x12e363&&_0x12e363[_0x070e('0xf5')]('true')>=0x0?!![]:![];logger['info'](_0x070e('0xf6'),_0x58052b['id'],_0x8d52b9['id'],_0x8d52b9['interval'],_0x5cbcf6?'ONLINE':_0x070e('0xf7'),_0x58052b['timezone']?_0x58052b[_0x070e('0xf1')]:_0x070e('0xf8'));return _0x5cbcf6;})[_0x070e('0x1b')](function(_0x56f60d){logger[_0x070e('0x17')](_0x070e('0xf6'),_0x58052b['id'],_0x8d52b9['id'],_0x8d52b9[_0x070e('0xf3')],util[_0x070e('0xf9')](_0x56f60d,{'showHidden':![],'depth':null}),_0x58052b[_0x070e('0xf1')]?_0x58052b['timezone']:_0x070e('0xf8'));return![];});}exports[_0x070e('0xfa')]=function(_0x2bc10f,_0x486249){var _0x20cae7=0x0;var _0x952836=0x0;var _0x399add=![];var _0x4e4996;var _0x1dbff0;return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x2bc10f[_0x070e('0x45')]['id']},'include':[{'model':db['Interval'],'as':_0x070e('0xfb'),'include':[{'model':db[_0x070e('0xfb')],'as':_0x070e('0xfc'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x070e('0x27')](handleEntityNotFound(_0x486249,null))[_0x070e('0x27')](function(_0x73e3f4){if(_0x73e3f4){_0x4e4996=_0x73e3f4;return _0x73e3f4['getProactiveActions']({'raw':!![]});}})[_0x070e('0x27')](function(_0x581b04){if(_0x4e4996){if(_0x581b04){_0x1dbff0=_0x581b04;}}return require(_0x070e('0xfd'))[_0x070e('0x6c')]();})[_0x070e('0x27')](function(_0x46bc31){if(_0x46bc31){_0x952836=_0x46bc31['virtual'];_0x399add=_0x46bc31[_0x070e('0x6d')];}})[_0x070e('0x27')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x070e('0x27')](function(_0x4542a8){_0x20cae7=_0x4542a8;if(_0x952836&&_0x4542a8>_0x952836){return db[_0x070e('0xfe')][_0x070e('0x5e')]({'where':{'id':0x1}})['then'](function(_0x43b79d){if(_0x43b79d){_0x43b79d[_0x070e('0xff')](_0x070e('0x100'));}});}})['then'](function(){if(_0x4e4996[_0x070e('0xfb')]&&_0x4e4996[_0x070e('0xfb')][_0x070e('0xfc')]){var _0x26a26b=[];for(var _0x4d5e29=0x0;_0x4d5e29<_0x4e4996['Interval'][_0x070e('0xfc')][_0x070e('0x38')];_0x4d5e29++){var _0x58c7e1=_0x4e4996[_0x070e('0xfb')][_0x070e('0xfc')][_0x4d5e29]['get']({'plain':!![]});_0x26a26b['push'](iftimePromise(_0x58c7e1,_0x4e4996));}return BPromise[_0x070e('0x101')](_0x26a26b)[_0x070e('0x27')](function(_0x3094d4){return _[_0x070e('0x102')](_0x3094d4);});}else{return!![];}})['then'](function(_0x59d668){var _0x2d597c=fs[_0x070e('0xc7')](path['join'](config[_0x070e('0x6a')],'server/files/chat/iframe.ejs'),_0x070e('0xc9'));var _0x3420d0=new url[(_0x070e('0x103'))](_0x4e4996['address'])[_0x070e('0x104')];var _0x589b76='3.5.0';var _0x47e50f=![];var _0x36ad23={'chatVersion':_0x589b76,'chatWebsiteAddressOrigin':_0x3420d0,'remote':_0x4e4996[_0x070e('0x105')],'query':querystring[_0x070e('0x15')](_[_0x070e('0x3f')](_0x4e4996[_0x070e('0x4a')]({'plain':!![]}),{'customerIp':_0x2bc10f[_0x070e('0x7a')][_0x070e('0x97')]||_0x2bc10f[_0x070e('0x7a')][_0x070e('0x106')]||_0x2bc10f[_0x070e('0x107')][_0x070e('0x108')]||_0x2bc10f['ip'],'referer':_0x2bc10f['headers'][_0x070e('0x9c')],'openedInteractions':_0x20cae7,'maxInteractions':_0x952836,'virtual':_0x399add[_0x070e('0x109')],'online':_0x59d668,'custom':_0x399add}))['replace'](/'/g,'\x5c\x27')};_0x486249['send'](ejs[_0x070e('0x10a')](Mustache[_0x070e('0x10a')](_0x2d597c,_0x36ad23),{'proactiveActions':_0x1dbff0,'alignment':_0x4e4996[_0x070e('0x10b')],'verticalAlignment':_0x4e4996[_0x070e('0x10c')],'div_color':_0x4e4996['color'],'labelText':_0x4e4996[_0x070e('0x10d')],'text_color':_0x4e4996[_0x070e('0x10e')],'text_button_color':_0x4e4996[_0x070e('0x10f')],'button_color':_0x4e4996[_0x070e('0x110')],'background_color':_0x4e4996[_0x070e('0x111')],'hideWhenOffline':_0x4e4996[_0x070e('0x112')],'intervalId':_0x4e4996['IntervalId'],'isDevelopment':_0x47e50f,'chatVersion':_0x589b76}));})[_0x070e('0x1b')](handleError(_0x486249,null));};exports['addApplications']=function(_0x260eb9,_0x835606){var _0x20612b=_0x260eb9[_0x070e('0x45')]['id'];var _0x2290e8=_0x260eb9[_0x070e('0x51')];var _0x22cca8=0xc8;var _0x560176=null;return db[_0x070e('0xd3')][_0x070e('0xd4')]({'isolationLevel':db[_0x070e('0xd3')][_0x070e('0x113')][_0x070e('0x114')][_0x070e('0x115')]},function(_0x405d9f){return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x20612b},'transaction':_0x405d9f})[_0x070e('0x27')](function(_0x14c924){if(_0x14c924){return db[_0x070e('0x8d')][_0x070e('0x28')]({'where':{'ChatWebsiteId':_0x20612b},'transaction':_0x405d9f})[_0x070e('0x27')](function(){var _0x4c9226=_[_0x070e('0x2e')](_0x2290e8,function(_0x234fe6){_0x234fe6['ChatWebsiteId']=_0x20612b;return _0x234fe6;});return db[_0x070e('0x8d')][_0x070e('0x116')](_0x4c9226,{'transaction':_0x405d9f});});}else{_0x22cca8=0x194;_0x560176=[];}});})[_0x070e('0x27')](function(){if(_0x22cca8!==0x194){return db[_0x070e('0x8d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x20612b},'order':_0x070e('0x92')})[_0x070e('0x27')](function(_0x4c9334){_0x560176=_0x4c9334;});}})[_0x070e('0x1b')](function(_0x606970){_0x22cca8=0x1f4;logger[_0x070e('0x17')](_0x606970[_0x070e('0x29')]);if(_0x606970[_0x070e('0x2a')]){delete _0x606970['name'];}_0x560176=_0x606970;})[_0x070e('0x117')](function(){if(_0x560176===null){_0x835606[_0x070e('0x1c')](_0x22cca8);}else{if(_0x22cca8===0x1f4){_0x835606[_0x070e('0x1d')](_0x22cca8)[_0x070e('0xbf')](_0x560176);}else{_0x835606['status'](_0x22cca8)[_0x070e('0x25')](_0x560176);}}});};exports[_0x070e('0x118')]=function(_0x3d0462,_0x50267c){var _0x2855c9={};var _0x4292f0={};var _0x5448ef;var _0x3a684d;return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x3d0462[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x50267c,null))[_0x070e('0x27')](function(_0x5e1a7a){if(_0x5e1a7a){_0x5448ef=_0x5e1a7a;_0x4292f0[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0x8d')]['rawAttributes']);_0x4292f0['query']=_['keys'](_0x3d0462[_0x070e('0x34')]);_0x4292f0[_0x070e('0x35')]=_['intersection'](_0x4292f0[_0x070e('0x32')],_0x4292f0[_0x070e('0x34')]);_0x2855c9[_0x070e('0x36')]=_[_0x070e('0x47')](_0x4292f0[_0x070e('0x32')],qs[_0x070e('0x37')](_0x3d0462[_0x070e('0x34')]['fields']));_0x2855c9[_0x070e('0x36')]=_0x2855c9['attributes'][_0x070e('0x38')]?_0x2855c9[_0x070e('0x36')]:_0x4292f0[_0x070e('0x32')];_0x2855c9[_0x070e('0x3a')]=qs['sort'](_0x3d0462[_0x070e('0x34')][_0x070e('0x3b')]);_0x2855c9[_0x070e('0x3d')]=qs['filters'](_[_0x070e('0x56')](_0x3d0462['query'],_0x4292f0[_0x070e('0x35')]));if(_0x3d0462[_0x070e('0x34')][_0x070e('0x3c')]){_0x2855c9['where']=_[_0x070e('0x3f')](_0x2855c9[_0x070e('0x3d')],{'$or':_[_0x070e('0x2e')](_0x2855c9[_0x070e('0x36')],function(_0x45fa15){var _0x155c3d={};_0x155c3d[_0x45fa15]={'$like':'%'+_0x3d0462[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x155c3d;})});}_0x2855c9=_[_0x070e('0x3f')]({},_0x2855c9,_0x3d0462[_0x070e('0x40')]);return _0x5448ef[_0x070e('0x118')](_0x2855c9);}})['then'](function(_0x15fc52){if(_0x15fc52){_0x3a684d=_0x15fc52[_0x070e('0x38')];if(!_0x3d0462['query'][_0x070e('0xe9')](_0x070e('0x39'))){_0x2855c9[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x3d0462[_0x070e('0x34')][_0x070e('0x21')]);_0x2855c9[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x3d0462[_0x070e('0x34')]['offset']);}return _0x5448ef[_0x070e('0x118')](_0x2855c9);}})[_0x070e('0x27')](function(_0x3f459b){if(_0x3f459b){return _0x3f459b?{'count':_0x3a684d,'rows':_0x3f459b}:null;}})['then'](respondWithResult(_0x50267c,null))[_0x070e('0x1b')](handleError(_0x50267c,null));};exports[_0x070e('0x119')]=function(_0x2f5572,_0x42c8b3){return db[_0x070e('0x11a')][_0x070e('0x52')]({'where':{'id':_0x2f5572[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x42c8b3,null))[_0x070e('0x27')](function(_0x673c7e){if(_0x673c7e){return _0x673c7e[_0x070e('0x119')](_0x2f5572[_0x070e('0x51')][_0x070e('0x5a')],_['omit'](_0x2f5572[_0x070e('0x51')],[_0x070e('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x42c8b3,null))['catch'](handleError(_0x42c8b3,null));};exports['getProactiveActions']=function(_0x395bf7,_0x41b760){var _0x5906f5={};var _0x550c04={};var _0x205559;var _0x4878d8;return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x395bf7[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x41b760,null))[_0x070e('0x27')](function(_0x1d5c86){if(_0x1d5c86){_0x205559=_0x1d5c86;_0x550c04[_0x070e('0x32')]=_['keys'](db[_0x070e('0x11b')][_0x070e('0x46')]);_0x550c04[_0x070e('0x34')]=_[_0x070e('0x33')](_0x395bf7['query']);_0x550c04['filters']=_[_0x070e('0x47')](_0x550c04[_0x070e('0x32')],_0x550c04[_0x070e('0x34')]);_0x5906f5['attributes']=_[_0x070e('0x47')](_0x550c04[_0x070e('0x32')],qs[_0x070e('0x37')](_0x395bf7[_0x070e('0x34')]['fields']));_0x5906f5['attributes']=_0x5906f5[_0x070e('0x36')][_0x070e('0x38')]?_0x5906f5[_0x070e('0x36')]:_0x550c04[_0x070e('0x32')];_0x5906f5[_0x070e('0x3a')]=qs['sort'](_0x395bf7['query']['sort']);_0x5906f5[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x395bf7[_0x070e('0x34')],_0x550c04['filters']));if(_0x395bf7[_0x070e('0x34')]['filter']){_0x5906f5['where']=_[_0x070e('0x3f')](_0x5906f5[_0x070e('0x3d')],{'$or':_['map'](_0x5906f5[_0x070e('0x36')],function(_0x1b6728){var _0x158670={};_0x158670[_0x1b6728]={'$like':'%'+_0x395bf7[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x158670;})});}_0x5906f5=_[_0x070e('0x3f')]({},_0x5906f5,_0x395bf7['options']);return _0x205559[_0x070e('0x11c')](_0x5906f5);}})[_0x070e('0x27')](function(_0x408b87){if(_0x408b87){_0x4878d8=_0x408b87['length'];if(!_0x395bf7[_0x070e('0x34')][_0x070e('0xe9')](_0x070e('0x39'))){_0x5906f5['limit']=qs[_0x070e('0x21')](_0x395bf7[_0x070e('0x34')][_0x070e('0x21')]);_0x5906f5[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x395bf7[_0x070e('0x34')][_0x070e('0x1f')]);}return _0x205559[_0x070e('0x11c')](_0x5906f5);}})[_0x070e('0x27')](function(_0x39497c){if(_0x39497c){return _0x39497c?{'count':_0x4878d8,'rows':_0x39497c}:null;}})[_0x070e('0x27')](respondWithResult(_0x41b760,null))['catch'](handleError(_0x41b760,null));};exports[_0x070e('0x11d')]=function(_0x1e0b95,_0x460933){var _0x9fa764=_0x1e0b95['query'][_0x070e('0x11e')]===_0x070e('0x11f')?'offlineForm':_0x070e('0x120');return db[_0x070e('0x2f')]['find']({'attributes':['id',_0x9fa764],'where':{'id':_0x1e0b95[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x460933,null))[_0x070e('0x27')](function(_0x5a7692){if(_0x5a7692){var _0x5b85be=_0x5a7692[_0x9fa764];var _0x3877b3=_0x5b85be&&_0x5b85be['items']?_0x5b85be[_0x070e('0x121')]:[];_0x460933[_0x070e('0xbf')]({'fromKey':_[_0x070e('0x6e')](_0x5b85be[_0x070e('0x122')])?undefined:_0x5b85be[_0x070e('0x122')],'count':_0x3877b3[_0x070e('0x38')],'rows':_0x3877b3});}})['catch'](handleError(_0x460933,null));};exports['getOfflineMessages']=function(_0x50f8c4,_0x4b1e3a){var _0x349339={'raw':![],'where':{}};var _0x54ffda={};var _0x295e24={'count':0x0,'rows':[]};return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x50f8c4[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x4b1e3a,null))[_0x070e('0x27')](function(_0x5d7cbf){if(_0x5d7cbf){_0x54ffda[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0xcb')][_0x070e('0x46')]);_0x54ffda[_0x070e('0x34')]=_[_0x070e('0x33')](_0x50f8c4['query']);_0x54ffda[_0x070e('0x35')]=_[_0x070e('0x47')](_0x54ffda[_0x070e('0x32')],_0x54ffda['query']);_0x349339[_0x070e('0x36')]=_[_0x070e('0x47')](_0x54ffda[_0x070e('0x32')],qs[_0x070e('0x37')](_0x50f8c4[_0x070e('0x34')][_0x070e('0x37')]));_0x349339[_0x070e('0x36')]=_0x349339[_0x070e('0x36')][_0x070e('0x38')]?_0x349339[_0x070e('0x36')]:_0x54ffda[_0x070e('0x32')];if(!_0x50f8c4[_0x070e('0x34')][_0x070e('0xe9')](_0x070e('0x39'))){_0x349339[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x50f8c4[_0x070e('0x34')][_0x070e('0x21')]);_0x349339[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x50f8c4['query'][_0x070e('0x1f')]);}_0x349339['order']=qs['sort'](_0x50f8c4[_0x070e('0x34')]['sort']);_0x349339[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x50f8c4[_0x070e('0x34')],_0x54ffda[_0x070e('0x35')]));_0x349339[_0x070e('0x3d')][_0x070e('0x55')]=_0x5d7cbf['id'];if(_0x50f8c4[_0x070e('0x34')][_0x070e('0x3c')]){_0x349339[_0x070e('0x3d')]=_['merge'](_0x349339[_0x070e('0x3d')],{'$or':_[_0x070e('0x2e')](_0x349339[_0x070e('0x36')],function(_0x24cc9e){var _0x340df0={};_0x340df0[_0x24cc9e]={'$like':'%'+_0x50f8c4['query'][_0x070e('0x3c')]+'%'};return _0x340df0;})});}_0x349339=_[_0x070e('0x3f')]({},_0x349339,_0x50f8c4[_0x070e('0x40')]);return db[_0x070e('0xcb')]['count']({'where':_0x349339[_0x070e('0x3d')]})[_0x070e('0x27')](function(_0x5c0fa5){_0x295e24[_0x070e('0x22')]=_0x5c0fa5;if(_0x50f8c4[_0x070e('0x34')][_0x070e('0x41')]){_0x349339[_0x070e('0x42')]=[{'all':!![]}];}else{_0x349339['include']=[{'model':db[_0x070e('0x7e')],'as':_0x070e('0x123'),'required':![]},{'model':db[_0x070e('0xd5')],'as':'Attachments','required':![]}];}return db[_0x070e('0xcb')]['findAll'](_0x349339);})[_0x070e('0x27')](function(_0xc4a364){_0x295e24['rows']=_0xc4a364;return _0x295e24;});}})[_0x070e('0x27')](respondWithFilteredResult(_0x4b1e3a,_0x349339))[_0x070e('0x1b')](handleError(_0x4b1e3a,null));};exports[_0x070e('0x124')]=function(_0x553cf8,_0x353041){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x553cf8['params']['id']}})['then'](handleEntityNotFound(_0x353041,null))[_0x070e('0x27')](function(_0x22932b){if(_0x22932b){return _0x22932b[_0x070e('0x124')](_0x553cf8['body']['ids'],_[_0x070e('0xe8')](_0x553cf8['body'],['ids','id'])||{})[_0x070e('0xa9')](function(_0xeb1314){for(var _0x42414c=0x0;_0x42414c<_0x553cf8[_0x070e('0x51')]['ids']['length'];_0x42414c+=0x1){socket[_0x070e('0x125')](_0x070e('0x126'),{'UserId':Number(_0x553cf8[_0x070e('0x51')][_0x070e('0x5a')][_0x42414c]),'ChatWebsiteId':Number(_0x553cf8[_0x070e('0x45')]['id'])});}return _0xeb1314;});}})['then'](respondWithResult(_0x353041,null))[_0x070e('0x1b')](handleError(_0x353041,null));};exports[_0x070e('0x127')]=function(_0x1a2d80,_0x50c3a9){return db[_0x070e('0x2f')]['find']({'where':{'id':_0x1a2d80[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x50c3a9,null))[_0x070e('0x27')](function(_0x5274f){if(_0x5274f){return _0x5274f[_0x070e('0x127')](_0x1a2d80['query']['ids'])[_0x070e('0x27')](function(){if(_[_0x070e('0x128')](_0x1a2d80[_0x070e('0x34')]['ids'])){for(var _0x5c5fcb=0x0;_0x5c5fcb<_0x1a2d80[_0x070e('0x34')][_0x070e('0x5a')][_0x070e('0x38')];_0x5c5fcb+=0x1){socket[_0x070e('0x125')](_0x070e('0x129'),{'UserId':Number(_0x1a2d80[_0x070e('0x34')][_0x070e('0x5a')][_0x5c5fcb]),'ChatWebsiteId':Number(_0x1a2d80[_0x070e('0x45')]['id'])});}}else{socket[_0x070e('0x125')](_0x070e('0x129'),{'UserId':Number(_0x1a2d80[_0x070e('0x34')][_0x070e('0x5a')]),'ChatWebsiteId':Number(_0x1a2d80[_0x070e('0x45')]['id'])});}});}})[_0x070e('0x27')](respondWithStatusCode(_0x50c3a9,null))[_0x070e('0x1b')](handleError(_0x50c3a9,null));};exports['getAgents']=function(_0x15277b,_0x31db5c){var _0x2f20d9={};var _0x5268e9={};var _0x51836a;var _0x4dd9cb;return db['ChatWebsite'][_0x070e('0x5e')]({'where':{'id':_0x15277b[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x31db5c,null))[_0x070e('0x27')](function(_0xd10a6e){if(_0xd10a6e){_0x51836a=_0xd10a6e;_0x5268e9[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0xb2')][_0x070e('0x46')]);_0x5268e9['query']=_['keys'](_0x15277b['query']);_0x5268e9['filters']=_[_0x070e('0x47')](_0x5268e9['model'],_0x5268e9[_0x070e('0x34')]);_0x2f20d9[_0x070e('0x36')]=_[_0x070e('0x47')](_0x5268e9[_0x070e('0x32')],qs[_0x070e('0x37')](_0x15277b[_0x070e('0x34')][_0x070e('0x37')]));_0x2f20d9[_0x070e('0x36')]=_0x2f20d9['attributes'][_0x070e('0x38')]?_0x2f20d9[_0x070e('0x36')]:_0x5268e9[_0x070e('0x32')];_0x2f20d9[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x15277b[_0x070e('0x34')][_0x070e('0x3b')]);_0x2f20d9[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x15277b[_0x070e('0x34')],_0x5268e9['filters']));if(_0x15277b[_0x070e('0x34')][_0x070e('0x3c')]){_0x2f20d9['where']=_[_0x070e('0x3f')](_0x2f20d9['where'],{'$or':_['map'](_0x2f20d9[_0x070e('0x36')],function(_0x4c9db4){var _0x28456b={};_0x28456b[_0x4c9db4]={'$like':'%'+_0x15277b[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x28456b;})});}_0x2f20d9=_['merge']({},_0x2f20d9,_0x15277b[_0x070e('0x40')]);return _0x51836a['getAgents'](_0x2f20d9);}})[_0x070e('0x27')](function(_0x5c04b8){if(_0x5c04b8){_0x4dd9cb=_0x5c04b8[_0x070e('0x38')];if(!_0x15277b[_0x070e('0x34')][_0x070e('0xe9')]('nolimit')){_0x2f20d9['limit']=qs[_0x070e('0x21')](_0x15277b[_0x070e('0x34')][_0x070e('0x21')]);_0x2f20d9[_0x070e('0x1f')]=qs['offset'](_0x15277b[_0x070e('0x34')][_0x070e('0x1f')]);}return _0x51836a[_0x070e('0x12a')](_0x2f20d9);}})[_0x070e('0x27')](function(_0x326961){if(_0x326961){return _0x326961?{'count':_0x4dd9cb,'rows':_0x326961}:null;}})[_0x070e('0x27')](respondWithResult(_0x31db5c,null))['catch'](handleError(_0x31db5c,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index a648404..55123e9 100644
--- a/server/api/chatWebsite/chatWebsite.events.js
+++ b/server/api/chatWebsite/chatWebsite.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a9a=['hasOwnProperty','hook','events','ChatWebsite','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a9a,0x64));var _0xa2a9=function(_0xfba519,_0x7b249b){_0xfba519=_0xfba519-0x0;var _0x15a578=_0x2a9a[_0xfba519];return _0x15a578;};'use strict';var EventEmitter=require(_0xa2a9('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa2a9('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa2a9('0x2'),'afterDestroy':_0xa2a9('0x3')};function emitEvent(_0x39eca6){return function(_0x1a817a,_0x593d5c,_0x55dc29){ChatWebsiteEvents[_0xa2a9('0x4')](_0x39eca6+':'+_0x1a817a['id'],_0x1a817a);ChatWebsiteEvents[_0xa2a9('0x4')](_0x39eca6,_0x1a817a);_0x55dc29(null);};}for(var e in events){if(events[_0xa2a9('0x5')](e)){var event=events[e];ChatWebsite[_0xa2a9('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xbf4e=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x1ad89c,_0x49dfe0){var _0x1dd3b1=function(_0xb4094c){while(--_0xb4094c){_0x1ad89c['push'](_0x1ad89c['shift']());}};_0x1dd3b1(++_0x49dfe0);}(_0xbf4e,0x172));var _0xebf4=function(_0x5be829,_0x48378c){_0x5be829=_0x5be829-0x0;var _0x343686=_0xbf4e[_0x5be829];return _0x343686;};'use strict';var EventEmitter=require(_0xebf4('0x0'));var ChatWebsite=require(_0xebf4('0x1'))['db'][_0xebf4('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xebf4('0x3')](0x0);var events={'afterCreate':_0xebf4('0x4'),'afterUpdate':_0xebf4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41cb2c){return function(_0x5d2ad5,_0x59cc54,_0x15328a){ChatWebsiteEvents[_0xebf4('0x6')](_0x41cb2c+':'+_0x5d2ad5['id'],_0x5d2ad5);ChatWebsiteEvents['emit'](_0x41cb2c,_0x5d2ad5);_0x15328a(null);};}for(var e in events){if(events[_0xebf4('0x7')](e)){var event=events[e];ChatWebsite[_0xebf4('0x8')](e,emitEvent(event));}}module[_0xebf4('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 85899d1..28c0dbb 100644
--- a/server/api/chatWebsite/chatWebsite.model.js
+++ b/server/api/chatWebsite/chatWebsite.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6170=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','chat_websites','util','../../config/logger','api','bluebird'];(function(_0x50a171,_0x46a5a7){var _0x51999c=function(_0x3c3dab){while(--_0x3c3dab){_0x50a171['push'](_0x50a171['shift']());}};_0x51999c(++_0x46a5a7);}(_0x6170,0x164));var _0x0617=function(_0x1c048a,_0x138c9f){_0x1c048a=_0x1c048a-0x0;var _0x828391=_0x6170[_0x1c048a];return _0x828391;};'use strict';var _=require('lodash');var util=require(_0x0617('0x0'));var logger=require(_0x0617('0x1'))(_0x0617('0x2'));var moment=require('moment');var BPromise=require(_0x0617('0x3'));var rp=require(_0x0617('0x4'));var fs=require('fs');var path=require(_0x0617('0x5'));var rimraf=require(_0x0617('0x6'));var config=require(_0x0617('0x7'));var attributes=require(_0x0617('0x8'));module['exports']=function(_0x39af8f,_0x5eda8a){return _0x39af8f['define']('ChatWebsite',attributes,{'tableName':_0x0617('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c2f=['api','moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','define','chat_websites','util','../../config/logger'];(function(_0x44583b,_0x4f23f7){var _0x12fd08=function(_0x5b8815){while(--_0x5b8815){_0x44583b['push'](_0x44583b['shift']());}};_0x12fd08(++_0x4f23f7);}(_0x0c2f,0x111));var _0xf0c2=function(_0x5c0b22,_0x56d46a){_0x5c0b22=_0x5c0b22-0x0;var _0x16a8a6=_0x0c2f[_0x5c0b22];return _0x16a8a6;};'use strict';var _=require('lodash');var util=require(_0xf0c2('0x0'));var logger=require(_0xf0c2('0x1'))(_0xf0c2('0x2'));var moment=require(_0xf0c2('0x3'));var BPromise=require(_0xf0c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0c2('0x5'));var rimraf=require(_0xf0c2('0x6'));var config=require(_0xf0c2('0x7'));var attributes=require(_0xf0c2('0x8'));module['exports']=function(_0x33989e,_0x245e79){return _0x33989e[_0xf0c2('0x9')]('ChatWebsite',attributes,{'tableName':_0xf0c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 5e299c3..3161af9 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e1f=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x123414,_0x4f85f6){var _0x50e83a=function(_0x585a1e){while(--_0x585a1e){_0x123414['push'](_0x123414['shift']());}};_0x50e83a(++_0x4f85f6);}(_0x9e1f,0xfd));var _0xf9e1=function(_0x50e425,_0x3ca8d7){_0x50e425=_0x50e425-0x0;var _0x4b985d=_0x9e1f[_0x50e425];return _0x4b985d;};'use strict';var _=require(_0xf9e1('0x0'));var util=require(_0xf9e1('0x1'));var moment=require(_0xf9e1('0x2'));var BPromise=require(_0xf9e1('0x3'));var rs=require(_0xf9e1('0x4'));var fs=require('fs');var Redis=require(_0xf9e1('0x5'));var db=require(_0xf9e1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9e1('0x7'))(_0xf9e1('0x8'));var config=require('../../config/environment');var jayson=require(_0xf9e1('0x9'));var client=jayson['client'][_0xf9e1('0xa')]({'port':0x232a});config[_0xf9e1('0xb')]=_['defaults'](config[_0xf9e1('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9e1('0xb')]));require(_0xf9e1('0xc'))[_0xf9e1('0xd')](socket);function respondWithRpcPromise(_0x18492c,_0x3c8260,_0x321a85){return new BPromise(function(_0x27ca46,_0x28f165){return client[_0xf9e1('0xe')](_0x18492c,_0x321a85)['then'](function(_0x1bf640){logger[_0xf9e1('0xf')](_0xf9e1('0x10'),_0x3c8260,_0xf9e1('0x11'));logger[_0xf9e1('0x12')](_0xf9e1('0x13'),_0x3c8260,_0xf9e1('0x11'),JSON[_0xf9e1('0x14')](_0x1bf640));if(_0x1bf640[_0xf9e1('0x15')]){if(_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x16')]===0x1f4){logger['error'](_0xf9e1('0x10'),_0x3c8260,_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);return _0x28f165(_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);}logger[_0xf9e1('0x15')](_0xf9e1('0x10'),_0x3c8260,_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);return _0x27ca46(_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);}else{logger[_0xf9e1('0xf')](_0xf9e1('0x10'),_0x3c8260,'request\x20sent');_0x27ca46(_0x1bf640['result']['message']);}})[_0xf9e1('0x18')](function(_0x4851a9){logger['error'](_0xf9e1('0x10'),_0x3c8260,_0x4851a9);_0x28f165(_0x4851a9);});});}
\ No newline at end of file
+var _0xe0b0=['redis','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults'];(function(_0x5a59b9,_0x438b5a){var _0x41d2a4=function(_0x296606){while(--_0x296606){_0x5a59b9['push'](_0x5a59b9['shift']());}};_0x41d2a4(++_0x438b5a);}(_0xe0b0,0x7c));var _0x0e0b=function(_0x16505c,_0x573d70){_0x16505c=_0x16505c-0x0;var _0x2893a0=_0xe0b0[_0x16505c];return _0x2893a0;};'use strict';var _=require(_0x0e0b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0e0b('0x1'));var rs=require(_0x0e0b('0x2'));var fs=require('fs');var Redis=require(_0x0e0b('0x3'));var db=require(_0x0e0b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e0b('0x5'))(_0x0e0b('0x6'));var config=require(_0x0e0b('0x7'));var jayson=require(_0x0e0b('0x8'));var client=jayson[_0x0e0b('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0e0b('0xa')](config[_0x0e0b('0xb')],{'host':_0x0e0b('0xc'),'port':0x18eb});var socket=require(_0x0e0b('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x0e0b('0xe')](socket);function respondWithRpcPromise(_0x163492,_0x5e1af1,_0x57b2a2){return new BPromise(function(_0x36381b,_0x1d0fac){return client[_0x0e0b('0xf')](_0x163492,_0x57b2a2)[_0x0e0b('0x10')](function(_0x46527c){logger[_0x0e0b('0x11')](_0x0e0b('0x12'),_0x5e1af1,_0x0e0b('0x13'));logger[_0x0e0b('0x14')](_0x0e0b('0x15'),_0x5e1af1,'request\x20sent',JSON[_0x0e0b('0x16')](_0x46527c));if(_0x46527c['error']){if(_0x46527c[_0x0e0b('0x17')]['code']===0x1f4){logger[_0x0e0b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5e1af1,_0x46527c[_0x0e0b('0x17')][_0x0e0b('0x18')]);return _0x1d0fac(_0x46527c[_0x0e0b('0x17')][_0x0e0b('0x18')]);}logger[_0x0e0b('0x17')](_0x0e0b('0x12'),_0x5e1af1,_0x46527c[_0x0e0b('0x17')]['message']);return _0x36381b(_0x46527c[_0x0e0b('0x17')][_0x0e0b('0x18')]);}else{logger[_0x0e0b('0x11')](_0x0e0b('0x12'),_0x5e1af1,_0x0e0b('0x13'));_0x36381b(_0x46527c[_0x0e0b('0x19')][_0x0e0b('0x18')]);}})[_0x0e0b('0x1a')](function(_0x1318b7){logger[_0x0e0b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5e1af1,_0x1318b7);_0x1d0fac(_0x1318b7);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 646ee4f..2a8c9cb 100644
--- a/server/api/chatWebsite/chatWebsite.socket.js
+++ b/server/api/chatWebsite/chatWebsite.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x79fd=['register','length','chatWebsite:','save','remove','emit','removeListener'];(function(_0x60fa35,_0x12abc6){var _0x2d9933=function(_0x310304){while(--_0x310304){_0x60fa35['push'](_0x60fa35['shift']());}};_0x2d9933(++_0x12abc6);}(_0x79fd,0x114));var _0xd79f=function(_0xb48c0,_0x35e2c1){_0xb48c0=_0xb48c0-0x0;var _0x196404=_0x79fd[_0xb48c0];return _0x196404;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd79f('0x0'),_0xd79f('0x1'),'update'];function createListener(_0x1450d7,_0x494ce3){return function(_0x1e3d77){_0x494ce3[_0xd79f('0x2')](_0x1450d7,_0x1e3d77);};}function removeListener(_0x281ab9,_0x509f19){return function(){ChatWebsiteEvents[_0xd79f('0x3')](_0x281ab9,_0x509f19);};}exports[_0xd79f('0x4')]=function(_0x56737e){for(var _0x2d5c2d=0x0,_0x4dcfb1=events[_0xd79f('0x5')];_0x2d5c2d<_0x4dcfb1;_0x2d5c2d++){var _0x9ba835=events[_0x2d5c2d];var _0x7b155d=createListener(_0xd79f('0x6')+_0x9ba835,_0x56737e);ChatWebsiteEvents['on'](_0x9ba835,_0x7b155d);}};
\ No newline at end of file
+var _0x6816=['update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x231e97,_0x478239){var _0x4565b2=function(_0xce29c9){while(--_0xce29c9){_0x231e97['push'](_0x231e97['shift']());}};_0x4565b2(++_0x478239);}(_0x6816,0x126));var _0x6681=function(_0x1c8c26,_0xa43196){_0x1c8c26=_0x1c8c26-0x0;var _0xd021dd=_0x6816[_0x1c8c26];return _0xd021dd;};'use strict';var ChatWebsiteEvents=require(_0x6681('0x0'));var events=[_0x6681('0x1'),_0x6681('0x2'),_0x6681('0x3')];function createListener(_0x283205,_0x1d205e){return function(_0x11117f){_0x1d205e[_0x6681('0x4')](_0x283205,_0x11117f);};}function removeListener(_0x3c2261,_0x3c37c8){return function(){ChatWebsiteEvents[_0x6681('0x5')](_0x3c2261,_0x3c37c8);};}exports[_0x6681('0x6')]=function(_0xe50b7){for(var _0x88b1e5=0x0,_0x535138=events[_0x6681('0x7')];_0x88b1e5<_0x535138;_0x88b1e5++){var _0xc2b5bd=events[_0x88b1e5];var _0x365251=createListener(_0x6681('0x8')+_0xc2b5bd,_0xe50b7);ChatWebsiteEvents['on'](_0xc2b5bd,_0x365251);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 21ce322..86a6bfa 100644
--- a/server/api/chatWebsite/index.js
+++ b/server/api/chatWebsite/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe22e=['post','/:id/dispositions','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','single','addLogo','diskStorage','server/files/images/avatars/','originalname','/:id/avatar','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','extname','replace','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','/:id/users','getAgents'];(function(_0x18295a,_0x381298){var _0x2a22a1=function(_0x57151d){while(--_0x57151d){_0x18295a['push'](_0x18295a['shift']());}};_0x2a22a1(++_0x381298);}(_0xe22e,0xfa));var _0xee22=function(_0x14790f,_0x432b5f){_0x14790f=_0x14790f-0x0;var _0x5acc1f=_0xe22e[_0x14790f];return _0x5acc1f;};'use strict';var multer=require(_0xee22('0x0'));var util=require(_0xee22('0x1'));var path=require(_0xee22('0x2'));var timeout=require(_0xee22('0x3'));var express=require(_0xee22('0x4'));var router=express['Router']();var fs_extra=require(_0xee22('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xee22('0x6'));var config=require(_0xee22('0x7'));var controller=require(_0xee22('0x8'));router[_0xee22('0x9')]('/',auth[_0xee22('0xa')](),controller[_0xee22('0xb')]);router[_0xee22('0x9')](_0xee22('0xc'),auth[_0xee22('0xa')](),controller[_0xee22('0xd')]);router[_0xee22('0x9')](_0xee22('0xe'),auth[_0xee22('0xa')](),controller[_0xee22('0xf')]);router[_0xee22('0x9')]('/:id/dispositions',auth[_0xee22('0xa')](),controller[_0xee22('0x10')]);router[_0xee22('0x9')](_0xee22('0x11'),auth[_0xee22('0xa')](),controller[_0xee22('0x12')]);router[_0xee22('0x9')](_0xee22('0x13'),controller['getLogo']);router[_0xee22('0x9')]('/:id/avatar',controller[_0xee22('0x14')]);router[_0xee22('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xee22('0x9')](_0xee22('0x15'),controller[_0xee22('0x16')]);router[_0xee22('0x9')](_0xee22('0x17'),auth[_0xee22('0xa')](),controller[_0xee22('0x18')]);router[_0xee22('0x9')](_0xee22('0x19'),controller[_0xee22('0x1a')]);router[_0xee22('0x9')](_0xee22('0x1b'),auth['isAuthenticated'](),controller[_0xee22('0x1c')]);router['get']('/:id/proactive_actions',auth[_0xee22('0xa')](),controller[_0xee22('0x1d')]);router['get']('/:id/fields',controller[_0xee22('0x1e')]);router[_0xee22('0x9')](_0xee22('0x1f'),auth[_0xee22('0xa')](),controller['getOfflineMessages']);router[_0xee22('0x9')](_0xee22('0x20'),auth[_0xee22('0xa')](),controller[_0xee22('0x21')]);router[_0xee22('0x22')]('/',auth[_0xee22('0xa')](),controller['create']);router['post'](_0xee22('0x23'),auth[_0xee22('0xa')](),controller[_0xee22('0x24')]);router[_0xee22('0x22')](_0xee22('0x11'),auth[_0xee22('0xa')](),controller[_0xee22('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22d46f,_0x209e7e,_0x386d64){_0x386d64(null,path[_0xee22('0x26')](config[_0xee22('0x27')],_0xee22('0x28')));},'filename':function(_0x16c919,_0x2bdc08,_0x594f2b){_0x594f2b(null,util[_0xee22('0x29')](_0xee22('0x2a'),Date[_0xee22('0x2b')](),_0x2bdc08['originalname']));}})});router['post'](_0xee22('0x13'),upload[_0xee22('0x2c')]('file'),controller[_0xee22('0x2d')]);var upload=multer({'storage':multer[_0xee22('0x2e')]({'destination':function(_0x163da5,_0x23cac2,_0x5792a1){_0x5792a1(null,path[_0xee22('0x26')](config[_0xee22('0x27')],_0xee22('0x2f')));},'filename':function(_0x1aac97,_0x5468ef,_0x5496e4){_0x5496e4(null,util[_0xee22('0x29')](_0xee22('0x2a'),Date[_0xee22('0x2b')](),_0x5468ef[_0xee22('0x30')]));}})});router[_0xee22('0x22')](_0xee22('0x31'),upload[_0xee22('0x2c')]('file'),controller[_0xee22('0x32')]);var upload=multer({'storage':multer[_0xee22('0x2e')]({'destination':function(_0x4e194d,_0x376545,_0x59852f){_0x59852f(null,path[_0xee22('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xdceca5,_0x38c1f0,_0x4c7713){_0x4c7713(null,util['format']('%s-%s',Date[_0xee22('0x2b')](),_0x38c1f0['originalname']));}})});router[_0xee22('0x22')](_0xee22('0x33'),upload['single']('file'),controller[_0xee22('0x34')]);var upload=multer({'storage':multer[_0xee22('0x2e')]({'destination':function(_0x5230e2,_0x7f8b47,_0x465bbd){_0x465bbd(null,path[_0xee22('0x26')](config['root'],_0xee22('0x2f')));},'filename':function(_0x4b0a2c,_0x4575d9,_0xefe1ad){_0xefe1ad(null,util[_0xee22('0x29')]('%s-%s',Date[_0xee22('0x2b')](),_0x4575d9[_0xee22('0x30')]));}})});router[_0xee22('0x22')](_0xee22('0x15'),upload['single']('file'),controller[_0xee22('0x35')]);router[_0xee22('0x22')](_0xee22('0x36'),controller[_0xee22('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x14a2df,_0x2e5e96,_0x362db0){const _0x4b0862=path[_0xee22('0x26')](config[_0xee22('0x27')],'server/files','attachments',_0xee22('0x38'));fs_extra[_0xee22('0x39')](_0x4b0862,function(){_0x362db0(null,_0x4b0862);});},'filename':function(_0x4e617f,_0x5c7669,_0x21f886){const _0x54e0f7=_0x5c7669[_0xee22('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x47f378=path[_0xee22('0x3a')](_0x54e0f7);const _0xb6128c=Date[_0xee22('0x2b')]()+'-'+_0x54e0f7[_0xee22('0x3b')](_0x47f378,'')+_0x47f378;_0x21f886(null,_0xb6128c);}})});router['post']('/:id/offline',offlineUploadMulter['any'](),controller[_0xee22('0x3c')]);router[_0xee22('0x22')]('/:id/interactions',auth[_0xee22('0xa')](),controller['addInteraction']);router['post'](_0xee22('0x1b'),auth[_0xee22('0xa')](),controller[_0xee22('0x3d')]);router[_0xee22('0x22')]('/:id/proactive_actions',auth[_0xee22('0xa')](),controller[_0xee22('0x3e')]);router[_0xee22('0x22')](_0xee22('0x20'),auth[_0xee22('0xa')](),controller[_0xee22('0x3f')]);router[_0xee22('0x40')]('/:id',auth[_0xee22('0xa')](),controller[_0xee22('0x41')]);router[_0xee22('0x42')]('/:id',auth[_0xee22('0xa')](),controller[_0xee22('0x43')]);router[_0xee22('0x42')](_0xee22('0x23'),auth[_0xee22('0xa')](),controller[_0xee22('0x44')]);router[_0xee22('0x42')](_0xee22('0x11'),auth[_0xee22('0xa')](),controller[_0xee22('0x45')]);router[_0xee22('0x42')]('/:id/users',auth[_0xee22('0xa')](),controller['removeAgents']);module[_0xee22('0x46')]=router;
\ No newline at end of file
+var _0x004b=['/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','format','now','originalname','file','root','server/files/images/avatars/','single','%s-%s','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace'];(function(_0x4b3280,_0x2b3d50){var _0x4005c2=function(_0x16d705){while(--_0x16d705){_0x4b3280['push'](_0x4b3280['shift']());}};_0x4005c2(++_0x2b3d50);}(_0x004b,0x171));var _0xb004=function(_0x21b580,_0x5b7172){_0x21b580=_0x21b580-0x0;var _0x16a50e=_0x004b[_0x21b580];return _0x16a50e;};'use strict';var multer=require(_0xb004('0x0'));var util=require(_0xb004('0x1'));var path=require('path');var timeout=require(_0xb004('0x2'));var express=require(_0xb004('0x3'));var router=express[_0xb004('0x4')]();var fs_extra=require(_0xb004('0x5'));var auth=require(_0xb004('0x6'));var interaction=require(_0xb004('0x7'));var config=require('../../config/environment');var controller=require(_0xb004('0x8'));router[_0xb004('0x9')]('/',auth['isAuthenticated'](),controller[_0xb004('0xa')]);router[_0xb004('0x9')]('/describe',auth[_0xb004('0xb')](),controller[_0xb004('0xc')]);router[_0xb004('0x9')](_0xb004('0xd'),auth[_0xb004('0xb')](),controller[_0xb004('0xe')]);router[_0xb004('0x9')](_0xb004('0xf'),auth[_0xb004('0xb')](),controller[_0xb004('0x10')]);router[_0xb004('0x9')](_0xb004('0x11'),auth['isAuthenticated'](),controller[_0xb004('0x12')]);router[_0xb004('0x9')](_0xb004('0x13'),controller[_0xb004('0x14')]);router['get'](_0xb004('0x15'),controller['getAvatar']);router[_0xb004('0x9')](_0xb004('0x16'),controller[_0xb004('0x17')]);router[_0xb004('0x9')](_0xb004('0x18'),controller['getSystemAvatar']);router[_0xb004('0x9')](_0xb004('0x19'),auth[_0xb004('0xb')](),controller[_0xb004('0x1a')]);router[_0xb004('0x9')](_0xb004('0x1b'),controller[_0xb004('0x1c')]);router[_0xb004('0x9')](_0xb004('0x1d'),auth[_0xb004('0xb')](),controller['getApplications']);router[_0xb004('0x9')](_0xb004('0x1e'),auth['isAuthenticated'](),controller[_0xb004('0x1f')]);router[_0xb004('0x9')](_0xb004('0x20'),controller[_0xb004('0x21')]);router['get'](_0xb004('0x22'),auth[_0xb004('0xb')](),controller['getOfflineMessages']);router[_0xb004('0x9')](_0xb004('0x23'),auth[_0xb004('0xb')](),controller[_0xb004('0x24')]);router[_0xb004('0x25')]('/',auth[_0xb004('0xb')](),controller['create']);router[_0xb004('0x25')](_0xb004('0xf'),auth[_0xb004('0xb')](),controller[_0xb004('0x26')]);router[_0xb004('0x25')](_0xb004('0x11'),auth[_0xb004('0xb')](),controller[_0xb004('0x27')]);var upload=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x51c11a,_0x277d06,_0xf8125e){_0xf8125e(null,path[_0xb004('0x29')](config['root'],'server/files/images/logos/'));},'filename':function(_0xcdaf85,_0x3f104b,_0x3aa826){_0x3aa826(null,util[_0xb004('0x2a')]('%s-%s',Date[_0xb004('0x2b')](),_0x3f104b[_0xb004('0x2c')]));}})});router[_0xb004('0x25')](_0xb004('0x13'),upload['single'](_0xb004('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x552e9c,_0x2d5fec,_0x18fb87){_0x18fb87(null,path['join'](config[_0xb004('0x2e')],_0xb004('0x2f')));},'filename':function(_0x5e08bb,_0x14a614,_0x32d0a5){_0x32d0a5(null,util['format']('%s-%s',Date['now'](),_0x14a614[_0xb004('0x2c')]));}})});router['post'](_0xb004('0x15'),upload[_0xb004('0x30')](_0xb004('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x1fe02a,_0xdab94a,_0x3f1a5d){_0x3f1a5d(null,path[_0xb004('0x29')](config['root'],_0xb004('0x2f')));},'filename':function(_0x223094,_0x363f7a,_0x3afeba){_0x3afeba(null,util[_0xb004('0x2a')](_0xb004('0x31'),Date[_0xb004('0x2b')](),_0x363f7a[_0xb004('0x2c')]));}})});router[_0xb004('0x25')](_0xb004('0x16'),upload[_0xb004('0x30')](_0xb004('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x4cc0fe,_0x5f07a6,_0x4a7f66){_0x4a7f66(null,path[_0xb004('0x29')](config[_0xb004('0x2e')],_0xb004('0x2f')));},'filename':function(_0x5e8747,_0x4b443d,_0x2261f5){_0x2261f5(null,util[_0xb004('0x2a')](_0xb004('0x31'),Date[_0xb004('0x2b')](),_0x4b443d[_0xb004('0x2c')]));}})});router[_0xb004('0x25')]('/:id/system_avatar',upload[_0xb004('0x30')](_0xb004('0x2d')),controller['addSystemAvatar']);router['post'](_0xb004('0x32'),controller[_0xb004('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x19b13e,_0x5c0038,_0x2d8dc2){const _0x3c0bf2=path[_0xb004('0x29')](config[_0xb004('0x2e')],_0xb004('0x34'),_0xb004('0x35'),_0xb004('0x36'));fs_extra[_0xb004('0x37')](_0x3c0bf2,function(){_0x2d8dc2(null,_0x3c0bf2);});},'filename':function(_0x588b32,_0x4b6989,_0x403e8a){const _0xd02bf8=_0x4b6989[_0xb004('0x2c')][_0xb004('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xc5ac08=path['extname'](_0xd02bf8);const _0x4e27ef=Date[_0xb004('0x2b')]()+'-'+_0xd02bf8[_0xb004('0x38')](_0xc5ac08,'')+_0xc5ac08;_0x403e8a(null,_0x4e27ef);}})});router['post'](_0xb004('0x39'),offlineUploadMulter[_0xb004('0x3a')](),controller[_0xb004('0x3b')]);router['post'](_0xb004('0x19'),auth[_0xb004('0xb')](),controller['addInteraction']);router[_0xb004('0x25')]('/:id/applications',auth[_0xb004('0xb')](),controller[_0xb004('0x3c')]);router[_0xb004('0x25')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xb004('0x3d')]);router[_0xb004('0x25')](_0xb004('0x23'),auth[_0xb004('0xb')](),controller[_0xb004('0x3e')]);router[_0xb004('0x3f')](_0xb004('0xd'),auth[_0xb004('0xb')](),controller[_0xb004('0x40')]);router[_0xb004('0x41')](_0xb004('0xd'),auth[_0xb004('0xb')](),controller[_0xb004('0x42')]);router[_0xb004('0x41')](_0xb004('0xf'),auth['isAuthenticated'](),controller[_0xb004('0x43')]);router[_0xb004('0x41')](_0xb004('0x11'),auth[_0xb004('0xb')](),controller[_0xb004('0x44')]);router[_0xb004('0x41')](_0xb004('0x23'),auth[_0xb004('0xb')](),controller[_0xb004('0x45')]);module[_0xb004('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 98f0c59..aa6ae81 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1740=['express','../components/auth/service','../config/environment','Router','production','app','get','client-side-logger','expressEndpoint','/client-logs','exports','beaver-logger/server'];(function(_0x26c559,_0x3421ec){var _0x262123=function(_0x194378){while(--_0x194378){_0x26c559['push'](_0x26c559['shift']());}};_0x262123(++_0x3421ec);}(_0x1740,0x143));var _0x0174=function(_0x19efa0,_0x245b7b){_0x19efa0=_0x19efa0-0x0;var _0x374b08=_0x1740[_0x19efa0];return _0x374b08;};var beaverLogger=require(_0x0174('0x0'));var express=require(_0x0174('0x1'));var auth=require(_0x0174('0x2'));var config=require(_0x0174('0x3'));var router=express[_0x0174('0x4')]();var isProduction=config['env']===_0x0174('0x5')||![];function clientSideLogs(_0x5a2059,_0xca4224,_0x4c3726){var _0x1a3f9e=_0x5a2059[_0x0174('0x6')][_0x0174('0x7')](_0x0174('0x8'));if(!_0x1a3f9e){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x0174('0x9')]({'uri':_0x0174('0xa'),'logger':_0x1a3f9e,'enableCors':!isProduction})(_0x5a2059,_0xca4224,_0x4c3726);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x0174('0xb')]=router;
\ No newline at end of file
+var _0x4ea5=['use','isAuthenticated','exports','beaver-logger/server','../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x4ea5,0xd3));var _0x54ea=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x4ea5[_0x550d12];return _0x12103d;};var beaverLogger=require(_0x54ea('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x54ea('0x1'));var router=express[_0x54ea('0x2')]();var isProduction=config[_0x54ea('0x3')]==='production'||![];function clientSideLogs(_0x47b7f5,_0x4dc268,_0xa6a5ed){var _0x1dc925=_0x47b7f5[_0x54ea('0x4')][_0x54ea('0x5')](_0x54ea('0x6'));if(!_0x1dc925){throw new Error(_0x54ea('0x7'));}return beaverLogger[_0x54ea('0x8')]({'uri':_0x54ea('0x9'),'logger':_0x1dc925,'enableCors':!isProduction})(_0x47b7f5,_0x4dc268,_0xa6a5ed);}router[_0x54ea('0xa')](auth[_0x54ea('0xb')](),clientSideLogs);module[_0x54ea('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index c54c1c9..2f71b6e 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x62d7=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365'];(function(_0x52969b,_0x35eb2e){var _0x157c5b=function(_0x26ffef){while(--_0x26ffef){_0x52969b['push'](_0x52969b['shift']());}};_0x157c5b(++_0x35eb2e);}(_0x62d7,0x168));var _0x762d=function(_0x29c54e,_0xd415a2){_0x29c54e=_0x29c54e-0x0;var _0x142be0=_0x62d7[_0x29c54e];return _0x142be0;};'use strict';var Sequelize=require(_0x762d('0x0'));module[_0x762d('0x1')]={'name':{'type':Sequelize[_0x762d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x762d('0x3'),_0x762d('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x762d('0x5')](_0x762d('0x6'),_0x762d('0x7'))},'data1':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0x8')},'data2':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0x9')},'data3':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0xa')},'data4':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0xb')},'data5':{'type':Sequelize[_0x762d('0xc')],'comment':_0x762d('0xd')},'data6':{'type':Sequelize[_0x762d('0xc')],'comment':_0x762d('0xe')},'data7':{'type':Sequelize[_0x762d('0xc')],'comment':_0x762d('0xf')}};
\ No newline at end of file
+var _0xdcce=['ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0x19f094,_0x53af25){var _0x122ad5=function(_0x29dd24){while(--_0x29dd24){_0x19f094['push'](_0x19f094['shift']());}};_0x122ad5(++_0x53af25);}(_0xdcce,0xad));var _0xedcc=function(_0x2d1e90,_0x359a52){_0x2d1e90=_0x2d1e90-0x0;var _0x3c168b=_0xdcce[_0x2d1e90];return _0x3c168b;};'use strict';var Sequelize=require(_0xedcc('0x0'));module[_0xedcc('0x1')]={'name':{'type':Sequelize[_0xedcc('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xedcc('0x3')](_0xedcc('0x4'),_0xedcc('0x5'),_0xedcc('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xedcc('0x3')](_0xedcc('0x7'),_0xedcc('0x8'))},'data1':{'type':Sequelize[_0xedcc('0x2')],'comment':_0xedcc('0x9')},'data2':{'type':Sequelize[_0xedcc('0x2')],'comment':_0xedcc('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0xedcc('0xb')},'data4':{'type':Sequelize[_0xedcc('0x2')],'comment':_0xedcc('0xc')},'data5':{'type':Sequelize[_0xedcc('0xd')],'comment':_0xedcc('0xe')},'data6':{'type':Sequelize[_0xedcc('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xedcc('0xd')],'comment':_0xedcc('0xf')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 8951d76..9cbcaab 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2baf=['status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','show','params','options','find','decryptString','create','Name\x20parameter\x20not\x20specified','values','includes','body','join','encryptString','catch','oauth2MicrosoftAuthorize','user','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','update','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','end'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x2baf,0x1cd));var _0xf2ba=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x2baf[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0xf2ba('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0xf2ba('0x1'));var logger=require('../../config/logger')(_0xf2ba('0x2'));var db=require(_0xf2ba('0x3'))['db'];var oauth=require(_0xf2ba('0x4'));config[_0xf2ba('0x5')]=_[_0xf2ba('0x6')](config[_0xf2ba('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2ba('0x7'))(new Redis(config[_0xf2ba('0x5')]));var redis=new Redis(config[_0xf2ba('0x5')]);function respondWithStatusCode(_0x22f241,_0x3cda5e){_0x3cda5e=_0x3cda5e||0xcc;return function(_0x404681){if(_0x404681){return _0x22f241['sendStatus'](_0x3cda5e);}return _0x22f241['status'](_0x3cda5e)[_0xf2ba('0x8')]();};}function respondWithResult(_0x8b9c94,_0x2b84bf){_0x2b84bf=_0x2b84bf||0xc8;return function(_0x21ae11){if(_0x21ae11){return _0x8b9c94[_0xf2ba('0x9')](_0x2b84bf)[_0xf2ba('0xa')](_0x21ae11);}};}function respondWithFilteredResult(_0x1c1c9d,_0x4a55c9){return function(_0x15d5c6){if(_0x15d5c6){var _0x4616a2=typeof _0x4a55c9[_0xf2ba('0xb')]===_0xf2ba('0xc')&&typeof _0x4a55c9[_0xf2ba('0xd')]===_0xf2ba('0xc');var _0x266448=_0x15d5c6[_0xf2ba('0xe')];var _0x2e06d1=_0x4616a2?0x0:_0x4a55c9[_0xf2ba('0xb')];var _0x1ebec7=_0x4616a2?_0x15d5c6[_0xf2ba('0xe')]:_0x4a55c9['offset']+_0x4a55c9[_0xf2ba('0xd')];var _0x1a02ac;if(_0x1ebec7>=_0x266448){_0x1ebec7=_0x266448;_0x1a02ac=0xc8;}else{_0x1a02ac=0xce;}_0x1c1c9d[_0xf2ba('0x9')](_0x1a02ac);return _0x1c1c9d[_0xf2ba('0xf')](_0xf2ba('0x10'),_0x2e06d1+'-'+_0x1ebec7+'/'+_0x266448)[_0xf2ba('0xa')](_0x15d5c6);}return null;};}function saveUpdates(_0x3f47ea){return function(_0xdaceab){if(_0xdaceab){return _0xdaceab['update'](_0x3f47ea)['then'](function(_0x140fbe){return _0x140fbe;});}return null;};}function removeEntity(_0x1097cf){return function(_0xed32a8){if(_0xed32a8){return _0xed32a8[_0xf2ba('0x11')]()[_0xf2ba('0x12')](function(){_0x1097cf[_0xf2ba('0x9')](0xcc)[_0xf2ba('0x8')]();});}};}function handleEntityNotFound(_0x5d5b82){return function(_0x22d884){if(!_0x22d884){_0x5d5b82[_0xf2ba('0x13')](0x194);}return _0x22d884;};}function handleError(_0xbe698f,_0x52c8ef){_0x52c8ef=_0x52c8ef||0x1f4;return function(_0xa0436a){logger[_0xf2ba('0x14')](_0xa0436a[_0xf2ba('0x15')]);if(_0xa0436a[_0xf2ba('0x16')]){delete _0xa0436a[_0xf2ba('0x16')];}_0xbe698f[_0xf2ba('0x9')](_0x52c8ef)[_0xf2ba('0x17')](_0xa0436a);};}function maskClientSecret(_0x314c5b){return _[_0xf2ba('0x18')](_0x314c5b[_0xf2ba('0x19')](0x0,0x3),0x14,'*');}exports[_0xf2ba('0x1a')]=function(_0x248ff9,_0x61c2fc){var _0x5f3d62={},_0x4146bc={},_0x49894a={'count':0x0,'rows':[]};var _0x384a6f=_[_0xf2ba('0x1b')](db[_0xf2ba('0x1c')][_0xf2ba('0x1d')],function(_0x3ef2b8){return{'name':_0x3ef2b8[_0xf2ba('0x1e')],'type':_0x3ef2b8[_0xf2ba('0x1f')][_0xf2ba('0x20')]};});_0x4146bc['model']=_['map'](_0x384a6f,_0xf2ba('0x16'));_0x4146bc[_0xf2ba('0x21')]=_[_0xf2ba('0x22')](_0x248ff9[_0xf2ba('0x21')]);_0x4146bc['filters']=_[_0xf2ba('0x23')](_0x4146bc[_0xf2ba('0x24')],_0x4146bc[_0xf2ba('0x21')]);_0x5f3d62[_0xf2ba('0x25')]=_['intersection'](_0x4146bc[_0xf2ba('0x24')],qs[_0xf2ba('0x26')](_0x248ff9['query'][_0xf2ba('0x26')]));_0x5f3d62['attributes']=_0x5f3d62[_0xf2ba('0x25')][_0xf2ba('0x27')]?_0x5f3d62[_0xf2ba('0x25')]:_0x4146bc[_0xf2ba('0x24')];if(!_0x248ff9['query'][_0xf2ba('0x28')](_0xf2ba('0x29'))){_0x5f3d62[_0xf2ba('0xd')]=qs['limit'](_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0xd')]);_0x5f3d62[_0xf2ba('0xb')]=qs[_0xf2ba('0xb')](_0x248ff9['query'][_0xf2ba('0xb')]);}_0x5f3d62[_0xf2ba('0x2a')]=qs[_0xf2ba('0x2b')](_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0x2b')]);_0x5f3d62[_0xf2ba('0x2c')]=qs[_0xf2ba('0x2d')](_['pick'](_0x248ff9['query'],_0x4146bc[_0xf2ba('0x2d')]),_0x384a6f);if(_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0x2e')]){_0x5f3d62[_0xf2ba('0x2c')]=_['merge'](_0x5f3d62[_0xf2ba('0x2c')],{'$or':_[_0xf2ba('0x1b')](_0x384a6f,function(_0x532063){if(_0x532063[_0xf2ba('0x1f')]!=='VIRTUAL'){var _0x1e375e={};_0x1e375e[_0x532063[_0xf2ba('0x16')]]={'$like':'%'+_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0x2e')]+'%'};return _0x1e375e;}})});}_0x5f3d62=_[_0xf2ba('0x2f')]({},_0x5f3d62,_0x248ff9['options']);var _0x2cd520={'where':_0x5f3d62[_0xf2ba('0x2c')]};return db[_0xf2ba('0x1c')][_0xf2ba('0xe')](_0x2cd520)[_0xf2ba('0x12')](function(_0x3da1cd){_0x49894a['count']=_0x3da1cd;if(_0x248ff9['query'][_0xf2ba('0x30')]){_0x5f3d62[_0xf2ba('0x31')]=[{'all':!![]}];}return db[_0xf2ba('0x1c')][_0xf2ba('0x32')](_0x5f3d62);})[_0xf2ba('0x12')](function(_0x314b9f){_0x49894a[_0xf2ba('0x33')]=_[_0xf2ba('0x1b')](_0x314b9f,function(_0x4362a0){if(_0x4362a0[_0xf2ba('0x34')]===_0xf2ba('0x35')){var _0x50a991=encryptor['decryptString'](_0x4362a0[_0xf2ba('0x36')]);_0x4362a0[_0xf2ba('0x36')]=maskClientSecret(_0x50a991);}return _0x4362a0;});return _0x49894a;})[_0xf2ba('0x12')](respondWithFilteredResult(_0x61c2fc,_0x5f3d62))['catch'](handleError(_0x61c2fc,null));};exports[_0xf2ba('0x37')]=function(_0x1a65bb,_0x520abc){var _0x4c435d={'raw':!![],'where':{'id':_0x1a65bb[_0xf2ba('0x38')]['id']}},_0x174a83={};_0x174a83[_0xf2ba('0x24')]=_['keys'](db['CloudProvider'][_0xf2ba('0x1d')]);_0x174a83[_0xf2ba('0x21')]=_[_0xf2ba('0x22')](_0x1a65bb[_0xf2ba('0x21')]);_0x174a83[_0xf2ba('0x2d')]=_['intersection'](_0x174a83[_0xf2ba('0x24')],_0x174a83[_0xf2ba('0x21')]);_0x4c435d[_0xf2ba('0x25')]=_[_0xf2ba('0x23')](_0x174a83[_0xf2ba('0x24')],qs[_0xf2ba('0x26')](_0x1a65bb[_0xf2ba('0x21')]['fields']));_0x4c435d[_0xf2ba('0x25')]=_0x4c435d[_0xf2ba('0x25')][_0xf2ba('0x27')]?_0x4c435d[_0xf2ba('0x25')]:_0x174a83[_0xf2ba('0x24')];if(_0x1a65bb[_0xf2ba('0x21')]['includeAll']){_0x4c435d[_0xf2ba('0x31')]=[{'all':!![]}];}_0x4c435d=_[_0xf2ba('0x2f')]({},_0x4c435d,_0x1a65bb[_0xf2ba('0x39')]);return db[_0xf2ba('0x1c')][_0xf2ba('0x3a')](_0x4c435d)[_0xf2ba('0x12')](handleEntityNotFound(_0x520abc,null))[_0xf2ba('0x12')](function(_0x23a300){if(_0x23a300[_0xf2ba('0x34')]===_0xf2ba('0x35')){var _0x57bf3c=encryptor[_0xf2ba('0x3b')](_0x23a300['data3']);_0x23a300['data3']=maskClientSecret(_0x57bf3c);}return _0x23a300;})[_0xf2ba('0x12')](respondWithResult(_0x520abc,null))['catch'](handleError(_0x520abc,null));};exports[_0xf2ba('0x3c')]=function(_0x56816f,_0x420925){if(!_0x56816f['body'][_0xf2ba('0x16')])throw new Error(_0xf2ba('0x3d'));if(!_0x56816f['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x229f62=db[_0xf2ba('0x1c')][_0xf2ba('0x1d')]['service'][_0xf2ba('0x3e')];if(!_0x229f62[_0xf2ba('0x3f')](_0x56816f[_0xf2ba('0x40')][_0xf2ba('0x34')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x229f62[_0xf2ba('0x41')](',\x20'));if(_0x56816f[_0xf2ba('0x40')]['service']===_0xf2ba('0x35')&&_0x56816f[_0xf2ba('0x40')][_0xf2ba('0x36')]){_0x56816f[_0xf2ba('0x40')][_0xf2ba('0x36')]=encryptor[_0xf2ba('0x42')](_0x56816f[_0xf2ba('0x40')]['data3']);}return db['CloudProvider'][_0xf2ba('0x3c')](_0x56816f['body'],{})[_0xf2ba('0x12')](respondWithResult(_0x420925,0xc9))['catch'](handleError(_0x420925,null));};exports['update']=function(_0x3f17c5,_0x4552c5){if(_0x3f17c5[_0xf2ba('0x40')]['id']){delete _0x3f17c5[_0xf2ba('0x40')]['id'];}return db[_0xf2ba('0x1c')][_0xf2ba('0x3a')]({'where':{'id':_0x3f17c5[_0xf2ba('0x38')]['id']}})[_0xf2ba('0x12')](handleEntityNotFound(_0x4552c5,null))['then'](function(_0x12f45c){if(_0x12f45c[_0xf2ba('0x34')]===_0xf2ba('0x35')&&_0x3f17c5[_0xf2ba('0x40')][_0xf2ba('0x36')]){_0x3f17c5['body'][_0xf2ba('0x36')]=encryptor['encryptString'](_0x3f17c5[_0xf2ba('0x40')][_0xf2ba('0x36')]);}return _0x12f45c;})[_0xf2ba('0x12')](saveUpdates(_0x3f17c5[_0xf2ba('0x40')],null))[_0xf2ba('0x12')](respondWithResult(_0x4552c5,null))['catch'](handleError(_0x4552c5,null));};exports[_0xf2ba('0x11')]=function(_0x496e50,_0x2afe6d){return db[_0xf2ba('0x1c')][_0xf2ba('0x3a')]({'where':{'id':_0x496e50['params']['id']}})[_0xf2ba('0x12')](handleEntityNotFound(_0x2afe6d,null))[_0xf2ba('0x12')](removeEntity(_0x2afe6d,null))[_0xf2ba('0x43')](handleError(_0x2afe6d,null));};exports[_0xf2ba('0x44')]=function(_0x239142,_0x570282){return db[_0xf2ba('0x1c')]['findOne']({'where':{'id':_0x239142[_0xf2ba('0x38')]['id']},'raw':!![]})['then'](function(_0x36f413){if(!_0x36f413)return _0x570282['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x36f413,_0x239142[_0xf2ba('0x45')]['id'])};})[_0xf2ba('0x12')](respondWithResult(_0x570282,null))[_0xf2ba('0x43')](handleError(_0x570282,null));};exports['oauth2MicrosoftCallback']=function(_0x135851,_0x553759){var _0x384453=_0x135851[_0xf2ba('0x40')];var _0x529656;var _0x1d9aac;if(_0x384453[_0xf2ba('0x14')])throw _0x384453;redis[_0xf2ba('0x46')](_0x384453[_0xf2ba('0x47')])['then'](function(_0x2ab535){if(!_0x2ab535)throw new Error(_0xf2ba('0x48'));_0x529656=JSON[_0xf2ba('0x49')](_0x2ab535);var _0x50230b=Buffer[_0xf2ba('0x4a')](_0x384453['state'],_0xf2ba('0x4b'))[_0xf2ba('0x4c')](_0xf2ba('0x4d'));_0x1d9aac=JSON[_0xf2ba('0x49')](_0x50230b);if(!oauth[_0xf2ba('0x4e')](_0x384453[_0xf2ba('0x4f')],_0x529656[_0xf2ba('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xf2ba('0x51')](_0x384453['state']);return oauth[_0xf2ba('0x52')](_0x384453[_0xf2ba('0x53')],_0x529656);})['then'](function(_0x92bb48){_0x529656['data5']=_0x92bb48[_0xf2ba('0x54')];_0x529656['data6']=_0x92bb48[_0xf2ba('0x55')];return db[_0xf2ba('0x1c')][_0xf2ba('0x56')]({'data5':_0x529656['data5'],'data6':_0x529656['data6']},{'where':{'id':_0x529656['id']}});})[_0xf2ba('0x12')](function(){oauth[_0xf2ba('0x57')](_0x529656);socket[_0xf2ba('0x58')]('microsoftAuthorization:success',{'id':_0x1d9aac['id']});return;})[_0xf2ba('0x12')](respondWithStatusCode(_0x553759,null))[_0xf2ba('0x43')](function(_0x30496c){if(_0x1d9aac){socket[_0xf2ba('0x58')](_0xf2ba('0x59'),{'id':_0x1d9aac['id']});}if(!_0x529656){logger[_0xf2ba('0x14')](_0xf2ba('0x5a'),_0x30496c);return _0x553759[_0xf2ba('0x9')](0x1f4)[_0xf2ba('0x17')](_0x30496c[_0xf2ba('0x5b')]);}logger[_0xf2ba('0x14')](_0xf2ba('0x5c'),_0x529656['id'],JSON[_0xf2ba('0x5d')](_0x30496c));});};
\ No newline at end of file
+var _0xdef4=['filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','decryptString','data3','params','rawAttributes','intersection','includeAll','options','find','MicrosoftAzure','catch','body','Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','join','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','type','key','model','query','keys'];(function(_0x52740f,_0x343961){var _0x1cbe11=function(_0x376976){while(--_0x376976){_0x52740f['push'](_0x52740f['shift']());}};_0x1cbe11(++_0x343961);}(_0xdef4,0x94));var _0x4def=function(_0x24eab8,_0x2f471c){_0x24eab8=_0x24eab8-0x0;var _0x41d883=_0xdef4[_0x24eab8];return _0x41d883;};'use strict';var _=require(_0x4def('0x0'));var Redis=require(_0x4def('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x4def('0x2'));var config=require(_0x4def('0x3'));var logger=require('../../config/logger')(_0x4def('0x4'));var db=require(_0x4def('0x5'))['db'];var oauth=require(_0x4def('0x6'));config[_0x4def('0x7')]=_[_0x4def('0x8')](config['redis'],{'host':_0x4def('0x9'),'port':0x18eb});var socket=require(_0x4def('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x4def('0x7')]);function respondWithStatusCode(_0x2697b7,_0x4db75e){_0x4db75e=_0x4db75e||0xcc;return function(_0x18cb56){if(_0x18cb56){return _0x2697b7['sendStatus'](_0x4db75e);}return _0x2697b7[_0x4def('0xb')](_0x4db75e)[_0x4def('0xc')]();};}function respondWithResult(_0x2f479d,_0x140490){_0x140490=_0x140490||0xc8;return function(_0x3128c7){if(_0x3128c7){return _0x2f479d[_0x4def('0xb')](_0x140490)[_0x4def('0xd')](_0x3128c7);}};}function respondWithFilteredResult(_0x4ab486,_0x3e222c){return function(_0x3c50c6){if(_0x3c50c6){var _0x178869=typeof _0x3e222c['offset']===_0x4def('0xe')&&typeof _0x3e222c[_0x4def('0xf')]===_0x4def('0xe');var _0x3556e2=_0x3c50c6[_0x4def('0x10')];var _0x3b623b=_0x178869?0x0:_0x3e222c[_0x4def('0x11')];var _0x467b18=_0x178869?_0x3c50c6['count']:_0x3e222c[_0x4def('0x11')]+_0x3e222c[_0x4def('0xf')];var _0x4b0d08;if(_0x467b18>=_0x3556e2){_0x467b18=_0x3556e2;_0x4b0d08=0xc8;}else{_0x4b0d08=0xce;}_0x4ab486[_0x4def('0xb')](_0x4b0d08);return _0x4ab486['set']('Content-Range',_0x3b623b+'-'+_0x467b18+'/'+_0x3556e2)[_0x4def('0xd')](_0x3c50c6);}return null;};}function saveUpdates(_0x22ba32){return function(_0x1b88f2){if(_0x1b88f2){return _0x1b88f2[_0x4def('0x12')](_0x22ba32)[_0x4def('0x13')](function(_0x7712b1){return _0x7712b1;});}return null;};}function removeEntity(_0x2ed17f){return function(_0x5733d0){if(_0x5733d0){return _0x5733d0[_0x4def('0x14')]()[_0x4def('0x13')](function(){_0x2ed17f['status'](0xcc)[_0x4def('0xc')]();});}};}function handleEntityNotFound(_0x59e14a){return function(_0x188fd2){if(!_0x188fd2){_0x59e14a[_0x4def('0x15')](0x194);}return _0x188fd2;};}function handleError(_0x37e188,_0x255779){_0x255779=_0x255779||0x1f4;return function(_0x5337a7){logger[_0x4def('0x16')](_0x5337a7[_0x4def('0x17')]);if(_0x5337a7[_0x4def('0x18')]){delete _0x5337a7['name'];}_0x37e188[_0x4def('0xb')](_0x255779)[_0x4def('0x19')](_0x5337a7);};}function maskClientSecret(_0x4ba3f9){return _[_0x4def('0x1a')](_0x4ba3f9[_0x4def('0x1b')](0x0,0x3),0x14,'*');}exports[_0x4def('0x1c')]=function(_0x508eab,_0x33bbde){var _0x2c1232={},_0x1cc6dd={},_0x336314={'count':0x0,'rows':[]};var _0x39663d=_[_0x4def('0x1d')](db[_0x4def('0x1e')]['rawAttributes'],function(_0x37eac4){return{'name':_0x37eac4['fieldName'],'type':_0x37eac4[_0x4def('0x1f')][_0x4def('0x20')]};});_0x1cc6dd[_0x4def('0x21')]=_[_0x4def('0x1d')](_0x39663d,_0x4def('0x18'));_0x1cc6dd[_0x4def('0x22')]=_[_0x4def('0x23')](_0x508eab[_0x4def('0x22')]);_0x1cc6dd[_0x4def('0x24')]=_['intersection'](_0x1cc6dd['model'],_0x1cc6dd[_0x4def('0x22')]);_0x2c1232[_0x4def('0x25')]=_['intersection'](_0x1cc6dd['model'],qs[_0x4def('0x26')](_0x508eab[_0x4def('0x22')]['fields']));_0x2c1232['attributes']=_0x2c1232[_0x4def('0x25')][_0x4def('0x27')]?_0x2c1232[_0x4def('0x25')]:_0x1cc6dd['model'];if(!_0x508eab['query'][_0x4def('0x28')]('nolimit')){_0x2c1232[_0x4def('0xf')]=qs[_0x4def('0xf')](_0x508eab['query'][_0x4def('0xf')]);_0x2c1232[_0x4def('0x11')]=qs[_0x4def('0x11')](_0x508eab[_0x4def('0x22')][_0x4def('0x11')]);}_0x2c1232[_0x4def('0x29')]=qs[_0x4def('0x2a')](_0x508eab['query'][_0x4def('0x2a')]);_0x2c1232[_0x4def('0x2b')]=qs[_0x4def('0x24')](_[_0x4def('0x2c')](_0x508eab[_0x4def('0x22')],_0x1cc6dd[_0x4def('0x24')]),_0x39663d);if(_0x508eab[_0x4def('0x22')]['filter']){_0x2c1232[_0x4def('0x2b')]=_['merge'](_0x2c1232[_0x4def('0x2b')],{'$or':_['map'](_0x39663d,function(_0x59fa5){if(_0x59fa5[_0x4def('0x1f')]!==_0x4def('0x2d')){var _0x345e32={};_0x345e32[_0x59fa5['name']]={'$like':'%'+_0x508eab[_0x4def('0x22')][_0x4def('0x2e')]+'%'};return _0x345e32;}})});}_0x2c1232=_[_0x4def('0x2f')]({},_0x2c1232,_0x508eab['options']);var _0x323840={'where':_0x2c1232[_0x4def('0x2b')]};return db[_0x4def('0x1e')][_0x4def('0x10')](_0x323840)[_0x4def('0x13')](function(_0x537178){_0x336314[_0x4def('0x10')]=_0x537178;if(_0x508eab[_0x4def('0x22')]['includeAll']){_0x2c1232[_0x4def('0x30')]=[{'all':!![]}];}return db[_0x4def('0x1e')][_0x4def('0x31')](_0x2c1232);})[_0x4def('0x13')](function(_0x3d46c6){_0x336314['rows']=_[_0x4def('0x1d')](_0x3d46c6,function(_0x26879a){if(_0x26879a['service']==='MicrosoftAzure'){var _0x6b8329=encryptor[_0x4def('0x32')](_0x26879a[_0x4def('0x33')]);_0x26879a[_0x4def('0x33')]=maskClientSecret(_0x6b8329);}return _0x26879a;});return _0x336314;})['then'](respondWithFilteredResult(_0x33bbde,_0x2c1232))['catch'](handleError(_0x33bbde,null));};exports['show']=function(_0x5285b6,_0x2e741b){var _0x58b952={'raw':!![],'where':{'id':_0x5285b6[_0x4def('0x34')]['id']}},_0x5adf12={};_0x5adf12[_0x4def('0x21')]=_['keys'](db[_0x4def('0x1e')][_0x4def('0x35')]);_0x5adf12['query']=_['keys'](_0x5285b6[_0x4def('0x22')]);_0x5adf12[_0x4def('0x24')]=_[_0x4def('0x36')](_0x5adf12[_0x4def('0x21')],_0x5adf12[_0x4def('0x22')]);_0x58b952[_0x4def('0x25')]=_[_0x4def('0x36')](_0x5adf12['model'],qs[_0x4def('0x26')](_0x5285b6['query']['fields']));_0x58b952[_0x4def('0x25')]=_0x58b952[_0x4def('0x25')][_0x4def('0x27')]?_0x58b952[_0x4def('0x25')]:_0x5adf12['model'];if(_0x5285b6['query'][_0x4def('0x37')]){_0x58b952[_0x4def('0x30')]=[{'all':!![]}];}_0x58b952=_[_0x4def('0x2f')]({},_0x58b952,_0x5285b6[_0x4def('0x38')]);return db[_0x4def('0x1e')][_0x4def('0x39')](_0x58b952)[_0x4def('0x13')](handleEntityNotFound(_0x2e741b,null))[_0x4def('0x13')](function(_0x37f18d){if(_0x37f18d['service']===_0x4def('0x3a')){var _0x2cd938=encryptor[_0x4def('0x32')](_0x37f18d[_0x4def('0x33')]);_0x37f18d[_0x4def('0x33')]=maskClientSecret(_0x2cd938);}return _0x37f18d;})[_0x4def('0x13')](respondWithResult(_0x2e741b,null))[_0x4def('0x3b')](handleError(_0x2e741b,null));};exports['create']=function(_0x4e538f,_0xa38611){if(!_0x4e538f[_0x4def('0x3c')][_0x4def('0x18')])throw new Error(_0x4def('0x3d'));if(!_0x4e538f[_0x4def('0x3c')][_0x4def('0x3e')])throw new Error(_0x4def('0x3f'));var _0x263791=db['CloudProvider'][_0x4def('0x35')]['service'][_0x4def('0x40')];if(!_0x263791['includes'](_0x4e538f[_0x4def('0x3c')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x263791[_0x4def('0x41')](',\x20'));if(_0x4e538f[_0x4def('0x3c')][_0x4def('0x3e')]===_0x4def('0x3a')&&_0x4e538f[_0x4def('0x3c')][_0x4def('0x33')]){_0x4e538f[_0x4def('0x3c')][_0x4def('0x33')]=encryptor[_0x4def('0x42')](_0x4e538f[_0x4def('0x3c')]['data3']);}return db[_0x4def('0x1e')]['create'](_0x4e538f[_0x4def('0x3c')],{})[_0x4def('0x13')](respondWithResult(_0xa38611,0xc9))[_0x4def('0x3b')](handleError(_0xa38611,null));};exports[_0x4def('0x12')]=function(_0xb0d201,_0x1b2af0){if(_0xb0d201[_0x4def('0x3c')]['id']){delete _0xb0d201[_0x4def('0x3c')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0xb0d201[_0x4def('0x34')]['id']}})['then'](handleEntityNotFound(_0x1b2af0,null))[_0x4def('0x13')](function(_0x142f11){if(_0x142f11['service']===_0x4def('0x3a')&&_0xb0d201['body']['data3']){_0xb0d201[_0x4def('0x3c')][_0x4def('0x33')]=encryptor[_0x4def('0x42')](_0xb0d201[_0x4def('0x3c')][_0x4def('0x33')]);}return _0x142f11;})[_0x4def('0x13')](saveUpdates(_0xb0d201[_0x4def('0x3c')],null))[_0x4def('0x13')](respondWithResult(_0x1b2af0,null))[_0x4def('0x3b')](handleError(_0x1b2af0,null));};exports[_0x4def('0x14')]=function(_0x4cc7b7,_0x202d4f){return db[_0x4def('0x1e')]['find']({'where':{'id':_0x4cc7b7[_0x4def('0x34')]['id']}})[_0x4def('0x13')](handleEntityNotFound(_0x202d4f,null))['then'](removeEntity(_0x202d4f,null))[_0x4def('0x3b')](handleError(_0x202d4f,null));};exports[_0x4def('0x43')]=function(_0x44cbb2,_0x2c403c){return db[_0x4def('0x1e')][_0x4def('0x44')]({'where':{'id':_0x44cbb2['params']['id']},'raw':!![]})['then'](function(_0xdc8b04){if(!_0xdc8b04)return _0x2c403c[_0x4def('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xdc8b04,_0x44cbb2[_0x4def('0x45')]['id'])};})[_0x4def('0x13')](respondWithResult(_0x2c403c,null))['catch'](handleError(_0x2c403c,null));};exports[_0x4def('0x46')]=function(_0x51b32a,_0x1d8d01){var _0x4a258c=_0x51b32a[_0x4def('0x3c')];var _0x577c03;var _0xe99e98;if(_0x4a258c[_0x4def('0x16')])throw _0x4a258c;redis[_0x4def('0x47')](_0x4a258c[_0x4def('0x48')])['then'](function(_0x20f774){if(!_0x20f774)throw new Error('Invalid\x20state\x20parameter');_0x577c03=JSON[_0x4def('0x49')](_0x20f774);var _0x5d06f8=Buffer[_0x4def('0x4a')](_0x4a258c[_0x4def('0x48')],_0x4def('0x4b'))[_0x4def('0x4c')](_0x4def('0x4d'));_0xe99e98=JSON[_0x4def('0x49')](_0x5d06f8);if(!oauth[_0x4def('0x4e')](_0x4a258c[_0x4def('0x4f')],_0x577c03[_0x4def('0x50')]))throw new Error(_0x4def('0x51'));redis[_0x4def('0x52')](_0x4a258c[_0x4def('0x48')]);return oauth[_0x4def('0x53')](_0x4a258c['code'],_0x577c03);})[_0x4def('0x13')](function(_0x239421){_0x577c03[_0x4def('0x54')]=_0x239421['access_token'];_0x577c03['data6']=_0x239421['refresh_token'];return db[_0x4def('0x1e')][_0x4def('0x12')]({'data5':_0x577c03[_0x4def('0x54')],'data6':_0x577c03[_0x4def('0x55')]},{'where':{'id':_0x577c03['id']}});})[_0x4def('0x13')](function(){oauth[_0x4def('0x56')](_0x577c03);socket[_0x4def('0x57')]('microsoftAuthorization:success',{'id':_0xe99e98['id']});return;})[_0x4def('0x13')](respondWithStatusCode(_0x1d8d01,null))[_0x4def('0x3b')](function(_0x429bcc){if(_0xe99e98){socket[_0x4def('0x57')](_0x4def('0x58'),{'id':_0xe99e98['id']});}if(!_0x577c03){logger[_0x4def('0x16')](_0x4def('0x59'),_0x429bcc);return _0x1d8d01['status'](0x1f4)[_0x4def('0x19')](_0x429bcc[_0x4def('0x5a')]);}logger['error'](_0x4def('0x5b'),_0x577c03['id'],JSON['stringify'](_0x429bcc));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index e3b5ead..79f8b74 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3af5=['CloudProvider','cloud_providers','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x3af5,0x1db));var _0x53af=function(_0x4277b0,_0x2b2cf6){_0x4277b0=_0x4277b0-0x0;var _0x57c93f=_0x3af5[_0x4277b0];return _0x57c93f;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var logger=require(_0x53af('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53af('0x3'));var fs=require('fs');var path=require(_0x53af('0x4'));var rimraf=require(_0x53af('0x5'));var config=require(_0x53af('0x6'));var attributes=require(_0x53af('0x7'));module['exports']=function(_0x41c533,_0xcb68dc){return _0x41c533[_0x53af('0x8')](_0x53af('0x9'),attributes,{'tableName':_0x53af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9bce=['path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0x9bce,0x192));var _0xe9bc=function(_0x2288c3,_0x470419){_0x2288c3=_0x2288c3-0x0;var _0x1ccf3e=_0x9bce[_0x2288c3];return _0x1ccf3e;};'use strict';var _=require(_0xe9bc('0x0'));var util=require(_0xe9bc('0x1'));var logger=require(_0xe9bc('0x2'))('api');var moment=require(_0xe9bc('0x3'));var BPromise=require(_0xe9bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9bc('0x5'));var rimraf=require(_0xe9bc('0x6'));var config=require(_0xe9bc('0x7'));var attributes=require(_0xe9bc('0x8'));module['exports']=function(_0x4fc601,_0x5a3fe6){return _0x4fc601[_0xe9bc('0x9')]('CloudProvider',attributes,{'tableName':_0xe9bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index f4551a1..f484161 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbb3=['bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','data7','/.default','join','replace','data2','code','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','{TENANT_ID}','data5','access_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4','POST','intervals'];(function(_0x8d5e52,_0x40df7b){var _0x563f85=function(_0xcd4da7){while(--_0xcd4da7){_0x8d5e52['push'](_0x8d5e52['shift']());}};_0x563f85(++_0x40df7b);}(_0xdbb3,0x1ea));var _0x3dbb=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xdbb3[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x3dbb('0x0'));var crypto=require(_0x3dbb('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x3dbb('0x2'));var Redis=require(_0x3dbb('0x3'));var rp=require(_0x3dbb('0x4'));var util=require(_0x3dbb('0x5'));var encryptor=require(_0x3dbb('0x6'));var config=require(_0x3dbb('0x7'));var logger=require(_0x3dbb('0x8'))(_0x3dbb('0x9'));var schedule=require(_0x3dbb('0xa'));var db=require(_0x3dbb('0xb'))['db'];config[_0x3dbb('0xc')]=_[_0x3dbb('0xd')](config[_0x3dbb('0xc')],{'host':_0x3dbb('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x3dbb('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x3dbb('0x10'),_0x3dbb('0x11'),_0x3dbb('0x12'),_0x3dbb('0x13'),_0x3dbb('0x14'),_0x3dbb('0x15'),_0x3dbb('0x16')],'Dynamics365':['openid',_0x3dbb('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x3dbb('0x17');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x334860){var _0x3a3dc0=_[_0x3dbb('0x18')](AZURE_AUTH_SCOPES[_0x334860[_0x3dbb('0x19')]]);if(_0x334860[_0x3dbb('0x19')]===_0x3dbb('0x1a'))_0x3a3dc0['push'](_0x334860[_0x3dbb('0x1b')]+_0x3dbb('0x1c'));return _0x3a3dc0[_0x3dbb('0x1d')]('\x20');}function getAccessTokenScope(_0x5b7f2d){if(_0x5b7f2d[_0x3dbb('0x19')]==='Outlook365')return _0x3dbb('0x14');if(_0x5b7f2d[_0x3dbb('0x19')]===_0x3dbb('0x1a'))return _0x5b7f2d[_0x3dbb('0x1b')]+_0x3dbb('0x1c');}function generateMicrosoftAuthorizationUrl(_0x141ba0,_0x39293b){var _0x2eb46c=MICROSOFT_AUTH_URL[_0x3dbb('0x1e')]('{TENANT_ID}',_0x141ba0[_0x3dbb('0x1f')]);var _0x5ce3a7=[_0x3dbb('0x20'),'id_token'];var _0x504686=Buffer[_0x3dbb('0x21')](JSON[_0x3dbb('0x22')]({'id':_0x39293b}))[_0x3dbb('0x23')]('base64');var _0x33aea8=crypto[_0x3dbb('0x24')](0x10)['toString'](_0x3dbb('0x25'));var _0x25330e=getAuthorizationScopes(_0x141ba0);var _0x341ae3=[{'key':_0x3dbb('0x26'),'value':_0x141ba0[_0x3dbb('0x27')]},{'key':_0x3dbb('0x28'),'value':encodeURIComponent(_0x5ce3a7['join']('\x20'))},{'key':_0x3dbb('0x29'),'value':_0x141ba0['data4']},{'key':_0x3dbb('0x2a'),'value':_0x3dbb('0x2b')},{'key':_0x3dbb('0x2c'),'value':encodeURIComponent(_0x25330e)},{'key':_0x3dbb('0x2d'),'value':_0x504686},{'key':_0x3dbb('0x2e'),'value':_0x33aea8},{'key':_0x3dbb('0x2f'),'value':'login'}];var _0x560c6d=_0x2eb46c+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x341ae3,function(_0x3b15cc){return _0x3b15cc['key']+'='+_0x3b15cc[_0x3dbb('0x30')];})[_0x3dbb('0x1d')]('&');_0x141ba0[_0x3dbb('0x31')]={'issuer':_0x2eb46c[_0x3dbb('0x1e')](_0x3dbb('0x32'),''),'audience':_0x141ba0[_0x3dbb('0x27')],'state':_0x504686,'nonce':_0x33aea8};redis[_0x3dbb('0x33')](_0x504686,JSON[_0x3dbb('0x22')](_0x141ba0));return _0x560c6d;}function isValidIdToken(_0x1813ee,_0x423641){try{var _0x18ccd=jwt[_0x3dbb('0x34')](_0x1813ee,{'complete':!![]});var _0xe30df1=_0x18ccd[_0x3dbb('0x35')];if(_0xe30df1[_0x3dbb('0x36')]!==_0x423641[_0x3dbb('0x37')])return![];if(_0xe30df1[_0x3dbb('0x38')]!==_0x423641[_0x3dbb('0x39')])return![];if(_0xe30df1[_0x3dbb('0x2e')]!==_0x423641[_0x3dbb('0x2e')])return![];if(moment()[_0x3dbb('0x3a')](moment[_0x3dbb('0x3b')](_0xe30df1[_0x3dbb('0x3c')])))return![];return!![];}catch(_0x5e5ec4){throw _0x5e5ec4;}}function refreshOauth2MicrosoftAccessToken(_0x41a73a){return Promise[_0x3dbb('0x3d')]()[_0x3dbb('0x3e')](function(){if(_0x41a73a[_0x3dbb('0x3f')])return _0x41a73a;return db[_0x3dbb('0x40')]['findOne']({'where':{'id':_0x41a73a['id']},'raw':!![]});})[_0x3dbb('0x3e')](function(_0x18b66f){var _0x4453dd={'grant_type':_0x3dbb('0x41'),'refresh_token':_0x18b66f[_0x3dbb('0x42')],'scope':getAccessTokenScope(_0x18b66f),'redirect_uri':_0x18b66f['data4'],'client_id':_0x18b66f[_0x3dbb('0x27')],'client_secret':encryptor[_0x3dbb('0x43')](_0x18b66f[_0x3dbb('0x3f')])};var _0x42006e={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x3dbb('0x44'),_0x18b66f[_0x3dbb('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4453dd,'json':!![]};return rp(_0x42006e);})['then'](function(_0x339a6a){_0x41a73a[_0x3dbb('0x45')]=_0x339a6a[_0x3dbb('0x46')];_0x41a73a['data6']=_0x339a6a[_0x3dbb('0x41')];return db[_0x3dbb('0x40')]['update']({'data5':_0x41a73a[_0x3dbb('0x45')],'data6':_0x41a73a['data6']},{'where':{'id':_0x41a73a['id']}});})[_0x3dbb('0x3e')](function(){return _0x41a73a;})['catch'](function(_0x118c69){logger[_0x3dbb('0x47')](_0x3dbb('0x48'),_0x41a73a['id'],_0x118c69);});}function getOauth2MicrosoftAccessToken(_0x2f9fc4,_0x15a44e){var _0x57ac89={'grant_type':_0x3dbb('0x49'),'code':_0x2f9fc4,'scope':getAccessTokenScope(_0x15a44e),'redirect_uri':_0x15a44e[_0x3dbb('0x4a')],'client_id':_0x15a44e[_0x3dbb('0x27')],'client_secret':encryptor['decryptString'](_0x15a44e[_0x3dbb('0x3f')])};var _0x239cc7={'method':_0x3dbb('0x4b'),'uri':MICROSOFT_AUTH_URL['replace'](_0x3dbb('0x44'),_0x15a44e[_0x3dbb('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x57ac89,'json':!![]};return rp(_0x239cc7);}function startRefreshInterval(_0x275144){var _0x2249b9=schedule[_0x3dbb('0x4c')];if(_0x2249b9[_0x275144['id']])clearInterval(_0x2249b9[_0x275144['id']]);_0x2249b9[_0x275144['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3dbb('0x4d')](this,{'id':_0x275144['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3dbb('0x4c')]=_0x2249b9;}function startAllRefreshIntervals(){return db[_0x3dbb('0x40')][_0x3dbb('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x17999d){var _0x2b983e=_0x17999d['map'](function(_0x132867){return refreshOauth2MicrosoftAccessToken(_0x132867)[_0x3dbb('0x3e')](function(_0xa89f1e){startRefreshInterval(_0xa89f1e);});});return Promise[_0x3dbb('0x4f')](_0x2b983e);})['catch'](function(_0x249ce6){var _0x33d9cf=_0x249ce6?util['inspect'](_0x249ce6,{'showHidden':![],'depth':null}):'';logger[_0x3dbb('0x47')](_0x3dbb('0x50'),_0x33d9cf);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x258f=['update','data5','then','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','findAll','inspect','exports','lodash','moment','ioredis','request-promise','util','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','randomBytes','toString','response_type','redirect_uri','data4','response_mode','scope','nonce','prompt','login','map','key','oauth2Claims','oauth2/','data1','decode','payload','iss','audience','isAfter','exp','resolve','data3','refresh_token','data6','decryptString','POST','access_token','CloudProvider'];(function(_0x260e07,_0x2dd0e4){var _0x28ba4e=function(_0x237146){while(--_0x237146){_0x260e07['push'](_0x260e07['shift']());}};_0x28ba4e(++_0x2dd0e4);}(_0x258f,0x11c));var _0xf258=function(_0xee2791,_0x3fb463){_0xee2791=_0xee2791-0x0;var _0x4c0cfb=_0x258f[_0xee2791];return _0x4c0cfb;};'use strict';var _=require(_0xf258('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xf258('0x1'));var Redis=require(_0xf258('0x2'));var rp=require(_0xf258('0x3'));var util=require(_0xf258('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0xf258('0x5'));var logger=require('../../config/logger')(_0xf258('0x6'));var schedule=require(_0xf258('0x7'));var db=require(_0xf258('0x8'))['db'];config[_0xf258('0x9')]=_[_0xf258('0xa')](config[_0xf258('0x9')],{'host':_0xf258('0xb'),'port':0x18eb});var redis=new Redis(config[_0xf258('0x9')]);var MICROSOFT_AUTH_URL=_0xf258('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf258('0xd'),_0xf258('0xe'),_0xf258('0xf'),_0xf258('0x10'),_0xf258('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xf258('0x12')],'Dynamics365':[_0xf258('0xd'),_0xf258('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xf258('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x28b962){var _0x726940=_['map'](AZURE_AUTH_SCOPES[_0x28b962[_0xf258('0x14')]]);if(_0x28b962['type']===_0xf258('0x15'))_0x726940[_0xf258('0x16')](_0x28b962[_0xf258('0x17')]+_0xf258('0x18'));return _0x726940['join']('\x20');}function getAccessTokenScope(_0x390a53){if(_0x390a53[_0xf258('0x14')]===_0xf258('0x19'))return _0xf258('0x11');if(_0x390a53[_0xf258('0x14')]===_0xf258('0x15'))return _0x390a53[_0xf258('0x17')]+_0xf258('0x18');}function generateMicrosoftAuthorizationUrl(_0x3f79f0,_0x102403){var _0x202626=MICROSOFT_AUTH_URL[_0xf258('0x1a')](_0xf258('0x1b'),_0x3f79f0[_0xf258('0x1c')]);var _0x106c04=['code',_0xf258('0x1d')];var _0x6f8ff7=Buffer[_0xf258('0x1e')](JSON[_0xf258('0x1f')]({'id':_0x102403}))['toString']('base64');var _0x2eee29=crypto[_0xf258('0x20')](0x10)[_0xf258('0x21')]('hex');var _0x20af4d=getAuthorizationScopes(_0x3f79f0);var _0x48076a=[{'key':'client_id','value':_0x3f79f0['data1']},{'key':_0xf258('0x22'),'value':encodeURIComponent(_0x106c04['join']('\x20'))},{'key':_0xf258('0x23'),'value':_0x3f79f0[_0xf258('0x24')]},{'key':_0xf258('0x25'),'value':'form_post'},{'key':_0xf258('0x26'),'value':encodeURIComponent(_0x20af4d)},{'key':'state','value':_0x6f8ff7},{'key':_0xf258('0x27'),'value':_0x2eee29},{'key':_0xf258('0x28'),'value':_0xf258('0x29')}];var _0x618115=_0x202626+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf258('0x2a')](_0x48076a,function(_0x30b09c){return _0x30b09c[_0xf258('0x2b')]+'='+_0x30b09c['value'];})['join']('&');_0x3f79f0[_0xf258('0x2c')]={'issuer':_0x202626[_0xf258('0x1a')](_0xf258('0x2d'),''),'audience':_0x3f79f0[_0xf258('0x2e')],'state':_0x6f8ff7,'nonce':_0x2eee29};redis['set'](_0x6f8ff7,JSON[_0xf258('0x1f')](_0x3f79f0));return _0x618115;}function isValidIdToken(_0x330ec7,_0x1c2140){try{var _0x1cf52e=jwt[_0xf258('0x2f')](_0x330ec7,{'complete':!![]});var _0x37cea0=_0x1cf52e[_0xf258('0x30')];if(_0x37cea0[_0xf258('0x31')]!==_0x1c2140['issuer'])return![];if(_0x37cea0['aud']!==_0x1c2140[_0xf258('0x32')])return![];if(_0x37cea0[_0xf258('0x27')]!==_0x1c2140[_0xf258('0x27')])return![];if(moment()[_0xf258('0x33')](moment['unix'](_0x37cea0[_0xf258('0x34')])))return![];return!![];}catch(_0x25c3ee){throw _0x25c3ee;}}function refreshOauth2MicrosoftAccessToken(_0x118813){return Promise[_0xf258('0x35')]()['then'](function(){if(_0x118813[_0xf258('0x36')])return _0x118813;return db['CloudProvider']['findOne']({'where':{'id':_0x118813['id']},'raw':!![]});})['then'](function(_0xc7928){var _0x557116={'grant_type':_0xf258('0x37'),'refresh_token':_0xc7928[_0xf258('0x38')],'scope':getAccessTokenScope(_0xc7928),'redirect_uri':_0xc7928[_0xf258('0x24')],'client_id':_0xc7928[_0xf258('0x2e')],'client_secret':encryptor[_0xf258('0x39')](_0xc7928[_0xf258('0x36')])};var _0x1ea6da={'method':_0xf258('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf258('0x1a')]('{TENANT_ID}',_0xc7928[_0xf258('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x557116,'json':!![]};return rp(_0x1ea6da);})['then'](function(_0x3bd07b){_0x118813['data5']=_0x3bd07b[_0xf258('0x3b')];_0x118813[_0xf258('0x38')]=_0x3bd07b[_0xf258('0x37')];return db[_0xf258('0x3c')][_0xf258('0x3d')]({'data5':_0x118813[_0xf258('0x3e')],'data6':_0x118813['data6']},{'where':{'id':_0x118813['id']}});})[_0xf258('0x3f')](function(){return _0x118813;})['catch'](function(_0x5a8b2d){logger[_0xf258('0x40')](_0xf258('0x41'),_0x118813['id'],_0x5a8b2d);});}function getOauth2MicrosoftAccessToken(_0x317d25,_0x2087c0){var _0x3460e9={'grant_type':'authorization_code','code':_0x317d25,'scope':getAccessTokenScope(_0x2087c0),'redirect_uri':_0x2087c0[_0xf258('0x24')],'client_id':_0x2087c0[_0xf258('0x2e')],'client_secret':encryptor[_0xf258('0x39')](_0x2087c0[_0xf258('0x36')])};var _0x2c7545={'method':_0xf258('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf258('0x1a')]('{TENANT_ID}',_0x2087c0[_0xf258('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3460e9,'json':!![]};return rp(_0x2c7545);}function startRefreshInterval(_0x3a2daa){var _0x230889=schedule['intervals'];if(_0x230889[_0x3a2daa['id']])clearInterval(_0x230889[_0x3a2daa['id']]);_0x230889[_0x3a2daa['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x3a2daa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x230889;}function startAllRefreshIntervals(){return db[_0xf258('0x3c')][_0xf258('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf258('0x3f')](function(_0x1438eb){var _0x183ee0=_0x1438eb[_0xf258('0x2a')](function(_0x426a3e){return refreshOauth2MicrosoftAccessToken(_0x426a3e)[_0xf258('0x3f')](function(_0x4ba0b3){startRefreshInterval(_0x4ba0b3);});});return Promise['all'](_0x183ee0);})['catch'](function(_0x1fcf42){var _0x3b6261=_0x1fcf42?util[_0xf258('0x43')](_0x1fcf42,{'showHidden':![],'depth':null}):'';logger[_0xf258('0x40')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3b6261);});}module[_0xf258('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 894586b..db02546 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7d06=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7d06,0x158));var _0x67d0=function(_0x204a77,_0x40ae18){_0x204a77=_0x204a77-0x0;var _0x348407=_0x7d06[_0x204a77];return _0x348407;};'use strict';var _=require(_0x67d0('0x0'));var util=require(_0x67d0('0x1'));var moment=require(_0x67d0('0x2'));var BPromise=require(_0x67d0('0x3'));var rs=require(_0x67d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d0('0x5'))['db'];var utils=require(_0x67d0('0x6'));var logger=require(_0x67d0('0x7'))('rpc');var config=require(_0x67d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67d0('0x9')][_0x67d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367f1d,_0xe4789b,_0x3c9976){return new BPromise(function(_0x481a08,_0x358986){return client['request'](_0x367f1d,_0x3c9976)[_0x67d0('0xb')](function(_0x5916d0){logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));logger[_0x67d0('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0xe4789b,_0x67d0('0xe'),JSON['stringify'](_0x5916d0));if(_0x5916d0['error']){if(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x11')]===0x1f4){logger['error'](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')]['message']);return _0x358986(_0x5916d0[_0x67d0('0x10')]['message']);}logger[_0x67d0('0x10')](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);return _0x481a08(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);}else{logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));_0x481a08(_0x5916d0[_0x67d0('0x13')]['message']);}})[_0x67d0('0x14')](function(_0xa1b889){logger['error'](_0x67d0('0xd'),_0xe4789b,_0xa1b889);_0x358986(_0xa1b889);});});}
\ No newline at end of file
+var _0xed03=['info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x57afc0,_0x24ff04){var _0x44b769=function(_0x238847){while(--_0x238847){_0x57afc0['push'](_0x57afc0['shift']());}};_0x44b769(++_0x24ff04);}(_0xed03,0xdc));var _0x3ed0=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xed03[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x3ed0('0x0'));var util=require(_0x3ed0('0x1'));var moment=require('moment');var BPromise=require(_0x3ed0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ed0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ed0('0x4'))('rpc');var config=require(_0x3ed0('0x5'));var jayson=require(_0x3ed0('0x6'));var client=jayson[_0x3ed0('0x7')][_0x3ed0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8470b7,_0x3f1277,_0xd729a0){return new BPromise(function(_0x4500aa,_0xddc4c5){return client[_0x3ed0('0x9')](_0x8470b7,_0xd729a0)[_0x3ed0('0xa')](function(_0x34950c){logger[_0x3ed0('0xb')](_0x3ed0('0xc'),_0x3f1277,'request\x20sent');logger[_0x3ed0('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3f1277,_0x3ed0('0xe'),JSON[_0x3ed0('0xf')](_0x34950c));if(_0x34950c[_0x3ed0('0x10')]){if(_0x34950c['error'][_0x3ed0('0x11')]===0x1f4){logger[_0x3ed0('0x10')](_0x3ed0('0xc'),_0x3f1277,_0x34950c[_0x3ed0('0x10')][_0x3ed0('0x12')]);return _0xddc4c5(_0x34950c['error'][_0x3ed0('0x12')]);}logger[_0x3ed0('0x10')](_0x3ed0('0xc'),_0x3f1277,_0x34950c[_0x3ed0('0x10')][_0x3ed0('0x12')]);return _0x4500aa(_0x34950c['error'][_0x3ed0('0x12')]);}else{logger[_0x3ed0('0xb')]('CloudProvider,\x20%s,\x20%s',_0x3f1277,_0x3ed0('0xe'));_0x4500aa(_0x34950c[_0x3ed0('0x13')][_0x3ed0('0x12')]);}})[_0x3ed0('0x14')](function(_0xaa73cd){logger[_0x3ed0('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3f1277,_0xaa73cd);_0xddc4c5(_0xaa73cd);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 52d0047..4ec3099 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x39bf17,_0x319d5e){var _0x1ccf1d=function(_0x1244ec){while(--_0x1244ec){_0x39bf17['push'](_0x39bf17['shift']());}};_0x1ccf1d(++_0x319d5e);}(_0x2ef3,0xba));var _0x32ef=function(_0x28cffc,_0x59e0c3){_0x28cffc=_0x28cffc-0x0;var _0x4253d4=_0x2ef3[_0x28cffc];return _0x4253d4;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x5c82e9,_0x1a13d5){var _0x57fc44=function(_0x196831){while(--_0x196831){_0x5c82e9['push'](_0x5c82e9['shift']());}};_0x57fc44(++_0x1a13d5);}(_0x2ef3,0xba));var _0x32ef=function(_0x421c29,_0x4074f6){_0x421c29=_0x421c29-0x0;var _0xd2c93b=_0x2ef3[_0x421c29];return _0xd2c93b;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index faa2c47..a8133a1 100644
--- a/server/api/cmCompany/cmCompany.attributes.js
+++ b/server/api/cmCompany/cmCompany.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6824=['exports','STRING','sequelize'];(function(_0xbb0ce8,_0xb63549){var _0x1a1b17=function(_0x171af3){while(--_0x171af3){_0xbb0ce8['push'](_0xbb0ce8['shift']());}};_0x1a1b17(++_0xb63549);}(_0x6824,0x80));var _0x4682=function(_0x248d93,_0xf9322c){_0x248d93=_0x248d93-0x0;var _0x1abac3=_0x6824[_0x248d93];return _0x1abac3;};'use strict';var Sequelize=require(_0x4682('0x0'));module[_0x4682('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4682('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x4682('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4682('0x2')]},'type':{'type':Sequelize[_0x4682('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4682('0x2')]},'country':{'type':Sequelize[_0x4682('0x2')]},'email':{'type':Sequelize[_0x4682('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x4682('0x2')]},'sPostalCode':{'type':Sequelize[_0x4682('0x2')]},'sCity':{'type':Sequelize[_0x4682('0x2')]},'sCountry':{'type':Sequelize[_0x4682('0x2')]},'description':{'type':Sequelize[_0x4682('0x2')]}};
\ No newline at end of file
+var _0x9a45=['name','STRING'];(function(_0x119961,_0x38c0a1){var _0x147fe2=function(_0xd2e914){while(--_0xd2e914){_0x119961['push'](_0x119961['shift']());}};_0x147fe2(++_0x38c0a1);}(_0x9a45,0x11d));var _0x59a4=function(_0x21f729,_0x20de13){_0x21f729=_0x21f729-0x0;var _0x41c0ab=_0x9a45[_0x21f729];return _0x41c0ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x59a4('0x0')],'unique':_0x59a4('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x59a4('0x0')]},'companyId':{'type':Sequelize[_0x59a4('0x0')]},'website':{'type':Sequelize[_0x59a4('0x0')]},'phone':{'type':Sequelize[_0x59a4('0x0')]},'fax':{'type':Sequelize[_0x59a4('0x0')]},'type':{'type':Sequelize[_0x59a4('0x0')]},'street':{'type':Sequelize[_0x59a4('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x59a4('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x59a4('0x0')]},'sPostalCode':{'type':Sequelize[_0x59a4('0x0')]},'sCity':{'type':Sequelize[_0x59a4('0x0')]},'sCountry':{'type':Sequelize[_0x59a4('0x0')]},'description':{'type':Sequelize[_0x59a4('0x0')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index b41ee60..1284121 100644
--- a/server/api/cmCompany/cmCompany.controller.js
+++ b/server/api/cmCompany/cmCompany.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56cc=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','save','update','then','destroy','get','UserProfileResource','error','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','count','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection'];(function(_0x1f0f46,_0x3873ff){var _0x5d12f8=function(_0x455bf7){while(--_0x455bf7){_0x1f0f46['push'](_0x1f0f46['shift']());}};_0x5d12f8(++_0x3873ff);}(_0x56cc,0x1db));var _0xc56c=function(_0x20dbe5,_0x15a188){_0x20dbe5=_0x20dbe5-0x0;var _0x5ae2d7=_0x56cc[_0x20dbe5];return _0x5ae2d7;};'use strict';var emlformat=require(_0xc56c('0x0'));var rimraf=require(_0xc56c('0x1'));var zipdir=require(_0xc56c('0x2'));var jsonpatch=require(_0xc56c('0x3'));var rp=require(_0xc56c('0x4'));var moment=require(_0xc56c('0x5'));var BPromise=require(_0xc56c('0x6'));var Mustache=require(_0xc56c('0x7'));var util=require('util');var path=require(_0xc56c('0x8'));var sox=require(_0xc56c('0x9'));var csv=require(_0xc56c('0xa'));var ejs=require(_0xc56c('0xb'));var fs=require('fs');var fs_extra=require(_0xc56c('0xc'));var _=require(_0xc56c('0xd'));var squel=require(_0xc56c('0xe'));var crypto=require(_0xc56c('0xf'));var jsforce=require(_0xc56c('0x10'));var deskjs=require(_0xc56c('0x11'));var toCsv=require(_0xc56c('0xa'));var querystring=require(_0xc56c('0x12'));var Papa=require(_0xc56c('0x13'));var Redis=require(_0xc56c('0x14'));var authService=require(_0xc56c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xc56c('0x16'));var hardwareService=require(_0xc56c('0x17'));var logger=require(_0xc56c('0x18'))(_0xc56c('0x19'));var utils=require(_0xc56c('0x1a'));var config=require(_0xc56c('0x1b'));var licenseUtil=require(_0xc56c('0x1c'));var db=require(_0xc56c('0x1d'))['db'];function respondWithStatusCode(_0x371f6a,_0x5040c1){_0x5040c1=_0x5040c1||0xcc;return function(_0x590443){if(_0x590443){return _0x371f6a[_0xc56c('0x1e')](_0x5040c1);}return _0x371f6a[_0xc56c('0x1f')](_0x5040c1)[_0xc56c('0x20')]();};}function respondWithResult(_0x1c2880,_0x26390c){_0x26390c=_0x26390c||0xc8;return function(_0x49f315){if(_0x49f315){return _0x1c2880['status'](_0x26390c)[_0xc56c('0x21')](_0x49f315);}};}function respondWithFilteredResult(_0x14f18b,_0x24417b){return function(_0xc9cad5){if(_0xc9cad5){var _0x543e=typeof _0x24417b['offset']===_0xc56c('0x22')&&typeof _0x24417b[_0xc56c('0x23')]===_0xc56c('0x22');var _0xda752a=_0xc9cad5['count'];var _0x4fa547=_0x543e?0x0:_0x24417b[_0xc56c('0x24')];var _0x3de48e=_0x543e?_0xc9cad5['count']:_0x24417b['offset']+_0x24417b[_0xc56c('0x23')];var _0x5bd0fb;if(_0x3de48e>=_0xda752a){_0x3de48e=_0xda752a;_0x5bd0fb=0xc8;}else{_0x5bd0fb=0xce;}_0x14f18b[_0xc56c('0x1f')](_0x5bd0fb);return _0x14f18b[_0xc56c('0x25')](_0xc56c('0x26'),_0x4fa547+'-'+_0x3de48e+'/'+_0xda752a)[_0xc56c('0x21')](_0xc9cad5);}return null;};}function patchUpdates(_0x1fa096){return function(_0x3d856c){try{jsonpatch['apply'](_0x3d856c,_0x1fa096,!![]);}catch(_0xe02930){return BPromise['reject'](_0xe02930);}return _0x3d856c[_0xc56c('0x27')]();};}function saveUpdates(_0x2a7fca,_0x1f2210){return function(_0x4d8269){if(_0x4d8269){return _0x4d8269[_0xc56c('0x28')](_0x2a7fca)[_0xc56c('0x29')](function(_0x37ab2a){return _0x37ab2a;});}return null;};}function removeEntity(_0x422e9e,_0x50e355){return function(_0x54c637){if(_0x54c637){return _0x54c637[_0xc56c('0x2a')]()[_0xc56c('0x29')](function(){var _0x48d1b3=_0x54c637[_0xc56c('0x2b')]({'plain':!![]});var _0xd9fcec='Companies';return db[_0xc56c('0x2c')][_0xc56c('0x2a')]({'where':{'type':_0xd9fcec,'resourceId':_0x48d1b3['id']}})[_0xc56c('0x29')](function(){return _0x54c637;});})[_0xc56c('0x29')](function(){_0x422e9e[_0xc56c('0x1f')](0xcc)[_0xc56c('0x20')]();});}};}function handleEntityNotFound(_0x47e738,_0xc0b9c){return function(_0x51ffcd){if(!_0x51ffcd){_0x47e738[_0xc56c('0x1e')](0x194);}return _0x51ffcd;};}function handleError(_0x430315,_0x1c53d3){_0x1c53d3=_0x1c53d3||0x1f4;return function(_0x42a70a){logger[_0xc56c('0x2d')](_0x42a70a['stack']);if(_0x42a70a[_0xc56c('0x2e')]){delete _0x42a70a[_0xc56c('0x2e')];}_0x430315['status'](_0x1c53d3)['send'](_0x42a70a);};}exports['index']=function(_0x3ca308,_0xceccfe){var _0x4b98db={},_0x505b7f={},_0x5aa2f7={'count':0x0,'rows':[]};return db[_0xc56c('0x2f')][_0xc56c('0x30')]()[_0xc56c('0x29')](function(_0x1efcb4){_0x505b7f[_0xc56c('0x31')]=_[_0xc56c('0x32')](_0x1efcb4);_0x505b7f[_0xc56c('0x33')]=_[_0xc56c('0x32')](_0x3ca308[_0xc56c('0x33')]);_0x505b7f[_0xc56c('0x34')]=_[_0xc56c('0x35')](_0x505b7f[_0xc56c('0x31')],_0x505b7f[_0xc56c('0x33')]);_0x4b98db[_0xc56c('0x36')]=_[_0xc56c('0x35')](_0x505b7f[_0xc56c('0x31')],qs[_0xc56c('0x37')](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x37')]));_0x4b98db[_0xc56c('0x36')]=_0x4b98db['attributes'][_0xc56c('0x38')]?_0x4b98db[_0xc56c('0x36')]:_0x505b7f[_0xc56c('0x31')];if(!_0x3ca308[_0xc56c('0x33')][_0xc56c('0x39')](_0xc56c('0x3a'))){_0x4b98db[_0xc56c('0x23')]=qs['limit'](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x23')]);_0x4b98db['offset']=qs[_0xc56c('0x24')](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x24')]);}_0x4b98db[_0xc56c('0x3b')]=qs[_0xc56c('0x3c')](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x3c')]);_0x4b98db[_0xc56c('0x3d')]=qs[_0xc56c('0x34')](_[_0xc56c('0x3e')](_0x3ca308['query'],_0x505b7f[_0xc56c('0x34')]),_0x1efcb4);if(_0x3ca308[_0xc56c('0x33')]['filter']){_0x4b98db[_0xc56c('0x3d')]=_[_0xc56c('0x3f')](_0x4b98db[_0xc56c('0x3d')],{'$or':_[_0xc56c('0x40')](_0x4b98db['attributes'],function(_0x27c9db){var _0xe21ebc={};_0xe21ebc[_0x27c9db]={'$like':'%'+_0x3ca308['query'][_0xc56c('0x41')]+'%'};return _0xe21ebc;})});}_0x4b98db=_[_0xc56c('0x3f')]({},_0x4b98db,_0x3ca308[_0xc56c('0x42')]);var _0x36c7e1={'where':_0x4b98db[_0xc56c('0x3d')]};return db[_0xc56c('0x2f')][_0xc56c('0x43')](_0x36c7e1)[_0xc56c('0x29')](function(_0x450703){_0x5aa2f7[_0xc56c('0x43')]=_0x450703;if(_0x3ca308[_0xc56c('0x33')]['includeAll']){_0x4b98db[_0xc56c('0x44')]=[{'all':!![]}];}return db[_0xc56c('0x2f')][_0xc56c('0x45')](_0x4b98db);})['then'](function(_0x1e54af){_0x5aa2f7[_0xc56c('0x46')]=_0x1e54af;return _0x5aa2f7;})[_0xc56c('0x29')](respondWithFilteredResult(_0xceccfe,_0x4b98db))[_0xc56c('0x47')](handleError(_0xceccfe,null));})['catch'](handleError(_0xceccfe,null));};exports[_0xc56c('0x48')]=function(_0x322e06,_0x2cfe65){var _0x43ca28={'raw':![],'where':{'id':_0x322e06['params']['id']}},_0xbdbd63={};_0xbdbd63[_0xc56c('0x31')]=_[_0xc56c('0x32')](db[_0xc56c('0x2f')][_0xc56c('0x49')]);_0xbdbd63[_0xc56c('0x33')]=_[_0xc56c('0x32')](_0x322e06['query']);_0xbdbd63[_0xc56c('0x34')]=_[_0xc56c('0x35')](_0xbdbd63[_0xc56c('0x31')],_0xbdbd63[_0xc56c('0x33')]);_0x43ca28['attributes']=_[_0xc56c('0x35')](_0xbdbd63['model'],qs[_0xc56c('0x37')](_0x322e06['query'][_0xc56c('0x37')]));_0x43ca28['attributes']=_0x43ca28[_0xc56c('0x36')][_0xc56c('0x38')]?_0x43ca28[_0xc56c('0x36')]:_0xbdbd63[_0xc56c('0x31')];if(_0x322e06[_0xc56c('0x33')][_0xc56c('0x4a')]){_0x43ca28[_0xc56c('0x44')]=[{'all':!![]}];}_0x43ca28=_[_0xc56c('0x3f')]({},_0x43ca28,_0x322e06[_0xc56c('0x42')]);return db[_0xc56c('0x2f')][_0xc56c('0x4b')](_0x43ca28)[_0xc56c('0x29')](handleEntityNotFound(_0x2cfe65,null))[_0xc56c('0x29')](respondWithResult(_0x2cfe65,null))['catch'](handleError(_0x2cfe65,null));};exports[_0xc56c('0x4c')]=function(_0x51f2db,_0x4a6402){return db[_0xc56c('0x2f')][_0xc56c('0x4c')](_0x51f2db[_0xc56c('0x4d')],{})['then'](function(_0x2f38e0){var _0xb9582c=_0x51f2db[_0xc56c('0x4e')][_0xc56c('0x2b')]({'plain':!![]});if(!_0xb9582c)throw new Error(_0xc56c('0x4f'));if(_0xb9582c[_0xc56c('0x50')]===_0xc56c('0x4e')){var _0x3ffb44=_0x2f38e0['get']({'plain':!![]});var _0x1063c5=_0xc56c('0x51');return db[_0xc56c('0x52')][_0xc56c('0x4b')]({'where':{'name':_0x1063c5,'userProfileId':_0xb9582c[_0xc56c('0x53')]},'raw':!![]})[_0xc56c('0x29')](function(_0x2f66ca){if(_0x2f66ca&&_0x2f66ca[_0xc56c('0x54')]===0x0){return db[_0xc56c('0x2c')]['create']({'name':_0x3ffb44['name'],'resourceId':_0x3ffb44['id'],'type':_0x2f66ca[_0xc56c('0x2e')],'sectionId':_0x2f66ca['id']},{})[_0xc56c('0x29')](function(){return _0x2f38e0;});}else{return _0x2f38e0;}})['catch'](function(_0x2fc7c0){logger[_0xc56c('0x2d')](_0xc56c('0x55'),_0x2fc7c0);throw _0x2fc7c0;});}return _0x2f38e0;})['then'](respondWithResult(_0x4a6402,0xc9))['catch'](handleError(_0x4a6402,null));};exports[_0xc56c('0x28')]=function(_0x3ab92c,_0x27b1b1){if(_0x3ab92c[_0xc56c('0x4d')]['id']){delete _0x3ab92c[_0xc56c('0x4d')]['id'];}return db[_0xc56c('0x2f')][_0xc56c('0x4b')]({'where':{'id':_0x3ab92c[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0x27b1b1,null))['then'](saveUpdates(_0x3ab92c[_0xc56c('0x4d')],null))['then'](respondWithResult(_0x27b1b1,null))[_0xc56c('0x47')](handleError(_0x27b1b1,null));};exports[_0xc56c('0x2a')]=function(_0x2341aa,_0x2e00bf){return db['CmCompany']['find']({'where':{'id':_0x2341aa[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0x2e00bf,null))[_0xc56c('0x29')](removeEntity(_0x2e00bf,null))[_0xc56c('0x47')](handleError(_0x2e00bf,null));};exports[_0xc56c('0x30')]=function(_0x382fd9,_0x53fe46){return db[_0xc56c('0x2f')][_0xc56c('0x30')]()[_0xc56c('0x29')](respondWithResult(_0x53fe46,null))['catch'](handleError(_0x53fe46,null));};exports[_0xc56c('0x57')]=function(_0x47240e,_0xea4dd0,_0x45a6e6){return db[_0xc56c('0x58')]['find']({'where':{'id':_0x47240e[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0xea4dd0,null))['then'](function(_0x397a52){if(_0x397a52){return _0x397a52[_0xc56c('0x57')](_0x47240e[_0xc56c('0x4d')][_0xc56c('0x59')],_[_0xc56c('0x5a')](_0x47240e[_0xc56c('0x4d')],[_0xc56c('0x59'),'id'])||{});}})[_0xc56c('0x29')](respondWithResult(_0xea4dd0,null))[_0xc56c('0x47')](handleError(_0xea4dd0,null));};exports[_0xc56c('0x5b')]=function(_0x38de47,_0x1da6e8,_0x4bb16b){var _0x200ced={};var _0x422c97={};var _0x191fde;var _0x41af65;return db[_0xc56c('0x2f')][_0xc56c('0x5c')]({'where':{'id':_0x38de47[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0x1da6e8,null))['then'](function(_0x536108){if(_0x536108){_0x191fde=_0x536108;_0x422c97[_0xc56c('0x31')]=_[_0xc56c('0x32')](db[_0xc56c('0x58')][_0xc56c('0x49')]);_0x422c97[_0xc56c('0x33')]=_['keys'](_0x38de47['query']);_0x422c97[_0xc56c('0x34')]=_[_0xc56c('0x35')](_0x422c97[_0xc56c('0x31')],_0x422c97['query']);_0x200ced[_0xc56c('0x36')]=_[_0xc56c('0x35')](_0x422c97[_0xc56c('0x31')],qs['fields'](_0x38de47[_0xc56c('0x33')][_0xc56c('0x37')]));_0x200ced['attributes']=_0x200ced[_0xc56c('0x36')][_0xc56c('0x38')]?_0x200ced['attributes']:_0x422c97[_0xc56c('0x31')];_0x200ced[_0xc56c('0x3b')]=qs['sort'](_0x38de47[_0xc56c('0x33')][_0xc56c('0x3c')]);_0x200ced[_0xc56c('0x3d')]=qs[_0xc56c('0x34')](_[_0xc56c('0x3e')](_0x38de47[_0xc56c('0x33')],_0x422c97[_0xc56c('0x34')]));if(_0x38de47[_0xc56c('0x33')][_0xc56c('0x41')]){_0x200ced[_0xc56c('0x3d')]=_[_0xc56c('0x3f')](_0x200ced[_0xc56c('0x3d')],{'$or':_[_0xc56c('0x40')](_0x200ced[_0xc56c('0x36')],function(_0x2d7d5f){var _0x3ac751={};_0x3ac751[_0x2d7d5f]={'$like':'%'+_0x38de47[_0xc56c('0x33')][_0xc56c('0x41')]+'%'};return _0x3ac751;})});}_0x200ced=_['merge']({},_0x200ced,_0x38de47[_0xc56c('0x42')]);return _0x191fde[_0xc56c('0x5b')](_0x200ced);}})[_0xc56c('0x29')](function(_0x4e2ece){if(_0x4e2ece){_0x41af65=_0x4e2ece['length'];if(!_0x38de47['query'][_0xc56c('0x39')](_0xc56c('0x3a'))){_0x200ced[_0xc56c('0x23')]=qs[_0xc56c('0x23')](_0x38de47[_0xc56c('0x33')][_0xc56c('0x23')]);_0x200ced[_0xc56c('0x24')]=qs['offset'](_0x38de47[_0xc56c('0x33')][_0xc56c('0x24')]);}return _0x191fde[_0xc56c('0x5b')](_0x200ced);}})[_0xc56c('0x29')](function(_0x1922ad){if(_0x1922ad){return _0x1922ad?{'count':_0x41af65,'rows':_0x1922ad}:null;}})['then'](respondWithResult(_0x1da6e8,null))['catch'](handleError(_0x1da6e8,null));};
\ No newline at end of file
+var _0x3e89=['describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','pick','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany'];(function(_0x3ee39d,_0x2e04a5){var _0x1ada4f=function(_0x145d54){while(--_0x145d54){_0x3ee39d['push'](_0x3ee39d['shift']());}};_0x1ada4f(++_0x2e04a5);}(_0x3e89,0x17d));var _0x93e8=function(_0x1cdaaa,_0x493dda){_0x1cdaaa=_0x1cdaaa-0x0;var _0x1c761d=_0x3e89[_0x1cdaaa];return _0x1c761d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93e8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93e8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x93e8('0x2'));var Mustache=require(_0x93e8('0x3'));var util=require(_0x93e8('0x4'));var path=require(_0x93e8('0x5'));var sox=require(_0x93e8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x93e8('0x7'));var jsforce=require(_0x93e8('0x8'));var deskjs=require(_0x93e8('0x9'));var toCsv=require(_0x93e8('0xa'));var querystring=require(_0x93e8('0xb'));var Papa=require(_0x93e8('0xc'));var Redis=require(_0x93e8('0xd'));var authService=require(_0x93e8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x93e8('0xf'));var hardwareService=require(_0x93e8('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x93e8('0x11'));var config=require(_0x93e8('0x12'));var licenseUtil=require(_0x93e8('0x13'));var db=require(_0x93e8('0x14'))['db'];function respondWithStatusCode(_0x1c71ba,_0x240045){_0x240045=_0x240045||0xcc;return function(_0x298d63){if(_0x298d63){return _0x1c71ba['sendStatus'](_0x240045);}return _0x1c71ba[_0x93e8('0x15')](_0x240045)[_0x93e8('0x16')]();};}function respondWithResult(_0x59c05d,_0x540013){_0x540013=_0x540013||0xc8;return function(_0x11690e){if(_0x11690e){return _0x59c05d[_0x93e8('0x15')](_0x540013)[_0x93e8('0x17')](_0x11690e);}};}function respondWithFilteredResult(_0x5db59f,_0x198ee6){return function(_0x273add){if(_0x273add){var _0x597357=typeof _0x198ee6[_0x93e8('0x18')]===_0x93e8('0x19')&&typeof _0x198ee6[_0x93e8('0x1a')]==='undefined';var _0x52dc66=_0x273add[_0x93e8('0x1b')];var _0x4f8fe9=_0x597357?0x0:_0x198ee6[_0x93e8('0x18')];var _0x42ffe3=_0x597357?_0x273add[_0x93e8('0x1b')]:_0x198ee6['offset']+_0x198ee6[_0x93e8('0x1a')];var _0x2f0902;if(_0x42ffe3>=_0x52dc66){_0x42ffe3=_0x52dc66;_0x2f0902=0xc8;}else{_0x2f0902=0xce;}_0x5db59f[_0x93e8('0x15')](_0x2f0902);return _0x5db59f['set'](_0x93e8('0x1c'),_0x4f8fe9+'-'+_0x42ffe3+'/'+_0x52dc66)['json'](_0x273add);}return null;};}function patchUpdates(_0x242a84){return function(_0x1024ea){try{jsonpatch[_0x93e8('0x1d')](_0x1024ea,_0x242a84,!![]);}catch(_0x36951e){return BPromise[_0x93e8('0x1e')](_0x36951e);}return _0x1024ea[_0x93e8('0x1f')]();};}function saveUpdates(_0x2c891e,_0x43734b){return function(_0x3749f0){if(_0x3749f0){return _0x3749f0[_0x93e8('0x20')](_0x2c891e)['then'](function(_0x429cc6){return _0x429cc6;});}return null;};}function removeEntity(_0x4b0a7f,_0x4fee7d){return function(_0x46b5ed){if(_0x46b5ed){return _0x46b5ed[_0x93e8('0x21')]()[_0x93e8('0x22')](function(){var _0x2fe8c4=_0x46b5ed[_0x93e8('0x23')]({'plain':!![]});var _0x28797e=_0x93e8('0x24');return db[_0x93e8('0x25')][_0x93e8('0x21')]({'where':{'type':_0x28797e,'resourceId':_0x2fe8c4['id']}})[_0x93e8('0x22')](function(){return _0x46b5ed;});})['then'](function(){_0x4b0a7f[_0x93e8('0x15')](0xcc)[_0x93e8('0x16')]();});}};}function handleEntityNotFound(_0x4117c5,_0x2b79f8){return function(_0x21a58f){if(!_0x21a58f){_0x4117c5['sendStatus'](0x194);}return _0x21a58f;};}function handleError(_0x2ea8f7,_0x1bbb89){_0x1bbb89=_0x1bbb89||0x1f4;return function(_0x37e2c1){logger[_0x93e8('0x26')](_0x37e2c1[_0x93e8('0x27')]);if(_0x37e2c1['name']){delete _0x37e2c1[_0x93e8('0x28')];}_0x2ea8f7[_0x93e8('0x15')](_0x1bbb89)[_0x93e8('0x29')](_0x37e2c1);};}exports[_0x93e8('0x2a')]=function(_0x114ebe,_0x9695c9){var _0x3e22c5={},_0x26a1ab={},_0x501ed4={'count':0x0,'rows':[]};return db[_0x93e8('0x2b')][_0x93e8('0x2c')]()['then'](function(_0x5e7e78){_0x26a1ab[_0x93e8('0x2d')]=_[_0x93e8('0x2e')](_0x5e7e78);_0x26a1ab[_0x93e8('0x2f')]=_[_0x93e8('0x2e')](_0x114ebe['query']);_0x26a1ab['filters']=_[_0x93e8('0x30')](_0x26a1ab['model'],_0x26a1ab[_0x93e8('0x2f')]);_0x3e22c5[_0x93e8('0x31')]=_[_0x93e8('0x30')](_0x26a1ab[_0x93e8('0x2d')],qs['fields'](_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x32')]));_0x3e22c5[_0x93e8('0x31')]=_0x3e22c5[_0x93e8('0x31')][_0x93e8('0x33')]?_0x3e22c5[_0x93e8('0x31')]:_0x26a1ab[_0x93e8('0x2d')];if(!_0x114ebe['query'][_0x93e8('0x34')](_0x93e8('0x35'))){_0x3e22c5[_0x93e8('0x1a')]=qs[_0x93e8('0x1a')](_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x1a')]);_0x3e22c5['offset']=qs[_0x93e8('0x18')](_0x114ebe['query'][_0x93e8('0x18')]);}_0x3e22c5[_0x93e8('0x36')]=qs[_0x93e8('0x37')](_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x37')]);_0x3e22c5[_0x93e8('0x38')]=qs[_0x93e8('0x39')](_['pick'](_0x114ebe[_0x93e8('0x2f')],_0x26a1ab[_0x93e8('0x39')]),_0x5e7e78);if(_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x3a')]){_0x3e22c5[_0x93e8('0x38')]=_[_0x93e8('0x3b')](_0x3e22c5[_0x93e8('0x38')],{'$or':_[_0x93e8('0x3c')](_0x3e22c5[_0x93e8('0x31')],function(_0x1b32bb){var _0x16a044={};_0x16a044[_0x1b32bb]={'$like':'%'+_0x114ebe['query'][_0x93e8('0x3a')]+'%'};return _0x16a044;})});}_0x3e22c5=_[_0x93e8('0x3b')]({},_0x3e22c5,_0x114ebe[_0x93e8('0x3d')]);var _0x5134b8={'where':_0x3e22c5[_0x93e8('0x38')]};return db[_0x93e8('0x2b')][_0x93e8('0x1b')](_0x5134b8)['then'](function(_0x30ced0){_0x501ed4[_0x93e8('0x1b')]=_0x30ced0;if(_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x3e')]){_0x3e22c5['include']=[{'all':!![]}];}return db['CmCompany'][_0x93e8('0x3f')](_0x3e22c5);})[_0x93e8('0x22')](function(_0x5431b1){_0x501ed4[_0x93e8('0x40')]=_0x5431b1;return _0x501ed4;})[_0x93e8('0x22')](respondWithFilteredResult(_0x9695c9,_0x3e22c5))[_0x93e8('0x41')](handleError(_0x9695c9,null));})[_0x93e8('0x41')](handleError(_0x9695c9,null));};exports['show']=function(_0x199eda,_0x36ab0f){var _0x161f96={'raw':![],'where':{'id':_0x199eda[_0x93e8('0x42')]['id']}},_0x1dcc4d={};_0x1dcc4d[_0x93e8('0x2d')]=_[_0x93e8('0x2e')](db[_0x93e8('0x2b')][_0x93e8('0x43')]);_0x1dcc4d[_0x93e8('0x2f')]=_['keys'](_0x199eda[_0x93e8('0x2f')]);_0x1dcc4d['filters']=_[_0x93e8('0x30')](_0x1dcc4d[_0x93e8('0x2d')],_0x1dcc4d[_0x93e8('0x2f')]);_0x161f96[_0x93e8('0x31')]=_['intersection'](_0x1dcc4d[_0x93e8('0x2d')],qs[_0x93e8('0x32')](_0x199eda['query'][_0x93e8('0x32')]));_0x161f96['attributes']=_0x161f96[_0x93e8('0x31')][_0x93e8('0x33')]?_0x161f96[_0x93e8('0x31')]:_0x1dcc4d[_0x93e8('0x2d')];if(_0x199eda[_0x93e8('0x2f')][_0x93e8('0x3e')]){_0x161f96[_0x93e8('0x44')]=[{'all':!![]}];}_0x161f96=_[_0x93e8('0x3b')]({},_0x161f96,_0x199eda[_0x93e8('0x3d')]);return db[_0x93e8('0x2b')][_0x93e8('0x45')](_0x161f96)[_0x93e8('0x22')](handleEntityNotFound(_0x36ab0f,null))[_0x93e8('0x22')](respondWithResult(_0x36ab0f,null))['catch'](handleError(_0x36ab0f,null));};exports[_0x93e8('0x46')]=function(_0x56eb63,_0x4fe99a){return db[_0x93e8('0x2b')][_0x93e8('0x46')](_0x56eb63[_0x93e8('0x47')],{})[_0x93e8('0x22')](function(_0x1fd6de){var _0x78d35b=_0x56eb63[_0x93e8('0x48')]['get']({'plain':!![]});if(!_0x78d35b)throw new Error(_0x93e8('0x49'));if(_0x78d35b[_0x93e8('0x4a')]===_0x93e8('0x48')){var _0x1837ed=_0x1fd6de[_0x93e8('0x23')]({'plain':!![]});var _0x114ea4=_0x93e8('0x24');return db[_0x93e8('0x4b')][_0x93e8('0x45')]({'where':{'name':_0x114ea4,'userProfileId':_0x78d35b[_0x93e8('0x4c')]},'raw':!![]})[_0x93e8('0x22')](function(_0x26cb80){if(_0x26cb80&&_0x26cb80['autoAssociation']===0x0){return db['UserProfileResource'][_0x93e8('0x46')]({'name':_0x1837ed[_0x93e8('0x28')],'resourceId':_0x1837ed['id'],'type':_0x26cb80['name'],'sectionId':_0x26cb80['id']},{})['then'](function(){return _0x1fd6de;});}else{return _0x1fd6de;}})['catch'](function(_0x389df4){logger[_0x93e8('0x26')](_0x93e8('0x4d'),_0x389df4);throw _0x389df4;});}return _0x1fd6de;})[_0x93e8('0x22')](respondWithResult(_0x4fe99a,0xc9))[_0x93e8('0x41')](handleError(_0x4fe99a,null));};exports[_0x93e8('0x20')]=function(_0x2d2b7f,_0x51b5a1){if(_0x2d2b7f[_0x93e8('0x47')]['id']){delete _0x2d2b7f[_0x93e8('0x47')]['id'];}return db[_0x93e8('0x2b')]['find']({'where':{'id':_0x2d2b7f[_0x93e8('0x42')]['id']}})[_0x93e8('0x22')](handleEntityNotFound(_0x51b5a1,null))[_0x93e8('0x22')](saveUpdates(_0x2d2b7f['body'],null))['then'](respondWithResult(_0x51b5a1,null))[_0x93e8('0x41')](handleError(_0x51b5a1,null));};exports['destroy']=function(_0xc60f0a,_0xccb513){return db[_0x93e8('0x2b')][_0x93e8('0x45')]({'where':{'id':_0xc60f0a[_0x93e8('0x42')]['id']}})['then'](handleEntityNotFound(_0xccb513,null))[_0x93e8('0x22')](removeEntity(_0xccb513,null))[_0x93e8('0x41')](handleError(_0xccb513,null));};exports['describe']=function(_0x3dfd4b,_0x28cc8b){return db[_0x93e8('0x2b')]['describe']()[_0x93e8('0x22')](respondWithResult(_0x28cc8b,null))['catch'](handleError(_0x28cc8b,null));};exports[_0x93e8('0x4e')]=function(_0xa0d379,_0x332f41,_0xb98850){return db[_0x93e8('0x4f')][_0x93e8('0x45')]({'where':{'id':_0xa0d379[_0x93e8('0x42')]['id']}})['then'](handleEntityNotFound(_0x332f41,null))[_0x93e8('0x22')](function(_0x2c67ec){if(_0x2c67ec){return _0x2c67ec[_0x93e8('0x4e')](_0xa0d379[_0x93e8('0x47')][_0x93e8('0x50')],_[_0x93e8('0x51')](_0xa0d379['body'],[_0x93e8('0x50'),'id'])||{});}})[_0x93e8('0x22')](respondWithResult(_0x332f41,null))['catch'](handleError(_0x332f41,null));};exports[_0x93e8('0x52')]=function(_0x3df805,_0x5b395b,_0x30e631){var _0x18feff={};var _0x425605={};var _0x3862a6;var _0x373d0a;return db[_0x93e8('0x2b')][_0x93e8('0x53')]({'where':{'id':_0x3df805[_0x93e8('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b395b,null))[_0x93e8('0x22')](function(_0x15a008){if(_0x15a008){_0x3862a6=_0x15a008;_0x425605[_0x93e8('0x2d')]=_[_0x93e8('0x2e')](db[_0x93e8('0x4f')]['rawAttributes']);_0x425605[_0x93e8('0x2f')]=_[_0x93e8('0x2e')](_0x3df805[_0x93e8('0x2f')]);_0x425605[_0x93e8('0x39')]=_[_0x93e8('0x30')](_0x425605[_0x93e8('0x2d')],_0x425605[_0x93e8('0x2f')]);_0x18feff[_0x93e8('0x31')]=_[_0x93e8('0x30')](_0x425605['model'],qs[_0x93e8('0x32')](_0x3df805[_0x93e8('0x2f')][_0x93e8('0x32')]));_0x18feff[_0x93e8('0x31')]=_0x18feff[_0x93e8('0x31')][_0x93e8('0x33')]?_0x18feff['attributes']:_0x425605[_0x93e8('0x2d')];_0x18feff['order']=qs[_0x93e8('0x37')](_0x3df805[_0x93e8('0x2f')][_0x93e8('0x37')]);_0x18feff[_0x93e8('0x38')]=qs[_0x93e8('0x39')](_[_0x93e8('0x54')](_0x3df805[_0x93e8('0x2f')],_0x425605[_0x93e8('0x39')]));if(_0x3df805[_0x93e8('0x2f')][_0x93e8('0x3a')]){_0x18feff['where']=_[_0x93e8('0x3b')](_0x18feff[_0x93e8('0x38')],{'$or':_[_0x93e8('0x3c')](_0x18feff['attributes'],function(_0x157c25){var _0x377d9b={};_0x377d9b[_0x157c25]={'$like':'%'+_0x3df805[_0x93e8('0x2f')][_0x93e8('0x3a')]+'%'};return _0x377d9b;})});}_0x18feff=_[_0x93e8('0x3b')]({},_0x18feff,_0x3df805['options']);return _0x3862a6[_0x93e8('0x52')](_0x18feff);}})[_0x93e8('0x22')](function(_0x1244ce){if(_0x1244ce){_0x373d0a=_0x1244ce[_0x93e8('0x33')];if(!_0x3df805[_0x93e8('0x2f')]['hasOwnProperty'](_0x93e8('0x35'))){_0x18feff['limit']=qs[_0x93e8('0x1a')](_0x3df805[_0x93e8('0x2f')][_0x93e8('0x1a')]);_0x18feff[_0x93e8('0x18')]=qs[_0x93e8('0x18')](_0x3df805['query'][_0x93e8('0x18')]);}return _0x3862a6[_0x93e8('0x52')](_0x18feff);}})['then'](function(_0x5f5a18){if(_0x5f5a18){return _0x5f5a18?{'count':_0x373d0a,'rows':_0x5f5a18}:null;}})['then'](respondWithResult(_0x5b395b,null))[_0x93e8('0x41')](handleError(_0x5b395b,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index a18db96..040e890 100644
--- a/server/api/cmCompany/cmCompany.model.js
+++ b/server/api/cmCompany/cmCompany.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xed0a=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api'];(function(_0x4336bc,_0x1a0da6){var _0x231421=function(_0x3d31a8){while(--_0x3d31a8){_0x4336bc['push'](_0x4336bc['shift']());}};_0x231421(++_0x1a0da6);}(_0xed0a,0x19d));var _0xaed0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xed0a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaed0('0x0'));var util=require('util');var logger=require(_0xaed0('0x1'))(_0xaed0('0x2'));var moment=require(_0xaed0('0x3'));var BPromise=require(_0xaed0('0x4'));var rp=require(_0xaed0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaed0('0x6'));var config=require(_0xaed0('0x7'));var attributes=require(_0xaed0('0x8'));module[_0xaed0('0x9')]=function(_0x5650b0,_0x4a30be){return _0x5650b0[_0xaed0('0xa')](_0xaed0('0xb'),attributes,{'tableName':_0xaed0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ed7=['api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x598ac5,_0x11aa0e){var _0x317e7f=function(_0x487a5a){while(--_0x487a5a){_0x598ac5['push'](_0x598ac5['shift']());}};_0x317e7f(++_0x11aa0e);}(_0x0ed7,0x1d9));var _0x70ed=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x0ed7[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x70ed('0x0'));var util=require(_0x70ed('0x1'));var logger=require(_0x70ed('0x2'))(_0x70ed('0x3'));var moment=require(_0x70ed('0x4'));var BPromise=require(_0x70ed('0x5'));var rp=require(_0x70ed('0x6'));var fs=require('fs');var path=require(_0x70ed('0x7'));var rimraf=require('rimraf');var config=require(_0x70ed('0x8'));var attributes=require(_0x70ed('0x9'));module[_0x70ed('0xa')]=function(_0x285d70,_0x2159c6){return _0x285d70[_0x70ed('0xb')](_0x70ed('0xc'),attributes,{'tableName':_0x70ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index c9f9c98..1da5d89 100644
--- a/server/api/cmCompany/cmCompany.rpc.js
+++ b/server/api/cmCompany/cmCompany.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17ce=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','lodash','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x17ce,0x1a0));var _0xe17c=function(_0x4188e6,_0x403e0a){_0x4188e6=_0x4188e6-0x0;var _0x3e3c9a=_0x17ce[_0x4188e6];return _0x3e3c9a;};'use strict';var _=require(_0xe17c('0x0'));var util=require(_0xe17c('0x1'));var moment=require(_0xe17c('0x2'));var BPromise=require(_0xe17c('0x3'));var rs=require(_0xe17c('0x4'));var fs=require('fs');var Redis=require(_0xe17c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe17c('0x6'));var logger=require(_0xe17c('0x7'))(_0xe17c('0x8'));var config=require(_0xe17c('0x9'));var jayson=require(_0xe17c('0xa'));var client=jayson[_0xe17c('0xb')][_0xe17c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a0cfc,_0x372069,_0x49d828){return new BPromise(function(_0x4a5e73,_0x1354a5){return client['request'](_0x5a0cfc,_0x49d828)[_0xe17c('0xd')](function(_0x40e19b){logger[_0xe17c('0xe')]('CmCompany,\x20%s,\x20%s',_0x372069,_0xe17c('0xf'));logger[_0xe17c('0x10')](_0xe17c('0x11'),_0x372069,_0xe17c('0xf'),JSON[_0xe17c('0x12')](_0x40e19b));if(_0x40e19b[_0xe17c('0x13')]){if(_0x40e19b[_0xe17c('0x13')]['code']===0x1f4){logger[_0xe17c('0x13')](_0xe17c('0x14'),_0x372069,_0x40e19b[_0xe17c('0x13')][_0xe17c('0x15')]);return _0x1354a5(_0x40e19b[_0xe17c('0x13')][_0xe17c('0x15')]);}logger[_0xe17c('0x13')](_0xe17c('0x14'),_0x372069,_0x40e19b[_0xe17c('0x13')][_0xe17c('0x15')]);return _0x4a5e73(_0x40e19b['error']['message']);}else{logger[_0xe17c('0xe')](_0xe17c('0x14'),_0x372069,_0xe17c('0xf'));_0x4a5e73(_0x40e19b['result'][_0xe17c('0x15')]);}})['catch'](function(_0x1a1326){logger[_0xe17c('0x13')](_0xe17c('0x14'),_0x372069,_0x1a1326);_0x1354a5(_0x1a1326);});});}
\ No newline at end of file
+var _0xc3b1=['result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x916117,_0x3101da){var _0x5ddef9=function(_0x43136a){while(--_0x43136a){_0x916117['push'](_0x916117['shift']());}};_0x5ddef9(++_0x3101da);}(_0xc3b1,0x10f));var _0x1c3b=function(_0x2ecf13,_0x213a49){_0x2ecf13=_0x2ecf13-0x0;var _0x423a67=_0xc3b1[_0x2ecf13];return _0x423a67;};'use strict';var _=require(_0x1c3b('0x0'));var util=require('util');var moment=require(_0x1c3b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c3b('0x2'));var db=require(_0x1c3b('0x3'))['db'];var utils=require(_0x1c3b('0x4'));var logger=require(_0x1c3b('0x5'))('rpc');var config=require(_0x1c3b('0x6'));var jayson=require(_0x1c3b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa3b870,_0x1c53a9,_0x32ac49){return new BPromise(function(_0x261f47,_0x30a82d){return client[_0x1c3b('0x8')](_0xa3b870,_0x32ac49)[_0x1c3b('0x9')](function(_0x1ac37c){logger['info'](_0x1c3b('0xa'),_0x1c53a9,_0x1c3b('0xb'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x1c53a9,'request\x20sent',JSON[_0x1c3b('0xc')](_0x1ac37c));if(_0x1ac37c[_0x1c3b('0xd')]){if(_0x1ac37c['error'][_0x1c3b('0xe')]===0x1f4){logger[_0x1c3b('0xd')](_0x1c3b('0xa'),_0x1c53a9,_0x1ac37c[_0x1c3b('0xd')][_0x1c3b('0xf')]);return _0x30a82d(_0x1ac37c['error'][_0x1c3b('0xf')]);}logger[_0x1c3b('0xd')](_0x1c3b('0xa'),_0x1c53a9,_0x1ac37c[_0x1c3b('0xd')]['message']);return _0x261f47(_0x1ac37c[_0x1c3b('0xd')][_0x1c3b('0xf')]);}else{logger[_0x1c3b('0x10')](_0x1c3b('0xa'),_0x1c53a9,'request\x20sent');_0x261f47(_0x1ac37c[_0x1c3b('0x11')][_0x1c3b('0xf')]);}})['catch'](function(_0x6aafba){logger[_0x1c3b('0xd')](_0x1c3b('0xa'),_0x1c53a9,_0x6aafba);_0x30a82d(_0x6aafba);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index abc3c15..e377ed0 100644
--- a/server/api/cmCompany/index.js
+++ b/server/api/cmCompany/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc165=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/contacts','post','addContacts','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x33b627,_0xcd64e0){var _0x531df0=function(_0x46db94){while(--_0x46db94){_0x33b627['push'](_0x33b627['shift']());}};_0x531df0(++_0xcd64e0);}(_0xc165,0x199));var _0x5c16=function(_0x50ac27,_0x1306e3){_0x50ac27=_0x50ac27-0x0;var _0x45f86a=_0xc165[_0x50ac27];return _0x45f86a;};'use strict';var multer=require(_0x5c16('0x0'));var util=require(_0x5c16('0x1'));var path=require(_0x5c16('0x2'));var timeout=require(_0x5c16('0x3'));var express=require(_0x5c16('0x4'));var router=express[_0x5c16('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5c16('0x6'));var interaction=require(_0x5c16('0x7'));var config=require(_0x5c16('0x8'));var controller=require('./cmCompany.controller');router[_0x5c16('0x9')]('/',auth[_0x5c16('0xa')](),controller['index']);router[_0x5c16('0x9')](_0x5c16('0xb'),auth[_0x5c16('0xa')](),controller[_0x5c16('0xc')]);router[_0x5c16('0x9')]('/:id',auth[_0x5c16('0xa')](),controller[_0x5c16('0xd')]);router[_0x5c16('0x9')](_0x5c16('0xe'),auth[_0x5c16('0xa')](),controller['getContacts']);router[_0x5c16('0xf')]('/',auth[_0x5c16('0xa')](),controller['create']);router[_0x5c16('0xf')](_0x5c16('0xe'),auth['isAuthenticated'](),controller[_0x5c16('0x10')]);router[_0x5c16('0x11')]('/:id',auth[_0x5c16('0xa')](),controller[_0x5c16('0x12')]);router[_0x5c16('0x13')](_0x5c16('0x14'),auth['isAuthenticated'](),controller[_0x5c16('0x15')]);module[_0x5c16('0x16')]=router;
\ No newline at end of file
+var _0xe2da=['../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x53f152,_0x7e09db){var _0x54e658=function(_0x597bf0){while(--_0x597bf0){_0x53f152['push'](_0x53f152['shift']());}};_0x54e658(++_0x7e09db);}(_0xe2da,0xc8));var _0xae2d=function(_0x195e0b,_0x3c536b){_0x195e0b=_0x195e0b-0x0;var _0x3df39e=_0xe2da[_0x195e0b];return _0x3df39e;};'use strict';var multer=require(_0xae2d('0x0'));var util=require(_0xae2d('0x1'));var path=require(_0xae2d('0x2'));var timeout=require(_0xae2d('0x3'));var express=require(_0xae2d('0x4'));var router=express['Router']();var fs_extra=require(_0xae2d('0x5'));var auth=require(_0xae2d('0x6'));var interaction=require(_0xae2d('0x7'));var config=require(_0xae2d('0x8'));var controller=require(_0xae2d('0x9'));router[_0xae2d('0xa')]('/',auth['isAuthenticated'](),controller[_0xae2d('0xb')]);router['get'](_0xae2d('0xc'),auth[_0xae2d('0xd')](),controller[_0xae2d('0xe')]);router['get'](_0xae2d('0xf'),auth[_0xae2d('0xd')](),controller[_0xae2d('0x10')]);router[_0xae2d('0xa')](_0xae2d('0x11'),auth[_0xae2d('0xd')](),controller[_0xae2d('0x12')]);router[_0xae2d('0x13')]('/',auth[_0xae2d('0xd')](),controller[_0xae2d('0x14')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0xae2d('0x15')]);router[_0xae2d('0x16')](_0xae2d('0xf'),auth[_0xae2d('0xd')](),controller['update']);router[_0xae2d('0x17')](_0xae2d('0xf'),auth[_0xae2d('0xd')](),controller[_0xae2d('0x18')]);module[_0xae2d('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index c6e32a1..151d68c 100644
--- a/server/api/cmContact/cmContact.attributes.js
+++ b/server/api/cmContact/cmContact.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0f0a=['UNSIGNED','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0x5c4f31,_0x4bcb71){var _0x1340e8=function(_0x5940ba){while(--_0x5940ba){_0x5c4f31['push'](_0x5c4f31['shift']());}};_0x1340e8(++_0x4bcb71);}(_0x0f0a,0x133));var _0xa0f0=function(_0x2067ae,_0x2297d9){_0x2067ae=_0x2067ae-0x0;var _0x15d9e7=_0x0f0a[_0x2067ae];return _0x15d9e7;};'use strict';var _=require(_0xa0f0('0x0'));var Sequelize=require(_0xa0f0('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa0f0('0x2')]},'street':{'type':Sequelize[_0xa0f0('0x2')]},'postalCode':{'type':Sequelize[_0xa0f0('0x2')]},'city':{'type':Sequelize[_0xa0f0('0x2')]},'country':{'type':Sequelize[_0xa0f0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa0f0('0x2')]},'description':{'type':Sequelize[_0xa0f0('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa0f0('0x2')]},'fax':{'type':Sequelize[_0xa0f0('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa0f0('0x2')]},'fb_data':{'type':Sequelize[_0xa0f0('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa0f0('0x2')]},'teams':{'type':Sequelize[_0xa0f0('0x2')]},'viber':{'type':Sequelize[_0xa0f0('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xa0f0('0x2')]},'UserId':{'type':Sequelize[_0xa0f0('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xa0f0('0x2')]},'priority':{'type':Sequelize[_0xa0f0('0x4')](0x2)[_0xa0f0('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xa0f0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1436=['NOW','sequelize','exports','STRING','TEXT','INTEGER','DATE'];(function(_0x47a385,_0x5d8781){var _0x31abb9=function(_0x210f7a){while(--_0x210f7a){_0x47a385['push'](_0x47a385['shift']());}};_0x31abb9(++_0x5d8781);}(_0x1436,0x1eb));var _0x6143=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1436[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var Sequelize=require(_0x6143('0x0'));module[_0x6143('0x1')]={'firstName':{'type':Sequelize[_0x6143('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6143('0x2')]},'street':{'type':Sequelize[_0x6143('0x2')]},'postalCode':{'type':Sequelize[_0x6143('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x6143('0x2')]},'description':{'type':Sequelize[_0x6143('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6143('0x2')]},'fax':{'type':Sequelize[_0x6143('0x2')]},'email':{'type':Sequelize[_0x6143('0x2')]},'url':{'type':Sequelize[_0x6143('0x2')]},'facebook':{'type':Sequelize[_0x6143('0x2')]},'fb_data':{'type':Sequelize[_0x6143('0x2')]},'twitter':{'type':Sequelize[_0x6143('0x2')]},'skype':{'type':Sequelize[_0x6143('0x2')]},'teams':{'type':Sequelize[_0x6143('0x2')]},'viber':{'type':Sequelize[_0x6143('0x2')]},'line':{'type':Sequelize[_0x6143('0x2')]},'wechat':{'type':Sequelize[_0x6143('0x2')]},'telegram':{'type':Sequelize[_0x6143('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x6143('0x2')]},'priority':{'type':Sequelize[_0x6143('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6143('0x5')],'defaultValue':Sequelize[_0x6143('0x6')]},'dialTimezone':{'type':Sequelize[_0x6143('0x2')]},'utcOffset':{'type':Sequelize[_0x6143('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 46ed02c..9afd072 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5e53=['includeAll','include','rows','getHopperHistories','rawAttributes','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','root','server/files/tmp','file','filename','chmodSync','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','binding','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','../../components/import/cm/csv2','stringify','error\x20child\x20process','importUpdates','User','agent','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','exit','chat','sms','openchannel','fax','whatsapp','voice','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','UserId','DESC','VoiceCallReport','fullname','startCase','Website','Account','closed','closedAt','note','secondDisposition','thirdDisposition','Owner','browserName','customerIp','customerPort','deviceModel','ratingMessage','referer','mail','subject','substatus','externalUrl','threadId','Interaction','findAndCountAll','flatten','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/contacts','api','../../config/environment/shared','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','json','undefined','limit','offset','status','set','destroy','then','end','sendStatus','error','stack','name','send','index','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','startsWith','cf_','displayName','analytics','length','columnName','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','keys','forEach','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','spread','contact','show','Tag','Tags','tag','Phones','ItemType','sequelize','literal','$and','CmCustomField','omit','format','cf_%d','isEmpty','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','filters','intersection','attributes','fields','sort','pick','filter','map','hasOwnProperty','nolimit','setTags','ids','setAdditionalPhones','all','CmContactHasItem','ContactItemType','items','item_types','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','order','ContactId','options','count'];(function(_0x5ae5b5,_0x51d4d5){var _0x23c34f=function(_0x50527d){while(--_0x50527d){_0x5ae5b5['push'](_0x5ae5b5['shift']());}};_0x23c34f(++_0x51d4d5);}(_0x5e53,0x15e));var _0x35e5=function(_0x3a6d7a,_0x1210ea){_0x3a6d7a=_0x3a6d7a-0x0;var _0x1eda3d=_0x5e53[_0x3a6d7a];return _0x1eda3d;};'use strict';var moment=require(_0x35e5('0x0'));var BPromise=require(_0x35e5('0x1'));var util=require(_0x35e5('0x2'));var path=require(_0x35e5('0x3'));var fs=require('fs');var _=require(_0x35e5('0x4'));var squel=require('squel');var Papa=require(_0x35e5('0x5'));var Redis=require(_0x35e5('0x6'));var contacts=require(_0x35e5('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x35e5('0x8'));var config=require('../../config/environment');var shared=require(_0x35e5('0x9'));var db=require(_0x35e5('0xa'))['db'];config['redis']=_[_0x35e5('0xb')](config[_0x35e5('0xc')],{'host':_0x35e5('0xd'),'port':0x18eb});var socket=require(_0x35e5('0xe'))(new Redis(config['redis']));require(_0x35e5('0xf'))[_0x35e5('0x10')](socket);function respondWithResult(_0x563442,_0x298da1){_0x298da1=_0x298da1||0xc8;return function(_0x581551){if(_0x581551){return _0x563442['status'](_0x298da1)[_0x35e5('0x11')](_0x581551);}};}function respondWithFilteredResult(_0x5f201c,_0x3642b3){return function(_0x1e09cb){if(_0x1e09cb){var _0xc69d8b=typeof _0x3642b3['offset']===_0x35e5('0x12')&&typeof _0x3642b3[_0x35e5('0x13')]===_0x35e5('0x12');var _0xb32c4=_0x1e09cb['count'];var _0x5a2f08=_0xc69d8b?0x0:_0x3642b3[_0x35e5('0x14')];var _0x37acd4=_0xc69d8b?_0x1e09cb['count']:_0x3642b3['offset']+_0x3642b3[_0x35e5('0x13')];var _0x2b2877;if(_0x37acd4>=_0xb32c4){_0x37acd4=_0xb32c4;_0x2b2877=0xc8;}else{_0x2b2877=0xce;}_0x5f201c[_0x35e5('0x15')](_0x2b2877);return _0x5f201c[_0x35e5('0x16')]('Content-Range',_0x5a2f08+'-'+_0x37acd4+'/'+_0xb32c4)[_0x35e5('0x11')](_0x1e09cb);}return null;};}function saveUpdates(_0x40ba71){return function(_0x86d20c){if(_0x86d20c){return _0x86d20c['update'](_0x40ba71)['then'](function(_0x10dd5a){return _0x10dd5a;});}return null;};}function removeEntity(_0x1ff33a){return function(_0x42bea1){if(_0x42bea1){return _0x42bea1[_0x35e5('0x17')]()[_0x35e5('0x18')](function(){_0x1ff33a[_0x35e5('0x15')](0xcc)[_0x35e5('0x19')]();});}};}function handleEntityNotFound(_0x1fbe88){return function(_0x51c30d){if(!_0x51c30d){_0x1fbe88[_0x35e5('0x1a')](0x194);}return _0x51c30d;};}function handleError(_0x256947,_0x1351c0){_0x1351c0=_0x1351c0||0x1f4;return function(_0x3a5724){logger[_0x35e5('0x1b')](_0x3a5724[_0x35e5('0x1c')]);if(_0x3a5724[_0x35e5('0x1d')]){delete _0x3a5724[_0x35e5('0x1d')];}_0x256947[_0x35e5('0x15')](_0x1351c0)[_0x35e5('0x1e')](_0x3a5724);};}exports[_0x35e5('0x1f')]=function(_0x4cb4e1,_0x5e9b32){var _0x2206cd={};return contacts[_0x35e5('0x20')]()[_0x35e5('0x18')](function(_0x3ecacb){_0x2206cd=qs[_0x35e5('0x21')](_0x3ecacb,_0x4cb4e1);return contacts[_0x35e5('0x22')](_0x4cb4e1[_0x35e5('0x23')],_0x4cb4e1[_0x35e5('0x24')],_0x2206cd,_0x3ecacb);})[_0x35e5('0x18')](respondWithFilteredResult(_0x5e9b32,_0x2206cd))[_0x35e5('0x25')](handleError(_0x5e9b32,null));};exports[_0x35e5('0x17')]=function(_0xe0205,_0x2d4141){return db[_0x35e5('0x26')][_0x35e5('0x27')]({'where':{'id':_0xe0205[_0x35e5('0x28')]['id']}})['then'](handleEntityNotFound(_0x2d4141,null))[_0x35e5('0x18')](removeEntity(_0x2d4141,null))[_0x35e5('0x25')](handleError(_0x2d4141,null));};exports[_0x35e5('0x20')]=function(_0x5758af,_0x2821fe){return db[_0x35e5('0x26')][_0x35e5('0x20')]()[_0x35e5('0x18')](function(_0xd1f258){delete _0xd1f258[_0x35e5('0x29')];for(var _0x298fad=0x0;_0x298fad
','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','base64','moment','randomstring','path','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','name','substring'];(function(_0x36c6c6,_0x103c44){var _0x4bd317=function(_0xf4188a){while(--_0xf4188a){_0x36c6c6['push'](_0x36c6c6['shift']());}};_0x4bd317(++_0x103c44);}(_0x382a,0x197));var _0xa382=function(_0x4d3287,_0xe83871){_0x4d3287=_0x4d3287-0x0;var _0x3e46fc=_0x382a[_0x4d3287];return _0x3e46fc;};'use strict';var _=require('lodash');var moment=require(_0xa382('0x0'));var random=require(_0xa382('0x1'));var fs=require('fs');var path=require(_0xa382('0x2'));var util=require('util');var tnef=require(_0xa382('0x3'));var logger=require(_0xa382('0x4'))(_0xa382('0x5'));var config=require('../../../config/environment');function getAddress(_0xc8e2ea){var _0x1bea6c=_[_0xa382('0x6')](_0xc8e2ea[_0xa382('0x7')]);return _0x1bea6c&&_0x1bea6c[_0xa382('0x8')]?_0x1bea6c['address']:_0xa382('0x9')+random[_0xa382('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x145bf9){var _0x33fd37=_['head'](_0x145bf9['value']);if(_0x33fd37&&_0x33fd37[_0xa382('0xb')]){if(_0x33fd37[_0xa382('0xb')]==_0x33fd37['address']){return _0x33fd37[_0xa382('0xb')][_0xa382('0xc')](0x0,_0x33fd37[_0xa382('0xb')][_0xa382('0xd')]('@'));}var _0x520874=_0x33fd37[_0xa382('0xb')][_0xa382('0xe')](/\s+/);return _0x520874[_0xa382('0xf')]>0x1?_0x520874[_0xa382('0x10')](0x0,-0x1)['join']('\x20'):_0x33fd37[_0xa382('0xb')];}return _0xa382('0x11');}function getLastName(_0x43bc60){var _0x357d06=_[_0xa382('0x6')](_0x43bc60[_0xa382('0x7')]);if(_0x357d06&&_0x357d06[_0xa382('0xb')]){var _0x4e30f7=_0x357d06[_0xa382('0xb')][_0xa382('0xe')](/\s+/);return _0x4e30f7[_0xa382('0xf')]>0x1?_0x4e30f7['pop']():'';}return'';}function getMails(_0x216d35,_0x314472){var _0x537d0a='';for(var _0x4215a7=0x0;_0x4215a7<_0x314472['value'][_0xa382('0xf')];_0x4215a7+=0x1){if(_0x314472[_0xa382('0x7')][_0x4215a7][_0xa382('0x8')]!==_0x216d35){if(!_[_0xa382('0x12')](_0x537d0a)){_0x537d0a+=',';}_0x537d0a+=_0x314472[_0xa382('0x7')][_0x4215a7][_0xa382('0xb')]||_0x314472[_0xa382('0x7')][_0x4215a7][_0xa382('0x8')]||'';_0x537d0a+='\x20<';_0x537d0a+=_0x314472[_0xa382('0x7')][_0x4215a7][_0xa382('0x8')]?_0x314472['value'][_0x4215a7][_0xa382('0x8')]:_0xa382('0x9')+random[_0xa382('0xa')](0x6)+_0xa382('0x13');_0x537d0a+='>';}}return _0x537d0a;}function parseEmail(_0x6a88a7,_0x133de6,_0x246857){if(_0x133de6['html']){var _0x13e3cb=/